use of com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryRootsComponent 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.roots.ui.configuration.libraryEditor.LibraryRootsComponent in project intellij-community by JetBrains.
the class LibraryConfigurable method createOptionsPanel.
@Override
public JComponent createOptionsPanel() {
myLibraryEditorComponent = new LibraryRootsComponent(myProject, () -> getLibraryEditor());
myLibraryEditorComponent.addListener(() -> {
myContext.getDaemonAnalyzer().queueUpdate(myProjectStructureElement);
updateName();
});
return myLibraryEditorComponent.getComponent();
}
Aggregations