/** * Adds a component to the container with the given constraint at * the given index. * * @param c the component to add * @param index the index of the component */ public void add(SComponent c, Object constraint, int index) { addComponent(c, constraint, index); }
/** * Adds the component to the content pane of the root container. */ @Override public SComponent addComponent(SComponent c, Object constraint, int index) { return contentPane.addComponent(c, constraint, index); }
/** * Adds a component to the container with null constraint at the given * index. * * @param c the component to add * @param index the index of the component * @return the added component */ public SComponent add(SComponent c, int index) { return addComponent(c, null, index); }
/** * Adds a component to the container with the given constraint at * the given index. * * @param c the component to add * @param index the index of the component * @return the added component */ public SComponent addComponent(SComponent c, int index) { return addComponent(c, null, index); }
/** * Adds a component to the container with null constraint at the end * of the internal list. * * @param c the component to add * @return the added component */ public SComponent add(SComponent c) { return addComponent(c, null); }
/** * Adds a component to the container with the given constraint at the end * of the internal list. * * @param c the component to add * @param constraint the constraint for this component */ public void add(SComponent c, Object constraint) { addComponent(c, constraint); }
/** * Adds a component to the container with null constraint at the end * of the internal list. * * @param c the component to add * @return the added component */ public SComponent addComponent(SComponent c) { return addComponent(c, null); }
protected SComponent addMe(SComponent c, Object constraint, int index) { return super.addComponent(c, constraint, index); }
@Override public SComponent addComponent(SComponent c, Object constraint, int index) { if (c instanceof SForm) log.warn("WARNING: attempt to nest forms; won't work."); return super.addComponent(c, constraint, index); }
/** * Only {@link Scrollable scrollables} are allowed here! */ @Override public SComponent addComponent(SComponent c, Object constraint, int index) { if (c instanceof Scrollable || constraint == SScrollPaneLayout.VIEWPORT) { super.addComponent(c, SScrollPaneLayout.VIEWPORT, index); setScrollable(c); } else { super.addComponent(c, constraint, index); } return c; }
/** * Adds a component to the container with the given constraint at the end * of the internal list. * * @param c the component to add * @param constraint the constraint for this component * @return the added component */ public SComponent addComponent(SComponent c, Object constraint) { return addComponent(c, constraint, getComponentList().size()); }
/** * If the specified component is already a child of this then we don't * bother doing anything - stacking order doesn't matter for cell * renderer components (CellRendererPane doesn't paint anyway). */ @Override public SComponent addComponent(SComponent c, Object constraints, int index) { if (c.getParent() == this) { return null; } else { return super.addComponent(c, constraints, index); } }
/** * Sets the container for the contentPane. * * @param container the container for the contentPane. */ public void setContentPane(SContainer container) { SContainer oldVal = this.contentPane; if (this.contentPane != null) { super.remove(contentPane); } this.contentPane = container; super.addComponent(this.contentPane, null, 0); propertyChangeSupport.firePropertyChange("contentPane", oldVal, this.contentPane); }
/** * Sets the container for the windowsPane. ! This is not like in swing. Each window object is bound to its frame or internal frame. * * @param windowsPane The container for the windowsPane. */ protected void setWindowsPane(SContainer windowsPane) { SContainer oldVal = this.windowsPane; if (this.windowsPane != null) { super.remove(this.windowsPane); } this.windowsPane = windowsPane; super.addComponent(this.windowsPane, null, 1); propertyChangeSupport.firePropertyChange("windowsPane", oldVal, this.windowsPane); }
/** * @param component The internal frame to be added. * @param constraints nothing */ @Override public SComponent addComponent(SComponent component, Object constraints, int index) { if (constraints == null) constraints = component.getName(); ((SInternalFrame)component).addInternalFrameListener(listener); return super.addComponent(component, constraints, index); }
/** * Creates an empty TabbedPane with the specified tab placement * of either: TOP, BOTTOM, LEFT, or RIGHT. * * @param tabPlacement the placement for the tabs relative to the content * @see #addTab */ public STabbedPane(int tabPlacement) { setTabPlacement(tabPlacement); super.addComponent(contents, null, 0); setModel(new DefaultSingleSelectionModel()); }
/** * Sets the component at <i>index</i> to <i>component</i>. * An internal exception is raised if there is no tab at that index. * * @param index the tab index where this component is being placed * @param component the component for the tab * @see #getComponent(int) */ public void setComponent(int index, SComponent component) { Page page = (Page) pages.get(index); SComponent oldVal = page.component; if (component != page.component) { if (page.component != null) { contents.remove(page.component); } page.component = component; contents.addComponent(page.component, page.component.getName()); if (getSelectedIndex() == index) card.show(component); reload(); propertyChangeSupport.firePropertyChange("component", oldVal, page.component); } }
/** * CAVEAT this did not work yet... We need to clone the layout manager as * well, so SLayoutManager must be Cloneable */ @Override public Object clone() { try { SContainer erg = (SContainer) super.clone(); // uiuiui, layout manager must be cloned as well,... // componentList and constraintList contain references to the // original components / constraints erg.getComponentList().clear(); erg.getConstraintList().clear(); for (int i = 0; i < getComponentCount(); i++) { erg.addComponent((SComponent) getComponent(i).clone()); } return erg; } catch (Exception e) { log.error("Unable to clone container", e); return null; } }
/** * Push a new window on top of the stack. * * @param window the SDialog that is to be shown on top. */ public void pushWindow(SWindow window) { getSession().getReloadManager().setSuppressMode(true); windowsPane.addComponent(window); getSession().getReloadManager().setSuppressMode(false); if (isUpdatePossible() && SRootContainer.class.isAssignableFrom(getClass())) { update(((RootContainerCG) getCG()).getAddWindowUpdate(windowsPane, window)); } else { windowsPane.reload(); } LOG.debug("push window = " + window.getName()); }
super.addComponent((SComponent) horizontalScrollBar, constraint, getComponentCount());