List of usage examples for com.jgoodies.forms.builder DefaultFormBuilder DefaultFormBuilder
public DefaultFormBuilder(FormLayout layout, StringResourceAccessor localizer)
From source file:jgnash.ui.wizards.file.NewFileThree.java
License:Open Source License
private void layoutMainPanel() { initComponents();/*from w ww .ja v a2 s. com*/ FormLayout layout = new FormLayout("min(65dlu;d):g(0.5), 8dlu, d, 8dlu, min(65dlu;d):g(0.5)", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); builder.appendSeparator(rb.getString("Title.SelAvailCurr")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(helpPane, 5); builder.appendTitle(rb.getString("Title.Available")); builder.append(""); builder.appendTitle(rb.getString("Title.Selected")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.appendRow(RowSpec.decode("f:d:g")); builder.append(new JScrollPane(aJList), buildCenterPanel(), new JScrollPane(cJList)); }
From source file:jgnash.ui.wizards.file.NewFileTwo.java
License:Open Source License
private void layoutMainPanel() { initComponents();// ww w . ja v a2 s . c o m FormLayout layout = new FormLayout("p, 8dlu, f:d:g", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); builder.appendSeparator(rb.getString("Title.DefDefCurr")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(helpPane, 3); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(rb.getString("Label.DefaultCurrency"), currencyCombo); }
From source file:jgnash.ui.wizards.imports.ImportOne.java
License:Open Source License
private void layoutMainPanel() { initComponents();// w ww .j a va 2 s . c o m FormLayout layout = new FormLayout("p, 8dlu, 85dlu:g", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); builder.appendSeparator(rb.getString("Title.SelDestAccount")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.appendRow(RowSpec.decode("p")); builder.append(helpPane, 3); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(rb.getString("Label.DestAccount"), accountCombo); }
From source file:jgnash.ui.wizards.imports.ImportSummary.java
License:Open Source License
private void layoutMainPanel() { initComponents();/* w w w. j a va 2 s . c o m*/ FormLayout layout = new FormLayout("p, 8dlu, d:g", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); builder.appendSeparator(rb.getString("Title.ImpSum")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(rb.getString("Label.DestAccount"), destLabel); builder.append(rb.getString("Label.NumTrans"), transCount); }
From source file:jgnash.ui.wizards.imports.ImportTwo.java
License:Open Source License
private void layoutMainPanel() { initComponents();//from w w w .j a v a 2 s . co m FormLayout layout = new FormLayout("p, 8dlu, d:g", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); builder.appendSeparator(rb.getString("Title.ModImportTrans")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.appendRow(RowSpec.decode("p")); builder.append(helpPane, 3); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.appendRow(RowSpec.decode("f:85dlu:g")); builder.append(new JScrollPane(table), 3); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(deleteButton); }
From source file:jgnash.ui.wizards.imports.jgnash.ImportZero.java
License:Open Source License
private void layoutMainPanel() { initComponents();/* w ww . jav a 2s . c om*/ FormLayout layout = new FormLayout("p, 8dlu, f:d:g, 4dlu, p", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); builder.appendSeparator(rb.getString("Title.FileImport")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(helpPane, 3); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(rb.getString("Label.FileName"), fileImportField, fileImportButton); builder.nextLine(); builder.append(validFileLabel, 5); }
From source file:jgnash.ui.wizards.imports.qif.PartialOne.java
License:Open Source License
private void layoutMainPanel() { initComponents();// w ww . j a va 2 s. co m FormLayout layout = new FormLayout("p, 8dlu, 85dlu:g", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); builder.appendSeparator(rb.getString("Title.SelDestAccount")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.appendRow(RowSpec.decode("p")); builder.append(helpPane, 3); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(rb.getString("Label.DestAccount"), accountCombo); builder.nextLine(); builder.append(rb.getString("Label.DateFormat"), dateFormatCombo); }
From source file:jgnash.ui.wizards.imports.qif.PartialTwo.java
License:Open Source License
private void layoutMainPanel() { initComponents();/*from w w w. ja v a 2s . c om*/ FormLayout layout = new FormLayout("p, 8dlu, d:g", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout, this); builder.appendSeparator(rb.getString("Title.ModQIFTrans")); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.appendRow(RowSpec.decode("p")); builder.append(helpPane, 3); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.appendRow(RowSpec.decode("f:85dlu:g")); builder.append(new JScrollPane(table), 3); builder.nextLine(); builder.appendRelatedComponentsGapRow(); builder.nextLine(); builder.append(deleteButton); }
From source file:net.sf.jabref.CompressedEntryEditorTab.java
License:Open Source License
void setupPanel(JabRefFrame frame, BasePanel bPanel, boolean addKeyField, String title) { InputMap im = panel.getInputMap(JComponent.WHEN_FOCUSED); ActionMap am = panel.getActionMap(); im.put(Globals.prefs.getKey("Entry editor, previous entry"), "prev"); am.put("prev", parent.prevEntryAction); im.put(Globals.prefs.getKey("Entry editor, next entry"), "next"); am.put("next", parent.nextEntryAction); im.put(Globals.prefs.getKey("Entry editor, store field"), "store"); am.put("store", parent.storeFieldAction); im.put(Globals.prefs.getKey("Entry editor, next panel"), "right"); im.put(Globals.prefs.getKey("Entry editor, next panel 2"), "right"); am.put("left", parent.switchLeftAction); im.put(Globals.prefs.getKey("Entry editor, previous panel"), "left"); im.put(Globals.prefs.getKey("Entry editor, previous panel 2"), "left"); am.put("right", parent.switchRightAction); im.put(Globals.prefs.getKey("Help"), "help"); am.put("help", parent.helpAction); im.put(Globals.prefs.getKey("Save database"), "save"); am.put("save", parent.saveDatabaseAction); im.put(Globals.prefs.getKey("Next tab"), "nexttab"); am.put("nexttab", parent.frame.nextTab); im.put(Globals.prefs.getKey("Previous tab"), "prevtab"); am.put("prevtab", parent.frame.prevTab); panel.setName(title);/*from w ww. j a v a 2 s . c o m*/ //String rowSpec = "left:pref, 4dlu, fill:pref:grow, 4dlu, fill:pref"; String colSpec = "fill:pref, 1dlu, fill:10dlu:grow, 1dlu, fill:pref, " + "8dlu, fill:pref, 1dlu, fill:10dlu:grow, 1dlu, fill:pref"; StringBuffer sb = new StringBuffer(); int rows = (int) Math.ceil((double) fields.length / 2.0); for (int i = 0; i < rows; i++) { sb.append("fill:pref:grow, "); } if (addKeyField) sb.append("4dlu, fill:pref"); else if (sb.length() >= 2) sb.delete(sb.length() - 2, sb.length()); String rowSpec = sb.toString(); DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout(colSpec, rowSpec), panel); for (int i = 0; i < fields.length; i++) { // Create the text area: int editorType = BibtexFields.getEditorType(fields[i]); final FieldEditor ta; if (editorType == GUIGlobals.FILE_LIST_EDITOR) { ta = new FileListEditor(frame, bPanel.metaData(), fields[i], null, parent); fileListEditor = (FileListEditor) ta; } else { ta = new FieldTextArea(fields[i], null); //inform the fieldtextarea of search events to highlight searchstrings frame.getSearchManager().addSearchListener((FieldTextArea) ta); } //ta.addUndoableEditListener(bPanel.undoListener); JComponent ex = parent.getExtra(fields[i], ta); // Add autocompleter listener, if required for this field: AbstractAutoCompleter autoComp = bPanel.getAutoCompleter(fields[i]); AutoCompleteListener acl = null; if (autoComp != null) { acl = new AutoCompleteListener(autoComp); } setupJTextComponent(ta.getTextComponent(), acl); ta.setAutoCompleteListener(acl); // Store the editor for later reference: editors.put(fields[i], ta); if (i == 0) activeField = ta; //System.out.println(fields[i]+": "+BibtexFields.getFieldWeight(fields[i])); //ta.getPane().setPreferredSize(new Dimension(100, // (int)(50.0*BibtexFields.getFieldWeight(fields[i])))); builder.append(ta.getLabel()); if (ex == null) builder.append(ta.getPane(), 3); else { builder.append(ta.getPane()); JPanel pan = new JPanel(); pan.setLayout(new BorderLayout()); pan.add(ex, BorderLayout.NORTH); builder.append(pan); } if (i % 2 == 1) builder.nextLine(); } // Add the edit field for Bibtex-key. if (addKeyField) { final FieldTextField tf = new FieldTextField(BibtexFields.KEY_FIELD, parent.getEntry().getField(BibtexFields.KEY_FIELD), true); //tf.addUndoableEditListener(bPanel.undoListener); setupJTextComponent(tf, null); editors.put("bibtexkey", tf); /* * If the key field is the only field, we should have only one * editor, and this one should be set as active initially: */ if (editors.size() == 1) activeField = tf; builder.nextLine(); builder.append(tf.getLabel()); builder.append(tf, 3); } }
From source file:net.sf.jabref.EntryEditorTab.java
License:Open Source License
private void setupPanel(JabRefFrame frame, BasePanel bPanel, boolean addKeyField, boolean compressed, String title) {//from w w w . j a va2 s .c om InputMap im = panel.getInputMap(JComponent.WHEN_FOCUSED); ActionMap am = panel.getActionMap(); im.put(Globals.prefs.getKey("Entry editor, previous entry"), "prev"); am.put("prev", parent.prevEntryAction); im.put(Globals.prefs.getKey("Entry editor, next entry"), "next"); am.put("next", parent.nextEntryAction); im.put(Globals.prefs.getKey("Entry editor, store field"), "store"); am.put("store", parent.storeFieldAction); im.put(Globals.prefs.getKey("Entry editor, next panel"), "right"); im.put(Globals.prefs.getKey("Entry editor, next panel 2"), "right"); am.put("left", parent.switchLeftAction); im.put(Globals.prefs.getKey("Entry editor, previous panel"), "left"); im.put(Globals.prefs.getKey("Entry editor, previous panel 2"), "left"); am.put("right", parent.switchRightAction); im.put(Globals.prefs.getKey("Help"), "help"); am.put("help", parent.helpAction); im.put(Globals.prefs.getKey("Save database"), "save"); am.put("save", parent.saveDatabaseAction); im.put(Globals.prefs.getKey("Next tab"), "nexttab"); am.put("nexttab", parent.frame.nextTab); im.put(Globals.prefs.getKey("Previous tab"), "prevtab"); am.put("prevtab", parent.frame.prevTab); panel.setName(title); int fieldsPerRow = compressed ? 2 : 1; //String rowSpec = "left:pref, 4dlu, fill:pref:grow, 4dlu, fill:pref"; String colSpec = compressed ? "fill:pref, 1dlu, fill:10dlu:grow, 1dlu, fill:pref, " + "8dlu, fill:pref, 1dlu, fill:10dlu:grow, 1dlu, fill:pref" : "fill:pref, 1dlu, fill:pref:grow, 1dlu, fill:pref"; StringBuilder sb = new StringBuilder(); int rows = (int) Math.ceil((double) fields.length / fieldsPerRow); for (int i = 0; i < rows; i++) { sb.append("fill:pref:grow, "); } if (addKeyField) { sb.append("4dlu, fill:pref"); } else if (sb.length() >= 2) { sb.delete(sb.length() - 2, sb.length()); } String rowSpec = sb.toString(); DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout(colSpec, rowSpec), panel); for (int i = 0; i < fields.length; i++) { // Create the text area: int editorType = BibtexFields.getEditorType(fields[i]); final FieldEditor ta; int defaultHeight; int wHeight = (int) (50.0 * BibtexFields.getFieldWeight(fields[i])); if (editorType == GUIGlobals.FILE_LIST_EDITOR) { ta = new FileListEditor(frame, bPanel.metaData(), fields[i], null, parent); fileListEditor = (FileListEditor) ta; defaultHeight = 0; } else { ta = new FieldTextArea(fields[i], null); frame.getSearchManager().addSearchListener((FieldTextArea) ta); defaultHeight = ta.getPane().getPreferredSize().height; } //ta.addUndoableEditListener(bPanel.undoListener); JComponent ex = parent.getExtra(fields[i], ta); // Add autocompleter listener, if required for this field: AutoCompleter autoComp = bPanel.getAutoCompleters().get(fields[i]); AutoCompleteListener acl = null; if (autoComp != null) { acl = new AutoCompleteListener(autoComp); } setupJTextComponent(ta.getTextComponent(), acl); ta.setAutoCompleteListener(acl); // Store the editor for later reference: editors.put(fields[i], ta); if (i == 0) { activeField = ta; } //System.out.println(fields[i]+": "+BibtexFields.getFieldWeight(fields[i])); if (!compressed) { ta.getPane().setPreferredSize(new Dimension(100, Math.max(defaultHeight, wHeight))); } builder.append(ta.getLabel()); if (ex == null) { builder.append(ta.getPane(), 3); } else { builder.append(ta.getPane()); JPanel pan = new JPanel(); pan.setLayout(new BorderLayout()); pan.add(ex, BorderLayout.NORTH); builder.append(pan); } if (((i + 1) % fieldsPerRow) == 0) { builder.nextLine(); } } // Add the edit field for Bibtex-key. if (addKeyField) { final FieldTextField tf = new FieldTextField(BibtexFields.KEY_FIELD, parent.getEntry().getField(BibtexFields.KEY_FIELD), true); //tf.addUndoableEditListener(bPanel.undoListener); setupJTextComponent(tf, null); editors.put("bibtexkey", tf); /* * If the key field is the only field, we should have only one * editor, and this one should be set as active initially: */ if (editors.size() == 1) { activeField = tf; } builder.nextLine(); builder.append(tf.getLabel()); builder.append(tf, 3); } }