Java Code Examples for com.intellij.util.IconUtil#getAddIcon()

The following examples show how to use com.intellij.util.IconUtil#getAddIcon() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PackageTemplateWrapper.java    From PackageTemplates with Apache License 2.0 5 votes vote down vote up
private void initTextInjectionAddButton() {
    if (getMode() == ViewMode.USAGE) {
        return;
    }

    JButton btnAdd = new JButton(Localizer.get("action.AddTextInjection"), IconUtil.getAddIcon());
    btnAdd.addMouseListener(new ClickListener() {
        @Override
        public void mouseClicked(MouseEvent e) {
            createTextInjection();
        }
    });
    panel.add(btnAdd, new CC().wrap());
}
 
Example 2
Source File: CustomPathDialog.java    From PackageTemplates with Apache License 2.0 5 votes vote down vote up
private JButton getAddButton() {
    JButton btnAdd = new JButton(Localizer.get("action.Add"), IconUtil.getAddIcon());
    btnAdd.addMouseListener(new ClickListener() {
        @Override
        public void mouseClicked(MouseEvent e) {
            createSearchAction(null);
        }
    });
    return btnAdd;
}
 
Example 3
Source File: CommonActionsPanel.java    From consulo with Apache License 2.0 5 votes vote down vote up
public SwingImageRef getIcon() {
  switch (this) {
    case ADD:    return IconUtil.getAddIcon();
    case EDIT:    return IconUtil.getEditIcon();
    case REMOVE: return IconUtil.getRemoveIcon();
    case UP:     return IconUtil.getMoveUpIcon();
    case DOWN:   return IconUtil.getMoveDownIcon();
  }
  return null;
}
 
Example 4
Source File: SelectPackageTemplateDialog.java    From PackageTemplates with Apache License 2.0 4 votes vote down vote up
private void initToolbarActions() {
    //Add
    actionAdd = new BaseAction(Localizer.get("tooltip.Create"), Localizer.get("description.CreateNewPackageTemplate"), IconUtil.getAddIcon()) {
        @Override
        public void actionPerformed(AnActionEvent e) {
            presenter.onAddAction();
        }
    };

    //Edit
    actionEdit = new BaseAction(Localizer.get("tooltip.Edit"), Localizer.get("description.EditExistingPackageTemplate"), IconUtil.getEditIcon()) {
        @Override
        public void actionPerformed(AnActionEvent e) {
            if (FileValidator.isValidTemplatePath(getSelectedPath())) {
                presenter.onEditAction(getSelectedPath());
            } else {
                Messages.showErrorDialog(project, Localizer.get("warning.select.packageTemplate"), Localizer.get("title.SystemMessage"));
            }
        }
    };

    // Settings
    actionSettings = new BaseAction(Localizer.get("tooltip.Settings"), Localizer.get("description.EditGeneralSettings"), PlatformIcons.SHOW_SETTINGS_ICON) {
        @Override
        public void actionPerformed(AnActionEvent e) {
            presenter.onSettingsAction();
        }
    };

    // Export
    actionExport = new BaseAction(Localizer.get("tooltip.Export"), Localizer.get("description.ExportPackageTemplate") ,PlatformIcons.EXPORT_ICON) {
        @Override
        public void actionPerformed(AnActionEvent e) {
            if (FileValidator.isValidTemplatePath(getSelectedPath())) {
                presenter.onExportAction(getSelectedPath());
            } else {
                Messages.showErrorDialog(project, Localizer.get("warning.select.packageTemplate"), Localizer.get("title.SystemMessage"));
            }
        }
    };

    // Import
    actionImport = new BaseAction(Localizer.get("tooltip.Import"), Localizer.get("description.ImportPackageTemplate"), PlatformIcons.IMPORT_ICON) {
        @Override
        public void actionPerformed(AnActionEvent e) {
            presenter.onImportAction();
        }
    };

    // Add to Favourite
    actionAddToFavourites = new BaseAction(Localizer.get("tooltip.Favourite"), Localizer.get("description.AddRemoveFromFavourites"), AllIcons.Toolwindows.ToolWindowFavorites) {
        @Override
        public void actionPerformed(AnActionEvent e) {
            String path = getSelectedPath();
            switch (templateSourceType) {
                case FAVOURITE:
                    presenter.removeFavourite(path);
                    break;
                case PATH:
                    if (!FileValidator.isValidTemplatePath(path)) {
                        Messages.showErrorDialog(project, Localizer.get("warning.select.packageTemplate"), Localizer.get("title.SystemMessage"));
                        return;
                    }

                    presenter.addFavourite(path);
                    break;
            }
        }
    };

    // AutoImport
    actionAutoImport = new BaseAction(Localizer.get("tooltip.Auto"), Localizer.get("description.EditAutoImportSettings"), PluginIcons.AUTO_IMPORT) {
        @Override
        public void actionPerformed(AnActionEvent e) {
            presenter.onAutoImportAction();
        }
    };

}
 
Example 5
Source File: SettingsDialog.java    From PackageTemplates with Apache License 2.0 4 votes vote down vote up
private void buildAutoImportBlock() {
    panel.add(new SeparatorComponent(10), new CC().pushX().growX().wrap().spanX());
    panel.add(new JLabel(Localizer.get("settings.AutoImport"), JLabel.CENTER), new CC().wrap().growX().pushX().spanX());

    //WriteRules
    ArrayList<WriteRules> actionTypes = new ArrayList<>();
    actionTypes.add(WriteRules.USE_EXISTING);
    actionTypes.add(WriteRules.ASK_ME);
    actionTypes.add(WriteRules.OVERWRITE);

    cbAutoImportWriteRules = new ComboBox(actionTypes.toArray());
    cbAutoImportWriteRules.setRenderer(new WriteRulesCellRenderer());

    panel.add(cbAutoImportWriteRules, new CC().pushX().growX().spanX().gapY("10", "10"));

    //Paths
    paths = new ArrayList<>();
    lvAutoImport = new ListView<String>(paths) {
        @Nullable
        @Override
        public CollectDataFromUI onBuildView(String item, int pos) {
            TextFieldWithBrowseButton btnPath = new TextFieldWithBrowseButton();
            btnPath.setText(item);
            btnPath.addBrowseFolderListener(Localizer.get("SelectDirectoryToImport"), "", project, FileReaderUtil.getDirectoryDescriptor());

            JButton btnDelete = new JButton(IconUtil.getRemoveIcon());
            btnDelete.addMouseListener(new ClickListener() {
                @Override
                public void mouseClicked(MouseEvent e) {
                    lvAutoImport.collectDataFromUI();
                    presenter.removeImportPath(paths, pos);
                }
            });

            add(btnDelete, new CC().split(2).spanX());
            add(btnPath, new CC().pushX().growX());
            return () -> list.set(pos, btnPath.getText());
        }
    };
    panel.add(lvAutoImport, new CC().spanX().pushX().growX().wrap());

    JButton btnAdd = new JButton(Localizer.get("action.AddPath"), IconUtil.getAddIcon());
    btnAdd.addMouseListener(new ClickListener() {
        @Override
        public void mouseClicked(MouseEvent e) {
            lvAutoImport.collectDataFromUI();
            presenter.addImportPath(paths);
        }
    });
    panel.add(btnAdd, new CC().wrap());
}
 
Example 6
Source File: CoverageSuiteChooserDialog.java    From consulo with Apache License 2.0 4 votes vote down vote up
public AddExternalSuiteAction() {
  super("Add", "Add", IconUtil.getAddIcon());
  registerCustomShortcutSet(CommonShortcuts.INSERT, mySuitesTree);
}
 
Example 7
Source File: RemoteServerListConfigurable.java    From consulo with Apache License 2.0 4 votes vote down vote up
private AddRemoteServerGroup() {
  super("Add", "", IconUtil.getAddIcon());
  registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
}
 
Example 8
Source File: NamedItemsListEditor.java    From consulo with Apache License 2.0 4 votes vote down vote up
public AddAction() {
    super("Add", "Add", IconUtil.getAddIcon());
    registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
}
 
Example 9
Source File: NewLayerAction.java    From consulo with Apache License 2.0 4 votes vote down vote up
public NewLayerAction(ModuleEditor moduleEditor, boolean copy) {
  super(copy ? "Copy layer" : "New layer", null, copy ? AllIcons.Actions.Copy : IconUtil.getAddIcon());
  myModuleEditor = moduleEditor;
  myCopy = copy;
}
 
Example 10
Source File: BaseStructureConfigurableNoDaemon.java    From consulo with Apache License 2.0 4 votes vote down vote up
public AbstractAddGroup(String text) {
  this(text, IconUtil.getAddIcon());
}
 
Example 11
Source File: BaseStructureConfigurable.java    From consulo with Apache License 2.0 4 votes vote down vote up
public AbstractAddGroup(String text) {
  this(text, IconUtil.getAddIcon());
}