@Override public void installCG(SComponent component) { super.installCG(component); component.setPreferredSize(SDimension.FULLWIDTH); }
private void adjustSizes(SComponent component, IFormatter formatter, Object templateValue, int extraWidth) { int preferredWidth = computePixelWidth(component, getFormatLength( formatter, templateValue)) + extraWidth; SDimension size = new SDimension(preferredWidth + "px", null); component.setPreferredSize(size); }
/** * Sets the preferred size of the given component. In case the component's current * dimension is unmodifiable (e.g. FULLAREA, FULLWIDTH, ...) a new dimension object * with the desired initial values is created and set for the component. * * @param component the component which needs to be changed in size * @param width the new width for the given component * @param height the new height for the given component */ public static void setPreferredSize(SComponent component, int width, int height) { try { component.getPreferredSize().setSize(width, height); } catch(UnsupportedOperationException e) { component.setPreferredSize(new SDimension(width, height)); } }
/** * Sets the preferred size of the given component. In case the component's current * dimension is unmodifiable (e.g. FULLAREA, FULLWIDTH, ...) a new dimension object * with the desired initial values is created and set for the component. * * @param component the component which needs to be changed in size * @param width the new width for the given component * @param height the new height for the given component */ public static void setPreferredSize(SComponent component, String width, String height) { try { component.getPreferredSize().setSize(width, height); } catch(UnsupportedOperationException e) { component.setPreferredSize(new SDimension(width, height)); } }
/** * {@inheritDoc} */ @Override protected void applyPreferredSize(SComponent component, org.jspresso.framework.util.gui.Dimension preferredSize) { if (preferredSize != null) { Integer pW = null; Integer pH = null; if (preferredSize.getWidth() > 0) { pW = new Integer(preferredSize.getWidth()); } if (preferredSize.getHeight() > 0) { pH = new Integer(preferredSize.getHeight()); } component.setPreferredSize(new SDimension(pW, pH)); } }
/** * {@inheritDoc} */ @Override protected void adjustSizes(IViewDescriptor viewDescriptor, SComponent component, IFormatter formatter, Object templateValue, int extraWidth) { if (viewDescriptor.getFont() != null) { // must set font before computing size. component.setFont(createFont(viewDescriptor.getFont(), component.getFont())); } int preferredWidth = computePixelWidth(component, getFormatLength(formatter, templateValue)) + extraWidth; SDimension size = new SDimension(preferredWidth + "px", null); component.setPreferredSize(size); }
workspaceName, workspaceNavigatorViewDescriptor); IView<SComponent> moduleAreaView = createModuleAreaView(workspaceName); moduleAreaView.getPeer().setPreferredSize(SDimension.FULLAREA);
mainView.setPreferredSize(new SDimension(dimension.getWidth() + "px", dimension.getHeight() + "px")); } else { mainView.setPreferredSize(DIALOG_DIMENSION);
IView<SComponent> view = getViewFactory(context).createView( wizardStep.getViewDescriptor(), actionHandler, getLocale(context)); view.getPeer().setPreferredSize(WIZARD_DIMENSION); cardPanel.add(view.getPeer(), cardName); getMvcBinder(context).bind(view.getConnector(), modelConnector);