use of com.intellij.uiDesigner.radComponents.RadRootContainer in project intellij-community by JetBrains.
the class ComponentPtrDescriptor method update.
public boolean update() {
myPtr.validate();
if (!myPtr.isValid()) {
myPtr = null;
return true;
}
final String oldBinding = myBinding;
final String oldTitle = myTitle;
final RadComponent component = myPtr.getComponent();
if (component.getModule().isDisposed()) {
return false;
}
if (component instanceof RadRootContainer) {
myBinding = ((RadRootContainer) component).getClassToBind();
} else {
myBinding = component.getBinding();
}
myTitle = component.getComponentTitle();
return !Comparing.equal(oldBinding, myBinding) || !Comparing.equal(oldTitle, myTitle);
}
use of com.intellij.uiDesigner.radComponents.RadRootContainer in project intellij-community by JetBrains.
the class GridCaptionPanel method getSelectedGridContainer.
@Nullable
private RadContainer getSelectedGridContainer() {
final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(myEditor);
if (selection.size() == 1 && selection.get(0) instanceof RadContainer) {
RadContainer container = (RadContainer) selection.get(0);
if (container.getLayoutManager().isGrid() && (container.getParent() instanceof RadRootContainer || container.getComponentCount() > 0)) {
return container;
}
}
RadContainer container = FormEditingUtil.getSelectionParent(selection);
if (container == null && myEditor.getRootContainer().getComponentCount() > 0) {
final RadComponent topComponent = myEditor.getRootContainer().getComponent(0);
if (topComponent instanceof RadContainer) {
container = (RadContainer) topComponent;
}
}
if (container != null && !container.getLayoutManager().isGrid()) {
return null;
}
return container;
}
use of com.intellij.uiDesigner.radComponents.RadRootContainer in project intellij-community by JetBrains.
the class GroupButtonsAction method groupButtons.
public static void groupButtons(final GuiEditor editor, final List<RadComponent> selectedComponents) {
if (!editor.ensureEditable())
return;
String groupName = Messages.showInputDialog(editor.getProject(), UIDesignerBundle.message("group.buttons.name.prompt"), UIDesignerBundle.message("group.buttons.title"), Messages.getQuestionIcon(), editor.getRootContainer().suggestGroupName(), new IdentifierValidator(editor.getProject()));
if (groupName == null)
return;
RadRootContainer rootContainer = editor.getRootContainer();
RadButtonGroup group = rootContainer.createGroup(groupName);
for (RadComponent component : selectedComponents) {
rootContainer.setGroupForComponent(component, group);
}
editor.refreshAndSave(true);
}
use of com.intellij.uiDesigner.radComponents.RadRootContainer in project intellij-community by JetBrains.
the class UngroupButtonsAction method isSameGroup.
public static boolean isSameGroup(final GuiEditor editor, final ArrayList<RadComponent> selectedComponents) {
final RadRootContainer rootContainer = editor.getRootContainer();
IButtonGroup group = FormEditingUtil.findGroupForComponent(rootContainer, selectedComponents.get(0));
if (group == null) {
return false;
}
for (int i = 1; i < selectedComponents.size(); i++) {
if (FormEditingUtil.findGroupForComponent(rootContainer, selectedComponents.get(i)) != group) {
return false;
}
}
return true;
}
Aggregations