Search in sources :

Example 6 with CaptionSelection

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);
            }
        }
    }
}
Also used : CaptionSelection(com.intellij.uiDesigner.CaptionSelection) Presentation(com.intellij.openapi.actionSystem.Presentation)

Aggregations

CaptionSelection (com.intellij.uiDesigner.CaptionSelection)6 Presentation (com.intellij.openapi.actionSystem.Presentation)2 GuiEditor (com.intellij.uiDesigner.designSurface.GuiEditor)2 FormLayout (com.jgoodies.forms.layout.FormLayout)2