use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.
the class ImageEditorActionUtil method setEnabled.
/**
* Enable or disable current action from event.
*
* @param e Action event
* @return Enabled value
*/
public static boolean setEnabled(AnActionEvent e) {
ImageComponentDecorator decorator = getImageComponentDecorator(e);
Presentation presentation = e.getPresentation();
presentation.setEnabled(decorator != null);
return presentation.isEnabled();
}
use of org.intellij.images.ui.ImageComponentDecorator in project intellij-community by JetBrains.
the class ActualSizeAction 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.getZoomFactor() != 1.0d);
}
}
Aggregations