mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
[images] IJPL-61678 Show chessboard action is not available during indexing
GitOrigin-RevId: 3b46b0c857c05b14f4261699987cc196a0a05760
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1536b4f8fe
commit
64d51a40bc
@@ -18,18 +18,22 @@ package org.intellij.images.actions;
|
|||||||
import com.intellij.ide.IdeBundle;
|
import com.intellij.ide.IdeBundle;
|
||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread;
|
import com.intellij.openapi.actionSystem.ActionUpdateThread;
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||||
import com.intellij.openapi.actionSystem.ToggleAction;
|
import com.intellij.openapi.project.DumbAwareToggleAction;
|
||||||
import org.intellij.images.options.DefaultImageEditorSettings;
|
import org.intellij.images.options.DefaultImageEditorSettings;
|
||||||
import org.intellij.images.ui.ImageComponentDecorator;
|
import org.intellij.images.ui.ImageComponentDecorator;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show/hide background action.
|
* Show/hide background action.
|
||||||
*
|
|
||||||
* @author <a href="mailto:aefimov.box@gmail.com">Alexey Efimov</a>
|
|
||||||
* @see ImageComponentDecorator#setTransparencyChessboardVisible
|
* @see ImageComponentDecorator#setTransparencyChessboardVisible
|
||||||
*/
|
*/
|
||||||
public final class ToggleTransparencyChessboardAction extends ToggleAction {
|
final class ToggleTransparencyChessboardAction extends DumbAwareToggleAction {
|
||||||
|
@Override
|
||||||
|
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
||||||
|
return ActionUpdateThread.EDT;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSelected(@NotNull AnActionEvent e) {
|
public boolean isSelected(@NotNull AnActionEvent e) {
|
||||||
ImageComponentDecorator decorator = e.getData(ImageComponentDecorator.DATA_KEY);
|
ImageComponentDecorator decorator = e.getData(ImageComponentDecorator.DATA_KEY);
|
||||||
@@ -52,9 +56,4 @@ public final class ToggleTransparencyChessboardAction extends ToggleAction {
|
|||||||
e.getPresentation().setEnabled(decorator != null && decorator.isEnabledForActionPlace(e.getPlace()));
|
e.getPresentation().setEnabled(decorator != null && decorator.isEnabledForActionPlace(e.getPlace()));
|
||||||
e.getPresentation().setText(isSelected(e) ? IdeBundle.message("action.text.hide.chessboard") : IdeBundle.message("action.text.show.chessboard"));
|
e.getPresentation().setText(isSelected(e) ? IdeBundle.message("action.text.hide.chessboard") : IdeBundle.message("action.text.show.chessboard"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
|
||||||
return ActionUpdateThread.EDT;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user