List of usage examples for com.jgoodies.forms.builder DefaultFormBuilder appendSeparator
public JComponent appendSeparator(String text)
From source file:clinicamedica.ClinicaMedica.java
private void createPanel() { FormLayout layout = new FormLayout("right:max(30dlu;p), 4dlu, 80dlu, 7dlu, " // 1st major column + "right:max(30dlu;p), 4dlu, 80dlu", // 2nd major column ""); // add rows dynamically DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();/*from w ww . j a va 2 s . c o m*/ builder.appendSeparator("Paciente"); builder.append("Cdigo", idField); builder.nextLine(); builder.append("CPF", cpfField); builder.nextLine(); builder.append("Nome", nomeField, 5); builder.nextLine(); builder.append("Endereo", enderecoField, 5); builder.nextLine(); builder.append("Dt Nasc", dataNascimentoField); builder.append("Idade", idadeField); builder.nextLine(); builder.append("Telefone", telefoneField); builder.nextLine(); //builder.append(new JButton("Incluir")); ButtonBarBuilder bar = new ButtonBarBuilder().addButton(incluirButton).addRelatedGap() .addButton(cancelarButton); builder.append(bar.build()); createIncluirActionListener(); JFrame frame = new JFrame(); frame.add(builder.build()); frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); }
From source file:com.lyndir.lhunath.opal.gui.template.shade.AbstractUi.java
License:Apache License
private JComponent getSettingsPane() { FormLayout layout = new FormLayout( "20dlu:g(3), r:p, 5dlu, f:100dlu:g(2), 10dlu, r:p, 5dlu, f:100dlu:g(2), 5dlu, l:20dlu:g(4)"); //$NON-NLS-1$ DefaultFormBuilder builder = new DefaultFormBuilder(layout, new ScrollPanel()); builder.setBorder(Borders.DLU4_BORDER); builder.setLeadingColumnOffset(1);/*from w w w .j a v a 2 s. c o m*/ builder.appendSeparator(Locale.explain("ui.appearance")); //$NON-NLS-1$ builder.append(Locale.explain("ui.theme"), new ToolTip(Locale.explain("ui.themeTitle") //$NON-NLS-1$ //$NON-NLS-2$ + Locale.explain("ui.themeTip"), themesPanel = new JPanel()), 5); //$NON-NLS-1$ for (MyTheme theme : MyTheme.values()) themesPanel.add(theme.getButton()); themesPanel.setOpaque(false); builder.nextLine(); builder.append(Locale.explain("ui.systray"), new ToolTip(Locale.explain("ui.systrayTitle") //$NON-NLS-1$ //$NON-NLS-2$ + Locale.explain("ui.systrayTip"), //$NON-NLS-1$ systrayButton = new JCheckBox(Locale.explain("ui.enable")))); //$NON-NLS-1$ builder.append(Locale.explain("ui.ontop"), new ToolTip(Locale.explain("ui.ontopTitle") //$NON-NLS-1$ //$NON-NLS-2$ + Locale.explain("ui.ontopTip"), //$NON-NLS-1$ alwaysOnTop = new JCheckBox(Locale.explain("ui.enable")))); //$NON-NLS-1$ builder.nextLine(); builder.append(Locale.explain("ui.startmini"), new ToolTip(Locale.explain("ui.startminiTitle") //$NON-NLS-1$ //$NON-NLS-2$ + Locale.explain("ui.startminiTip"), //$NON-NLS-1$ startMini = new JCheckBox(Locale.explain("ui.enable")))); //$NON-NLS-1$ builder.append(Locale.explain("ui.verbose"), new ToolTip(Locale.explain("ui.verboseTitle") //$NON-NLS-1$ //$NON-NLS-2$ + Locale.explain("ui.verboseTip"), //$NON-NLS-1$ verboseLogs = new JCheckBox(Locale.explain("ui.enable")))); //$NON-NLS-1$ builder.nextLine(); appendCustomSettings(builder); for (Plugin plugin : plugins) { builder.appendSeparator(plugin.getName()); plugin.buildSettings(builder); } systrayButton.addActionListener(this); alwaysOnTop.addActionListener(this); startMini.addActionListener(this); verboseLogs.addActionListener(this); systrayButton.setOpaque(false); alwaysOnTop.setOpaque(false); startMini.setOpaque(false); verboseLogs.setOpaque(false); JScrollPane pane = new JScrollPane(builder.getPanel()); pane.setBorder(Borders.EMPTY_BORDER); builder.getPanel().setOpaque(false); pane.getViewport().setOpaque(false); pane.setOpaque(false); return pane; }
From source file:com.zeroc.IceGridGUI.Application.ApplicationEditor.java
License:Open Source License
@Override protected void appendProperties(DefaultFormBuilder builder) { builder.append("Name"); builder.append(_name, 3);/*from w ww . ja v a 2s .com*/ builder.append("Description"); builder.nextLine(); builder.append(""); builder.nextRow(-2); CellConstraints cc = new CellConstraints(); JScrollPane scrollPane = new JScrollPane(_description); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 3)); builder.nextRow(2); builder.nextLine(); builder.append("Variables"); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-6); scrollPane = new JScrollPane(_variables); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7)); builder.nextRow(6); builder.nextLine(); JComponent c = builder.appendSeparator("Distribution"); c.setToolTipText("Files shared by all servers in your application"); builder.append("IcePatch2 Proxy"); builder.append(_distrib, 3); builder.nextLine(); builder.append("Directories"); builder.append(_distribDirs, 3); builder.nextLine(); }
From source file:com.zeroc.IceGridGUI.Application.ServerSubEditor.java
License:Open Source License
@Override void appendProperties(DefaultFormBuilder builder) { builder.append("Server ID"); builder.append(_id, 3);//from ww w . j ava2s . co m builder.nextLine(); // // Add Communicator fields // super.appendProperties(builder); builder.appendSeparator("Activation"); builder.append("Path to Executable"); builder.append(_exe, 3); builder.nextLine(); builder.append("Ice Version"); builder.append(_iceVersion, 3); builder.nextLine(); builder.append("Working Directory"); builder.append(_pwd, 3); builder.nextLine(); builder.append("Command Arguments"); builder.append(_options, 3); builder.nextLine(); builder.append("Run as"); builder.append(_user, 3); builder.nextLine(); builder.append("Environment Variables"); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-6); CellConstraints cc = new CellConstraints(); JScrollPane scrollPane = new JScrollPane(_envs); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7)); builder.nextRow(6); builder.nextLine(); builder.append("Activation Mode"); builder.append(_activation, 3); builder.nextLine(); builder.append("Activation Timeout"); builder.append(_activationTimeout, 3); builder.nextLine(); builder.append("Deactivation Timeout"); builder.append(_deactivationTimeout, 3); builder.nextLine(); builder.append("", _allocatable); builder.nextLine(); JComponent c = builder.appendSeparator("Distribution"); c.setToolTipText("Files specific to this server"); builder.append("", _applicationDistrib); builder.nextLine(); builder.append("IcePatch2 Proxy"); builder.append(_distrib, 3); builder.nextLine(); builder.append("Directories"); builder.append(_distribDirs, 3); builder.nextLine(); }
From source file:com.zeroc.IceGridGUI.LiveDeployment.AdapterEditor.java
License:Open Source License
@Override protected void appendProperties(DefaultFormBuilder builder) { builder.appendSeparator("Runtime Status"); builder.append("Status"); builder.append(_currentStatus, 3);/* w w w . j a v a2 s . c om*/ builder.nextLine(); builder.append("Published Endpoints"); builder.append(_currentEndpoints, 3); builder.nextLine(); builder.appendSeparator("Configuration"); builder.append("Description"); builder.nextLine(); builder.append(""); builder.nextRow(-2); CellConstraints cc = new CellConstraints(); JScrollPane scrollPane = new JScrollPane(_description); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 3)); builder.nextRow(2); builder.nextLine(); builder.append("Adapter ID"); builder.append(_id, 3); builder.nextLine(); builder.append("Replica Group"); builder.append(_replicaGroupId, 3); builder.nextLine(); builder.append("Priority"); builder.append(_priority, 3); builder.nextLine(); builder.append("Endpoints"); builder.append(_endpoints, 3); builder.nextLine(); builder.append("Published Endpoints"); builder.append(_publishedEndpoints, 3); builder.nextLine(); builder.append("", _registerProcess); builder.nextLine(); builder.append("", _serverLifetime); builder.nextLine(); builder.append("Well-known Objects"); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-6); scrollPane = new JScrollPane(_objects); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7)); builder.nextRow(6); builder.nextLine(); builder.append("Allocatable Objects"); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-6); scrollPane = new JScrollPane(_allocatables); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7)); builder.nextRow(6); builder.nextLine(); }
From source file:com.zeroc.IceGridGUI.LiveDeployment.LogFilterDialog.java
License:Open Source License
LogFilterDialog(final ShowIceLogDialog dialog) { super(dialog, "Ice log filter - IceGrid Admin", true); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); java.util.Set<com.zeroc.Ice.LogMessageType> messageTypeFilterSet = null; if (dialog.getMessageTypeFilter() != null) { messageTypeFilterSet = new java.util.HashSet<>(java.util.Arrays.asList(dialog.getMessageTypeFilter())); }//from w w w . j a va2s . co m final JCheckBox error = new JCheckBox("Error", messageTypeFilterSet == null || messageTypeFilterSet.contains(LogMessageType.ErrorMessage)); final JCheckBox warning = new JCheckBox("Warning", messageTypeFilterSet == null || messageTypeFilterSet.contains(LogMessageType.WarningMessage)); final JCheckBox print = new JCheckBox("Print", messageTypeFilterSet == null || messageTypeFilterSet.contains(LogMessageType.PrintMessage)); final JCheckBox trace = new JCheckBox("Trace", messageTypeFilterSet == null || messageTypeFilterSet.contains(LogMessageType.TraceMessage)); final JTextArea traceCategories = new JTextArea(3, 40); traceCategories.setLineWrap(true); String[] traceCategoryFilter = dialog.getTraceCategoryFilter(); if (traceCategoryFilter != null) { // TODO: join with escapes! traceCategories.setText(com.zeroc.IceUtilInternal.StringUtil .joinString(java.util.Arrays.asList(traceCategoryFilter), ", ")); } else { traceCategories.setText(null); } traceCategories.setToolTipText("Trace categories separated by commas; leave blank to get all categories"); JButton okButton = new JButton("OK"); ActionListener okListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String[] traceCategoryFilter = null; String txt = traceCategories.getText(); if (txt != null && !txt.isEmpty()) { traceCategoryFilter = com.zeroc.IceUtilInternal.StringUtil.splitString(txt, ", \t\r\n"); if (traceCategoryFilter == null) { // unmatched quote JOptionPane.showMessageDialog(LogFilterDialog.this, "Unmatched quote in Trace categories field", "Invalid entry", JOptionPane.ERROR_MESSAGE); return; } if (traceCategoryFilter.length == 0) // only separators { traceCategoryFilter = null; } } java.util.Set<LogMessageType> messageTypeFilterSet = new java.util.HashSet<>(); if (error.isSelected()) { messageTypeFilterSet.add(LogMessageType.ErrorMessage); } if (warning.isSelected()) { messageTypeFilterSet.add(LogMessageType.WarningMessage); } if (print.isSelected()) { messageTypeFilterSet.add(LogMessageType.PrintMessage); } if (trace.isSelected()) { messageTypeFilterSet.add(LogMessageType.TraceMessage); } if (messageTypeFilterSet.size() == 0 || messageTypeFilterSet.size() == 4) { // All or nothing checked equivalent of getting everything! messageTypeFilterSet = null; } LogMessageType[] messageTypeFilter = null; if (messageTypeFilterSet != null) { messageTypeFilter = messageTypeFilterSet.toArray(new LogMessageType[0]); } dispose(); dialog.setFilters(messageTypeFilter, traceCategoryFilter); } }; okButton.addActionListener(okListener); getRootPane().setDefaultButton(okButton); JButton cancelButton = new JButton("Cancel"); ActionListener cancelListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dispose(); } }; cancelButton.addActionListener(cancelListener); FormLayout layout = new FormLayout("left:pref, 3dlu, fill:pref:grow", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.border(Borders.DIALOG); builder.rowGroupingEnabled(true); builder.lineGapSize(LayoutStyle.getCurrent().getLinePad()); builder.appendSeparator("Retrieve only the following types of log messages (server-side filtering)"); builder.nextLine(); builder.append(error); builder.nextLine(); builder.append(warning); builder.nextLine(); builder.append(print); builder.nextLine(); builder.append(trace); builder.nextLine(); builder.append("Trace categories"); builder.nextLine(); builder.append(""); builder.nextRow(-2); CellConstraints cc = new CellConstraints(); JScrollPane scrollPane = new JScrollPane(traceCategories); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 1, 3)); builder.nextRow(2); builder.nextLine(); JComponent buttonBar = new ButtonBarBuilder().addGlue().addButton(okButton, cancelButton).build(); buttonBar.setBorder(Borders.DIALOG); java.awt.Container contentPane = getContentPane(); contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS)); contentPane.add(builder.getPanel()); contentPane.add(buttonBar); pack(); setResizable(false); setLocationRelativeTo(dialog); setVisible(true); }
From source file:com.zeroc.IceGridGUI.LiveDeployment.NodeEditor.java
License:Open Source License
@Override protected void appendProperties(DefaultFormBuilder builder) { builder.appendSeparator("System Information"); builder.append("Hostname"); builder.append(_hostname, 3);/*from w ww . j a v a 2 s . com*/ builder.nextLine(); builder.append("Operating System"); builder.append(_os, 3); builder.nextLine(); builder.append("Machine Type"); builder.append(_machineType, 3); builder.append(_loadAverageLabel, _loadAverage); builder.append(_refreshButton); builder.nextLine(); builder.appendSeparator("Configuration"); builder.append("Load Factor"); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-6); CellConstraints cc = new CellConstraints(); JScrollPane scrollPane = new JScrollPane(_loadFactor); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7)); builder.nextRow(6); builder.nextLine(); }
From source file:com.zeroc.IceGridGUI.LiveDeployment.RegistryEditor.java
License:Open Source License
@Override protected void appendProperties(DefaultFormBuilder builder) { CellConstraints cc = new CellConstraints(); builder.append("Hostname"); builder.append(_hostname, 3);/* w w w. j a va 2 s. co m*/ builder.nextLine(); builder.appendSeparator("Deployed Applications"); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-14); JScrollPane scrollPane = new JScrollPane(_applications); scrollPane.setToolTipText(_applications.getToolTipText()); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 14)); builder.nextRow(14); builder.nextLine(); builder.appendSeparator("Dynamic Well-Known Objects"); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-14); scrollPane = new JScrollPane(_objects); scrollPane.setToolTipText(_objects.getToolTipText()); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 14)); builder.nextRow(14); builder.nextLine(); builder.appendSeparator("Dynamic Object Adapters"); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-14); scrollPane = new JScrollPane(_adapters); scrollPane.setToolTipText(_adapters.getToolTipText()); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 14)); builder.nextRow(14); builder.nextLine(); }
From source file:com.zeroc.IceGridGUI.LiveDeployment.ServerEditor.java
License:Open Source License
@Override protected void appendProperties(DefaultFormBuilder builder) { builder.appendSeparator("Runtime Status"); builder.append("State"); builder.append(_currentState, 3);/*from w w w .ja v a2s .c om*/ builder.nextLine(); builder.append("", _enabled); builder.nextLine(); builder.append("Process Id"); builder.append(_currentPid, 3); builder.nextLine(); builder.append("Build Id"); builder.append(_buildId, _refreshButton); builder.nextLine(); builder.append("Properties"); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-6); CellConstraints cc = new CellConstraints(); JScrollPane scrollPane = new JScrollPane(_properties); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7)); builder.nextRow(6); builder.nextLine(); builder.appendSeparator("Configuration"); builder.append("Application"); builder.append(_application); builder.append(_gotoApplication); builder.nextLine(); // // Add Communicator fields // super.appendProperties(builder); builder.appendSeparator("Activation"); builder.append("Path to Executable"); builder.append(_exe, 3); builder.nextLine(); builder.append("Ice Version"); builder.append(_iceVersion, 3); builder.nextLine(); builder.append("Working Directory"); builder.append(_pwd, 3); builder.nextLine(); builder.append("Command Arguments"); builder.append(_options, 3); builder.nextLine(); builder.append("Run as"); builder.append(_user, 3); builder.nextLine(); builder.append("Environment Variables"); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-6); scrollPane = new JScrollPane(_envs); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7)); builder.nextRow(6); builder.nextLine(); builder.append("Activation Mode"); builder.append(_activation, 3); builder.nextLine(); builder.append("Activation Timeout"); builder.append(_activationTimeout, 3); builder.nextLine(); builder.append("Deactivation Timeout"); builder.append(_deactivationTimeout, 3); builder.nextLine(); builder.append("", _allocatable); builder.nextLine(); JComponent c = builder.appendSeparator("Distribution"); c.setToolTipText("Files specific to this server"); builder.append("", _applicationDistrib); builder.nextLine(); builder.append("IcePatch2 Proxy"); builder.append(_icepatch, 3); builder.nextLine(); builder.append("Directories"); builder.append(_directories, 3); builder.nextLine(); }
From source file:com.zeroc.IceGridGUI.LiveDeployment.ServiceEditor.java
License:Open Source License
@Override protected void appendProperties(DefaultFormBuilder builder) { builder.appendSeparator("Runtime Status"); builder.append("", _started); builder.nextLine();//from w w w.j a v a2 s.c om builder.append("Build Id"); builder.append(_buildId, _refreshButton); builder.nextLine(); builder.append("Properties"); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextLine(); builder.append(""); builder.nextRow(-6); CellConstraints cc = new CellConstraints(); JScrollPane scrollPane = new JScrollPane(_properties); builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7)); builder.nextRow(6); builder.nextLine(); builder.appendSeparator("Configuration"); super.appendProperties(builder); builder.append("Entry Point"); builder.append(_entry, 3); builder.nextLine(); }