use of com.intellij.openapi.diff.ex.DiffPanelEx in project intellij-community by JetBrains.
the class DiffPanelComboBoxAction method update.
@Override
public void update(AnActionEvent e) {
super.update(e);
Presentation presentation = e.getPresentation();
DiffPanelEx diffPanel = getDiffPanel(e.getDataContext());
if (diffPanel != null && diffPanel.getComponent().isDisplayable()) {
AnAction action = myActions.get(getCurrentOption(diffPanel));
Presentation templatePresentation = action.getTemplatePresentation();
presentation.setIcon(templatePresentation.getIcon());
presentation.setText(templatePresentation.getText());
presentation.setEnabled(true);
} else {
presentation.setIcon(null);
presentation.setText(DiffBundle.message("diff.panel.combo.box.action.not.available.action.name"));
presentation.setEnabled(false);
}
}
Aggregations