Search in sources :

Example 1 with ComponentItemDialog

use of com.intellij.uiDesigner.palette.ComponentItemDialog in project intellij-community by JetBrains.

the class InsertComponentProcessor method replaceAnyComponentItem.

@Nullable
public static ComponentItem replaceAnyComponentItem(GuiEditor editor, ComponentItem item, final String title) {
    if (item.isAnyComponent()) {
        ComponentItem newItem = item.clone();
        ComponentItemDialog dlg = new ComponentItemDialog(editor.getProject(), editor, newItem, true);
        dlg.setTitle(title);
        if (!dlg.showAndGet()) {
            return null;
        }
        return newItem;
    }
    return item;
}
Also used : ComponentItem(com.intellij.uiDesigner.palette.ComponentItem) ComponentItemDialog(com.intellij.uiDesigner.palette.ComponentItemDialog) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

ComponentItem (com.intellij.uiDesigner.palette.ComponentItem)1 ComponentItemDialog (com.intellij.uiDesigner.palette.ComponentItemDialog)1 Nullable (org.jetbrains.annotations.Nullable)1