public final class FormEditingUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
FormEditingUtil.ComponentVisitor<Type extends IComponent> |
static interface |
FormEditingUtil.StringDescriptorVisitor<T extends IComponent> |
Modifier and Type | Field and Description |
---|---|
static int |
EMPTY_COMPONENT_SIZE |
Modifier and Type | Method and Description |
---|---|
static int |
adjustForGap(RadContainer container,
int cellIndex,
boolean isRow,
int delta) |
static java.lang.String |
buildResourceName(PsiFile file) |
static boolean |
canDeleteSelection(GuiEditor editor) |
static void |
clearSelection(RadContainer container) |
static java.util.Set<java.lang.String> |
collectUsedBundleNames(IRootContainer rootContainer) |
static java.util.Locale[] |
collectUsedLocales(Module module,
IRootContainer rootContainer) |
static void |
deleteComponents(java.util.Collection<? extends RadComponent> selection,
boolean deleteEmptyCells) |
static void |
deleteEmptyGridCells(RadContainer parent,
GridConstraints delConstraints) |
static void |
deleteRowOrColumn(GuiEditor editor,
RadContainer container,
int[] cellsToDelete,
boolean isRow) |
static void |
deleteSelection(GuiEditor editor)
This method must be executed in command
|
static PsiClass |
findClassToBind(Module module,
java.lang.String classToBindName) |
static IComponent |
findComponent(IComponent component,
java.lang.String id)
Finds component with the specified
id starting from the
container . |
static IComponent |
findComponentWithBinding(IComponent component,
java.lang.String binding) |
static IComponent |
findComponentWithBinding(IComponent component,
java.lang.String binding,
IComponent exceptComponent) |
static PsiMethod |
findCreateComponentsMethod(PsiClass aClass) |
static IButtonGroup |
findGroupForComponent(IRootContainer radRootContainer,
IComponent component) |
static java.lang.String |
generateId(RadRootContainer rootContainer) |
static GuiEditor |
getActiveEditor(DataContext context) |
static java.util.ArrayList<RadComponent> |
getAllSelectedComponents(GuiEditor editor) |
static java.awt.Cursor |
getCopyDropCursor() |
static GridConstraints |
getDefaultConstraints(RadComponent component) |
static RadComponent |
getDraggerHost(GuiEditor editor) |
static GuiEditor |
getEditorFromContext(DataContext context) |
static java.lang.String |
getExceptionMessage(java.lang.Throwable ex) |
static java.awt.Cursor |
getMoveDropCursor() |
static java.awt.Cursor |
getMoveNoDropCursor() |
static java.lang.Object |
getNextSaveUndoGroupId(Project project) |
static RadComponent |
getRadComponentAt(RadRootContainer rootContainer,
int x,
int y) |
static RadContainer |
getRadContainerAt(RadRootContainer rootContainer,
int x,
int y,
int epsilon) |
static IRootContainer |
getRoot(IComponent component) |
static java.util.ArrayList<RadComponent> |
getSelectedComponents(GuiEditor editor) |
static java.awt.Rectangle |
getSelectionBounds(java.util.List<? extends RadComponent> selection) |
static RadContainer |
getSelectionParent(java.util.List<? extends RadComponent> selection) |
static boolean |
isBindingUnique(IComponent componentToAssignBinding,
java.lang.String binding,
IComponent component) |
static boolean |
isComponentSwitchedInView(RadComponent component) |
static boolean |
isDropOnChild(DraggedComponentList draggedComponentList,
ComponentDropLocation location) |
static void |
iterate(IComponent component,
FormEditingUtil.ComponentVisitor visitor)
Iterates component and its children (if any)
|
static void |
iterateStringDescriptors(IComponent component,
FormEditingUtil.StringDescriptorVisitor<? super IComponent> visitor) |
static int |
nextCol(RadContainer container,
int col) |
static int |
nextRow(RadContainer container,
int row) |
static int |
prevCol(RadContainer container,
int col) |
static int |
prevRow(RadContainer container,
int row) |
static java.util.List<RadComponent> |
remapToActionTargets(java.util.List<? extends RadComponent> selection) |
static boolean |
selectComponent(GuiEditor editor,
RadComponent component)
Selects the component and ensures that the tabbed panes containing the component are
switched to the correct tab.
|
static void |
selectComponents(GuiEditor editor,
java.util.List<? extends RadComponent> components) |
static void |
selectSingleComponent(GuiEditor editor,
RadComponent component) |
static void |
showPopupUnderComponent(JBPopup popup,
RadComponent selectedComponent) |
public static final int EMPTY_COMPONENT_SIZE
public static boolean canDeleteSelection(GuiEditor editor)
public static void deleteSelection(GuiEditor editor)
editor
- the editor in which the selection is deleted.public static void deleteComponents(java.util.Collection<? extends RadComponent> selection, boolean deleteEmptyCells)
public static void deleteEmptyGridCells(RadContainer parent, GridConstraints delConstraints)
public static RadComponent getRadComponentAt(RadRootContainer rootContainer, int x, int y)
x
- in editor pane coordinatesy
- in editor pane coordinatespublic static RadComponent getDraggerHost(GuiEditor editor)
public static java.awt.Cursor getMoveDropCursor()
public static java.awt.Cursor getMoveNoDropCursor()
public static java.awt.Cursor getCopyDropCursor()
public static java.util.ArrayList<RadComponent> getSelectedComponents(GuiEditor editor)
public static java.util.ArrayList<RadComponent> getAllSelectedComponents(GuiEditor editor)
editor
public static java.lang.String getExceptionMessage(java.lang.Throwable ex)
public static IComponent findComponentWithBinding(IComponent component, java.lang.String binding)
public static IComponent findComponentWithBinding(IComponent component, java.lang.String binding, IComponent exceptComponent)
public static RadContainer getRadContainerAt(RadRootContainer rootContainer, int x, int y, int epsilon)
public static GridConstraints getDefaultConstraints(RadComponent component)
public static IRootContainer getRoot(IComponent component)
public static void iterate(IComponent component, FormEditingUtil.ComponentVisitor visitor)
public static java.util.Set<java.lang.String> collectUsedBundleNames(IRootContainer rootContainer)
public static java.util.Locale[] collectUsedLocales(Module module, IRootContainer rootContainer)
public static void deleteRowOrColumn(GuiEditor editor, RadContainer container, int[] cellsToDelete, boolean isRow)
public static java.lang.String generateId(RadRootContainer rootContainer)
rootContainer
- public static GuiEditor getEditorFromContext(DataContext context)
GuiEditor
from the context. Can be null
.public static GuiEditor getActiveEditor(DataContext context)
public static boolean isBindingUnique(IComponent componentToAssignBinding, java.lang.String binding, IComponent component)
componentToAssignBinding
- binding
- component
- topmost container where to find duplicate binding. In most cases
it should be GuiEditor.getRootContainer()
public static java.lang.String buildResourceName(PsiFile file)
public static RadContainer getSelectionParent(java.util.List<? extends RadComponent> selection)
public static java.awt.Rectangle getSelectionBounds(java.util.List<? extends RadComponent> selection)
public static boolean isComponentSwitchedInView(RadComponent component)
public static boolean selectComponent(GuiEditor editor, RadComponent component)
editor
- component
- the component to select. @return true if the component is enclosed in at least one tabbed pane, false otherwise.public static void selectSingleComponent(GuiEditor editor, RadComponent component)
public static void selectComponents(GuiEditor editor, java.util.List<? extends RadComponent> components)
public static boolean isDropOnChild(DraggedComponentList draggedComponentList, ComponentDropLocation location)
public static java.lang.Object getNextSaveUndoGroupId(Project project)
public static int adjustForGap(RadContainer container, int cellIndex, boolean isRow, int delta)
public static int prevRow(RadContainer container, int row)
public static int nextRow(RadContainer container, int row)
public static int prevCol(RadContainer container, int col)
public static int nextCol(RadContainer container, int col)
public static IButtonGroup findGroupForComponent(IRootContainer radRootContainer, IComponent component)
public static java.util.List<RadComponent> remapToActionTargets(java.util.List<? extends RadComponent> selection)
public static void showPopupUnderComponent(JBPopup popup, RadComponent selectedComponent)
public static void iterateStringDescriptors(IComponent component, FormEditingUtil.StringDescriptorVisitor<? super IComponent> visitor)
public static void clearSelection(RadContainer container)
public static IComponent findComponent(IComponent component, java.lang.String id)
id
starting from the
container
. The method goes recursively through the hierarchy
of components. Note, that if container
itself has id
then the method immediately retuns it.