1. ToolbarDecorators added for some new icons

2. Duplicate icons removed
3. ToolbarDecorator: Disabling extra actions if context component disabled
4. ToolbarDecorator: Setter for add action.
This commit is contained in:
Evgeny Zakrevsky
2012-05-19 02:24:39 +04:00
parent 0556eb708c
commit 734a8b6db4
108 changed files with 556 additions and 761 deletions

View File

@@ -259,12 +259,12 @@ public class CompoundRendererConfigurable implements UnnamedConfigurable {
getTableModel().removeRow(selectedRow);
}
}
}).setUpAction(new AnActionButtonRunnable() {
}).setMoveUpAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
TableUtil.moveSelectedItemsUp(myTable);
}
}).setDownAction(new AnActionButtonRunnable() {
}).setMoveDownAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
TableUtil.moveSelectedItemsDown(myTable);

View File

@@ -25,8 +25,9 @@ import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.intellij.ui.DocumentAdapter;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.containers.InternalIterator;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -44,11 +45,11 @@ import java.util.ArrayList;
*/
public class UserRenderersConfigurable implements SearchableConfigurable, Configurable.NoScroll {
private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.settings.UserRenderersConfigurable");
private static final Icon ADD_ICON = IconLoader.getIcon("/general/add.png");
private static final Icon REMOVE_ICON = IconLoader.getIcon("/general/remove.png");
private static final Icon COPY_ICON = IconLoader.getIcon("/general/copy.png");
private static final Icon UP_ICON = IconLoader.getIcon("/actions/previousOccurence.png");
private static final Icon DOWN_ICON = IconLoader.getIcon("/actions/nextOccurence.png");
private static final Icon ADD_ICON = IconUtil.getAddIcon();
private static final Icon REMOVE_ICON = IconUtil.getRemoveIcon();
private static final Icon COPY_ICON = PlatformIcons.COPY_ICON;
private static final Icon UP_ICON = IconUtil.getMoveUpIcon();
private static final Icon DOWN_ICON = IconUtil.getMoveDownIcon();
private JTextField myNameField;
private ElementsChooser<NodeRenderer> myRendererChooser;

View File

@@ -49,7 +49,7 @@ public class ConfigurationArgumentsHelpArea extends JPanel {
);
FixedSizeButton copyButton = new FixedSizeButton(22);
copyButton.setIcon(PlatformIcons.DUPLICATE_ICON);
copyButton.setIcon(PlatformIcons.COPY_ICON);
copyButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {

View File

@@ -29,6 +29,7 @@ import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.components.JBList;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.StringBuilderSpinAllocator;
import com.intellij.util.containers.ContainerUtil;
@@ -52,7 +53,7 @@ import java.util.List;
*/
abstract class ProjectLayoutPanel<T> extends JPanel {
private static final Icon ICON_MODULE = IconLoader.getIcon("/nodes/ModuleClosed.png");
private static final Icon RENAME_ICON = IconLoader.getIcon("/modules/edit.png");
private static final Icon RENAME_ICON = IconUtil.getEditIcon();
private static final Icon MERGE_ICON = IconLoader.getIcon("/modules/merge.png");
private static final Icon SPLIT_ICON = IconLoader.getIcon("/modules/split.png");

View File

@@ -28,7 +28,7 @@ import com.intellij.ui.*;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.table.JBTable;
import com.intellij.util.ArrayUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import com.intellij.util.ui.ItemRemovable;
import com.intellij.util.ui.UIUtil;
@@ -108,7 +108,7 @@ public class JavadocEditor extends ModuleElementsEditor {
TableUtil.selectRows(myTable, new int[]{tableModel.getRowCount() - 1});
}
}
}).addExtraAction(new AnActionButton(ProjectBundle.message("module.javadoc.add.url.button"), PlatformIcons.TABLE_URL) {
}).addExtraAction(new AnActionButton(ProjectBundle.message("module.javadoc.add.url.button"), IconUtil.getAddLinkIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
VirtualFile[] files = new VirtualFile[]{Util.showSpecifyJavadocUrlDialog(myTable)};
@@ -133,7 +133,7 @@ public class JavadocEditor extends ModuleElementsEditor {
saveData();
}
}
}).createPanel();
}).setButtonComparator("Add", ProjectBundle.message("module.javadoc.add.url.button"), "Remove").createPanel();
final JPanel mainPanel = new JPanel(new BorderLayout());
mainPanel.add(tablePanel, BorderLayout.CENTER);

View File

@@ -39,7 +39,7 @@ import com.intellij.openapi.ui.Splitter;
import com.intellij.openapi.util.Conditions;
import com.intellij.ui.TreeSpeedSearch;
import com.intellij.util.Consumer;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import com.intellij.util.containers.Convertor;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
@@ -160,7 +160,7 @@ public class ProjectJdksConfigurable extends MasterDetailsComponent {
protected ArrayList<AnAction> createActions(final boolean fromPopup) {
final ArrayList<AnAction> actions = new ArrayList<AnAction>();
DefaultActionGroup group = new DefaultActionGroup(ProjectBundle.message("add.new.jdk.text"), true);
group.getTemplatePresentation().setIcon(PlatformIcons.ADD_ICON);
group.getTemplatePresentation().setIcon(IconUtil.getAddIcon());
myProjectJdksModel.createAddActions(group, myTree, new Consumer<Sdk>() {
public void consume(final Sdk projectJdk) {
addNode(new MyNode(new JdkConfigurable(((ProjectJdkImpl)projectJdk), myProjectJdksModel, TREE_UPDATER, myHistory, myProject), false), myRoot);

View File

@@ -55,7 +55,7 @@ import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.TabbedPaneWrapper;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.util.EventDispatcher;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import com.intellij.util.ui.ThreeStateCheckBox;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -294,8 +294,8 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
toolbarActionGroup.add(new RemovePackagingElementAction(this));
toolbarActionGroup.add(Separator.getInstance());
toolbarActionGroup.add(new SortElementsToggleAction(this.getLayoutTreeComponent()));
toolbarActionGroup.add(new MovePackagingElementAction(myLayoutTreeComponent, "Move Up", "", IconLoader.getIcon("/actions/moveUp.png"), -1));
toolbarActionGroup.add(new MovePackagingElementAction(myLayoutTreeComponent, "Move Down", "", IconLoader.getIcon("/actions/moveDown.png"), 1));
toolbarActionGroup.add(new MovePackagingElementAction(myLayoutTreeComponent, "Move Up", "", IconUtil.getMoveUpIcon(), -1));
toolbarActionGroup.add(new MovePackagingElementAction(myLayoutTreeComponent, "Move Down", "", IconUtil.getMoveDownIcon(), 1));
return toolbarActionGroup;
}
@@ -342,7 +342,7 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
private ActionGroup createAddNonCompositeElementGroup() {
DefaultActionGroup group = new DefaultActionGroup(ProjectBundle.message("artifacts.add.copy.action"), true);
group.getTemplatePresentation().setIcon(PlatformIcons.ADD_ICON);
group.getTemplatePresentation().setIcon(IconUtil.getAddIcon());
for (PackagingElementType<?> type : PackagingElementFactory.getInstance().getNonCompositeElementTypes()) {
group.add(new AddNewPackagingElementAction(type, this));
}

View File

@@ -51,7 +51,6 @@ import com.intellij.openapi.ui.popup.JBPopup;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.ui.popup.PopupStep;
import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.ToolWindowId;
import com.intellij.packageDependencies.DependenciesBuilder;
@@ -63,7 +62,6 @@ import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.table.JBTable;
import com.intellij.util.EventDispatcher;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -286,7 +284,7 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
}
};
final AnActionButton analyzeButton = new AnActionButton(ProjectBundle.message("classpath.panel.analyze"), null, SystemInfo.isMac ? PlatformIcons.TABLE_ANALYZE : PlatformIcons.ANALYZE) {
final AnActionButton analyzeButton = new AnActionButton(ProjectBundle.message("classpath.panel.analyze"), null, IconUtil.getAnalyzeIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
AnalyzeDependenciesDialog.show(getRootModel().getModule());
@@ -355,13 +353,13 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
removeAction.actionPerformed(null);
}
})
.setUpAction(new AnActionButtonRunnable() {
.setMoveUpAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
moveSelectedRows(-1);
}
})
.setDownAction(new AnActionButtonRunnable() {
.setMoveDownAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
moveSelectedRows(+1);

View File

@@ -36,7 +36,7 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.AnActionButton;
import com.intellij.ui.AnActionButtonUpdater;
import com.intellij.ui.ToolbarDecorator;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import javax.swing.*;
@@ -69,7 +69,7 @@ public class JavadocOrderRootTypeUIFactory implements OrderRootTypeUIFactory {
@Override
protected void addToolbarButtons(ToolbarDecorator toolbarDecorator) {
AnActionButton specifyUrlButton = new AnActionButton(ProjectBundle.message("sdk.paths.specify.url.button"), PlatformIcons.TABLE_URL) {
AnActionButton specifyUrlButton = new AnActionButton(ProjectBundle.message("sdk.paths.specify.url.button"), IconUtil.getAddLinkIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
onSpecifyUrlButtonClicked();

View File

@@ -29,7 +29,8 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.roots.libraries.LibraryTable;
import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.*;
import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureDaemonAnalyzerListener;
import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureElement;
import com.intellij.openapi.ui.MasterDetailsComponent;
import com.intellij.openapi.ui.MasterDetailsState;
import com.intellij.openapi.ui.MasterDetailsStateService;
@@ -42,7 +43,7 @@ import com.intellij.ui.TreeSpeedSearch;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.navigation.Place;
import com.intellij.util.Function;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.Convertor;
import com.intellij.util.ui.tree.TreeUtil;
@@ -433,7 +434,7 @@ public abstract class BaseStructureConfigurable extends MasterDetailsComponent i
}
public AbstractAddGroup(String text) {
this(text, PlatformIcons.ADD_ICON);
this(text, IconUtil.getAddIcon());
}
public ActionGroup getActionGroup() {

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.application.options;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationBundle;
import com.intellij.openapi.editor.SyntaxHighlighterColors;
import com.intellij.openapi.editor.markup.TextAttributes;
@@ -24,13 +25,12 @@ import com.intellij.psi.codeStyle.PackageEntry;
import com.intellij.psi.codeStyle.PackageEntryTable;
import com.intellij.ui.*;
import com.intellij.ui.table.JBTable;
import com.intellij.util.IconUtil;
import com.intellij.util.ui.UIUtil;
import javax.swing.*;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableColumn;
@@ -67,7 +67,7 @@ public class CodeStyleImportsPanel extends JPanel {
private JPanel myWholePanel;
private JCheckBox myCbLayoutStaticImportsSeparately;
public CodeStyleImportsPanel(CodeStyleSettings settings){
public CodeStyleImportsPanel(CodeStyleSettings settings) {
mySettings = settings;
setLayout(new BorderLayout());
setBorder(IdeBorderFactory.createEmptyBorder(2, 2, 2, 2));
@@ -96,8 +96,9 @@ public class CodeStyleImportsPanel extends JPanel {
final MultiLineLabel oneImportPerDirectiveLabel = new MultiLineLabel("<% page import=\"com.company.Boo\"%>\n" +
"<% page import=\"com.company.Far\"%>");
final JPanel labelPanel = new JPanel(new BorderLayout());
labelPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(20, 10, 0, 0), IdeBorderFactory.createTitledBorder(
ApplicationBundle.message("title.preview"), false)));
labelPanel.setBorder(
BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(20, 10, 0, 0), IdeBorderFactory.createTitledBorder(
ApplicationBundle.message("title.preview"), false)));
JPanel resultPanel = new JPanel(new BorderLayout());
resultPanel.add(btnPanel, BorderLayout.NORTH);
@@ -136,12 +137,18 @@ public class CodeStyleImportsPanel extends JPanel {
myClassCountField = new JTextField(3);
myNamesCountField = new JTextField(3);
final JPanel panel = new JPanel(new GridBagLayout());
panel.add(new JLabel(ApplicationBundle.message("editbox.class.count.to.use.import.with.star")), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 3, 0, 0), 0, 0));
panel.add(new JLabel(ApplicationBundle.message("editbox.class.count.to.use.import.with.star")),
new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 3, 0, 0), 0, 0));
panel.add(myClassCountField,
new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
new Insets(0, 1, 0, 0), 0, 0));
panel.add(new JLabel(ApplicationBundle.message("editbox.names.count.to.use.static.import.with.star")), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 3, 0, 0), 0, 0));
panel.add(myNamesCountField, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 1, 0, 0), 0, 0));
panel.add(new JLabel(ApplicationBundle.message("editbox.names.count.to.use.static.import.with.star")),
new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 3, 0, 0), 0, 0));
panel.add(myNamesCountField,
new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
new Insets(0, 1, 0, 0), 0, 0));
group.add(panel);
return group.createPanel();
@@ -159,8 +166,7 @@ public class CodeStyleImportsPanel extends JPanel {
public void run(AnActionButton button) {
removeEntryFromPackages();
}
}).disableUpDownActions().createPanel();
panel.setPreferredSize(new Dimension(-1, 150));
}).disableUpDownActions().setPreferredSize(new Dimension(-1, 150)).createPanel();
UIUtil.addBorder(panel, IdeBorderFactory.createTitledBorder(ApplicationBundle.message("title.packages.to.use.import.with"), false));
@@ -172,11 +178,11 @@ public class CodeStyleImportsPanel extends JPanel {
panel.setBorder(IdeBorderFactory.createTitledBorder(ApplicationBundle.message("title.import.layout"), false));
myCbLayoutStaticImportsSeparately = new JCheckBox("Layout static imports separately");
myCbLayoutStaticImportsSeparately.addItemListener(new ItemListener(){
myCbLayoutStaticImportsSeparately.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (areStaticImportsEnabled()) {
boolean found = false;
for (int i=myImportLayoutList.getEntryCount()-1; i>=0; i--) {
for (int i = myImportLayoutList.getEntryCount() - 1; i >= 0; i--) {
PackageEntry entry = myImportLayoutList.getEntryAt(i);
if (entry == PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY) {
found = true;
@@ -185,14 +191,14 @@ public class CodeStyleImportsPanel extends JPanel {
}
if (!found) {
int index = myImportLayoutList.getEntryCount();
if (index != 0 && myImportLayoutList.getEntryAt(index-1) != PackageEntry.BLANK_LINE_ENTRY) {
if (index != 0 && myImportLayoutList.getEntryAt(index - 1) != PackageEntry.BLANK_LINE_ENTRY) {
myImportLayoutList.addEntry(PackageEntry.BLANK_LINE_ENTRY);
}
myImportLayoutList.addEntry(PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY);
}
}
else {
for (int i=myImportLayoutList.getEntryCount()-1; i>=0; i--) {
for (int i = myImportLayoutList.getEntryCount() - 1; i >= 0; i--) {
PackageEntry entry = myImportLayoutList.getEntryAt(i);
if (entry.isStatic()) {
myImportLayoutList.removeEntryAt(i);
@@ -204,8 +210,44 @@ public class CodeStyleImportsPanel extends JPanel {
}
});
panel.add(myCbLayoutStaticImportsSeparately, BorderLayout.NORTH);
panel.add(createImportLayoutTable(), BorderLayout.CENTER);
panel.add(createImportLayoutButtonsPanel(), BorderLayout.EAST);
panel.add(
ToolbarDecorator.createDecorator(myImportLayoutTable = createTableForPackageEntries(myImportLayoutList))
.addExtraAction(new AnActionButton(ApplicationBundle.message("button.add.package"), IconUtil.getAddPackageIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
addPackageToImportLayouts();
}
}).addExtraAction(new AnActionButton(ApplicationBundle.message("button.add.blank"), IconUtil.getAddBlankLineIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
addBlankLine();
}
}).setRemoveAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
removeEntryFromImportLayouts();
}
}).setMoveUpAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
moveRowUp();
}
}).setMoveDownAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
moveRowDown();
}
}).setRemoveActionUpdater(new AnActionButtonUpdater() {
@Override
public boolean isEnabled(AnActionEvent e) {
int selectedImport = myImportLayoutTable.getSelectedRow();
PackageEntry entry = selectedImport < 0 ? null : myImportLayoutList.getEntryAt(selectedImport);
return entry != null && entry != PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY && entry != PackageEntry.ALL_OTHER_IMPORTS_ENTRY;
}
}).setButtonComparator(ApplicationBundle.message("button.add.package"), ApplicationBundle.message("button.add.blank"),
"Remove", "Up", "Down")
.setPreferredSize(new Dimension(-1, 200)).createPanel(), BorderLayout.CENTER);
return panel;
}
@@ -220,82 +262,14 @@ public class CodeStyleImportsPanel extends JPanel {
return myCbLayoutStaticImportsSeparately.isSelected();
}
private JPanel createImportLayoutButtonsPanel() {
JPanel tableButtonsPanel = new JPanel();
tableButtonsPanel.setLayout(new BoxLayout(tableButtonsPanel, BoxLayout.Y_AXIS));
JButton addPackageToImportLayoutButton = new JButton(ApplicationBundle.message("button.add.package"));
tableButtonsPanel.add(addPackageToImportLayoutButton);
addPackageToImportLayoutButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, addPackageToImportLayoutButton.getMaximumSize().height));
JButton addBlankLineButton = new JButton(ApplicationBundle.message("button.add.blank"));
tableButtonsPanel.add(addBlankLineButton);
addBlankLineButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, addBlankLineButton.getMaximumSize().height));
myMoveUpButton = new JButton(ApplicationBundle.message("button.move.up"));
tableButtonsPanel.add(myMoveUpButton);
myMoveUpButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, myMoveUpButton.getMaximumSize().height));
myMoveDownButton = new JButton(ApplicationBundle.message("button.move.down"));
tableButtonsPanel.add(myMoveDownButton);
myMoveDownButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, myMoveDownButton.getMaximumSize().height));
myRemovePackageFromImportLayoutButton = new JButton(ApplicationBundle.message("button.remove"));
tableButtonsPanel.add(myRemovePackageFromImportLayoutButton);
myRemovePackageFromImportLayoutButton.setMaximumSize(new Dimension(Integer.MAX_VALUE, myRemovePackageFromImportLayoutButton.getMaximumSize().height));
addPackageToImportLayoutButton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
addPackageToImportLayouts();
}
}
);
addBlankLineButton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
addBlankLine();
}
}
);
myRemovePackageFromImportLayoutButton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
removeEntryFromImportLayouts();
}
}
);
myMoveUpButton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
moveRowUp();
}
}
);
myMoveDownButton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
moveRowDown();
}
}
);
return tableButtonsPanel;
}
private void addPackageToImportLayouts() {
int selected = myImportLayoutTable.getSelectedRow() + 1;
if(selected < 0) {
if (selected < 0) {
selected = myImportLayoutList.getEntryCount();
}
PackageEntry entry = new PackageEntry(false,"", true);
PackageEntry entry = new PackageEntry(false, "", true);
myImportLayoutList.insertEntryAt(entry, selected);
refreshTableModel(selected, myImportLayoutTable);
updateButtons();
}
private static void refreshTableModel(int selectedRow, JBTable table) {
@@ -304,102 +278,98 @@ public class CodeStyleImportsPanel extends JPanel {
table.setRowSelectionInterval(selectedRow, selectedRow);
TableUtil.editCellAt(table, selectedRow, 0);
Component editorComp = table.getEditorComponent();
if(editorComp != null) {
if (editorComp != null) {
editorComp.requestFocus();
}
}
private void addPackageToPackages() {
int selected = myPackageTable.getSelectedRow() + 1;
if(selected < 0) {
if (selected < 0) {
selected = myPackageList.getEntryCount();
}
PackageEntry entry = new PackageEntry(false,"", true);
PackageEntry entry = new PackageEntry(false, "", true);
myPackageList.insertEntryAt(entry, selected);
refreshTableModel(selected, myPackageTable);
}
private void addBlankLine() {
int selected = myImportLayoutTable.getSelectedRow() + 1;
if(selected < 0) {
if (selected < 0) {
selected = myImportLayoutList.getEntryCount();
}
myImportLayoutList.insertEntryAt(PackageEntry.BLANK_LINE_ENTRY, selected);
AbstractTableModel model = (AbstractTableModel)myImportLayoutTable.getModel();
model.fireTableRowsInserted(selected, selected);
myImportLayoutTable.setRowSelectionInterval(selected, selected);
updateButtons();
}
private void removeEntryFromImportLayouts() {
int selected = myImportLayoutTable.getSelectedRow();
if(selected < 0)
if (selected < 0) {
return;
}
PackageEntry entry = myImportLayoutList.getEntryAt(selected);
if(entry == PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY || entry == PackageEntry.ALL_OTHER_IMPORTS_ENTRY) {
if (entry == PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY || entry == PackageEntry.ALL_OTHER_IMPORTS_ENTRY) {
return;
}
TableUtil.stopEditing(myImportLayoutTable);
myImportLayoutList.removeEntryAt(selected);
AbstractTableModel model = (AbstractTableModel)myImportLayoutTable.getModel();
model.fireTableRowsDeleted(selected, selected);
if(selected >= myImportLayoutList.getEntryCount()) {
selected --;
if (selected >= myImportLayoutList.getEntryCount()) {
selected--;
}
if(selected >= 0) {
if (selected >= 0) {
myImportLayoutTable.setRowSelectionInterval(selected, selected);
}
updateButtons();
}
private void removeEntryFromPackages() {
int selected = myPackageTable.getSelectedRow();
if(selected < 0) return;
if (selected < 0) return;
TableUtil.stopEditing(myPackageTable);
myPackageList.removeEntryAt(selected);
AbstractTableModel model = (AbstractTableModel)myPackageTable.getModel();
model.fireTableRowsDeleted(selected, selected);
if(selected >= myPackageList.getEntryCount()) {
selected --;
if (selected >= myPackageList.getEntryCount()) {
selected--;
}
if(selected >= 0) {
if (selected >= 0) {
myPackageTable.setRowSelectionInterval(selected, selected);
}
updateButtons();
}
private void moveRowUp() {
int selected = myImportLayoutTable.getSelectedRow();
if(selected < 1) {
if (selected < 1) {
return;
}
TableUtil.stopEditing(myImportLayoutTable);
PackageEntry entry = myImportLayoutList.getEntryAt(selected);
PackageEntry previousEntry = myImportLayoutList.getEntryAt(selected-1);
PackageEntry previousEntry = myImportLayoutList.getEntryAt(selected - 1);
myImportLayoutList.setEntryAt(previousEntry, selected);
myImportLayoutList.setEntryAt(entry, selected-1);
myImportLayoutList.setEntryAt(entry, selected - 1);
AbstractTableModel model = (AbstractTableModel)myImportLayoutTable.getModel();
model.fireTableRowsUpdated(selected-1, selected);
myImportLayoutTable.setRowSelectionInterval(selected-1, selected-1);
updateButtons();
model.fireTableRowsUpdated(selected - 1, selected);
myImportLayoutTable.setRowSelectionInterval(selected - 1, selected - 1);
}
private void moveRowDown() {
int selected = myImportLayoutTable.getSelectedRow();
if(selected >= myImportLayoutList.getEntryCount()-1) {
if (selected >= myImportLayoutList.getEntryCount() - 1) {
return;
}
TableUtil.stopEditing(myImportLayoutTable);
PackageEntry entry = myImportLayoutList.getEntryAt(selected);
PackageEntry nextEntry = myImportLayoutList.getEntryAt(selected+1);
PackageEntry nextEntry = myImportLayoutList.getEntryAt(selected + 1);
myImportLayoutList.setEntryAt(nextEntry, selected);
myImportLayoutList.setEntryAt(entry, selected+1);
myImportLayoutList.setEntryAt(entry, selected + 1);
AbstractTableModel model = (AbstractTableModel)myImportLayoutTable.getModel();
model.fireTableRowsUpdated(selected, selected+1);
myImportLayoutTable.setRowSelectionInterval(selected+1, selected+1);
updateButtons();
model.fireTableRowsUpdated(selected, selected + 1);
myImportLayoutTable.setRowSelectionInterval(selected + 1, selected + 1);
}
private JBTable createTableForPackageEntries(final PackageEntryTable packageTable) {
@@ -410,7 +380,7 @@ public class CodeStyleImportsPanel extends JPanel {
// Create a model of the data.
TableModel dataModel = new AbstractTableModel() {
public int getColumnCount() {
return names.length + (areStaticImportsEnabled()?1:0);
return names.length + (areStaticImportsEnabled() ? 1 : 0);
}
public int getRowCount() {
@@ -421,13 +391,13 @@ public class CodeStyleImportsPanel extends JPanel {
PackageEntry entry = packageTable.getEntryAt(row);
if (entry == null || !isCellEditable(row, col)) return null;
col += areStaticImportsEnabled() ? 0 : 1;
if(col == 0) {
if (col == 0) {
return entry.isStatic();
}
if(col == 1) {
if (col == 1) {
return entry.getPackageName();
}
if(col == 2) {
if (col == 2) {
return entry.isWithSubpackages() ? Boolean.TRUE : Boolean.FALSE;
}
throw new IllegalArgumentException(String.valueOf(col));
@@ -441,13 +411,13 @@ public class CodeStyleImportsPanel extends JPanel {
public Class getColumnClass(int col) {
col += areStaticImportsEnabled() ? 0 : 1;
if(col == 0) {
if (col == 0) {
return Boolean.class;
}
if(col == 1) {
if (col == 1) {
return String.class;
}
if(col == 2) {
if (col == 2) {
return Boolean.class;
}
throw new IllegalArgumentException(String.valueOf(col));
@@ -461,16 +431,18 @@ public class CodeStyleImportsPanel extends JPanel {
public void setValueAt(Object aValue, int row, int col) {
PackageEntry packageEntry = packageTable.getEntryAt(row);
col += areStaticImportsEnabled() ? 0 : 1;
if(col == 0) {
if (col == 0) {
PackageEntry newPackageEntry = new PackageEntry((Boolean)aValue, packageEntry.getPackageName(), packageEntry.isWithSubpackages());
packageTable.setEntryAt(newPackageEntry, row);
}
else if(col == 1) {
PackageEntry newPackageEntry = new PackageEntry(packageEntry.isStatic(), ((String)aValue).trim(), packageEntry.isWithSubpackages());
else if (col == 1) {
PackageEntry newPackageEntry =
new PackageEntry(packageEntry.isStatic(), ((String)aValue).trim(), packageEntry.isWithSubpackages());
packageTable.setEntryAt(newPackageEntry, row);
}
else if(col == 2) {
PackageEntry newPackageEntry = new PackageEntry(packageEntry.isStatic(), packageEntry.getPackageName(), ((Boolean)aValue).booleanValue());
else if (col == 2) {
PackageEntry newPackageEntry =
new PackageEntry(packageEntry.isStatic(), packageEntry.getPackageName(), ((Boolean)aValue).booleanValue());
packageTable.setEntryAt(newPackageEntry, row);
}
else {
@@ -483,12 +455,6 @@ public class CodeStyleImportsPanel extends JPanel {
final JBTable result = new JBTable(dataModel);
result.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
resizeColumns(packageTable, result);
result.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
updateButtons();
}
});
TableCellEditor editor = result.getDefaultEditor(String.class);
if (editor instanceof DefaultCellEditor) {
@@ -553,27 +519,12 @@ public class CodeStyleImportsPanel extends JPanel {
private static void fixColumnWidthToHeader(JBTable result, int columnIdx) {
final TableColumn column = result.getColumnModel().getColumn(columnIdx);
final int width = 15 + result.getTableHeader().getFontMetrics(result.getTableHeader().getFont()).stringWidth(result.getColumnName(columnIdx));
final int width =
15 + result.getTableHeader().getFontMetrics(result.getTableHeader().getFont()).stringWidth(result.getColumnName(columnIdx));
column.setMinWidth(width);
column.setMaxWidth(width);
}
private void updateButtons(){
int selectedImport = myImportLayoutTable.getSelectedRow();
myMoveUpButton.setEnabled(selectedImport >= 1);
myMoveDownButton.setEnabled(selectedImport < myImportLayoutTable.getRowCount() - 1);
PackageEntry entry = selectedImport < 0 ? null : myImportLayoutList.getEntryAt(selectedImport);
boolean canRemove = entry != null && entry != PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY && entry != PackageEntry.ALL_OTHER_IMPORTS_ENTRY;
myRemovePackageFromImportLayoutButton.setEnabled(canRemove);
}
private JComponent createImportLayoutTable() {
myImportLayoutTable = createTableForPackageEntries(myImportLayoutList);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myImportLayoutTable);
scrollPane.setPreferredSize(new Dimension(-1, 200));
return scrollPane;
}
public void reset(CodeStyleSettings settings) {
myCbUseFQClassNames.setSelected(settings.USE_FQ_CLASS_NAMES);
myCbUseFQClassNamesInJavaDoc.setSelected(settings.USE_FQ_CLASS_NAMES_IN_JAVADOC);
@@ -593,10 +544,10 @@ public class CodeStyleImportsPanel extends JPanel {
model = (AbstractTableModel)myPackageTable.getModel();
model.fireTableDataChanged();
if(myImportLayoutTable.getRowCount() > 0) {
if (myImportLayoutTable.getRowCount() > 0) {
myImportLayoutTable.getSelectionModel().setSelectionInterval(0, 0);
}
if(myPackageTable.getRowCount() > 0) {
if (myPackageTable.getRowCount() > 0) {
myPackageTable.getSelectionModel().setSelectionInterval(0, 0);
}
@@ -606,7 +557,6 @@ public class CodeStyleImportsPanel extends JPanel {
else {
myJspOneImportPerDirective.doClick();
}
updateButtons();
}
public void reset() {
@@ -621,16 +571,16 @@ public class CodeStyleImportsPanel extends JPanel {
settings.USE_FQ_CLASS_NAMES_IN_JAVADOC = myCbUseFQClassNamesInJavaDoc.isSelected();
settings.USE_SINGLE_CLASS_IMPORTS = myCbUseSingleClassImports.isSelected();
settings.INSERT_INNER_CLASS_IMPORTS = myCbInsertInnerClassImports.isSelected();
try{
try {
settings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = Integer.parseInt(myClassCountField.getText());
}
catch(NumberFormatException e){
catch (NumberFormatException e) {
//just a bad number
}
try{
try {
settings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = Integer.parseInt(myNamesCountField.getText());
}
catch(NumberFormatException e){
catch (NumberFormatException e) {
//just a bad number
}
@@ -654,8 +604,7 @@ public class CodeStyleImportsPanel extends JPanel {
}
public boolean isModified(CodeStyleSettings settings) {
boolean
isModified = isModified(myCbLayoutStaticImportsSeparately, settings.LAYOUT_STATIC_IMPORTS_SEPARATELY);
boolean isModified = isModified(myCbLayoutStaticImportsSeparately, settings.LAYOUT_STATIC_IMPORTS_SEPARATELY);
isModified |= isModified(myCbUseFQClassNames, settings.USE_FQ_CLASS_NAMES);
isModified |= isModified(myCbUseFQClassNamesInJavaDoc, settings.USE_FQ_CLASS_NAMES_IN_JAVADOC);
isModified |= isModified(myCbUseSingleClassImports, settings.USE_SINGLE_CLASS_IMPORTS);
@@ -679,7 +628,7 @@ public class CodeStyleImportsPanel extends JPanel {
int fieldValue = Integer.parseInt(textField.getText().trim());
return fieldValue != value;
}
catch(NumberFormatException e) {
catch (NumberFormatException e) {
return false;
}
}
@@ -689,14 +638,14 @@ public class CodeStyleImportsPanel extends JPanel {
}
private static boolean isModified(PackageEntryTable list, PackageEntryTable table) {
if(list.getEntryCount() != table.getEntryCount()) {
if (list.getEntryCount() != table.getEntryCount()) {
return true;
}
for(int i=0; i<list.getEntryCount(); i++) {
for (int i = 0; i < list.getEntryCount(); i++) {
PackageEntry entry1 = list.getEntryAt(i);
PackageEntry entry2 = table.getEntryAt(i);
if(!entry1.equals(entry2)) {
if (!entry1.equals(entry2)) {
return true;
}
}

View File

@@ -23,11 +23,16 @@ import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.VerticalFlowLayout;
import com.intellij.psi.PsiClass;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBList;
import com.intellij.util.ui.UIUtil;
import javax.swing.*;
import java.awt.*;
import static com.intellij.util.ui.UIUtil.ComponentStyle.SMALL;
import static com.intellij.util.ui.UIUtil.FontColor.BRIGHTER;
class RestoreReferencesDialog extends DialogWrapper {
private final Object[] myNamedElements;
private JList myList;
@@ -64,19 +69,14 @@ class RestoreReferencesDialog extends DialogWrapper {
@Override
protected JComponent createCenterPanel() {
final JPanel panel = new JPanel(new BorderLayout());
final JPanel panel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP));
myList = new JBList(myNamedElements);
myList.setCellRenderer(new FQNameCellRenderer());
myList.setBorder(BorderFactory.createEtchedBorder());
panel.add(ScrollPaneFactory.createScrollPane(myList), BorderLayout.CENTER);
JTextArea area = new JTextArea(myContainsClassesOnly ?
CodeInsightBundle.message("dialog.paste.on.import.text") :
CodeInsightBundle.message("dialog.paste.on.import.text2"));
area.setEditable(false);
area.setBackground(this.getContentPane().getBackground());
area.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
panel.add(area, BorderLayout.NORTH);
panel.add(new JBLabel(myContainsClassesOnly ?
CodeInsightBundle.message("dialog.paste.on.import.text") :
CodeInsightBundle.message("dialog.paste.on.import.text2"), SMALL, BRIGHTER), BorderLayout.NORTH);
final JPanel buttonPanel = new JPanel(new VerticalFlowLayout());
final JButton okButton = new JButton(CommonBundle.getOkButtonText());

View File

@@ -25,22 +25,19 @@ import com.intellij.ide.DataManager;
import com.intellij.ide.util.ClassFilter;
import com.intellij.ide.util.TreeClassChooser;
import com.intellij.ide.util.TreeClassChooserFactory;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.Factory;
import com.intellij.openapi.util.IconLoader;
import com.intellij.profile.codeInspection.InspectionProfileManager;
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.ui.ReorderableListController;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.SeparatorFactory;
import com.intellij.ui.SortedListModel;
import com.intellij.ui.*;
import com.intellij.ui.components.JBList;
import com.intellij.util.IconUtil;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.Processor;
import org.jetbrains.annotations.NonNls;
@@ -62,7 +59,9 @@ public class SpecialAnnotationsUtil {
return createSpecialAnnotationsListControl(list, borderTitle, false);
}
public static JPanel createSpecialAnnotationsListControl(final List<String> list, final String borderTitle, final boolean acceptPatterns) {
public static JPanel createSpecialAnnotationsListControl(final List<String> list,
final String borderTitle,
final boolean acceptPatterns) {
final SortedListModel<String> listModel = new SortedListModel<String>(new Comparator<String>() {
public int compare(final String o1, final String o2) {
return o1.compareTo(o2);
@@ -73,41 +72,6 @@ public class SpecialAnnotationsUtil {
listModel.add(s);
}
injectionList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
final DefaultActionGroup actionGroup = new DefaultActionGroup();
final ReorderableListController<String> controller = ReorderableListController.create(injectionList, actionGroup);
controller.addAddAction(InspectionsBundle.message("special.annotations.list.add.annotation.class"), new Factory<String>() {
public String create() {
Project project = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(injectionList));
if (project == null) project = ProjectManager.getInstance().getDefaultProject();
TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project)
.createWithInnerClassesScopeChooser(InspectionsBundle.message("special.annotations.list.annotation.class"),
GlobalSearchScope.allScope(project), new ClassFilter() {
@Override
public boolean isAccepted(PsiClass aClass) {
return aClass.isAnnotationType();
}
}, null);
chooser.showDialog();
final PsiClass selected = chooser.getSelected();
return selected != null ? selected.getQualifiedName() : null;
}
}, true);
if (acceptPatterns) {
controller.addAction(new AnAction(InspectionsBundle.message("special.annotations.list.annotation.pattern"),
InspectionsBundle.message("special.annotations.list.annotation.pattern"),
IconLoader.getIcon("/general/add.png")) {
@Override
public void actionPerformed(AnActionEvent e) {
String selectedPattern = Messages.showInputDialog(InspectionsBundle.message("special.annotations.list.annotation.pattern"),
InspectionsBundle.message("special.annotations.list.annotation.pattern"),
Messages.getQuestionIcon());
if (selectedPattern != null) {
listModel.add(selectedPattern);
}
}
});
}
controller.addRemoveAction(InspectionsBundle.message("special.annotations.list.remove.annotation.class"));
injectionList.getModel().addListDataListener(new ListDataListener() {
public void intervalAdded(ListDataEvent e) {
listChanged();
@@ -129,32 +93,55 @@ public class SpecialAnnotationsUtil {
}
});
final JScrollPane listScrollPane = ScrollPaneFactory.createScrollPane(injectionList);
// listScrollPane.setBorder(BorderFactory.createEtchedBorder());
listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
listScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
final FontMetrics fontMetrics = injectionList.getFontMetrics(injectionList.getFont());
listScrollPane.setPreferredSize(new Dimension(0, fontMetrics.getHeight() * 5));
listScrollPane.setMinimumSize(new Dimension(0, fontMetrics.getHeight() * 3));
//int height = injectionList.getCellRenderer().getListCellRendererComponent(injectionList, "foo", 0, false, false).getSize().height;
//injectionList.setFixedCellHeight(height);
//injectionList.setPreferredSize(new Dimension(0, height * 3));
//injectionList.setMinimumSize(new Dimension(0, height * 3));
// injectionList.setVisibleRowCount(3);
ToolbarDecorator toolbarDecorator = ToolbarDecorator.createDecorator(injectionList)
.setAddAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
Project project = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(injectionList));
if (project == null) project = ProjectManager.getInstance().getDefaultProject();
TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project)
.createWithInnerClassesScopeChooser(InspectionsBundle.message("special.annotations.list.annotation.class"),
GlobalSearchScope.allScope(project), new ClassFilter() {
@Override
public boolean isAccepted(PsiClass aClass) {
return aClass.isAnnotationType();
}
}, null);
chooser.showDialog();
final PsiClass selected = chooser.getSelected();
if (selected != null) {
listModel.add(selected.getQualifiedName());
}
}
}).setAddActionName(InspectionsBundle.message("special.annotations.list.add.annotation.class")).disableUpDownActions();
final JPanel listPanel = new JPanel(new BorderLayout());
ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, true);
listPanel.add(actionToolbar.getComponent(), BorderLayout.NORTH);
listPanel.add(listScrollPane, BorderLayout.CENTER);
if (acceptPatterns) {
toolbarDecorator
.setAddIcon(IconUtil.getAddClassIcon())
.addExtraAction(
new AnActionButton(InspectionsBundle.message("special.annotations.list.annotation.pattern"), IconUtil.getAddPatternIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
String selectedPattern = Messages.showInputDialog(InspectionsBundle.message("special.annotations.list.annotation.pattern"),
InspectionsBundle.message("special.annotations.list.annotation.pattern"),
Messages.getQuestionIcon());
if (selectedPattern != null) {
listModel.add(selectedPattern);
}
}
}).setButtonComparator(InspectionsBundle.message("special.annotations.list.add.annotation.class"),
InspectionsBundle.message("special.annotations.list.annotation.pattern"), "Remove");
}
JPanel panel = new JPanel(new BorderLayout());
panel.add(SeparatorFactory.createSeparator(borderTitle, null), BorderLayout.NORTH);
panel.add(listPanel, BorderLayout.CENTER);
panel.add(toolbarDecorator.createPanel(), BorderLayout.CENTER);
return panel;
}
public static IntentionAction createAddToSpecialAnnotationsListIntentionAction(final String text, final String family, final List<String> targetList,
public static IntentionAction createAddToSpecialAnnotationsListIntentionAction(final String text,
final String family,
final List<String> targetList,
final String qualifiedName) {
return new IntentionAction() {
@NotNull
@@ -181,9 +168,11 @@ public class SpecialAnnotationsUtil {
};
}
public static LocalQuickFix createAddToSpecialAnnotationsListQuickFix(final String text, final String family, final List<String> targetList,
final String qualifiedName,
final PsiElement context) {
public static LocalQuickFix createAddToSpecialAnnotationsListQuickFix(final String text,
final String family,
final List<String> targetList,
final String qualifiedName,
final PsiElement context) {
return new LocalQuickFix() {
@NotNull
public String getName() {
@@ -232,5 +221,4 @@ public class SpecialAnnotationsUtil {
}
}
}
}

View File

@@ -115,12 +115,12 @@ public class EditMigrationDialog extends DialogWrapper{
public void run(AnActionButton button) {
edit();
}
}).setUpAction(new AnActionButtonRunnable() {
}).setMoveUpAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
moveUp();
}
}).setDownAction(new AnActionButtonRunnable() {
}).setMoveDownAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
moveDown();

View File

@@ -30,6 +30,7 @@ import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.wm.ToolWindowId;
import com.intellij.ui.*;
import com.intellij.ui.components.JBList;
import com.intellij.util.PlatformIcons;
import com.intellij.util.ui.UIUtil;
import javax.swing.*;
@@ -246,7 +247,7 @@ public class ThreadDumpPanel extends JPanel {
private final Project myProject;
public CopyToClipboardAction(List<ThreadState> threadDump, Project project) {
super("Copy to Clipboard", "Copy whole thread dump to clipboard", IconLoader.getIcon("/general/copy.png"));
super("Copy to Clipboard", "Copy whole thread dump to clipboard", PlatformIcons.COPY_ICON);
myThreadDump = threadDump;
myProject = project;
}

View File

@@ -23,14 +23,14 @@ package com.intellij.ui.classFilter;
import com.intellij.ide.util.ClassFilter;
import com.intellij.ide.util.TreeClassChooser;
import com.intellij.ide.util.TreeClassChooserFactory;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiClass;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.TableUtil;
import com.intellij.ui.UIBundle;
import com.intellij.ui.*;
import com.intellij.ui.table.JBTable;
import com.intellij.util.IconUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.ComponentWithEmptyText;
import com.intellij.util.ui.ItemRemovable;
@@ -40,55 +40,69 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText {
protected AnActionButton myAddPatternButton;
protected JBTable myTable = null;
protected FilterTableModel myTableModel = null;
private final JButton myAddClassButton;
protected final JButton myAddPatternButton;
private final JButton myRemoveButton;
protected final Project myProject;
private final ClassFilter myChooserFilter;
@Nullable
private final String myPatternsHelpId;
public ClassFilterEditor(Project project) {
this (project, null);
this(project, null);
}
public ClassFilterEditor(Project project, ClassFilter classFilter) {
this (project, classFilter, null);
this(project, classFilter, null);
}
public ClassFilterEditor(Project project, ClassFilter classFilter, @Nullable String patternsHelpId) {
super(new GridBagLayout());
super(new BorderLayout());
myPatternsHelpId = patternsHelpId;
myAddClassButton = new JButton(getAddButtonText());
myAddPatternButton = new JButton(getAddPatternButtonText());
myRemoveButton = new JButton(UIBundle.message("button.remove"));
myTable = new JBTable();
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable);
add(scrollPane, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 3, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(4, 0, 4, 6), 0, 0));
add(myAddClassButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 0), 0, 0));
add(myAddPatternButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 0), 0, 0));
add(myRemoveButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 0), 0, 0));
add(
ToolbarDecorator.createDecorator(myTable)
.addExtraAction(new AnActionButton(getAddButtonText(), IconUtil.getAddClassIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
addClassFilter();
}
@Override
public void updateButton(AnActionEvent e) {
super.updateButton(e);
setEnabled(!myProject.isDefault());
}
}).addExtraAction(myAddPatternButton = new AnActionButton(getAddPatternButtonText(), IconUtil.getAddPatternIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
addPatternFilter();
}
@Override
public void updateButton(AnActionEvent e) {
super.updateButton(e);
setEnabled(!myProject.isDefault());
}
}).setRemoveAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
TableUtil.removeSelectedItems(myTable);
}
}).setButtonComparator(getAddButtonText(), getAddPatternButtonText(), "Remove")
.disableUpDownActions().createPanel(), BorderLayout.CENTER
);
myChooserFilter = classFilter;
myProject = project;
myAddClassButton.setDefaultCapable(false);
myAddPatternButton.setDefaultCapable(false);
myRemoveButton.setDefaultCapable(false);
myTableModel = new FilterTableModel();
myTable.setModel(myTableModel);
@@ -107,46 +121,6 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
column.setCellRenderer(new EnabledCellRenderer(myTable.getDefaultRenderer(Boolean.class)));
columnModel.getColumn(FilterTableModel.FILTER).setCellRenderer(new FilterCellRenderer());
myTable.registerKeyboardAction(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
myAddClassButton.doClick();
}
},
KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0),
JComponent.WHEN_FOCUSED
);
myTable.registerKeyboardAction(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
myRemoveButton.doClick();
}
},
KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
JComponent.WHEN_FOCUSED
);
myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
myRemoveButton.setEnabled(myTable.getSelectedRow() > -1);
}
});
myAddPatternButton.setEnabled(!myProject.isDefault());
myAddPatternButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
addPatternFilter();
}
});
myAddClassButton.setEnabled(!myProject.isDefault());
myAddClassButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
addClassFilter();
}
});
myRemoveButton.addActionListener(new RemoveAction());
myRemoveButton.setEnabled(false);
getEmptyText().setText(UIBundle.message("no.patterns"));
}
@@ -173,10 +147,7 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
myAddPatternButton.setEnabled(enabled);
myAddClassButton.setEnabled(enabled);
myRemoveButton.setEnabled((myTable.getSelectedRow() > -1) && enabled);
myTable.setEnabled(enabled);
myTable.setRowSelectionAllowed(enabled);
myTableModel.fireTableDataChanged();
}
@@ -188,7 +159,7 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
}
}
protected final class FilterTableModel extends AbstractTableModel implements ItemRemovable{
protected final class FilterTableModel extends AbstractTableModel implements ItemRemovable {
private final List<com.intellij.ui.classFilter.ClassFilter> myFilters = new LinkedList<com.intellij.ui.classFilter.ClassFilter>();
public static final int CHECK_MARK = 0;
public static final int FILTER = 1;
@@ -202,7 +173,7 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
}
public com.intellij.ui.classFilter.ClassFilter[] getFilters() {
for (Iterator<com.intellij.ui.classFilter.ClassFilter> it = myFilters.iterator(); it.hasNext();) {
for (Iterator<com.intellij.ui.classFilter.ClassFilter> it = myFilters.iterator(); it.hasNext(); ) {
com.intellij.ui.classFilter.ClassFilter filter = it.next();
String pattern = filter.getPattern();
if (pattern == null || "".equals(pattern)) {
@@ -240,7 +211,7 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
return filter;
}
if (columnIndex == CHECK_MARK) {
return filter.isEnabled()? Boolean.TRUE : Boolean.FALSE;
return filter.isEnabled() ? Boolean.TRUE : Boolean.FALSE;
}
return null;
}
@@ -248,7 +219,7 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
com.intellij.ui.classFilter.ClassFilter filter = myFilters.get(rowIndex);
if (columnIndex == FILTER) {
filter.setPattern(aValue != null? aValue.toString() : "");
filter.setPattern(aValue != null ? aValue.toString() : "");
}
else if (columnIndex == CHECK_MARK) {
filter.setEnabled(aValue == null || ((Boolean)aValue).booleanValue());
@@ -284,7 +255,8 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
((JLabel)component).setBorder(noFocusBorder);
}
UIManager.put(UIUtil.TABLE_FOCUS_CELL_BACKGROUND_PROPERTY, color);
com.intellij.ui.classFilter.ClassFilter filter = (com.intellij.ui.classFilter.ClassFilter)table.getValueAt(row, FilterTableModel.FILTER);
com.intellij.ui.classFilter.ClassFilter filter =
(com.intellij.ui.classFilter.ClassFilter)table.getValueAt(row, FilterTableModel.FILTER);
component.setEnabled(ClassFilterEditor.this.isEnabled() && filter.isEnabled());
return component;
}
@@ -306,7 +278,7 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
}
@NotNull
protected com.intellij.ui.classFilter.ClassFilter createFilter(String pattern){
protected com.intellij.ui.classFilter.ClassFilter createFilter(String pattern) {
return new com.intellij.ui.classFilter.ClassFilter(pattern);
}
@@ -346,7 +318,7 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
@Nullable
private static String getJvmClassName(PsiClass aClass) {
PsiClass parentClass = PsiTreeUtil.getParentOfType(aClass, PsiClass.class, true);
if(parentClass != null) {
if (parentClass != null) {
final String parentName = getJvmClassName(parentClass);
if (parentName == null) {
return null;
@@ -360,14 +332,4 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
com.intellij.ui.classFilter.ClassFilter filter = createFilter(pattern);
myTableModel.addRow(filter);
}
private final class RemoveAction implements ActionListener {
public void actionPerformed(ActionEvent e) {
TableUtil.removeSelectedItems(myTable);
}
}
public void setAddPatternButtonVisible(boolean visible) {
myAddPatternButton.setVisible(visible);
}
}

View File

@@ -211,12 +211,36 @@ public class IconUtil {
return getToolbarDecoratorIcon("addClass.png");
}
public static Icon getImportIcon() {
return IconLoader.getIcon("/toolbarDecorator/import.png");
public static Icon getAddPatternIcon() {
return getToolbarDecoratorIcon("addPattern.png");
}
public static Icon getExportIcon() {
return IconLoader.getIcon("/toolbarDecorator/export.png");
public static Icon getAddJiraPatternIcon() {
return getToolbarDecoratorIcon("addJira.png");
}
public static Icon getAddYouTrackPatternIcon() {
return getToolbarDecoratorIcon("addYouTrack.png");
}
public static Icon getAddBlankLineIcon() {
return getToolbarDecoratorIcon("addBlankLine.png");
}
public static Icon getAddPackageIcon() {
return getToolbarDecoratorIcon("addPackage.png");
}
public static Icon getAddLinkIcon() {
return getToolbarDecoratorIcon("addLink.png");
}
public static Icon getAddFolderIcon() {
return getToolbarDecoratorIcon("addFolder.png");
}
public static Icon getAnalyzeIcon() {
return getToolbarDecoratorIcon("analyze.png");
}
public static Icon getToolbarDecoratorIcon(String name) {

View File

@@ -75,14 +75,11 @@ public interface PlatformIcons {
Icon SMALL_VCS_CONFIGURABLE = IconLoader.getIcon("/general/smallConfigurableVcs.png");
Icon VCS_SMALL_TAB = IconLoader.getIcon("/general/vcsSmallTab.png");
Icon GROUP_BY_PACKAGES = IconLoader.getIcon("/toolbar/folders.png");
Icon ADD_ICON = IconLoader.getIcon("/actions/include.png");
Icon DELETE_ICON = IconLoader.getIcon("/actions/exclude.png");
Icon ADD_ICON = IconUtil.getAddIcon();
Icon DELETE_ICON = IconUtil.getRemoveIcon();
Icon COPY_ICON = IconLoader.getIcon("/actions/copy.png");
Icon MOVE_UP_ICON = IconLoader.getIcon("/actions/moveUp.png");
Icon MOVE_DOWN_ICON = IconLoader.getIcon("/actions/moveDown.png");
Icon EDIT = IconLoader.getIcon("/actions/edit.png");
Icon ANALYZE = IconLoader.getIcon("/actions/analyze.png");
Icon DUPLICATE_ICON = IconLoader.getIcon("/general/copy.png");
Icon EDIT = IconUtil.getEditIcon();
Icon ANALYZE = IconUtil.getAnalyzeIcon();
Icon SELECT_ALL_ICON = IconLoader.getIcon("/actions/selectall.png");
Icon UNSELECT_ALL_ICON = IconLoader.getIcon("/actions/unselectall.png");
Icon PROPERTIES_ICON = IconLoader.getIcon("/actions/properties.png");
@@ -96,7 +93,6 @@ public interface PlatformIcons {
Icon OPEN_EDIT_DIALOG_ICON = IconLoader.getIcon("/actions/showViewer.png");
Icon FLATTEN_PACKAGES_ICON = IconLoader.getIcon("/objectBrowser/flattenPackages.png");
Icon ADD_TO_SECTION_ICON = IconLoader.getIcon("/general/addItemToSection.png");
Icon EDIT_IN_SECTION_ICON = IconLoader.getIcon("/general/editItemInSection.png");
Icon TASK_ICON = IconLoader.getIcon("/ant/task.png");
Icon CLASS_INITIALIZER = IconLoader.getIcon("/nodes/classInitializer.png");
@@ -116,17 +112,8 @@ public interface PlatformIcons {
Icon UP_DOWN_ARROWS = IconLoader.getIcon("/ide/upDown.png");
Icon TABLE_ADD_ROW = IconLoader.getIcon("/tables/add.png");
Icon TABLE_REMOVE_ROW = IconLoader.getIcon("/tables/remove.png");
Icon TABLE_MOVE_ROW_UP = IconLoader.getIcon("/tables/moveUp.png");
Icon TABLE_MOVE_ROW_DOWN = IconLoader.getIcon("/tables/moveDown.png");
Icon TABLE_EXCEPTION = IconLoader.getIcon("/tables/exception.png");
Icon TABLE_EDIT_ROW = IconLoader.getIcon("/tables/edit.png");
Icon TABLE_ANALYZE = IconLoader.getIcon("/tables/analyze.png");
Icon TABLE_URL = IconLoader.getIcon("/tables/url.png");
Icon COMBOBOX_ARROW_ICON = IconLoader.getIcon("/general/comboArrow.png");
Icon EXPORT_ICON = IconLoader.getIcon("/actions/export.png");
Icon IMPORT_ICON = IconLoader.getIcon("/actions/import.png");
Icon EXPORT_ICON = IconLoader.getIcon("/toolbarDecorator/export.png");
Icon IMPORT_ICON = IconLoader.getIcon("/toolbarDecorator/import.png");
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

View File

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

View File

@@ -15,11 +15,11 @@
*/
package com.intellij.execution.configurations;
import com.intellij.execution.RunManager;
import com.intellij.execution.BeforeRunTask;
import com.intellij.execution.RunManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.util.Key;
import com.intellij.util.IconUtil;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
@@ -28,7 +28,7 @@ import javax.swing.*;
* @author dyoma
*/
public abstract class ConfigurationFactory {
public static final Icon ADD_ICON = IconLoader.getIcon("/general/add.png");
public static final Icon ADD_ICON = IconUtil.getAddIcon();
private final ConfigurationType myType;

View File

@@ -21,8 +21,8 @@ import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.project.ProjectBundle;
import com.intellij.openapi.roots.OrderRootType;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.IconUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -129,7 +129,7 @@ public abstract class SdkType implements SdkTypeId {
}
public Icon getIconForAddAction() {
return IconLoader.getIcon("/general/add.png");
return IconUtil.getAddIcon();
}
public boolean equals(Object o) {

View File

@@ -29,6 +29,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectUtil;
import com.intellij.openapi.util.Disposer;
import com.intellij.psi.codeStyle.*;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.components.JBTabbedPane;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -512,13 +513,16 @@ public abstract class TabbedLanguageCodeStylePanel extends CodeStyleAbstractPane
myProvider = provider;
myTopPanel = new JPanel();
myTopPanel.setLayout(new BorderLayout());
myLeftPanel = new JPanel();
myLeftPanel = new JPanel(new BorderLayout());
myTopPanel.add(myLeftPanel, BorderLayout.WEST);
myRightPanel = new JPanel();
installPreviewPanel(myRightPanel);
myEditor = editor;
if (myEditor != null) {
myLeftPanel.add(myEditor.createPanel());
JPanel panel = myEditor.createPanel();
JScrollPane scroll = ScrollPaneFactory.createScrollPane(panel, true);
scroll.setPreferredSize(new Dimension(panel.getPreferredSize().width + scroll.getVerticalScrollBar().getPreferredSize().width + 5, -1));
myLeftPanel.add(scroll, BorderLayout.CENTER);
}
myTopPanel.add(myRightPanel, BorderLayout.CENTER);
}

View File

@@ -682,7 +682,7 @@ public class TemplateListPanel extends JPanel implements Disposable {
})
.disableDownAction()
.disableUpAction()
.addExtraAction(new AnActionButton("Copy", PlatformIcons.DUPLICATE_ICON) {
.addExtraAction(new AnActionButton("Copy", PlatformIcons.COPY_ICON) {
@Override
public void actionPerformed(AnActionEvent e) {
copyRow();

View File

@@ -139,13 +139,13 @@ public class SeverityEditorDialog extends DialogWrapper {
myOptionsList.clearSelection();
ListScrollingUtil.selectItem(myOptionsList, newSeverityBasedTextAttributes);
}
}).setUpAction(new AnActionButtonRunnable() {
}).setMoveUpAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
apply(myCurrentSelection);
ListUtil.moveSelectedItemsUp(myOptionsList);
}
}).setDownAction(new AnActionButtonRunnable() {
}).setMoveDownAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
apply(myCurrentSelection);

View File

@@ -21,7 +21,6 @@ import com.intellij.execution.configuration.ConfigurationFactoryEx;
import com.intellij.execution.configurations.*;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.options.*;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
@@ -38,6 +37,7 @@ import com.intellij.ui.*;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.util.ArrayUtil;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.config.StorageAccessors;
import com.intellij.util.containers.ContainerUtil;
@@ -54,7 +54,6 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.event.*;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeNode;
@@ -63,7 +62,6 @@ import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.net.URL;
import java.util.*;
import java.util.List;
import java.util.regex.Matcher;
@@ -71,12 +69,10 @@ import java.util.regex.Pattern;
class RunConfigurable extends BaseConfigurable {
private static final Icon ICON = IconLoader.getIcon("/general/configurableRunDebug.png");
@NonNls private static final String GENERAL_ADD_ICON_PATH = "/general/add.png";
private static final Icon ADD_ICON = IconLoader.getIcon(GENERAL_ADD_ICON_PATH);
private static final Icon REMOVE_ICON = IconLoader.getIcon("/general/remove.png");
private static final Icon ADD_ICON = IconUtil.getAddIcon();
private static final Icon REMOVE_ICON = IconUtil.getRemoveIcon();
private static final Icon SAVE_ICON = IconLoader.getIcon("/runConfigurations/saveTempConfig.png");
@NonNls private static final String EDIT_DEFAULTS_ICON_PATH = "/general/ideOptions.png";
private static final Icon EDIT_DEFAULTS_ICON = IconLoader.getIcon(EDIT_DEFAULTS_ICON_PATH);
private static final Icon EDIT_DEFAULTS_ICON = IconLoader.getIcon("/general/ideOptions.png");
@NonNls private static final String DIVIDER_PROPORTION = "dividerProportion";
private volatile boolean isDisposed = false;
@@ -385,47 +381,19 @@ class RunConfigurable extends BaseConfigurable {
}
private void drawPressAddButtonMessage(final ConfigurationType configurationType) {
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
panel.setBorder(new EmptyBorder(30, 0, 0, 0));
panel.add(new JLabel("Press the"));
final JEditorPane browser = new JEditorPane();
browser.setEditable(false);
browser.setEditorKit(new HTMLEditorKit());
browser.setBackground(myRightPanel.getBackground());
final URL addUrl = getClass().getResource(GENERAL_ADD_ICON_PATH);
JLabel addIcon = new JLabel(IconUtil.getAddIcon());
addIcon.setBorder(new EmptyBorder(0, 0, 0, 5));
panel.add(addIcon);
final String configurationTypeDescription = configurationType != null
? configurationType.getConfigurationTypeDescription()
: ExecutionBundle.message("run.configuration.default.type.description");
browser.setText(ExecutionBundle.message("empty.run.configuration.panel.text.label2", addUrl, configurationType != null ? configurationType.getId() : ""));
browser.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(final HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
final String description = e.getDescription();
final String addPrefix = "add";
if (description.startsWith(addPrefix)) {
final String typeId = description.substring(addPrefix.length());
if (!typeId.isEmpty()) {
for (ConfigurationType type : Extensions.getExtensions(ConfigurationType.CONFIGURATION_TYPE_EP)) {
if (Comparing.strEqual(type.getId(), typeId)) {
final ConfigurationFactory[] factories = type.getConfigurationFactories();
if (factories.length > 0) {
createNewConfiguration(factories[0]);
}
return;
}
}
}
new MyToolbarAddAction().actionPerformed(null);
}
}
}
});
panel.add(browser);
panel.add(new JLabel(ExecutionBundle.message("empty.run.configuration.panel.text.label3", configurationTypeDescription)));
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(panel);
scrollPane.setBorder(null);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(panel, true);
myRightPanel.removeAll();
myRightPanel.add(scrollPane, BorderLayout.CENTER);
@@ -499,8 +467,8 @@ class RunConfigurable extends BaseConfigurable {
e.getPresentation().setEnabled(TreeUtil.findNodeWithObject("Defaults", myTree.getModel(), myRoot) != null);
}
});
group.add(new MyMoveAction(ExecutionBundle.message("move.up.action.name"), null, IconLoader.getIcon("/actions/moveUp.png"), -1));
group.add(new MyMoveAction(ExecutionBundle.message("move.down.action.name"), null, IconLoader.getIcon("/actions/moveDown.png"), 1));
group.add(new MyMoveAction(ExecutionBundle.message("move.up.action.name"), null, IconUtil.getMoveUpIcon(), -1));
group.add(new MyMoveAction(ExecutionBundle.message("move.down.action.name"), null, IconUtil.getMoveDownIcon(), 1));
return group;
}

View File

@@ -37,6 +37,7 @@ import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.TabbedPaneWrapper;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Function;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.containers.ContainerUtil;
import gnu.trove.THashSet;
@@ -252,7 +253,7 @@ public class AllFileTemplatesConfigurable implements SearchableConfigurable, Con
e.getPresentation().setEnabled(selectedItem != null && !isInternalTemplate(selectedItem.getName(), myCurrentTab.getTitle()));
}
};
AnAction addAction = new AnAction(IdeBundle.message("action.create.template"), null, IconLoader.getIcon("/general/add.png")) {
AnAction addAction = new AnAction(IdeBundle.message("action.create.template"), null, IconUtil.getAddIcon()) {
public void actionPerformed(AnActionEvent e) {
onAdd();
}

View File

@@ -31,7 +31,7 @@ import com.intellij.openapi.util.IconLoader;
import com.intellij.packageDependencies.DependencyValidationManager;
import com.intellij.psi.search.scope.packageSet.*;
import com.intellij.ui.TreeSpeedSearch;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import com.intellij.util.containers.Convertor;
import com.intellij.util.containers.HashSet;
import com.intellij.util.ui.tree.TreeUtil;
@@ -97,8 +97,8 @@ public class ScopeChooserConfigurable extends MasterDetailsComponent implements
})));
result.add(new MyCopyAction());
result.add(new MySaveAsAction());
result.add(new MyMoveAction(ExecutionBundle.message("move.up.action.name"), IconLoader.getIcon("/actions/moveUp.png"), -1));
result.add(new MyMoveAction(ExecutionBundle.message("move.down.action.name"), IconLoader.getIcon("/actions/moveDown.png"), 1));
result.add(new MyMoveAction(ExecutionBundle.message("move.up.action.name"), IconUtil.getMoveUpIcon(), -1));
result.add(new MyMoveAction(ExecutionBundle.message("move.down.action.name"), IconUtil.getMoveDownIcon(), 1));
return result;
}
@@ -363,7 +363,7 @@ public class ScopeChooserConfigurable extends MasterDetailsComponent implements
super(IdeBundle.message("add.scope.popup.title"), true);
myFromPopup = fromPopup;
final Presentation presentation = getTemplatePresentation();
presentation.setIcon(PlatformIcons.ADD_ICON);
presentation.setIcon(IconUtil.getAddIcon());
setShortcutSet(CommonShortcuts.INSERT);
}
@@ -394,7 +394,7 @@ public class ScopeChooserConfigurable extends MasterDetailsComponent implements
}
if (myFromPopup) {
final AnAction action = myChildren[getDefaultIndex()];
action.getTemplatePresentation().setIcon(PlatformIcons.ADD_ICON);
action.getTemplatePresentation().setIcon(IconUtil.getAddIcon());
return new AnAction[]{action};
}
return myChildren;

View File

@@ -36,7 +36,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.templateLanguages.TemplateDataLanguagePatterns;
import com.intellij.ui.*;
import com.intellij.ui.components.JBList;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -405,7 +405,7 @@ public class FileTypeConfigurable extends BaseConfigurable implements Searchable
}).disableUpDownActions();
if (getSchemesManager().isImportAvailable()) {
toolbarDecorator.addExtraAction(new AnActionButton("Import Shared...", IconUtil.getImportIcon()) {
toolbarDecorator.addExtraAction(new AnActionButton("Import Shared...", PlatformIcons.IMPORT_ICON) {
@Override
public void actionPerformed(AnActionEvent e) {
new SchemesToImportPopup<FileType, AbstractFileType>(myFileTypesList) {
@@ -418,7 +418,7 @@ public class FileTypeConfigurable extends BaseConfigurable implements Searchable
}
if (getSchemesManager().isExportAvailable()) {
toolbarDecorator.addExtraAction(new AnActionButton("Share...", IconUtil.getExportIcon()) {
toolbarDecorator.addExtraAction(new AnActionButton("Share...", PlatformIcons.EXPORT_ICON) {
@Override
public void actionPerformed(AnActionEvent e) {
FileType selected = (FileType)myFileTypesList.getSelectedValue();

View File

@@ -58,6 +58,7 @@ import com.intellij.psi.search.scope.packageSet.NamedScope;
import com.intellij.ui.*;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.util.Alarm;
import com.intellij.util.IconUtil;
import com.intellij.util.config.StorageAccessors;
import com.intellij.util.containers.Convertor;
import com.intellij.util.ui.UIUtil;
@@ -377,7 +378,7 @@ public class SingleInspectionProfilePanel extends JPanel {
actions.addSeparator();
actions.add(new MyAddScopeAction());
actions.add(new MyDeleteScopeAction());
actions.add(new MoveScopeAction(myTree, "Move Scope Up", IconLoader.getIcon("/actions/moveUp.png"), -1) {
actions.add(new MoveScopeAction(myTree, "Move Scope Up", IconUtil.getMoveUpIcon(), -1) {
protected boolean isEnabledFor(int idx, InspectionConfigTreeNode parent) {
return idx > 0;
}
@@ -386,7 +387,7 @@ public class SingleInspectionProfilePanel extends JPanel {
return mySelectedProfile;
}
});
actions.add(new MoveScopeAction(myTree, "Move Scope Down", IconLoader.getIcon("/actions/moveDown.png"), 1) {
actions.add(new MoveScopeAction(myTree, "Move Scope Down", IconUtil.getMoveDownIcon(), 1) {
protected boolean isEnabledFor(int idx, InspectionConfigTreeNode parent) {
return idx < parent.getChildCount() - 2;
}

View File

@@ -35,7 +35,7 @@ import com.intellij.psi.search.scope.packageSet.NamedScope;
import com.intellij.psi.search.scope.packageSet.NamedScopesHolder;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.util.ArrayUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
@@ -46,7 +46,7 @@ public abstract class AddScopeAction extends AnAction {
private static final Logger LOG = Logger.getInstance("#" + AddScopeAction.class.getName());
public AddScopeAction(Tree tree) {
super("Add Scope", "Add Scope", PlatformIcons.ADD_ICON);
super("Add Scope", "Add Scope", IconUtil.getAddIcon());
myTree = tree;
registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
}

View File

@@ -129,7 +129,7 @@ class OutputFiltersDialog extends DialogWrapper {
}
myFiltersList.requestFocus();
}
}).setUpAction(new AnActionButtonRunnable() {
}).setMoveUpAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
int movedCount = ListUtil.moveSelectedItemsUp(myFiltersList);
@@ -138,7 +138,7 @@ class OutputFiltersDialog extends DialogWrapper {
}
myFiltersList.requestFocus();
}
}).setDownAction(new AnActionButtonRunnable() {
}).setMoveDownAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
int movedCount = ListUtil.moveSelectedItemsDown(myFiltersList);

View File

@@ -148,19 +148,19 @@ class ToolsPanel extends JPanel {
editSelected();
myTree.requestFocus();
}
}).setUpAction(new AnActionButtonRunnable() {
}).setMoveUpAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
moveNode(Direction.UP);
myIsModified = true;
}
}).setDownAction(new AnActionButtonRunnable() {
}).setMoveDownAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
moveNode(Direction.DOWN);
myIsModified = true;
}
}).addExtraAction(myCopyButton = new AnActionButton(ToolsBundle.message("tools.copy.button"), PlatformIcons.DUPLICATE_ICON) {
}).addExtraAction(myCopyButton = new AnActionButton(ToolsBundle.message("tools.copy.button"), PlatformIcons.COPY_ICON) {
@Override
public void actionPerformed(AnActionEvent e) {
Tool originalTool = getSelectedTool();

View File

@@ -20,9 +20,9 @@ import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.configurable.VcsContentAnnotationConfigurable;
import com.intellij.util.PlatformIcons;
/**
* Created by IntelliJ IDEA.
@@ -33,7 +33,7 @@ import com.intellij.openapi.vcs.configurable.VcsContentAnnotationConfigurable;
*/
public class ShowRecentlyChanged extends DumbAwareAction {
public ShowRecentlyChanged() {
super("Show recently changed", "Show recently changed", IconLoader.getIcon("/general/copy.png"));
super("Show recently changed", "Show recently changed", PlatformIcons.COPY_ICON);
}
@Override

View File

@@ -27,7 +27,7 @@ import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.UnnamedConfigurable;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.util.*;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import com.intellij.util.ui.tree.TreeUtil;
import gnu.trove.Equality;
import org.jetbrains.annotations.Nullable;
@@ -299,7 +299,7 @@ public abstract class NamedItemsListEditor<T> extends MasterDetailsComponent {
private class AddAction extends DumbAwareAction {
public AddAction() {
super("Add", "Add", PlatformIcons.ADD_ICON);
super("Add", "Add", IconUtil.getAddIcon());
registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
}

View File

@@ -127,7 +127,7 @@ public abstract class AnActionButton extends AnAction implements ShortcutProvide
public void updateButton(AnActionEvent e) {
final JComponent component = getContextComponent();
e.getPresentation().setEnabled(component != null && component.isShowing());
e.getPresentation().setEnabled(component != null && component.isShowing() && component.isEnabled());
}
@Override

View File

@@ -47,8 +47,8 @@ public class CommonActionsPanel extends JPanel {
return null;
}
MyActionButton createButton(final Listener listener, String name) {
return new MyActionButton(this, listener, name == null ? StringUtil.capitalize(name().toLowerCase()) : name);
MyActionButton createButton(final Listener listener, String name, Icon icon) {
return new MyActionButton(this, listener, name == null ? StringUtil.capitalize(name().toLowerCase()) : name, icon);
}
public String getText() {
@@ -87,7 +87,7 @@ public class CommonActionsPanel extends JPanel {
CommonActionsPanel(ListenerFactory factory, @Nullable JComponent contextComponent, boolean isHorizontal,
@Nullable AnActionButton[] additionalActions, @Nullable Comparator<AnActionButton> buttonComparator,
String addName, String removeName, String moveUpName, String moveDownName, String editName,
Buttons... buttons) {
Icon addIcon, Buttons... buttons) {
super(new BorderLayout());
final Listener listener = factory.createListener(this);
AnActionButton[] actions = new AnActionButton[buttons.length];
@@ -101,7 +101,7 @@ public class CommonActionsPanel extends JPanel {
case UP: name = moveUpName; break;
case DOWN: name = moveDownName; break;
}
final MyActionButton b = button.createButton(listener, name);
final MyActionButton b = button.createButton(listener, name, button == Buttons.ADD && addIcon != null ? addIcon : button.getIcon());
actions[i] = b;
myButtons.put(button, b);
}
@@ -180,8 +180,8 @@ public class CommonActionsPanel extends JPanel {
private final Buttons myButton;
private final Listener myListener;
MyActionButton(Buttons button, Listener listener, String name) {
super(name, name, button.getIcon());
MyActionButton(Buttons button, Listener listener, String name, Icon icon) {
super(name, name, icon);
myButton = button;
myListener = listener;
}

View File

@@ -20,6 +20,7 @@ import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Factory;
import com.intellij.openapi.util.IconLoader;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.containers.Convertor;
import org.jetbrains.annotations.Nullable;
@@ -32,7 +33,7 @@ import java.util.*;
*/
public abstract class ReorderableListController <T> {
private final JList myList;
private static final Icon REMOVE_ICON = IconLoader.getIcon("/general/remove.png");
private static final Icon REMOVE_ICON = IconUtil.getRemoveIcon();
protected ReorderableListController(final JList list) {
myList = list;
@@ -69,7 +70,7 @@ public abstract class ReorderableListController <T> {
}
public void addMoveUpAction() {
addAction(new AnAction(UIBundle.message("move.up.action.name"), null, IconLoader.getIcon("/actions/moveUp.png")) {
addAction(new AnAction(UIBundle.message("move.up.action.name"), null, IconUtil.getMoveUpIcon()) {
public void actionPerformed(final AnActionEvent e) {
ListUtil.moveSelectedItemsUp(myList);
}
@@ -248,7 +249,7 @@ public abstract class ReorderableListController <T> {
private final String myActionDescription;
private final Factory<V> myAddHandler;
private final boolean myCreateShortcut;
private Icon myIcon = IconLoader.getIcon("/general/add.png");
private Icon myIcon = IconUtil.getAddIcon();
public AddActionDescriptionBase(final String actionDescription, final Factory<V> addHandler, final boolean createShortcut) {
myActionDescription = actionDescription;

View File

@@ -79,6 +79,7 @@ public abstract class ToolbarDecorator implements DataProvider, CommonActionsPan
private CommonActionsPanel myPanel;
private Comparator<AnActionButton> myButtonComparator;
private boolean myAsTopToolbar = false;
private Icon myAddIcon;
protected abstract JComponent getComponent();
@@ -206,13 +207,13 @@ public abstract class ToolbarDecorator implements DataProvider, CommonActionsPan
return this;
}
public ToolbarDecorator setUpAction(AnActionButtonRunnable action) {
public ToolbarDecorator setMoveUpAction(AnActionButtonRunnable action) {
myUpActionEnabled = action != null;
myUpAction = action;
return this;
}
public ToolbarDecorator setDownAction(AnActionButtonRunnable action) {
public ToolbarDecorator setMoveDownAction(AnActionButtonRunnable action) {
myDownActionEnabled = action != null;
myDownAction = action;
return this;
@@ -277,6 +278,11 @@ public abstract class ToolbarDecorator implements DataProvider, CommonActionsPan
return this;//do nothing by default
}
public ToolbarDecorator setAddIcon(Icon addIcon) {
myAddIcon = addIcon;
return this;
}
public JPanel createPanel() {
final CommonActionsPanel.Buttons[] buttons = getButtons();
final JComponent contextComponent = getComponent();
@@ -285,7 +291,7 @@ public abstract class ToolbarDecorator implements DataProvider, CommonActionsPan
myExtraActions.toArray(new AnActionButton[myExtraActions.size()]),
myButtonComparator,
myAddName, myRemoveName, myMoveUpName, myMoveDownName, myEditName,
buttons);
myAddIcon, buttons);
if (myAsTopToolbar) {
contextComponent.setBorder(IdeBorderFactory.createBorder(SideBorder.ALL));
} else {

View File

@@ -21,7 +21,7 @@ import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.options.ExternalizableScheme;
import com.intellij.openapi.options.Scheme;
import com.intellij.openapi.options.SchemesManager;
import com.intellij.openapi.util.IconLoader;
import com.intellij.util.PlatformIcons;
import java.awt.*;
import java.util.Collection;
@@ -32,7 +32,7 @@ public abstract class ImportSchemeAction<T extends Scheme, E extends Externaliza
public ImportSchemeAction(SchemesManager manager) {
super("Import", "Import", IconLoader.getIcon("/actions/import.png"));
super("Import", "Import", PlatformIcons.IMPORT_ICON);
mySchemesManager = manager;
}

View File

@@ -117,8 +117,8 @@ editbox.class.count.to.use.import.with.star=Class count to use import with '*':
editbox.names.count.to.use.static.import.with.star=Names count to use static import with '*':
title.packages.to.use.import.with=Packages to Use Import with '*'
title.import.layout=Import Layout
button.add.package=Add Packa&ge
button.add.blank=Add &Blank
button.add.package=Add Package
button.add.blank=Add Blank
button.remove=R&emove
listbox.import.package=Package
listbox.import.with.subpackages=With Subpackages

View File

@@ -31,10 +31,8 @@ dialog.reformat.files.reformat.selected.files.label=Reformat selected files?
command.name.typing=Typing
dialog.import.on.paste.title=Select Classes to Import
dialog.import.on.paste.title2=Select Elements to Import
dialog.paste.on.import.text=The code fragment which you have pasted uses classes\n\
that are not accessible by imports in the new context.\n\
Select classes that you want to import to the new file.
dialog.paste.on.import.text2=The code fragment which you have pasted uses elements\nthat are not accessible by imports in the new context.\nSelect elements that you want to import to the new file.
dialog.paste.on.import.text=<html>The code fragment which you have pasted uses classes that are not accessible by imports in the new context.</br>Select classes that you want to import to the new file.</html>
dialog.paste.on.import.text2=<html>The code fragment which you have pasted uses elements that are not accessible by imports in the new context.</br>Select elements that you want to import to the new file.</html>
paste.data.flavor.folding=FoldingData
paste.dataflavor.referencedata=ReferenceData
generate.constructor.fields.chooser.title=Choose Fields to Initialize by Constructor

View File

@@ -323,7 +323,7 @@
<!-- Toolbar -->
<!--
<group id="ToolbarNewElement">
<action id="NewElementToolbarAction" class="com.intellij.ide.actions.NewElementToolbarAction" icon="/general/plus.png"/>
<action id="NewElementToolbarAction" class="com.intellij.ide.actions.NewElementToolbarAction" icon="/general/add.png"/>
<add-to-group group-id="MainToolBar" anchor="first"/>
</group>
-->

View File

@@ -171,7 +171,7 @@
<separator/>
<group id="CutCopyPasteGroup">
<action id="$Cut" class="com.intellij.ide.actions.CutAction" icon="/actions/menu-cut.png"/>
<action id="$Copy" class="com.intellij.ide.actions.CopyAction" icon="/actions/menu-copy.png"/>
<action id="$Copy" class="com.intellij.ide.actions.CopyAction" icon="/actions/copy.png"/>
<action id="CopyPaths" class="com.intellij.ide.actions.CopyPathsAction"/>
<action id="$Paste" class="com.intellij.ide.actions.PasteAction" icon="/actions/menu-paste.png"/>
<action id="PasteMultiple" class="com.intellij.openapi.editor.actions.MultiplePasteAction"/>

View File

@@ -77,7 +77,7 @@
<action id="ChangesView.Rollback" class="com.intellij.openapi.vcs.changes.actions.RollbackAction"
icon="/actions/rollback.png"/>
<action id="ChangesView.NewChangeList" class="com.intellij.openapi.vcs.changes.actions.AddChangeListAction"
icon="/actions/include.png"/>
icon="/general/add.png"/>
<action id="ChangesView.RemoveChangeList" class="com.intellij.openapi.vcs.changes.actions.RemoveChangeListAction"
icon="/actions/exclude.png"/>
<action id="ChangesView.SetDefault" class="com.intellij.openapi.vcs.changes.actions.SetDefaultChangeListAction"
@@ -100,7 +100,7 @@
<action id="ChangesView.DeleteUnversioned" class="com.intellij.openapi.vcs.changes.actions.DeleteUnversionedFilesAction"
icon="/actions/cancel.png"/>
<action id="ChangesView.AddUnversioned" class="com.intellij.openapi.vcs.changes.actions.ScheduleForAdditionAction"
icon="/vcs/addToVcs.png">
icon="/general/add.png">
<keyboard-shortcut first-keystroke="control alt A" keymap="$default"/>
</action>
<action id="ChangesView.Ignore" class="com.intellij.openapi.vcs.changes.actions.IgnoreUnversionedAction"/>

View File

@@ -125,7 +125,7 @@ module.dependencies.title=Dependencies
module.dependencies.caption=Check modules this module depends on
module.javadoc.title=JavaDoc
module.javadoc.add.path.button=&Add Path...
module.javadoc.add.url.button=Add JavaDoc &URL...
module.javadoc.add.url.button=Add JavaDoc URL...
module.javadoc.remove.button=&Remove
module.javadoc.add.path.title=Add Path To JavaDoc
module.javadoc.add.path.prompt=Select jar/zip files or directories in which module javadoc documentation is located

View File

@@ -26,11 +26,11 @@ import com.intellij.ide.DeleteProvider;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.util.IconLoader;
import com.intellij.util.IconUtil;
public class DeleteUnversionedFilesAction extends AnAction {
public DeleteUnversionedFilesAction() {
super("Delete", "Delete", IconLoader.getIcon("/actions/cancel.png"));
super("Delete", "Delete", IconUtil.getRemoveIcon());
}
public void actionPerformed(AnActionEvent e) {

View File

@@ -28,12 +28,12 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.FileStatusManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl;
import com.intellij.openapi.vcs.changes.ui.ChangesListView;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.IconUtil;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
@@ -41,7 +41,7 @@ import java.util.List;
public class ScheduleForAdditionAction extends AnAction implements DumbAware {
public ScheduleForAdditionAction() {
super("Add to VCS", "Add to VCS", IconLoader.getIcon("/vcs/addToVcs.png"));
super("Add to VCS", "Add to VCS", IconUtil.getAddIcon());
}
public void update(AnActionEvent e) {

View File

@@ -948,7 +948,6 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
mySplitter.setHonorComponentsMinimumSize(true);
mySplitter.setFirstComponent(myBrowser);
mySplitter.setSecondComponent(myCommitMessageArea);
mySplitter.setDividerWidth(3);
initMainSplitter();
rootPane.add(mySplitter, BorderLayout.CENTER);
@@ -965,8 +964,6 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
rootPane.add(infoPanel, BorderLayout.EAST);
infoPanel.setBorder(IdeBorderFactory.createEmptyBorder(0, 10, 0, 0));
rootPane.add(myWarningLabel, BorderLayout.SOUTH);
final JPanel wrapper = new JPanel(new GridBagLayout());
final GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0);

View File

@@ -1,79 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.openapi.vcs.configurable.IssueNavigationConfigurationPanel">
<grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="eea80" class="com.intellij.ui.components.JBScrollPane">
<constraints>
<grid row="1" column="0" row-span="6" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="8d1f3" class="com.intellij.ui.table.JBTable" binding="myLinkTable">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
<component id="3a6df" class="javax.swing.JButton" binding="myAddButton" default-binding="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Add..."/>
</properties>
</component>
<component id="311ca" class="javax.swing.JButton" binding="myEditButton" default-binding="true">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Edit..."/>
</properties>
</component>
<component id="db9d5" class="javax.swing.JButton" binding="myDeleteButton" default-binding="true">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Delete"/>
</properties>
</component>
<vspacer id="11179">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="23a5b" class="javax.swing.JButton" binding="myAddJiraPatternButton">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Add JIRA Pattern..."/>
</properties>
</component>
<component id="6c42f" class="javax.swing.JButton" binding="myAddYouTrackPatternButton" default-binding="true">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Add YouTrack Pattern..."/>
</properties>
</component>
<component id="63b2c" class="javax.swing.JLabel" binding="myDescriptionLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="&lt;description&gt;"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.vcs.configurable;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationNamesInfo;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.SearchableConfigurable;
@@ -23,18 +24,18 @@ import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.vcs.IssueNavigationConfiguration;
import com.intellij.openapi.vcs.IssueNavigationLink;
import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.ui.AnActionButton;
import com.intellij.ui.AnActionButtonRunnable;
import com.intellij.ui.ToolbarDecorator;
import com.intellij.ui.table.JBTable;
import com.intellij.util.IconUtil;
import com.intellij.util.ui.ColumnInfo;
import com.intellij.util.ui.ListTableModel;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
@@ -42,14 +43,7 @@ import java.util.List;
* @author yole
*/
public class IssueNavigationConfigurationPanel extends JPanel implements SearchableConfigurable, Configurable.NoScroll {
private JPanel myPanel;
private JBTable myLinkTable;
private JButton myAddButton;
private JButton myEditButton;
private JButton myDeleteButton;
private JButton myAddJiraPatternButton;
private JButton myAddYouTrackPatternButton;
private JLabel myDescriptionLabel;
private final Project myProject;
private List<IssueNavigationLink> myLinks;
private ListTableModel<IssueNavigationLink> myModel;
@@ -68,93 +62,85 @@ public class IssueNavigationConfigurationPanel extends JPanel implements Searcha
public IssueNavigationConfigurationPanel(Project project) {
super(new BorderLayout());
myProject = project;
add(myPanel, BorderLayout.CENTER);
myDescriptionLabel.setText("<html>" + ApplicationNamesInfo.getInstance().getFullProductName() + " will search for the specified patterns in " +
"checkin comments and link them to issues in your issue tracker:</html>");
myLinkTable = new JBTable();
myLinkTable.getEmptyText().setText(VcsBundle.message("issue.link.no.patterns"));
reset();
myAddButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
IssueLinkConfigurationDialog dlg = new IssueLinkConfigurationDialog(myProject);
dlg.setTitle(VcsBundle.message("issue.link.add.title"));
dlg.show();
if (dlg.isOK()) {
myLinks.add(dlg.getLink());
myModel.fireTableDataChanged();
}
}
});
myAddJiraPatternButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String s = Messages.showInputDialog(IssueNavigationConfigurationPanel.this, "Enter JIRA installation URL:",
"Add JIRA Issue Navigation Pattern", Messages.getQuestionIcon());
if (s == null) {
return;
}
if (!s.endsWith("/")) {
s += "/";
}
myLinks.add(new IssueNavigationLink("[A-Z]+\\-\\d+", s + "browse/$0"));
myModel.fireTableDataChanged();
}
});
myAddYouTrackPatternButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String s = Messages.showInputDialog(IssueNavigationConfigurationPanel.this, "Enter YouTrack installation URL:",
"Add YouTrack Issue Navigation Pattern", Messages.getQuestionIcon());
if (s == null) {
return;
}
if (!s.endsWith("/")) {
s += "/";
}
myLinks.add(new IssueNavigationLink("[A-Z]+\\-\\d+", s + "issue/$0"));
myModel.fireTableDataChanged();
}
});
myEditButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
IssueNavigationLink link = (IssueNavigationLink) myModel.getItem(myLinkTable.getSelectedRow());
IssueLinkConfigurationDialog dlg = new IssueLinkConfigurationDialog(myProject);
dlg.setTitle(VcsBundle.message("issue.link.edit.title"));
dlg.setLink(link);
dlg.show();
if (dlg.isOK()) {
final IssueNavigationLink editedLink = dlg.getLink();
link.setIssueRegexp(editedLink.getIssueRegexp());
link.setLinkRegexp(editedLink.getLinkRegexp());
myModel.fireTableDataChanged();
}
}
});
myDeleteButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (Messages.showOkCancelDialog(myProject, VcsBundle.message("issue.link.delete.prompt"),
VcsBundle.message("issue.link.delete.title"), Messages.getQuestionIcon()) == 0) {
int selRow = myLinkTable.getSelectedRow();
myLinks.remove(selRow);
myModel.fireTableDataChanged();
if (myLinkTable.getRowCount() > 0) {
if (selRow >= myLinkTable.getRowCount()) {
selRow--;
add(new JLabel("<html>" + ApplicationNamesInfo.getInstance().getFullProductName() + " will search for the specified patterns in " +
"checkin comments and link them to issues in your issue tracker:</html>"), BorderLayout.NORTH);
add(
ToolbarDecorator.createDecorator(myLinkTable)
.setAddAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
IssueLinkConfigurationDialog dlg = new IssueLinkConfigurationDialog(myProject);
dlg.setTitle(VcsBundle.message("issue.link.add.title"));
dlg.show();
if (dlg.isOK()) {
myLinks.add(dlg.getLink());
myModel.fireTableDataChanged();
}
}
}).setRemoveAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
if (Messages.showOkCancelDialog(myProject, VcsBundle.message("issue.link.delete.prompt"),
VcsBundle.message("issue.link.delete.title"), Messages.getQuestionIcon()) == 0) {
int selRow = myLinkTable.getSelectedRow();
myLinks.remove(selRow);
myModel.fireTableDataChanged();
if (myLinkTable.getRowCount() > 0) {
if (selRow >= myLinkTable.getRowCount()) {
selRow--;
}
myLinkTable.getSelectionModel().setSelectionInterval(selRow, selRow);
}
myLinkTable.getSelectionModel().setSelectionInterval(selRow, selRow);
}
}
}
});
myLinkTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(final ListSelectionEvent e) {
updateButtons();
}
});
myLinkTable.getEmptyText().setText(VcsBundle.message("issue.link.no.patterns"));
updateButtons();
}
private void updateButtons() {
myEditButton.setEnabled(myLinkTable.getSelectedRow() >= 0);
myDeleteButton.setEnabled(myEditButton.isEnabled());
}).setEditAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
IssueNavigationLink link = (IssueNavigationLink) myModel.getItem(myLinkTable.getSelectedRow());
IssueLinkConfigurationDialog dlg = new IssueLinkConfigurationDialog(myProject);
dlg.setTitle(VcsBundle.message("issue.link.edit.title"));
dlg.setLink(link);
dlg.show();
if (dlg.isOK()) {
final IssueNavigationLink editedLink = dlg.getLink();
link.setIssueRegexp(editedLink.getIssueRegexp());
link.setLinkRegexp(editedLink.getLinkRegexp());
myModel.fireTableDataChanged();
}
}
}).addExtraAction(new AnActionButton("Add JIRA Pattern", IconUtil.getAddJiraPatternIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
String s = Messages.showInputDialog(IssueNavigationConfigurationPanel.this, "Enter JIRA installation URL:",
"Add JIRA Issue Navigation Pattern", Messages.getQuestionIcon());
if (s == null) {
return;
}
if (!s.endsWith("/")) {
s += "/";
}
myLinks.add(new IssueNavigationLink("[A-Z]+\\-\\d+", s + "browse/$0"));
myModel.fireTableDataChanged();
}
}).addExtraAction(new AnActionButton("Add YouTrack Pattern", IconUtil.getAddYouTrackPatternIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
String s = Messages.showInputDialog(IssueNavigationConfigurationPanel.this, "Enter YouTrack installation URL:",
"Add YouTrack Issue Navigation Pattern", Messages.getQuestionIcon());
if (s == null) {
return;
}
if (!s.endsWith("/")) {
s += "/";
}
myLinks.add(new IssueNavigationLink("[A-Z]+\\-\\d+", s + "issue/$0"));
myModel.fireTableDataChanged();
}
}).setButtonComparator("Add", "Add JIRA Pattern", "Add YouTrack Pattern", "Edit", "Remove")
.disableUpDownActions().createPanel(), BorderLayout.CENTER);
}
public void apply() {

View File

@@ -30,6 +30,7 @@ import com.intellij.ui.CheckBoxListListener;
import com.intellij.ui.components.JBList;
import com.intellij.ui.popup.util.ItemWrapper;
import com.intellij.ui.popup.util.MasterDetailPopupBuilder;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.xdebugger.breakpoints.ui.BreakpointItem;
import com.intellij.xdebugger.impl.DebuggerSupport;
@@ -149,7 +150,7 @@ public class BreakpointsMasterDetailPopupFactory implements CheckBoxListListener
for (BreakpointPanelProvider provider : myBreakpointPanelProviders) {
breakpointTypes.addAll(provider.getAddBreakpointActions(myProject));
}
actions.add(new AnAction("Add Breakpoint", null, PlatformIcons.ADD_ICON) {
actions.add(new AnAction("Add Breakpoint", null, IconUtil.getAddIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {

View File

@@ -27,11 +27,11 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.JBPopup;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.util.TextRange;
import com.intellij.ui.*;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.util.IconUtil;
import org.intellij.lang.annotations.JdkConstants;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -50,7 +50,7 @@ import java.util.EventObject;
public abstract class AbstractValueHint {
private static final Logger LOG = Logger.getInstance("#com.intellij.xdebugger.impl.evaluate.quick.common.AbstractValueHint");
@NonNls private final static String DIMENSION_SERVICE_KEY = "DebuggerActiveHint";
private static final Icon COLLAPSED_TREE_ICON = IconLoader.getIcon("/general/add.png");
private static final Icon COLLAPSED_TREE_ICON = IconUtil.getAddIcon();
private static final int HINT_TIMEOUT = 7000; // ms
private final KeyListener myEditorKeyListener = new KeyAdapter() {
public void keyReleased(KeyEvent e) {

View File

@@ -148,7 +148,7 @@ public class InjectionsSettingsUI implements SearchableConfigurable.Parent, NonD
});
final DefaultActionGroup group = new DefaultActionGroup();
final AnAction addAction = new AnAction("Add", "Add", PlatformIcons.ADD_ICON) {
final AnAction addAction = new AnAction("Add", "Add", IconUtil.getAddIcon()) {
@Override
public void update(final AnActionEvent e) {
e.getPresentation().setEnabled(!myAddActions.isEmpty());
@@ -191,7 +191,7 @@ public class InjectionsSettingsUI implements SearchableConfigurable.Parent, NonD
performEditAction(e);
}
};
final AnAction copyAction = new AnAction("Duplicate", "Duplicate", PlatformIcons.DUPLICATE_ICON) {
final AnAction copyAction = new AnAction("Duplicate", "Duplicate", PlatformIcons.COPY_ICON) {
@Override
public void update(final AnActionEvent e) {
final AnAction action = getEditAction();
@@ -240,7 +240,7 @@ public class InjectionsSettingsUI implements SearchableConfigurable.Parent, NonD
if (myInfos.length > 1) {
group.addSeparator();
final AnAction shareAction = new AnAction("Make Global", null, IconLoader.getIcon("/actions/import.png")) {
final AnAction shareAction = new AnAction("Make Global", null, PlatformIcons.IMPORT_ICON) {
@Override
public void actionPerformed(final AnActionEvent e) {
final List<InjInfo> injections = getSelectedInjections();

View File

@@ -110,8 +110,8 @@ public class ProfileDialog extends DialogWrapper {
removeProfile();
}
});
decorator.setUpAction(null);
decorator.setDownAction(null);
decorator.setMoveUpAction(null);
decorator.setMoveDownAction(null);
myProfileManager = new ProfileManager(module, EmptyRunnable.INSTANCE, EmptyRunnable.INSTANCE);

View File

@@ -49,6 +49,7 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.*;
import com.intellij.ui.treeStructure.Tree;
import com.intellij.util.ArrayUtil;
import com.intellij.util.IconUtil;
import com.intellij.util.StringBuilderSpinAllocator;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.tree.TreeUtil;
@@ -98,8 +99,8 @@ public class AntExplorer extends SimpleToolWindowPanel implements DataProvider,
}
};
private static final Icon ICON_RUN = IconLoader.getIcon("/actions/execute.png");
private static final Icon ICON_REMOVE = IconLoader.getIcon("/general/remove.png");
private static final Icon ICON_ADD = IconLoader.getIcon("/general/add.png");
private static final Icon ICON_REMOVE = IconUtil.getRemoveIcon();
private static final Icon ICON_ADD = IconUtil.getAddIcon();
private static final Icon ICON_FILTER = IconLoader.getIcon("/ant/filter.png");
public AntExplorer(final Project project) {

View File

@@ -30,6 +30,7 @@ import com.intellij.openapi.util.IconLoader;
import com.intellij.ui.ColoredListCellRenderer;
import com.intellij.ui.SimpleColoredComponent;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.config.AbstractProperty;
import com.intellij.util.ui.AbstractTableCellEditor;
@@ -120,7 +121,7 @@ public class AntUIUtil {
getChildComponent().setBorder(BorderFactory.createLineBorder(Color.black));
FixedSizeButton button = myComponent.getComponentWithButton().getButton();
button.setIcon(IconLoader.getIcon("/general/plus.png"));
button.setIcon(IconUtil.getAddIcon());
button.setToolTipText(AntBundle.message("ant.property.value.editor.insert.macro.tooltip.text"));
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {

View File

@@ -36,6 +36,7 @@ import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
import com.intellij.openapi.util.Conditions;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.containers.HashMap;
import com.maddyhome.idea.copyright.CopyrightManager;
@@ -145,7 +146,7 @@ public class CopyrightProfilesPanel extends MasterDetailsComponent implements Se
@Nullable
protected ArrayList<AnAction> createActions(boolean fromPopup) {
ArrayList<AnAction> result = new ArrayList<AnAction>();
result.add(new AnAction("Add", "Add", PlatformIcons.ADD_ICON) {
result.add(new AnAction("Add", "Add", IconUtil.getAddIcon()) {
{
registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
}

View File

@@ -27,12 +27,12 @@ import com.intellij.openapi.help.HelpManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.InputException;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.ui.AnActionButton;
import com.intellij.ui.AnActionButtonRunnable;
import com.intellij.ui.ToolbarDecorator;
import com.intellij.ui.components.JBList;
import com.intellij.util.PlatformIcons;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
@@ -134,7 +134,7 @@ public class CvsConfigurationsListEditor extends DialogWrapper implements DataPr
private JComponent createListPanel() {
final AnActionButton duplicateButton =
new AnActionButton(CvsBundle.message("action.name.copy"), IconLoader.getIcon("/general/copy.png")) {
new AnActionButton(CvsBundle.message("action.name.copy"), PlatformIcons.COPY_ICON) {
@Override
public void updateButton(AnActionEvent e) {

View File

@@ -37,6 +37,7 @@ import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.containers.HashMap;
import com.intellij.util.containers.HashSet;
@@ -131,7 +132,7 @@ public class ImportTree extends NodeRenderer {
}
public AnAction createIncludeAction() {
return new AnAction(CvsBundle.message("import.wizard.include.to.import.action.name"), null, PlatformIcons.ADD_ICON) {
return new AnAction(CvsBundle.message("import.wizard.include.to.import.action.name"), null, IconUtil.getAddIcon()) {
public void update(AnActionEvent e) {
final VirtualFile[] selectedFiles = myFileSystemTree.getSelectedFiles();
final Presentation presentation = e.getPresentation();

View File

@@ -19,7 +19,7 @@
</action>
<group id="GitFileActions">
<action id="Git.Add" class="git4idea.actions.GitAdd" text="Add" icon="/actions/include.png" use-shortcut-of="ChangesView.AddUnversioned" />
<action id="Git.Add" class="git4idea.actions.GitAdd" text="Add" icon="/general/add.png" use-shortcut-of="ChangesView.AddUnversioned" />
<reference ref="CheckinFiles"/>
<separator/>
<reference ref="Annotate"/>

View File

@@ -2380,7 +2380,7 @@ public class GitLogUI implements Disposable {
private class MyCheckoutNewBranchAction extends DumbAwareAction {
private MyCheckoutNewBranchAction() {
super("New Branch", "Create new branch starting from the selected commit", IconLoader.getIcon("/general/add.png"));
super("New Branch", "Create new branch starting from the selected commit", IconUtil.getAddIcon());
}
@Override

View File

@@ -23,7 +23,7 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.IconLoader;
import com.intellij.util.IconUtil;
import git4idea.GitBranch;
import git4idea.branch.GitBranchOperationsProcessor;
import git4idea.repo.GitRepository;
@@ -85,7 +85,7 @@ class GitBranchPopupActions {
@NotNull private final GitRepository mySelectedRepository;
NewBranchAction(@NotNull Project project, @NotNull List<GitRepository> repositories, @NotNull GitRepository selectedRepository) {
super("New Branch", "Create and checkout new branch", IconLoader.getIcon("/general/add.png"));
super("New Branch", "Create and checkout new branch", IconUtil.getAddIcon());
myProject = project;
myRepositories = repositories;
mySelectedRepository = selectedRepository;

View File

@@ -19,10 +19,10 @@ import com.intellij.ide.util.PackageChooserDialog;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiPackage;
import com.intellij.util.IconUtil;
import org.jetbrains.plugins.groovy.doc.GroovyDocConfiguration;
import javax.swing.*;
@@ -36,7 +36,7 @@ public class GroovyDocAddPackageAction extends AnAction implements DumbAware {
private final DefaultListModel myDataModel;
public GroovyDocAddPackageAction(final DefaultListModel dataModel) {
super("Add package", "Add package", IconLoader.getIcon("/general/add.png"));
super("Add package", "Add package", IconUtil.getAddIcon());
myDataModel = dataModel;
}

View File

@@ -25,9 +25,11 @@ import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.vcs.*;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.CommittedChangesProvider;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsKey;
import com.intellij.openapi.vcs.annotate.AnnotationProvider;
import com.intellij.openapi.vcs.changes.ChangeProvider;
import com.intellij.openapi.vcs.changes.CommitExecutor;
@@ -42,6 +44,7 @@ import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.StatusBar;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.util.IconUtil;
import com.intellij.util.containers.ComparatorDelegate;
import com.intellij.util.containers.Convertor;
import com.intellij.util.messages.MessageBusConnection;
@@ -73,8 +76,8 @@ public class HgVcs extends AbstractVcs<CommittedChangeList> {
public static final Topic<HgUpdater> REMOTE_TOPIC =
new Topic<HgUpdater>("hg4idea.remote", HgUpdater.class);
private static final Icon INCOMING_ICON = IconLoader.getIcon("/actions/moveDown.png");
private static final Icon OUTGOING_ICON = IconLoader.getIcon("/actions/moveUp.png");
private static final Icon INCOMING_ICON = IconUtil.getMoveDownIcon();
private static final Icon OUTGOING_ICON = IconUtil.getMoveUpIcon();
private static final Logger LOG = Logger.getInstance(HgVcs.class);
public static final String VCS_NAME = "hg4idea";

View File

@@ -51,7 +51,7 @@ import com.intellij.ui.EditorTextFieldWithBrowseButton;
import com.intellij.ui.InsertPathAction;
import com.intellij.ui.PanelWithAnchor;
import com.intellij.ui.components.JBLabel;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import com.intellij.util.TextFieldCompletionProvider;
import gnu.trove.TIntArrayList;
import org.jetbrains.annotations.NonNls;
@@ -178,7 +178,7 @@ public class JUnitConfigurable extends SettingsEditor<JUnitConfiguration> implem
final JPanel panel = myPattern.getComponent();
panel.setLayout(new BorderLayout());
myPatternTextField = new TextFieldWithBrowseButton();
myPatternTextField.setButtonIcon(PlatformIcons.ADD_ICON);
myPatternTextField.setButtonIcon(IconUtil.getAddIcon());
panel.add(myPatternTextField, BorderLayout.CENTER);
final FixedSizeButton editBtn = new FixedSizeButton();
editBtn.setIcon(IconLoader.getIcon("/actions/showViewer.png"));

View File

@@ -1,19 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.idea.svn.config.ConfigureProxiesOptionsPanel">
<grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="4" column-count="7" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="761" height="500"/>
<xy x="20" y="20" width="619" height="496"/>
</constraints>
<properties>
<minimumSize width="700" height="500"/>
</properties>
<properties/>
<border type="none"/>
<children>
<grid id="aa8fb" layout-manager="GridLayoutManager" row-count="5" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="5" bottom="5" right="5"/>
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="5" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
@@ -50,7 +48,7 @@
</component>
<component id="a392a" class="javax.swing.JTextField" binding="myServerField">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -67,7 +65,7 @@
</component>
<component id="ca2e5" class="javax.swing.JTextField" binding="myPortField">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -85,7 +83,7 @@
</component>
<component id="131ae" class="javax.swing.JPasswordField" binding="myPasswordField">
<constraints>
<grid row="3" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="3" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -102,7 +100,7 @@
</component>
<component id="4edaf" class="javax.swing.JTextField" binding="myUserField">
<constraints>
<grid row="2" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="2" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -119,7 +117,7 @@
</component>
<component id="13021" class="javax.swing.JTextField" binding="myTimeoutField">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -127,7 +125,7 @@
</component>
<scrollpane id="a8256" class="com.intellij.ui.components.JBScrollPane">
<constraints>
<grid row="0" column="1" row-span="1" col-span="3" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -135,15 +133,14 @@
<component id="29d0b" class="javax.swing.JTextArea" binding="myUrlPatterns">
<constraints/>
<properties>
<preferredSize width="374" height="50"/>
<wrapStyleWord value="false"/>
<rows value="3"/>
</properties>
</component>
</children>
</scrollpane>
<scrollpane id="55a1f" class="com.intellij.ui.components.JBScrollPane">
<constraints>
<grid row="1" column="1" row-span="1" col-span="3" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="1" column="1" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -152,7 +149,7 @@
<constraints/>
<properties>
<lineWrap value="true"/>
<preferredSize width="374" height="50"/>
<rows value="3"/>
</properties>
</component>
</children>
@@ -169,13 +166,13 @@
</grid>
<hspacer id="c69ce">
<constraints>
<grid row="0" column="5" row-span="1" col-span="2" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<grid id="41bae" layout-manager="GridLayoutManager" row-count="3" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="5" bottom="5" right="5"/>
<grid id="41bae" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="5" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
@@ -209,15 +206,6 @@
<text resource-bundle="org/jetbrains/idea/svn/SvnBundle" key="dialog.edit.http.proxies.settings.client.certificate.passphrase.text"/>
</properties>
</component>
<component id="d6581" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<requestFocusEnabled value="false"/>
<text value=""/>
</properties>
</component>
<component id="82eaa" class="javax.swing.JPasswordField" binding="myClientCertificatePasswordField">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
@@ -236,16 +224,14 @@
</component>
<component id="61468" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myClientCertificatePathField">
<constraints>
<grid row="1" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="300" height="-1"/>
</grid>
<grid row="1" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="ee552" class="javax.swing.JTextField" binding="myPathToCertificatesField">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="300" height="-1"/>
<grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
@@ -254,13 +240,13 @@
</grid>
<vspacer id="eaab8">
<constraints>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<grid id="b5b3e" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="5" bottom="5" right="5"/>
<grid id="b5b3e" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<clientProperties>
@@ -268,18 +254,9 @@
</clientProperties>
<border type="line" title-resource-bundle="org/jetbrains/idea/svn/SvnBundle" title-key="dialog.edit.http.proxies.settings.panel.repositories.title"/>
<children>
<component id="e003d" class="javax.swing.JButton" binding="myTestConnectionButton">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="2" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<label value="Test connection"/>
<text resource-bundle="org/jetbrains/idea/svn/SvnBundle" key="dialog.edit.http.proxies.settings.test.connection.button.text"/>
</properties>
</component>
<scrollpane id="e8cb0" class="com.intellij.ui.components.JBScrollPane">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -290,6 +267,15 @@
</component>
</children>
</scrollpane>
<component id="e003d" class="javax.swing.JButton" binding="myTestConnectionButton">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="4" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<label value="Test connection"/>
<text resource-bundle="org/jetbrains/idea/svn/SvnBundle" key="dialog.edit.http.proxies.settings.test.connection.button.text"/>
</properties>
</component>
</children>
</grid>
</children>

View File

@@ -23,6 +23,7 @@ import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.ui.MasterDetailsComponent;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Ref;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.ui.tree.TreeUtil;
import org.jetbrains.idea.svn.SvnBundle;
@@ -153,7 +154,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
protected ArrayList<AnAction> createActions(final boolean fromPopup) {
ArrayList<AnAction> result = new ArrayList<AnAction>();
result.add(new AnAction("Add", "Add", PlatformIcons.ADD_ICON) {
result.add(new AnAction("Add", "Add", IconUtil.getAddIcon()) {
{
registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
}

View File

@@ -28,6 +28,7 @@ import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.ui.PopupHandler;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.table.JBTable;
import com.intellij.util.IconUtil;
import com.intellij.util.containers.HashMap;
import org.jetbrains.idea.svn.SvnVcs;
import org.tmatesoft.svn.core.*;
@@ -317,7 +318,7 @@ public class PropertiesComponent extends JPanel {
e.getPresentation().setText("Add Property");
e.getPresentation().setDescription("Add new property");
if (!CONTEXT_ID.equals(e.getPlace())) {
e.getPresentation().setIcon(IconLoader.getIcon("/general/add.png"));
e.getPresentation().setIcon(IconUtil.getAddIcon());
}
e.getPresentation().setEnabled(myFile != null);
}

View File

@@ -43,6 +43,7 @@ import com.intellij.openapi.vcs.changes.ui.ChangeListViewerDialog;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.util.IconUtil;
import com.intellij.util.NotNullFunction;
import com.intellij.util.WaitForProgressToShow;
import org.jetbrains.annotations.NonNls;
@@ -395,7 +396,7 @@ public class RepositoryBrowserDialog extends DialogWrapper {
if (e.getPlace().equals(PLACE_TOOLBAR)) {
e.getPresentation().setDescription(SvnBundle.message("repository.browser.add.location.action"));
e.getPresentation().setText(SvnBundle.message("repository.browser.add.location.action"));
e.getPresentation().setIcon(IconLoader.getIcon("/general/add.png"));
e.getPresentation().setIcon(IconUtil.getAddIcon());
}
}

View File

@@ -18,7 +18,6 @@ package org.jetbrains.idea.svn.history;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.vcs.FilePath;
@@ -32,6 +31,7 @@ import com.intellij.openapi.vcs.history.*;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.*;
import com.intellij.util.Consumer;
import com.intellij.util.PlatformIcons;
import com.intellij.util.ThrowableConsumer;
import com.intellij.util.ui.ColumnInfo;
import com.intellij.util.ui.UIUtil;
@@ -771,7 +771,7 @@ public class SvnHistoryProvider
}
private static class CopyFromColumnInfo extends ColumnInfo<VcsFileRevision, String> {
private final Icon myIcon = IconLoader.getIcon("/actions/menu-copy.png");
private final Icon myIcon = PlatformIcons.COPY_ICON;
private final ColoredTableCellRenderer myRenderer = new ColoredTableCellRenderer() {
protected void customizeCellRenderer(final JTable table,
final Object value,

View File

@@ -27,6 +27,7 @@ import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.Nullable;
@@ -106,7 +107,7 @@ public class IntegratedSelectedOptionsDialog extends DialogWrapper {
myTargetInfoLabel.setText(SvnBundle.message("action.Subversion.integrate.changes.branch.info.target.label.text", selectedBranchUrl));
final String addText = SvnBundle.message("action.Subversion.integrate.changes.dialog.add.wc.text");
final AnAction addAction = new AnAction(addText, addText, PlatformIcons.ADD_ICON) {
final AnAction addAction = new AnAction(addText, addText, IconUtil.getAddIcon()) {
{
registerCustomShortcutSet(CommonShortcuts.INSERT, myWorkingCopiesList);
}

View File

@@ -23,6 +23,7 @@ import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.ui.MasterDetailsComponent;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Ref;
import com.intellij.util.IconUtil;
import com.intellij.util.PlatformIcons;
import com.intellij.util.ui.tree.TreeUtil;
import org.jetbrains.idea.svn.SvnBundle;
@@ -153,7 +154,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
protected ArrayList<AnAction> createActions(final boolean fromPopup) {
ArrayList<AnAction> result = new ArrayList<AnAction>();
result.add(new AnAction("Add", "Add", PlatformIcons.ADD_ICON) {
result.add(new AnAction("Add", "Add", IconUtil.getAddIcon()) {
{
registerCustomShortcutSet(CommonShortcuts.INSERT, myTree);
}

View File

@@ -105,7 +105,7 @@ public class IntegratedSelectedOptionsDialog extends DialogWrapper {
myTargetInfoLabel.setText(SvnBundle.message("action.Subversion.integrate.changes.branch.info.target.label.text", selectedBranchUrl));
final String addText = SvnBundle.message("action.Subversion.integrate.changes.dialog.add.wc.text");
final AnAction addAction = new AnAction(addText, addText, PlatformIcons.ADD_ICON) {
final AnAction addAction = new AnAction(addText, addText, IconUtil.getAddIcon()) {
{
registerCustomShortcutSet(CommonShortcuts.INSERT, myWorkingCopiesList);
}

View File

@@ -51,7 +51,7 @@ import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.ui.*;
import com.intellij.ui.components.JBList;
import com.intellij.ui.table.TableView;
import com.intellij.util.PlatformIcons;
import com.intellij.util.IconUtil;
import com.intellij.util.TextFieldCompletionProvider;
import com.theoryinpractice.testng.MessageInfoException;
import com.theoryinpractice.testng.configuration.browser.*;
@@ -145,7 +145,7 @@ public class TestNGConfigurationEditor extends SettingsEditor<TestNGConfiguratio
final JPanel panel = myPattern.getComponent();
panel.setLayout(new BorderLayout());
myPatternTextField = new TextFieldWithBrowseButton();
myPatternTextField.setButtonIcon(PlatformIcons.ADD_ICON);
myPatternTextField.setButtonIcon(IconUtil.getAddIcon());
panel.add(myPatternTextField, BorderLayout.CENTER);
final FixedSizeButton editBtn = new FixedSizeButton();
editBtn.setIcon(IconLoader.getIcon("/actions/showViewer.png"));

View File

@@ -25,6 +25,7 @@ import com.intellij.openapi.util.IconLoader;
import com.intellij.ui.ColoredTreeCellRenderer;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.uiDesigner.UIDesignerBundle;
import com.intellij.util.IconUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
@@ -202,7 +203,7 @@ public class ConfigureClientPropertiesDialog extends DialogWrapper {
private class AddClassAction extends AnAction {
public AddClassAction() {
super(UIDesignerBundle.message("client.properties.add.class.tooltip"), "", IconLoader.getIcon("/general/add.png"));
super(UIDesignerBundle.message("client.properties.add.class.tooltip"), "", IconUtil.getAddIcon());
}
public void actionPerformed(AnActionEvent e) {
@@ -248,7 +249,7 @@ public class ConfigureClientPropertiesDialog extends DialogWrapper {
private class AddPropertyAction extends AnAction {
public AddPropertyAction() {
super(UIDesignerBundle.message("client.properties.add.property.tooltip"), "", IconLoader.getIcon("/general/add.png"));
super(UIDesignerBundle.message("client.properties.add.property.tooltip"), "", IconUtil.getAddIcon());
}
public void actionPerformed(AnActionEvent e) {

Some files were not shown because too many files have changed in this diff Show More