Search in sources :

Example 1 with DiffMergeSettingsAction

use of com.intellij.openapi.diff.impl.settings.DiffMergeSettingsAction in project intellij-community by JetBrains.

the class DiffPanelImpl method createToolbar.

private DiffRequest.ToolbarAddons createToolbar() {
    return new DiffRequest.ToolbarAddons() {

        public void customize(DiffToolbar toolbar) {
            ActionManager actionManager = ActionManager.getInstance();
            toolbar.addAction(actionManager.getAction("DiffPanel.Toolbar"));
            toolbar.addSeparator();
            toolbar.addAction(new ToggleAutoScrollAction());
            toolbar.addSeparator();
            toolbar.addAction(actionManager.getAction("ContextHelp"));
            toolbar.addAction(getEditSourceAction());
            toolbar.addSeparator();
            toolbar.addAction(new DiffMergeSettingsAction(Arrays.asList(getEditor1(), getEditor2()), ServiceManager.getService(myProject, DiffToolSettings.class)));
        }

        @NotNull
        private AnAction getEditSourceAction() {
            AnAction editSourceAction = new EditSourceAction();
            editSourceAction.getTemplatePresentation().setIcon(AllIcons.Actions.EditSource);
            editSourceAction.getTemplatePresentation().setText(ActionsBundle.actionText("EditSource"));
            editSourceAction.getTemplatePresentation().setDescription(ActionsBundle.actionText("EditSource"));
            editSourceAction.registerCustomShortcutSet(CommonShortcuts.getEditSource(), myPanel, DiffPanelImpl.this);
            return editSourceAction;
        }
    };
}
Also used : ToggleAutoScrollAction(com.intellij.openapi.diff.actions.ToggleAutoScrollAction) EditSourceAction(com.intellij.ide.actions.EditSourceAction) DiffMergeSettingsAction(com.intellij.openapi.diff.impl.settings.DiffMergeSettingsAction)

Example 2 with DiffMergeSettingsAction

use of com.intellij.openapi.diff.impl.settings.DiffMergeSettingsAction in project intellij-community by JetBrains.

the class MergePanel2 method createToolbar.

@NotNull
private DiffRequest.ToolbarAddons createToolbar() {
    return new DiffRequest.ToolbarAddons() {

        public void customize(DiffToolbar toolbar) {
            toolbar.addAction(PreviousDiffAction.find());
            toolbar.addAction(NextDiffAction.find());
            toolbar.addSeparator();
            toolbar.addAction(new OpenPartialDiffAction(0, 1, AllIcons.Diff.LeftDiff));
            toolbar.addAction(new OpenPartialDiffAction(1, 2, AllIcons.Diff.RightDiff));
            toolbar.addAction(new OpenPartialDiffAction(0, 2, AllIcons.Diff.BranchDiff));
            toolbar.addSeparator();
            toolbar.addAction(new ApplyNonConflicts(myPanel));
            toolbar.addSeparator();
            toolbar.addAction(new ToggleAutoScrollAction());
            Project project = myData.getProject();
            if (project != null) {
                toolbar.addSeparator();
                toolbar.addAction(new DiffMergeSettingsAction(getEditors(), ServiceManager.getService(project, MergeToolSettings.class)));
            }
        }
    };
}
Also used : Project(com.intellij.openapi.project.Project) ToggleAutoScrollAction(com.intellij.openapi.diff.actions.ToggleAutoScrollAction) DiffMergeSettingsAction(com.intellij.openapi.diff.impl.settings.DiffMergeSettingsAction) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ToggleAutoScrollAction (com.intellij.openapi.diff.actions.ToggleAutoScrollAction)2 DiffMergeSettingsAction (com.intellij.openapi.diff.impl.settings.DiffMergeSettingsAction)2 EditSourceAction (com.intellij.ide.actions.EditSourceAction)1 Project (com.intellij.openapi.project.Project)1 NotNull (org.jetbrains.annotations.NotNull)1