use of com.intellij.uiDesigner.CaptionSelection in project intellij-community by JetBrains.
the class RowColumnAction method update.
public void update(final AnActionEvent e) {
final Presentation presentation = e.getPresentation();
CaptionSelection selection = CaptionSelection.DATA_KEY.getData(e.getDataContext());
if (selection == null) {
presentation.setEnabled(false);
} else {
presentation.setEnabled(selection.getContainer() != null && selection.getFocusedIndex() >= 0);
if (!selection.isRow()) {
presentation.setText(myColumnText);
if (myColumnIcon != null) {
presentation.setIcon(myColumnIcon);
}
} else {
presentation.setText(myRowText);
if (myRowIcon != null) {
presentation.setIcon(myRowIcon);
}
}
}
}
Aggregations