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); }
/** * Constructs a new <code>SActionField</code> instance. * * @param showTextField * is the text field visible to the user. */ public SActionField(boolean showTextField) { super(new SGridBagLayout()); textField = new STextField(); if (showTextField) { add(textField, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets( 0, 0, 0, 0), 0, 0)); textField.setPreferredSize(SDimension.FULLWIDTH); } this.showTextField = showTextField; buttonPanel = new SPanel(); buttonPanel.setLayout(new SBoxLayout(buttonPanel, SBoxLayout.X_AXIS)); int buttonPosition; if (showTextField) { buttonPosition = 1; } else { buttonPosition = 0; } add(buttonPanel, new GridBagConstraints(buttonPosition, 0, 1, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0)); }
/** * {@inheritDoc} */ @Override protected void setSelectedWorkspaceName(String workspaceName) { super.setSelectedWorkspaceName(workspaceName); ((SCardLayout) cardPanel.getLayout()).show(workspaceName); updateFrameTitle(); }
/** * Creates a panel. * * @param layout * the layout to apply to the panel. * @return the created panel. */ protected SPanel createSPanel(SLayoutManager layout) { SPanel panel = new SPanel(layout); panel.setPreferredSize(SDimension.FULLAREA); panel.setHorizontalAlignment(SConstants.LEFT_ALIGN); panel.setVerticalAlignment(SConstants.TOP_ALIGN); return panel; }
@Override public void executeTag(ParseContext context, Reader input) throws Exception { IntegrationTemplateParseContext tcontext = (IntegrationTemplateParseContext) context; Device sink = tcontext.getDevice(); /* * get the component that is associated with this name. This has * been set as Layout Manager Constraint. */ SComponent[] components = tcontext.getComponents(); StringBuilder sb = new StringBuilder(); for (long i = getTagLength(); i > 0; i--) { sb.append((char) input.read()); } SPanel container = new SPanel(new SFlowDownLayout()); for (SComponent c : components) { XDivision division = new XDivision(); division.add(c); container.add(division); } container.write(sink); }
SPanel buttonBox = new SPanel(); buttonBox.setLayout(new SBoxLayout(dialog, SBoxLayout.X_AXIS)); buttonBox.setBorder(new SEmptyBorder(new java.awt.Insets(5, 10, 5, 10))); actionButton.setAction(action); actionButton.setDisabledIcon(actionButton.getIcon()); buttonBox.add(actionButton); buttonBox.add(new SSpacer(10, 10)); if (defaultButton == null) { defaultButton = actionButton; SPanel actionPanel = new SPanel(new SBorderLayout()); actionPanel.add(buttonBox, SBorderLayout.EAST); SPanel mainPanel = new SPanel(new SBorderLayout()); if (dimension != null) { mainView.setPreferredSize(new SDimension(dimension.getWidth() + "px", mainView.setPreferredSize(DIALOG_DIMENSION); mainPanel.add(mainView, SBorderLayout.CENTER); mainPanel.add(actionPanel, SBorderLayout.SOUTH); dialog.add(mainPanel); if (defaultButton != null) {
/** * {@inheritDoc} */ @Override protected SComponent decorateWithPaginationView(SComponent viewPeer, SComponent paginationViewPeer) { SPanel decorator = createSPanel(new SBorderLayout()); decorator.add(viewPeer, SBorderLayout.CENTER); decorator.add(paginationViewPeer, SBorderLayout.SOUTH); return decorator; }
dialog.setDraggable(true); SPanel buttonBox = new SPanel(new SBoxLayout(dialog, SBoxLayout.X_AXIS)); buttonBox.setBorder(new SEmptyBorder(new java.awt.Insets(5, 10, 5, 10))); actionButton.setAction(getActionFactory(context).createAction(action, actionHandler, mainView, getLocale(context))); buttonBox.add(actionButton); buttonBox.add(new SSpacer(10, 10)); if (defaultButton == null) { defaultButton = actionButton; SPanel actionPanel = new SPanel(new SBorderLayout()); actionPanel.add(buttonBox, SBorderLayout.EAST); SPanel mainPanel = new SPanel(new SBorderLayout()); mainPanel.add(mainView.getPeer(), SBorderLayout.CENTER); mainPanel.add(actionPanel, SBorderLayout.SOUTH); mainPanel.setPreferredSize(DIALOG_DIMENSION); dialog.add(mainPanel); if (defaultButton != null) {
SPanel actionPanel = new SPanel(); actionPanel.setLayout(new SBoxLayout(actionPanel, SBoxLayout.X_AXIS)); actionPanel.add(okButton); actionPanel.add(cancelButton); actionPanel.add(restoreButton); SPanel mainPanel = new SPanel(new SBorderLayout()); mainPanel.add(colorPicker, SBorderLayout.CENTER); mainPanel.add(actionPanel, SBorderLayout.SOUTH);
SPanel workspaceView = new SPanel(new SGridBagLayout()); workspaceView.setPreferredSize(SDimension.FULLAREA); workspaceNavigator.getPeer().setVerticalAlignment(SConstants.TOP_ALIGN); double weightx = 0.0d; workspaceView.add(workspaceNavigator.getPeer(), new GridBagConstraints( 0, 0, 1, 1, weightx, 1.0d, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, insets, 0, 0)); int gridx = 1; int gridy = 0; workspaceView.add(moduleAreaView.getPeer(), new GridBagConstraints(gridx, gridy, GridBagConstraints.REMAINDER, GridBagConstraints.REMAINDER, 1.0d, 1.0d, cardPanel.add(workspaceView, workspaceName); getMvcBinder().bind(workspaceNavigator.getConnector(), workspaceConnector); ((SCardLayout) cardPanel.getLayout()).show(workspaceName); updateFrameTitle();
SPanel pane = new SPanel(new SGridBagLayout()); gbc.insets = new Insets(22, 12, 11, 17); iconLabel = new SLabel(); pane.add(iconLabel, gbc); gbc.weighty = 0.00001; gbc.insets = new Insets(24, 0, 0, 11); pane.add(messagePane, gbc); SButton okButton = new SButton(translationProvider.getTranslation("ok", locale)); pane.add(okButton, gbc); gbc.weightx = 0.0; gbc.insets = new Insets(12, 0, 11, 11); pane.add(detailsButton, gbc); detailsScrollPane.setMode(SScrollPane.MODE_COMPLETE); detailsScrollPane.setPreferredSize(new SDimension(10, 250)); detailsPanel = new SPanel(new SGridBagLayout()); detailsPanel.add(detailsScrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 11, 11, 11), 0, 0)); gbc.gridy = 2; gbc.weighty = 1.0; pane.add(detailsPanel, gbc);
titleLabel.setHorizontalAlignment(SConstants.LEFT_ALIGN); titleLabel.setBorder(new SEmptyBorder(new Insets(2, 2, 6, 2))); titledPanel.add(titleLabel, SBorderLayout.NORTH); titledPanel.add(view.getPeer(), SBorderLayout.CENTER); titledPanel.setBorder(new SLineBorder(Color.LIGHT_GRAY, 2, new Insets(0, 0, 2, 2))); view.setPeer(titledPanel);
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; }
protected void initializeContentPane() { setContentPane(new SPanel(new SBorderLayout())); }
private IMapView<SComponent> createCardView( ICardViewDescriptor viewDescriptor, IActionHandler actionHandler, Locale locale) { SCardLayout layout = new SCardLayout(); SPanel viewComponent = createSPanel(layout); BasicMapView<SComponent> view = constructMapView(viewComponent, viewDescriptor); Map<String, IView<SComponent>> childrenViews = new HashMap<String, IView<SComponent>>(); viewComponent.add(createSPanel(new SBorderLayout()), ICardViewDescriptor.DEFAULT_CARD); viewComponent.add(createSecurityPanel(), ICardViewDescriptor.SECURITY_CARD); for (Map.Entry<String, IViewDescriptor> childViewDescriptor : viewDescriptor .getCardViewDescriptors().entrySet()) { IView<SComponent> childView = createView(childViewDescriptor.getValue(), actionHandler, locale); viewComponent.add(childView.getPeer(), childViewDescriptor.getKey()); childrenViews.put(childViewDescriptor.getKey(), childView); } viewComponent.setPreferredSize(SDimension.FULLAREA); view.setChildren(childrenViews); view.setConnector(createCardViewConnector(view, actionHandler)); return view; }
/** * Sets the action field action. * * @param actions * the action field actions. */ public void setActions(List<Action> actions) { if (!ObjectUtils.equals(this.actions, actions)) { buttonPanel.removeAll(); this.actions = actions; for (Action action : actions) { SButton actionButton = new SButton(); actionButton.setAction(action); actionButton.setDisabledIcon(actionButton.getIcon()); actionButton.setActionCommand("*"); actionButton.setText(null); actionButton.setShowAsFormComponent(false); actionButton.setBorder(SBorderFactory.createSLineBorder(Color.GRAY)); if (showTextField) { if (defaultAction == null) { defaultAction = action; textField.addActionListener(action); } } buttonPanel.add(actionButton); } } }
/** * Decorates the component with a marker. * * @param decorated * if the component should be decorated. */ public void setDecorated(boolean decorated) { if (decorated) { SBevelBorder border = new SBevelBorder(SBevelBorder.RAISED); border.setColor(Color.red); buttonPanel.setBorder(border); } else { buttonPanel.setBorder(null); } }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); ftf.setEnabled(enabled); }
dialog.setLayout(new SBorderLayout()); final SPanel cardPanel = new SPanel(); cardPanel.setBorder(new SEmptyBorder(new Insets(5, 10, 5, 10))); cardPanel.setLayout(cardLayout); SPanel buttonPanel = new SPanel(); SPanel buttonBox = new SPanel( new SBoxLayout(buttonPanel, SBoxLayout.X_AXIS)); buttonPanel.setLayout(new SBorderLayout()); buttonPanel.add(new SSeparator(), SBorderLayout.NORTH); buttonBox.setBorder(new SEmptyBorder(new Insets(5, 10, 5, 10))); buttonBox.add(backButton); buttonBox.add(new SSpacer(10, 10)); buttonBox.add(nextButton); buttonBox.add(new SSpacer(10, 10)); buttonBox.add(finishButton); buttonBox.add(new SSpacer(10, 10)); buttonBox.add(cancelButton); buttonPanel.add(buttonBox, SBorderLayout.EAST);