@Override public void add(SComponent c, Object constraint) { getContentPane().add(c, constraint); }
contents.add(imageLabel, SBorderLayout.WEST); contents.add(optionData, SBorderLayout.CENTER); optionButtons.add(optionNo, "NO"); optionButtons.add(optionCancel, "CANCEL"); optionButtons.add(optionYes, "YES"); optionButtons.add(optionOK, "OK"); optionButtons.setPreferredSize(SDimension.FULLWIDTH); optionButtons.setStyle("SOptionPaneButtons");
/** * Appends the specified menu to the end of the menu bar. * * @param menu the SMenu component to add */ public SMenuItem add(SMenu menu) { getSession().getMenuManager().registerMenuLink(menu, this); super.add(menu); return menu; }
/** * Sets the component at <i>index</i> to <i>component</i> which must not be null. * An internal exception is raised if there is no tab at that index. * * @param index the tab index where the title should be set * @param component the component for the tab * @see #getComponentAt */ public void setComponentAt(int index, SComponent component) { contents.remove(index); SComponent oldVal = ((Page) pages.get(index)).component; ((Page) pages.get(index)).component = component; contents.add(component, component.getName(), index); component.setVisible(getSelectedIndex() == index); reload(); propertyChangeSupport.firePropertyChange("componentAt", oldVal, ((Page) pages.get(index)).component); }
public void showInput(SComponent parent, Object message, SComponent inputElement, String title) { showOption(parent, title, message); optionData.add(inputElement); inputValue = inputElement; setOptionType(SOptionPane.OK_CANCEL_OPTION); setMessageType(SOptionPane.QUESTION_MESSAGE); }
public void showOption(SComponent c, String title, Object message) { if (title != null) setTitle(title); optionData.removeAll(); if (message instanceof SComponent) { optionData.add((SComponent) message); } else if (message != null) { StringTokenizer stringTokenizer = new StringTokenizer(message.toString(), "\n"); while (stringTokenizer.hasMoreElements()) { SLabel label = new SLabel(stringTokenizer.nextElement().toString()); if (SOptionPane.defaultSize != null && SOptionPane.defaultSize.getWidthInt() != SDimension.AUTO_INT) { label.setWordWrap(true); } optionData.add(label); } } setOwner(c); show(); }
public void addComponent(String name, SComponent component) throws ServletException { SFrame frame = getFrame(this); frame.getContentPane().add(component, name); setProperty(name, component); }
/** * {@inheritDoc} */ @Override protected void addCard(IMapView<SComponent> cardView, IView<SComponent> card, String cardName) { ((SContainer) cardView.getPeer()).add(card.getPeer(), cardName); cardView.addToChildrenMap(cardName, card); }
private void updateControllerFrame() { controllerFrame.getContentPane().add(createApplicationMenuBar(), SBorderLayout.NORTH); updateFrameTitle(); }
public void setOptions(Object... options) { resetOptions(); Object[] oldVal = this.options; if (customButtons == null) customButtons = new SPanel(); for (Object option : options) { if (option instanceof SComponent) { if (option instanceof SAbstractButton) ((SAbstractButton) option).addActionListener(this); customButtons.add((SComponent) option); } else { SButton b = new SButton(option.toString()); b.addActionListener(this); customButtons.add(b); } } add(customButtons); propertyChangeSupport.firePropertyChange("options", oldVal, this.options); }
private static void rebuildPanel(SContainer oldPanel, SContainer newPanel) { SLayoutManager layoutManager = oldPanel.getLayout(); SComponent[] components = oldPanel.getComponents(); ArrayList constraints = oldPanel.getConstraintList(); oldPanel.removeAll(); oldPanel.setLayout(null); newPanel.setLayout(layoutManager); for (int i = 0; i < components.length; i++) { SComponent component = components[i]; Object constraint = constraints.get(i); newPanel.add(component, constraint); } }
private SFrame createControllerFrame() { SFrame frame = new SFrame(); frame .setPreferredSize(new SDimension(frameWidth, frameHeight/* WingsUtil.FULL_DIM_PERCENT */)); cardPanel = new SPanel(new SCardLayout()); cardPanel.setPreferredSize(SDimension.FULLAREA); frame.getContentPane().add(createApplicationMenuBar(), SBorderLayout.NORTH); frame.getContentPane().add(cardPanel, SBorderLayout.CENTER); frame.getContentPane().setPreferredSize(SDimension.FULLAREA); return frame; }
static void addCompForBorder(SBorder border, String description, SContainer container) { SPanel comp = new SPanel(new SGridLayout(1, 1)); SLabel label = new SLabel(description, SConstants.CENTER); comp.add(label); comp.setBorder(border); // container.add(Box.createRigidArea(new Dimension(0, 10))); container.add(comp); }
private void createControllerFrame() { controllerFrame = new SFrame(); String w = "95%"; String h = "768px"; if (getFrameWidth() != null) { w = getFrameWidth().intValue() + "px"; } if (getFrameHeight() != null) { h = getFrameHeight().intValue() + "px"; } controllerFrame.setPreferredSize(new SDimension(w, h)); controllerFrame.getContentPane().setPreferredSize(SDimension.FULLAREA); cardPanel = new SPanel(new SCardLayout()); cardPanel.setPreferredSize(SDimension.FULLAREA); controllerFrame.getContentPane().add(cardPanel, SBorderLayout.CENTER); statusBar = new SLabel(); statusBar.setBorder(new SLineBorder(1)); statusBar.setVisible(false); controllerFrame.getContentPane().add(statusBar, BorderLayout.SOUTH); updateFrameTitle(); controllerFrame.setVisible(true); }