use of com.intellij.openapi.ui.ex.MultiLineLabel in project android by JetBrains.
the class LibraryPropertiesDialog method createCenterPanel.
@Nullable
@Override
protected JComponent createCenterPanel() {
myIconLabel.setIcon(AllIcons.Modules.Library);
myNameLabel.setText(myLibrary.getName());
LibraryEditor editor = new SourcesAndDocsOnlyEditor(myLibrary);
myLibraryEditorComponent = new LibraryRootsComponent(myProject, editor) {
@Override
public void updatePropertiesLabel() {
JComponent c = getComponent();
if (c != null) {
MultiLineLabel propertiesLabel = findComponentOfType(c, MultiLineLabel.class);
if (propertiesLabel != null) {
propertiesLabel.setText("Add or remove source/Javadoc attachments");
}
}
}
};
myLibraryEditorComponent.updatePropertiesLabel();
JComponent c = myLibraryEditorComponent.getComponent();
// Remove "Exclude" button. We don't support this in libraries.
List<ActionButton> actionButtons = findComponentsOfType(c, ActionButton.class);
for (ActionButton actionButton : actionButtons) {
String text = actionButton.getAction().getTemplatePresentation().getText();
if (text != null && text.startsWith("Exclude")) {
actionButton.setVisible(false);
break;
}
}
MultiLineLabel propertiesLabel = findComponentOfType(c, MultiLineLabel.class);
if (propertiesLabel != null) {
propertiesLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 0, 1));
}
myTreePanel.add(c, BorderLayout.CENTER);
myTreePanel.setBorder(customLine(OnePixelDivider.BACKGROUND, 1, 1, 1, 1));
return myMainPanel;
}
use of com.intellij.openapi.ui.ex.MultiLineLabel in project intellij-community by JetBrains.
the class LocalChangesWouldBeOverwrittenHelper method showErrorDialog.
private static void showErrorDialog(@NotNull Project project, @NotNull String operationName, @NotNull List<Change> changes, @NotNull Collection<String> absolutePaths) {
String title = "Local Changes Prevent from " + StringUtil.capitalize(operationName);
String description = getErrorDialogDescription();
if (changes.isEmpty()) {
GitUtil.showPathsInDialog(project, absolutePaths, title, description);
} else {
DialogBuilder builder = new DialogBuilder(project);
builder.setNorthPanel(new MultiLineLabel(description));
builder.setCenterPanel(new ChangesBrowserWithRollback(project, changes));
builder.addOkAction();
builder.setTitle(title);
builder.show();
}
}
use of com.intellij.openapi.ui.ex.MultiLineLabel in project intellij-community by JetBrains.
the class GitUtil method showPathsInDialog.
public static void showPathsInDialog(@NotNull Project project, @NotNull Collection<String> absolutePaths, @NotNull String title, @Nullable String description) {
DialogBuilder builder = new DialogBuilder(project);
builder.setCenterPanel(new GitSimplePathsBrowser(project, absolutePaths));
if (description != null) {
builder.setNorthPanel(new MultiLineLabel(description));
}
builder.addOkAction();
builder.setTitle(title);
builder.show();
}
use of com.intellij.openapi.ui.ex.MultiLineLabel in project intellij-community by JetBrains.
the class RootsDetectionStep method createResultsPanel.
protected JComponent createResultsPanel() {
final JPanel panel = new JPanel(new GridBagLayout());
myDetectedRootsChooser = new DetectedRootsChooser();
myDetectedRootsChooser.addSelectionListener(new DetectedRootsChooser.RootSelectionListener() {
@Override
public void selectionChanged() {
updateSelectedTypes();
}
});
final String text = IdeBundle.message("label.project.roots.have.been.found");
final JLabel label = new JLabel(text);
label.setUI(new MultiLineLabelUI());
panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(8, 10, 0, 10), 0, 0));
panel.add(myDetectedRootsChooser.getComponent(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBUI.insets(8, 10), 0, 0));
final JButton markAllButton = new JButton(IdeBundle.message("button.mark.all"));
panel.add(markAllButton, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(0, 10, 8, 2), 0, 0));
final JButton unmarkAllButton = new JButton(IdeBundle.message("button.unmark.all"));
panel.add(unmarkAllButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(0, 0, 8, 10), 0, 0));
markAllButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
myDetectedRootsChooser.setAllElementsMarked(true);
}
});
unmarkAllButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
myDetectedRootsChooser.setAllElementsMarked(false);
}
});
myResultPanel = new JPanel(new CardLayout());
myResultPanel.add(ROOTS_FOUND_CARD, panel);
JPanel notFoundPanel = new JPanel(new BorderLayout());
notFoundPanel.setBorder(IdeBorderFactory.createEmptyBorder(5));
notFoundPanel.add(BorderLayout.NORTH, new MultiLineLabel(IdeBundle.message("label.project.roots.not.found")));
myResultPanel.add(ROOTS_NOT_FOUND_CARD, notFoundPanel);
return myResultPanel;
}
Aggregations