use of com.intellij.openapi.actionSystem.impl.ActionButton 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.actionSystem.impl.ActionButton in project android by JetBrains.
the class LibraryPropertiesDialogFixture method addAttachment.
@NotNull
public LibraryPropertiesDialogFixture addAttachment(@NotNull File path) {
ActionButton addButton = GuiTests.waitUntilShowing(robot(), target(), new GenericTypeMatcher<ActionButton>(ActionButton.class) {
@Override
protected boolean isMatching(@NotNull ActionButton button) {
return "Add".equals(button.getAction().getTemplatePresentation().getDescription());
}
});
new ActionButtonFixture(robot(), addButton).click();
VirtualFile attachment = findFileByIoFile(path, true);
FileChooserDialogFixture fileChooser = FileChooserDialogFixture.findDialog(robot(), new GenericTypeMatcher<JDialog>(JDialog.class) {
@Override
protected boolean isMatching(@NotNull JDialog dialog) {
String title = dialog.getTitle();
return isNotEmpty(title) && title.startsWith("Attach Files or Directories to Library");
}
});
assertNotNull("Failed to find VirtualFile with path " + quote(path.getPath()), attachment);
fileChooser.select(attachment).clickOk();
return this;
}
use of com.intellij.openapi.actionSystem.impl.ActionButton in project android by JetBrains.
the class NlPropertyFixture method clickCustomizer.
public void clickCustomizer() {
//JPanel
// TextEditor
// BrowsePanel
// ActionButton
ActionButton button = GuiTests.waitUntilFound(myRobot, myValuePanel, Matchers.byType(ActionButton.class));
new ComponentDriver(myRobot).click(button);
}
Aggregations