mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
actions update thread - diff
GitOrigin-RevId: 07c7fb9b2bde1f962c458fc4bc2e9a21562c8cd2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9bf40c2345
commit
06da957994
@@ -2,6 +2,7 @@
|
||||
package com.intellij.diff.actions;
|
||||
|
||||
import com.intellij.diff.util.DiffUtil;
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionUtil;
|
||||
@@ -37,6 +38,11 @@ public final class ProxyUndoRedoAction extends DumbAwareAction {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
e.getPresentation().setEnabled(myUndo ? myUndoManager.isUndoAvailable(myEditor) : myUndoManager.isRedoAvailable(myEditor));
|
||||
|
||||
@@ -193,6 +193,11 @@ public class SetEditorSettingsAction extends ActionGroup implements DumbAware {
|
||||
getTemplatePresentation().setIcon(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(@NotNull AnActionEvent e) {
|
||||
return isSelected();
|
||||
@@ -252,6 +257,11 @@ public class SetEditorSettingsAction extends ActionGroup implements DumbAware {
|
||||
myLayer = layer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(@NotNull AnActionEvent e) {
|
||||
return myTextSettings.getHighlightingLevel() == myLayer;
|
||||
@@ -291,6 +301,11 @@ public class SetEditorSettingsAction extends ActionGroup implements DumbAware {
|
||||
myOption = option;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(@NotNull AnActionEvent e) {
|
||||
return myTextSettings.getBreadcrumbsPlacement() == myOption;
|
||||
|
||||
@@ -714,6 +714,11 @@ public abstract class DiffRequestProcessor implements CheckedDisposable {
|
||||
ActionUtil.copyFrom(this, "Diff.ShowInExternalTool");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
getShowActions().get(0).actionPerformed(e);
|
||||
@@ -787,12 +792,17 @@ public abstract class DiffRequestProcessor implements CheckedDisposable {
|
||||
|
||||
private class MyChangeDiffToolAction extends ComboBoxAction implements DumbAware {
|
||||
// TODO: add icons for diff tools, show only icon in toolbar - to reduce jumping on change ?
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
Presentation presentation = e.getPresentation();
|
||||
|
||||
DiffTool activeTool = myState.getActiveTool();
|
||||
//noinspection DialogTitleCapitalization
|
||||
presentation.setText(activeTool.getName());
|
||||
|
||||
if (myForcedDiffTool != null) {
|
||||
@@ -826,10 +836,16 @@ public abstract class DiffRequestProcessor implements CheckedDisposable {
|
||||
@NotNull private final DiffTool myDiffTool;
|
||||
|
||||
private DiffToolToggleAction(@NotNull DiffTool tool) {
|
||||
//noinspection DialogTitleCapitalization
|
||||
super(tool.getName());
|
||||
myDiffTool = tool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
e.getPresentation().setEnabledAndVisible(myForcedDiffTool == null);
|
||||
@@ -851,6 +867,11 @@ public abstract class DiffRequestProcessor implements CheckedDisposable {
|
||||
ActionUtil.copyFrom(this, "Diff.ShowSettingsPopup");
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
e.getPresentation().setEnabled(myPopupActionGroup.getChildrenCount() > 0);
|
||||
@@ -901,6 +922,11 @@ public abstract class DiffRequestProcessor implements CheckedDisposable {
|
||||
public MyNextDifferenceAction() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
if (DiffUtil.isFromShortcut(e)) {
|
||||
@@ -949,6 +975,11 @@ public abstract class DiffRequestProcessor implements CheckedDisposable {
|
||||
public MyPrevDifferenceAction() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
if (DiffUtil.isFromShortcut(e)) {
|
||||
@@ -1054,6 +1085,11 @@ public abstract class DiffRequestProcessor implements CheckedDisposable {
|
||||
protected class MyNextChangeAction extends NextChangeAction {
|
||||
public MyNextChangeAction() { }
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
if (DiffUtil.isFromShortcut(e)) {
|
||||
@@ -1081,6 +1117,11 @@ public abstract class DiffRequestProcessor implements CheckedDisposable {
|
||||
protected class MyPrevChangeAction extends PrevChangeAction {
|
||||
public MyPrevChangeAction() { }
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
if (DiffUtil.isFromShortcut(e)) {
|
||||
|
||||
@@ -3,10 +3,7 @@ package com.intellij.diff.impl.ui
|
||||
|
||||
import com.intellij.diff.DiffTool
|
||||
import com.intellij.diff.FrameDiffTool
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup
|
||||
import com.intellij.openapi.actionSystem.Presentation
|
||||
import com.intellij.openapi.actionSystem.ToggleAction
|
||||
import com.intellij.openapi.actionSystem.*
|
||||
import com.intellij.openapi.actionSystem.ex.CustomComponentAction
|
||||
import com.intellij.openapi.project.DumbAware
|
||||
import com.intellij.openapi.project.DumbAwareAction
|
||||
@@ -14,10 +11,13 @@ import com.intellij.ui.dsl.builder.IntelliJSpacingConfiguration
|
||||
import com.intellij.ui.dsl.builder.components.SegmentedButtonToolbar
|
||||
import javax.swing.JComponent
|
||||
|
||||
@Suppress("DialogTitleCapitalization")
|
||||
abstract class DiffToolChooser(private val targetComponent: JComponent? = null) : DumbAwareAction(), CustomComponentAction {
|
||||
|
||||
private val actions = arrayListOf<MyDiffToolAction>()
|
||||
|
||||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
val presentation = e.presentation
|
||||
|
||||
@@ -62,6 +62,8 @@ abstract class DiffToolChooser(private val targetComponent: JComponent? = null)
|
||||
private inner class MyDiffToolAction(private val diffTool: DiffTool, private var state: Boolean) :
|
||||
ToggleAction(diffTool.name), DumbAware {
|
||||
|
||||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT
|
||||
|
||||
override fun isSelected(e: AnActionEvent): Boolean = state
|
||||
|
||||
override fun setSelected(e: AnActionEvent, state: Boolean) {
|
||||
|
||||
@@ -467,6 +467,11 @@ public abstract class MergeRequestProcessor implements Disposable {
|
||||
//
|
||||
|
||||
private static class MyNextDifferenceAction extends NextDifferenceAction {
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
if (!ActionPlaces.DIFF_TOOLBAR.equals(e.getPlace())) {
|
||||
@@ -493,6 +498,11 @@ public abstract class MergeRequestProcessor implements Disposable {
|
||||
}
|
||||
|
||||
private static class MyPrevDifferenceAction extends PrevDifferenceAction {
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
if (!ActionPlaces.DIFF_TOOLBAR.equals(e.getPlace())) {
|
||||
|
||||
+6
@@ -21,6 +21,7 @@ import com.intellij.diff.requests.DiffRequest;
|
||||
import com.intellij.diff.tools.holders.BinaryEditorHolder;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.diff.DiffBundle;
|
||||
@@ -212,6 +213,11 @@ public class TransferableFileEditorStateSupport {
|
||||
mySupport = support;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return mySupport.isSupported();
|
||||
|
||||
@@ -191,6 +191,11 @@ public final class TextDiffViewerUtil {
|
||||
public static abstract class ComboBoxSettingAction<T> extends ComboBoxAction implements DumbAware {
|
||||
private DefaultActionGroup myActions;
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
Presentation presentation = e.getPresentation();
|
||||
@@ -228,6 +233,11 @@ public final class TextDiffViewerUtil {
|
||||
private class MyAction extends AnAction implements Toggleable, DumbAware {
|
||||
@NotNull private final T myOption;
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
Toggleable.setSelected(e.getPresentation(), getValue() == myOption);
|
||||
@@ -385,6 +395,11 @@ public final class TextDiffViewerUtil {
|
||||
mySettings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(AnActionEvent e) {
|
||||
return mySettings.isEnableSyncScroll();
|
||||
@@ -406,6 +421,11 @@ public final class TextDiffViewerUtil {
|
||||
myFoldingSupport = foldingSupport;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return mySettings.getContextRange() != -1;
|
||||
@@ -445,6 +465,11 @@ public final class TextDiffViewerUtil {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
if (!isVisible()) {
|
||||
|
||||
+6
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.diff.impl.dir.actions;
|
||||
|
||||
import com.intellij.ide.diff.DirDiffSettings;
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.diff.impl.dir.DirDiffTableModel;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
@@ -55,4 +56,9 @@ class ChangeCompareModeAction extends DumbAwareAction {
|
||||
e.getPresentation().setIcon(on ? ON : OFF);
|
||||
e.getPresentation().setSelectedIcon(on ? ON_SELECTED : OFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -46,6 +46,11 @@ public class ChangeCompareModeGroup extends ComboBoxAction implements ShortcutPr
|
||||
e.getPresentation().setEnabledAndVisible(mySettings.showCompareModes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) {
|
||||
|
||||
+6
-4
@@ -15,10 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.diff.impl.dir.actions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.ShortcutProvider;
|
||||
import com.intellij.openapi.actionSystem.ShortcutSet;
|
||||
import com.intellij.openapi.actionSystem.ToggleAction;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.diff.impl.dir.DirDiffTableModel;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -76,4 +73,9 @@ public abstract class DirDiffAction extends ToggleAction implements ShortcutProv
|
||||
public ShortcutSet getShortcut() {
|
||||
return getShortcutSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,6 +288,11 @@ public abstract class LineStatusMarkerPopupRenderer extends LineStatusMarkerRend
|
||||
myMousePosition = position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||
return ActionUpdateThread.EDT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(@NotNull AnActionEvent e) {
|
||||
return DiffApplicationSettings.getInstance().SHOW_LST_WORD_DIFFERENCES;
|
||||
|
||||
Reference in New Issue
Block a user