use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class MoveComponentAction method actionPerformed.
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
if (myColumnDelta != 0) {
// sort the selection so that move in indexed layout will handle components in correct order
Collections.sort(selection, (o1, o2) -> {
int index1 = o1.getParent().indexOfComponent(o1);
int index2 = o2.getParent().indexOfComponent(o2);
return (index2 - index1) * myColumnDelta;
});
}
for (RadComponent c : selection) {
c.getParent().getLayoutManager().moveComponent(c, myRowDelta, myColumnDelta, myRowSpanDelta, myColSpanDelta);
}
}
use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class ResetValueAction method doResetValue.
public static void doResetValue(final List<RadComponent> selection, final Property property, final GuiEditor editor) {
try {
if (!editor.ensureEditable())
return;
final PropertyInspector propertyInspector = DesignerToolWindowManager.getInstance(editor).getPropertyInspector();
if (propertyInspector.isEditing()) {
propertyInspector.stopEditing();
}
//noinspection unchecked
for (RadComponent component : selection) {
//noinspection unchecked
if (property.isModified(component)) {
//noinspection unchecked
property.resetValue(component);
component.getDelegee().invalidate();
}
}
editor.refreshAndSave(false);
propertyInspector.repaint();
} catch (Exception e1) {
LOG.error(e1);
}
}
use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class StartInplaceEditingAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(myEditor);
final RadComponent component = selection.get(0);
final Property defaultInplaceProperty = component.getDefaultInplaceProperty();
myEditor.getInplaceEditingLayer().startInplaceEditing(component, defaultInplaceProperty, component.getDefaultInplaceEditorBounds(), new InplaceContext(true));
}
use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class StartInplaceEditingAction method update.
public void update(final AnActionEvent e) {
final Presentation presentation = e.getPresentation();
final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(myEditor);
// Inplace editing can be started only if single component is selected
if (selection.size() != 1) {
presentation.setEnabled(false);
return;
}
// Selected component should have "inplace" property
final RadComponent component = selection.get(0);
presentation.setEnabled(component.getDefaultInplaceProperty() != null);
}
use of com.intellij.uiDesigner.radComponents.RadComponent in project intellij-community by JetBrains.
the class SurroundPopupAction method actionPerformed.
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
final ListPopup groupPopup = JBPopupFactory.getInstance().createActionGroupPopup(UIDesignerBundle.message("surround.with.popup.title"), myActionGroup, e.getDataContext(), JBPopupFactory.ActionSelectionAid.ALPHA_NUMBERING, true);
final JComponent component = (JComponent) e.getData(PlatformDataKeys.CONTEXT_COMPONENT);
if (component instanceof ComponentTree) {
groupPopup.show(JBPopupFactory.getInstance().guessBestPopupLocation(component));
} else {
RadComponent selComponent = selection.get(0);
FormEditingUtil.showPopupUnderComponent(groupPopup, selComponent);
}
}
Aggregations