public void generateComponentLayout(final LwComponent lwComponent, final GeneratorAdapter generator, final int componentLocal, final int parentLocal) { generator.loadLocal(parentLocal); generator.loadLocal(componentLocal); if (LwSplitPane.POSITION_LEFT.equals(lwComponent.getCustomLayoutConstraints())) { generator.invokeVirtual(mySplitPaneType, mySetLeftMethod); } else { generator.invokeVirtual(mySplitPaneType, mySetRightMethod); } }
public void generateComponentLayout(final LwComponent component, final FormSourceCodeGenerator generator, final String variable, final String parentVariable) { @NonNls final String methodName = LwSplitPane.POSITION_LEFT.equals(component.getCustomLayoutConstraints()) ? "setLeftComponent" : "setRightComponent"; generator.startMethodCall(parentVariable, methodName); generator.pushVar(variable); generator.endMethod(); }
public void writeChildConstraints(final XmlWriter writer, final RadComponent child) { writer.startElement("splitpane"); try { final String position = (String)child.getCustomLayoutConstraints(); if (!LwSplitPane.POSITION_LEFT.equals(position) && !LwSplitPane.POSITION_RIGHT.equals(position)) { throw new IllegalStateException("invalid position: " + position); } writer.addAttribute("position", position); } finally { writer.endElement(); } }
public void addComponentToContainer(final RadContainer container, final RadComponent component, final int index) { final JSplitPane splitPane = (JSplitPane) container.getDelegee(); final JComponent delegee = component.getDelegee(); if (LwSplitPane.POSITION_LEFT.equals(component.getCustomLayoutConstraints())) { splitPane.setLeftComponent(delegee); } else if (LwSplitPane.POSITION_RIGHT.equals(component.getCustomLayoutConstraints())) { splitPane.setRightComponent(delegee); } else { throw new IllegalStateException("invalid layout constraints on component added to RadSplitPane"); } }
public void processDrop(GuiEditor editor, RadComponent[] components, GridConstraints[] constraintsToAdjust, ComponentDragObject dragObject) { components[0].setCustomLayoutConstraints(myLeft ? LwSplitPane.POSITION_LEFT : LwSplitPane.POSITION_RIGHT); addComponent(components[0]); }
@Override protected void importSnapshotComponent(final SnapshotContext context, final JComponent component) { JSplitPane splitPane = (JSplitPane) component; importSideComponent(splitPane.getLeftComponent(), context, LwSplitPane.POSITION_LEFT); importSideComponent(splitPane.getRightComponent(), context, LwSplitPane.POSITION_RIGHT); }