use of com.intellij.ui.DumbAwareActionButton in project intellij-community by JetBrains.
the class CvsConfigurationsListEditor method createListPanel.
private JComponent createListPanel() {
final AnActionButton duplicateButton = new DumbAwareActionButton(CvsBundle.message("action.name.copy"), PlatformIcons.COPY_ICON) {
@Override
public void updateButton(AnActionEvent e) {
e.getPresentation().setEnabled(getSelectedConfiguration() != null);
}
@Override
public void actionPerformed(AnActionEvent e) {
copySelectedConfiguration();
}
};
duplicateButton.setShortcut(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_D, SystemInfo.isMac ? KeyEvent.META_MASK : KeyEvent.CTRL_MASK)));
final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myList).setAddAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton anActionButton) {
createNewConfiguration();
}
}).addExtraAction(duplicateButton);
return decorator.createPanel();
}
Aggregations