diff --git a/platform/icons/src/codeStyle/AddNewSectionRule.png b/platform/icons/src/codeStyle/AddNewSectionRule.png new file mode 100644 index 000000000000..13dfcaa48969 Binary files /dev/null and b/platform/icons/src/codeStyle/AddNewSectionRule.png differ diff --git a/platform/icons/src/codeStyle/AddNewSectionRule@2x.png b/platform/icons/src/codeStyle/AddNewSectionRule@2x.png new file mode 100644 index 000000000000..0116c0779119 Binary files /dev/null and b/platform/icons/src/codeStyle/AddNewSectionRule@2x.png differ diff --git a/platform/icons/src/codeStyle/AddNewSectionRule@2x_dark.png b/platform/icons/src/codeStyle/AddNewSectionRule@2x_dark.png new file mode 100644 index 000000000000..93e49dc8e2ee Binary files /dev/null and b/platform/icons/src/codeStyle/AddNewSectionRule@2x_dark.png differ diff --git a/platform/icons/src/codeStyle/AddNewSectionRule_dark.png b/platform/icons/src/codeStyle/AddNewSectionRule_dark.png new file mode 100644 index 000000000000..739bc198d88c Binary files /dev/null and b/platform/icons/src/codeStyle/AddNewSectionRule_dark.png differ diff --git a/platform/icons/src/codeStyle/mac/AddNewSectionRule.png b/platform/icons/src/codeStyle/mac/AddNewSectionRule.png new file mode 100644 index 000000000000..7aaacdfddda9 Binary files /dev/null and b/platform/icons/src/codeStyle/mac/AddNewSectionRule.png differ diff --git a/platform/icons/src/codeStyle/mac/AddNewSectionRule@2x.png b/platform/icons/src/codeStyle/mac/AddNewSectionRule@2x.png new file mode 100644 index 000000000000..b1c0f9d04293 Binary files /dev/null and b/platform/icons/src/codeStyle/mac/AddNewSectionRule@2x.png differ diff --git a/platform/icons/src/codeStyle/mac/AddNewSectionRule@2x_dark.png b/platform/icons/src/codeStyle/mac/AddNewSectionRule@2x_dark.png new file mode 100644 index 000000000000..f78c45908c2e Binary files /dev/null and b/platform/icons/src/codeStyle/mac/AddNewSectionRule@2x_dark.png differ diff --git a/platform/icons/src/codeStyle/mac/AddNewSectionRule_dark.png b/platform/icons/src/codeStyle/mac/AddNewSectionRule_dark.png new file mode 100644 index 000000000000..2f6e97411bcb Binary files /dev/null and b/platform/icons/src/codeStyle/mac/AddNewSectionRule_dark.png differ diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/action/AddArrangementSectionRuleAction.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/action/AddArrangementSectionRuleAction.java index e324ee29e848..db0b66fb5167 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/action/AddArrangementSectionRuleAction.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/action/AddArrangementSectionRuleAction.java @@ -35,7 +35,7 @@ public class AddArrangementSectionRuleAction extends AddArrangementRuleAction { @Override public void update(AnActionEvent e) { - e.getPresentation().setIcon(SystemInfoRt.isMac ? AllIcons.ToolbarDecorator.Mac.Add : AllIcons.ToolbarDecorator.Add); + e.getPresentation().setIcon(SystemInfoRt.isMac ? AllIcons.CodeStyle.Mac.AddNewSectionRule : AllIcons.CodeStyle.AddNewSectionRule); final ArrangementMatchingRulesControl control = ArrangementMatchingRulesControl.KEY.getData(e.getDataContext()); if (control == null) { return; diff --git a/platform/util/src/com/intellij/icons/AllIcons.java b/platform/util/src/com/intellij/icons/AllIcons.java index 982d4cf79e1d..273306af980e 100644 --- a/platform/util/src/com/intellij/icons/AllIcons.java +++ b/platform/util/src/com/intellij/icons/AllIcons.java @@ -163,6 +163,14 @@ public class AllIcons { } + public static class CodeStyle { + public static final Icon AddNewSectionRule = IconLoader.getIcon("/codeStyle/AddNewSectionRule.png"); // 16x16 + + public static class Mac { + public static final Icon AddNewSectionRule = IconLoader.getIcon("/codeStyle/mac/AddNewSectionRule.png"); // 16x16 + } + } + public static class Css { public static final Icon Atrule = IconLoader.getIcon("/css/atrule.png"); // 16x16 public static final Icon Import = IconLoader.getIcon("/css/import.png"); // 16x16 diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RepositoryChangesBrowser.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RepositoryChangesBrowser.java index 3e3cca72fde0..38ada4ef6b40 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RepositoryChangesBrowser.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RepositoryChangesBrowser.java @@ -44,15 +44,17 @@ import java.util.List; * @author yole */ public class RepositoryChangesBrowser extends ChangesBrowser implements DataProvider { + private CommittedChangesBrowserUseCase myUseCase; + private EditSourceAction myEditSourceAction; public RepositoryChangesBrowser(final Project project, final List changeLists) { - super(project, changeLists, Collections.emptyList(), null, false, false, null, MyUseCase.COMMITTED_CHANGES, null); + this(project, changeLists, Collections.emptyList(), null); } public RepositoryChangesBrowser(final Project project, final List changeLists, final List changes, final ChangeList initialListSelection) { - super(project, changeLists, changes, initialListSelection, false, false, null, MyUseCase.COMMITTED_CHANGES, null); + this(project, changeLists, changes, initialListSelection, null); } public RepositoryChangesBrowser(final Project project, final List changeLists, final List changes, @@ -64,9 +66,9 @@ public class RepositoryChangesBrowser extends ChangesBrowser implements DataProv super.buildToolBar(toolBarGroup); toolBarGroup.add(new ShowDiffWithLocalAction()); - final MyEditSourceAction editSourceAction = new MyEditSourceAction(); - editSourceAction.registerCustomShortcutSet(CommonShortcuts.getEditSource(), this); - toolBarGroup.add(editSourceAction); + myEditSourceAction = new MyEditSourceAction(); + myEditSourceAction.registerCustomShortcutSet(CommonShortcuts.getEditSource(), this); + toolBarGroup.add(myEditSourceAction); OpenRepositoryVersionAction action = new OpenRepositoryVersionAction(); toolBarGroup.add(action); final RevertSelectedChangesAction revertSelectedChangesAction = new RevertSelectedChangesAction(); @@ -100,6 +102,10 @@ public class RepositoryChangesBrowser extends ChangesBrowser implements DataProv } } + public EditSourceAction getEditSourceAction() { + return myEditSourceAction; + } + private class MyEditSourceAction extends EditSourceAction { private final Icon myEditSourceIcon; diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/MainFrame.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/MainFrame.java index 4282f39884fc..26457599ab9d 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/MainFrame.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/MainFrame.java @@ -70,8 +70,9 @@ public class MainFrame extends JPanel implements TypeSafeDataProvider { myBranchesPanel.setVisible(settings.isShowBranchesPanel()); myDetailsPanel = new DetailsPanel(logDataHolder, myGraphTable, vcsLogUI.getColorManager(), initialDataPack); - final ChangesBrowser changesBrowser = new RepositoryChangesBrowser(project, null, Collections.emptyList(), null); + final RepositoryChangesBrowser changesBrowser = new RepositoryChangesBrowser(project, null, Collections.emptyList(), null); changesBrowser.getDiffAction().registerCustomShortcutSet(CommonShortcuts.getDiff(), getGraphTable()); + changesBrowser.getEditSourceAction().registerCustomShortcutSet(CommonShortcuts.getEditSource(), getGraphTable()); setDefaultEmptyText(changesBrowser); myChangesLoadingPane = new JBLoadingPanel(new BorderLayout(), project); myChangesLoadingPane.add(changesBrowser); @@ -230,10 +231,10 @@ public class MainFrame extends JPanel implements TypeSafeDataProvider { else if (VcsLogDataKeys.VCS_LOG_DATA_PROVIDER == key) { sink.put(key, myLogDataHolder); } - else if (VcsDataKeys.CHANGES.equals(key)) { + else if (VcsDataKeys.CHANGES == key || VcsDataKeys.SELECTED_CHANGES == key) { List selectedChanges = getSelectedChanges(); if (selectedChanges != null) { - sink.put(VcsDataKeys.CHANGES, ArrayUtil.toObjectArray(selectedChanges, Change.class)); + sink.put(key, ArrayUtil.toObjectArray(selectedChanges, Change.class)); } } }