List of usage examples for com.jgoodies.forms.builder DefaultFormBuilder appendSeparator
public JComponent appendSeparator(String text)
From source file:salomon.engine.controller.gui.common.AboutPanel.java
License:Open Source License
private DefaultFormBuilder buildForm() { FormLayout layout = new FormLayout("left:max(40dlu;pref), 3dlu, max(70dlu;pref)", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();/*from w ww .j a v a 2 s . c o m*/ // application name JLabel lblAppName = new JLabel(new ImageIcon(Config.RESOURCES_DIR + Config.FILE_SEPARATOR + "logo.jpg")); //$NON-NLS-1$ builder.append(lblAppName, 3); // authors builder.appendSeparator(Messages.getString("TIT_AUTHORS")); JLabel author = new JLabel("Nikodem Jura"); JLabel email = new JLabel("nico@ernie.icslab.agh.edu.pl"); email.setForeground(Color.BLUE); builder.append(author, email); author = new JLabel("Krzysztof Rajda"); email = new JLabel("krzysztof@rajda.name"); email.setForeground(Color.BLUE); builder.append(author, email); // versions builder.appendSeparator(Messages.getString("TIT_VERSION")); JLabel version = new JLabel(Messages.getString("VERSION")); version.setForeground(Color.RED); builder.append(new JLabel(Messages.getString("TIT_VERSION")), version); builder.append(new JLabel(Messages.getString("BUILD")), new JLabel(Version.getString("REVISION_VERSION"))); return builder; }
From source file:salomon.engine.controller.gui.domain.SolutionManagerGUI.java
License:Open Source License
private JPanel createSolutionPanel() { FormLayout layout = new FormLayout("left:pref, 3dlu, 100dlu:grow, 3dlu, right:20dlu", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();//from w w w . j a va 2s. c om builder.appendSeparator("Solution data"); builder.append("Solution name"); builder.append(_txtSolutionName, 3); builder.append("Hostname", _txtHostname, 3); builder.append("Database path"); builder.append(_txtDBPath, _btnChooseDB); builder.append("Username", _txtUsername, 3); builder.append("Password", _txtPasswd, 3); builder.append("Creation date", _txtSolutionCrDate, 3); builder.append("Last mod. date", _txtSolutionLastMod, 3); builder.appendSeparator("Test connection"); builder.append("", _btnTestConnect, 2); builder.appendSeparator("Solution info"); builder.append(new JScrollPane(_txtSolutionInfo), 5); return builder.getPanel(); }
From source file:salomon.engine.controller.gui.plugin.PluginManagerGUI.java
License:Open Source License
private JPanel createPluginPanel() { FormLayout layout = new FormLayout("left:pref, 3dlu, right:100dlu, 3dlu, right:20dlu", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();/*from w w w.ja v a2 s . c o m*/ builder.appendSeparator("Plugin data"); // initialize components _btnPluginFileLoad = new JButton(); _btnPluginFileLoad.setAction(_actionManager.getChoosePluginFileAction()); _btnPluginFileLoad.setText(Messages.getString("BTN_BROWSE")); _treeFileChooserPlugin = new TreeFileChooser(new File(Config.PLUGINS_DIR)); _treeFileChooserPlugin.setFileFilter(new SearchFileFilter(PLUGIN_EXT, PLUGIN_DESC)); int size = 100; _txtPluginName = new JTextField(size); _txtPluginLocation = new JTextField(size); _txtPluginInfo = new JTextArea(3, 10); _radioLocationUrl = new JRadioButton(); _radioLocationFile = new JRadioButton(); _txtPluginLocation.setText(""); _radioLocationUrl.setAction(_actionManager.getSwitchPluginLocationTypeAction()); _radioLocationFile.setAction(_actionManager.getSwitchPluginLocationTypeAction()); ButtonGroup buttonGroupLocation = new ButtonGroup(); buttonGroupLocation.add(_radioLocationFile); buttonGroupLocation.add(_radioLocationUrl); _radioLocationFile.setSelected(true); // putting components builder.append("Plugin name", _txtPluginName, 3); builder.append("Plugin location"); builder.append(_txtPluginLocation, _btnPluginFileLoad); builder.append(Messages.getString("TXT_PLUGIN_FILE"), _radioLocationFile, 3); builder.append(Messages.getString("TXT_PLUGIN_URL"), _radioLocationUrl, 3); builder.appendSeparator("Plugin info"); builder.append(new JScrollPane(_txtPluginInfo), 5); return builder.getPanel(); }
From source file:salomon.engine.controller.gui.project.ProjectManagerGUI.java
License:Open Source License
private JPanel createProjectPanel() { FormLayout layout = new FormLayout("left:pref, 3dlu, right:100dlu, 3dlu, right:20dlu", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();/*from w w w .j a va2 s . co m*/ builder.appendSeparator("Project data"); builder.append("Project name"); builder.append(_txtProjectName, 3); builder.append("Creation date"); builder.append(_txtProjectCrDate, 3); builder.append("Last mod. date"); builder.append(_txtProjectLastMod, 3); builder.appendSeparator("Agent configuration"); JPanel agentsRunning = ButtonBarFactory.buildAddRemoveBar(_btnStartAgents, _btnStopAgents); builder.append(_btnConfigureAgents); builder.append(agentsRunning, 3); builder.appendSeparator("Project info"); builder.append(new JScrollPane(_txtProjectInfo), 5); return builder.getPanel(); }
From source file:salomon.engine.controller.gui.task.GraphTaskManagerGUI.java
License:Open Source License
private JPanel createTaskPanel() { FormLayout layout = new FormLayout("left:pref, 3dlu, right:100dlu:grow", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();/*www .j a va 2 s . co m*/ builder.appendSeparator("Task Data"); Dimension size = new Dimension(150, 20); _txtTaskName = new JTextField(); _txtTaskName.setPreferredSize(size); _cmbPlugins = new JComboBox(); _cmbPlugins.setPreferredSize(size); _txtTaskCrDate = new JTextField(); _txtTaskCrDate.setEnabled(false); _txtTaskCrDate.setPreferredSize(size); _txtTaskLastMod = new JTextField(); _txtTaskLastMod.setEnabled(false); _txtTaskLastMod.setPreferredSize(size); _txtTaskStatus = new JTextField(); _txtTaskStatus.setEnabled(false); _txtTaskStatus.setPreferredSize(size); _txtTaskInfo = new JTextArea(3, 10); builder.append(new JLabel("Task name"), _txtTaskName); builder.append(new JLabel("Plugin"), _cmbPlugins); builder.append(new JLabel("Task Status"), _txtTaskStatus); builder.append(new JLabel("Creation Date"), _txtTaskCrDate); builder.append(new JLabel("Last Modification Date"), _txtTaskLastMod); builder.appendSeparator("Task Info"); builder.append(new JScrollPane(_txtTaskInfo), 3); return builder.getPanel(); }
From source file:salomon.engine.controller.gui.task.SettingsDialog.java
License:Open Source License
private JPanel getPanel() { FormLayout layout = new FormLayout("left:default:grow, 10dlu, left:default:grow", "fill:max(22dlu;p):grow, 10dlu, fill:default"); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();/*from w ww.j ava2 s. com*/ if (_validationComponent != null) { builder.append(_validationComponent, 3); } else { // fix: if _validationComponent is not set, sth need to be added // to keep layout unaffected builder.append(new JLabel(""), 3); } builder.appendSeparator(_separator); builder.append(_settingsComponent, 3); JPanel buttonPanel = ButtonBarFactory.buildRightAlignedBar(_okButton, _cancelButton); builder.append(buttonPanel, 3); return builder.getPanel(); }
From source file:salomon.util.gui.editor.JavaEditorFrame.java
License:Open Source License
JComponent buildPanel() { FormLayout layout = new FormLayout("F:D:GROW", ""); // "left:max(40dlu;pref), 3dlu, max(70dlu;pref)", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();/* w ww.j a v a 2 s.c o m*/ initComponents(); // input builder.appendSeparator("FIXME:");//Messages.getString("TT_JAVA_EDITOR_INPUT")); builder.append(_javaEditorComponent); builder.append(ButtonBarFactory.buildCenteredBar(_runButton)); builder.appendSeparator("FIXME:");//Messages.getString("TT_JAVA_EDITOR_OUTPUT")); builder.append(_outputComponent); builder.append(ButtonBarFactory.buildCenteredBar(_clearButton)); return builder.getPanel(); }
From source file:se.streamsource.streamflow.client.ui.account.AccountView.java
License:Apache License
public AccountView(@Service ApplicationContext context, @Structure Module module) { this.context = context; ActionMap am = context.getActionMap(this); setActionMap(am);// w w w .j a va2 s . c o m JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); accountForm = new JPanel(); panel.add(accountForm, BorderLayout.NORTH); FormLayout accountLayout = new FormLayout("75dlu, 5dlu, 120dlu:grow", "pref, pref, pref, pref, pref"); DefaultFormBuilder accountBuilder = new DefaultFormBuilder(accountLayout, accountForm); // accountBuilder.setDefaultDialogBorder(); accountBinder = module.objectBuilderFactory().newObject(StateBinder.class); accountBinder.setResourceMap(context.getResourceMap(getClass())); connectedBinder = module.objectBuilderFactory().newObject(StateBinder.class); AccountSettingsValue accountTemplate = accountBinder.bindingTemplate(AccountSettingsValue.class); accountBuilder.appendSeparator(i18n.text(AccountResources.account_separator)); accountBuilder.nextLine(); accountBuilder.add(new JLabel(i18n.text(AccountResources.account_name_label))); accountBuilder.nextColumn(2); accountBuilder.add(accountBinder.bind(TEXTFIELD.newField(), accountTemplate.name())); accountBuilder.nextLine(); accountBuilder.add(new JLabel(i18n.text(AccountResources.server_label))); accountBuilder.nextColumn(2); accountBuilder.add(accountBinder.bind(TEXTFIELD.newField(), accountTemplate.server())); accountBuilder.nextLine(); accountBuilder.add(new JLabel(i18n.text(AccountResources.username_label))); accountBuilder.nextColumn(2); accountBuilder.add(accountBinder.bind(TEXTFIELD.newField(), accountTemplate.userName())); accountBuilder.nextLine(); accountBuilder.add(new JLabel(i18n.text(AccountResources.password_label))); accountBuilder.nextColumn(2); accountBuilder.add(accountBinder.bind(PASSWORD.newField(), accountTemplate.password())); accountBuilder.nextLine(); accountEditor = new FormEditor(accountForm); contactForm = new JPanel(); panel.add(contactForm, BorderLayout.CENTER); FormLayout contactLayout = new FormLayout("75dlu, 5dlu,80dlu, 80dlu", "pref, pref, pref, pref, pref, pref, pref, pref, pref, pref, pref, pref"); DefaultFormBuilder contactBuilder = new DefaultFormBuilder(contactLayout, contactForm); JToggleButton editBtn = new JToggleButton(am.get("edit")); editBtn.setHorizontalAlignment(SwingConstants.LEFT); contactBuilder.add(editBtn, new CellConstraints(4, 5, 1, 1, CellConstraints.FILL, CellConstraints.BOTTOM, new Insets(0, 0, 0, 0))); StreamflowButton testBtn = new StreamflowButton(am.get("test")); testBtn.setHorizontalAlignment(SwingConstants.LEFT); contactBuilder.add(testBtn, new CellConstraints(4, 6, 1, 1, CellConstraints.FILL, CellConstraints.BOTTOM, new Insets(0, 0, 0, 0))); StreamflowButton changepasswordBtn = new StreamflowButton(am.get("changepassword")); changepasswordBtn.setHorizontalAlignment(SwingConstants.LEFT); contactBuilder.add(changepasswordBtn, new CellConstraints(4, 7, 1, 1, CellConstraints.FILL, CellConstraints.BOTTOM, new Insets(0, 0, 0, 0))); setViewportView(panel); }
From source file:se.streamsource.streamflow.client.ui.administration.casetypes.CaseTypeDetailView.java
License:Apache License
public CaseTypeDetailView(@Service ApplicationContext context, @Uses final CaseTypeDetailModel model, @Structure Module module) {// w w w . j ava 2 s . c o m this.model = model; valueBinder = module.objectBuilderFactory().newObject(ValueBinder.class); FormLayout layout = new FormLayout("150dlu, 2dlu, 350", "pref, pref, pref, pref, pref, pref"); setLayout(layout); setMaximumSize(new Dimension(Short.MAX_VALUE, 50)); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); ownerName = new StreamflowSelectableLabel(); builder.append(new JLabel(" ")); builder.nextLine(); builder.appendSeparator(i18n.text(AdministrationResources.casetype_separator)); builder.nextLine(); builder.append(i18n.text(AdministrationResources.owner_name_label), valueBinder.bind("ownerName", ownerName)); builder.nextLine(); ownerId = new StreamflowSelectableLabel(); builder.append(i18n.text(AdministrationResources.owner_id_label), valueBinder.bind("ownerId", ownerId)); builder.nextLine(); builder.append(new JLabel(" ")); builder.nextLine(); builder.appendSeparator(i18n.text(AdministrationResources.casetype_id_separator)); builder.nextLine(); caseTypeId = new StreamflowSelectableLabel(); builder.append(i18n.text(AdministrationResources.id_label), valueBinder.bind("id", caseTypeId)); new RefreshWhenShowing(this, this); }
From source file:se.streamsource.streamflow.client.ui.workspace.cases.forms.CaseSubmittedFormView.java
License:Apache License
public void refresh() { model.refresh();//w w w .ja va 2 s .co m panel().removeAll(); final DefaultFormBuilder builder = builder(panel()); SubmittedFormDTO form = model.getForm(); StreamflowSelectableLabel title = new StreamflowSelectableLabel(form.form().get() + " (" + form.submitter().get() + ", " + DateTimeFormat.forPattern(text(date_time_format)).print(new DateTime(form.submissionDate().get())) + "):"); builder.append(title); builder.nextLine(); if (!form.signatures().get().isEmpty()) { builder.appendSeparator(i18n.text(WorkspaceResources.signatures)); for (FormSignatureDTO signatureDTO : form.signatures().get()) { builder.append(new StreamflowSelectableLabel(signatureDTO.name().get() + ": " + signatureDTO.signerName().get() + "(" + signatureDTO.signerId() + ")")); builder.nextLine(); } } if (form.secondSignee().get() != null) { SecondSigneeInfoValue secondSignee = form.secondSignee().get(); builder.appendSeparator(i18n.text(WorkspaceResources.second_signee)); if (!Strings.empty(secondSignee.name().get())) { builder.append(new StreamflowSelectableLabel( text(WorkspaceResources.name_label) + ": " + secondSignee.name().get())); builder.nextLine(); } if (!Strings.empty(secondSignee.phonenumber().get())) { builder.append(new StreamflowSelectableLabel( text(WorkspaceResources.phone_label) + ": " + secondSignee.phonenumber().get())); builder.nextLine(); } if (!Strings.empty(secondSignee.socialsecuritynumber().get())) { builder.append(new StreamflowSelectableLabel(text(WorkspaceResources.contact_id_label) + ": " + secondSignee.socialsecuritynumber().get())); builder.nextLine(); } if (!Strings.empty(secondSignee.email().get())) { builder.append(new StreamflowSelectableLabel( text(WorkspaceResources.email_label) + ": " + secondSignee.email().get())); builder.nextLine(); } if (!Strings.empty(secondSignee.secondsigneetaskref().get())) { JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT)); StreamflowButton button = new StreamflowButton( context.getActionMap(this).get("resenddoublesignemail")); DateTime date = secondSignee.lastReminderSent().get(); JLabel lastReminderSent = new JLabel(text(WorkspaceResources.last_reminder_sent) + ": " + (date != null ? DateFormats.getProgressiveDateTimeValue(date, Locale.getDefault()) : "")); panel.add(button); panel.add(lastReminderSent); builder.append(panel); builder.nextLine(); } if (!Strings.empty(secondSignee.secondDraftUrl().get())) { JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT)); panel.add(new JLabel(text(WorkspaceResources.second_draft_url) + ": ")); panel.add(new StreamflowSelectableLabel(secondSignee.secondDraftUrl().get())); builder.append(panel); builder.nextLine(); } } for (SubmittedPageDTO page : form.pages().get()) { builder.appendSeparator(page.name().get()); for (FieldDTO field : page.fields().get()) { JLabel label = new JLabel( field.field().get() + (field.field().get().trim().endsWith(":") ? "" : ":"), SwingConstants.LEFT); label.setForeground(Color.gray); JComponent component = getComponent(field.value().get(), field.fieldType().get()); builder.append(label); builder.nextLine(); builder.append(component); builder.nextLine(); } } }