Search in sources :

Example 6 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ZoomOutAction method update.

public void update(AnActionEvent e) {
    super.update(e);
    if (ImageEditorActionUtil.setEnabled(e)) {
        ImageComponentDecorator decorator = ImageEditorActionUtil.getImageComponentDecorator(e);
        ImageZoomModel zoomModel = decorator.getZoomModel();
        e.getPresentation().setEnabled(zoomModel.canZoomOut());
    }
}
Also used : ImageZoomModel(org.intellij.images.editor.ImageZoomModel) ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Example 7 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ToggleFileNameAction method update.

public void update(final AnActionEvent e) {
    super.update(e);
    ImageComponentDecorator decorator = ImageComponentDecorator.DATA_KEY.getData(e.getDataContext());
    e.getPresentation().setEnabled(decorator != null && decorator.isEnabledForActionPlace(e.getPlace()));
    e.getPresentation().setText(isSelected(e) ? "Hide File Name" : "Show File Name");
}
Also used : ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Example 8 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ToggleFileSizeAction method update.

public void update(final AnActionEvent e) {
    super.update(e);
    ImageComponentDecorator decorator = ImageComponentDecorator.DATA_KEY.getData(e.getDataContext());
    e.getPresentation().setEnabled(decorator != null && decorator.isEnabledForActionPlace(e.getPlace()));
    e.getPresentation().setText(isSelected(e) ? "Hide File Size" : "Show File Size");
}
Also used : ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Example 9 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ToggleFileNameAction method setSelected.

public void setSelected(AnActionEvent e, boolean state) {
    ImageComponentDecorator decorator = ImageComponentDecorator.DATA_KEY.getData(e.getDataContext());
    if (decorator != null && decorator.isEnabledForActionPlace(e.getPlace())) {
        decorator.setFileNameVisible(state);
        OptionsManager.getInstance().getOptions().getEditorOptions().setFileNameVisible(state);
    }
}
Also used : ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Example 10 with ImageComponentDecorator

use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.

the class ToggleTransparencyChessboardAction method update.

public void update(final AnActionEvent e) {
    super.update(e);
    ImageComponentDecorator decorator = ImageComponentDecorator.DATA_KEY.getData(e.getDataContext());
    e.getPresentation().setEnabled(decorator != null && decorator.isEnabledForActionPlace(e.getPlace()));
    e.getPresentation().setText(isSelected(e) ? "Hide Chessboard" : "Show Chessboard");
}
Also used : ImageComponentDecorator(org.intellij.images.ui.ImageComponentDecorator)

Aggregations

ImageComponentDecorator (org.intellij.images.ui.ImageComponentDecorator)12 ImageZoomModel (org.intellij.images.editor.ImageZoomModel)6 Presentation (com.intellij.openapi.actionSystem.Presentation)1