use of com.jgoodies.forms.builder.DefaultFormBuilder in project jabref by JabRef.
the class FromAuxDialog method initPanels.
private void initPanels() {
// collect the names of all open databases
int len = parentTabbedPane.getTabCount();
int toSelect = -1;
for (int i = 0; i < len; i++) {
dbChooser.addItem(parentTabbedPane.getTitleAt(i));
if (parentFrame.getBasePanelAt(i) == parentFrame.getCurrentBasePanel()) {
toSelect = i;
}
}
if (toSelect >= 0) {
dbChooser.setSelectedIndex(toSelect);
}
auxFileField = new JTextField("", 25);
JButton browseAuxFileButton = new JButton(Localization.lang("Browse"));
FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder().addExtensionFilter(FileExtensions.AUX).withDefaultExtension(FileExtensions.AUX).withInitialDirectory(Globals.prefs.get(JabRefPreferences.WORKING_DIRECTORY)).build();
DialogService ds = new FXDialogService();
browseAuxFileButton.addActionListener(e -> {
Optional<Path> file = DefaultTaskExecutor.runInJavaFXThread(() -> ds.showFileOpenDialog(fileDialogConfiguration));
file.ifPresent(f -> auxFileField.setText(f.toAbsolutePath().toString()));
});
notFoundList = new JList<>();
JScrollPane listScrollPane = new JScrollPane(notFoundList);
statusInfos = new JTextArea("", 5, 20);
JScrollPane statusScrollPane = new JScrollPane(statusInfos);
statusInfos.setEditable(false);
DefaultFormBuilder b = new DefaultFormBuilder(new FormLayout("left:pref, 4dlu, fill:pref:grow, 4dlu, left:pref", ""), buttons);
b.appendSeparator(Localization.lang("Options"));
b.append(Localization.lang("Reference library") + ":");
b.append(dbChooser, 3);
b.nextLine();
b.append(Localization.lang("LaTeX AUX file") + ":");
b.append(auxFileField);
b.append(browseAuxFileButton);
b.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
b = new DefaultFormBuilder(new FormLayout("fill:pref:grow, 4dlu, fill:pref:grow", "pref, pref, fill:pref:grow"), statusPanel);
b.appendSeparator(Localization.lang("Result"));
b.append(Localization.lang("Unknown BibTeX entries") + ":");
b.append(Localization.lang("Messages") + ":");
b.nextLine();
b.append(listScrollPane);
b.append(statusScrollPane);
b.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
}
use of com.jgoodies.forms.builder.DefaultFormBuilder in project jabref by JabRef.
the class BibtexKeyPatternPrefTab method appendKeyGeneratorSettings.
private void appendKeyGeneratorSettings() {
ButtonGroup bg = new ButtonGroup();
bg.add(letterStartA);
bg.add(letterStartB);
bg.add(alwaysAddLetter);
// Build a panel for checkbox settings:
FormLayout layout = new FormLayout("1dlu, 8dlu, left:pref, 8dlu, left:pref", "");
JPanel pan = new JPanel();
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.appendSeparator(Localization.lang("Key generator settings"));
builder.nextLine();
builder.append(pan);
builder.append(autoGenerateOnImport);
builder.append(letterStartA);
builder.nextLine();
builder.append(pan);
builder.append(warnBeforeOverwriting);
builder.append(letterStartB);
builder.nextLine();
builder.append(pan);
builder.append(dontOverwrite);
builder.append(alwaysAddLetter);
builder.nextLine();
builder.append(pan);
builder.append(generateOnSave);
builder.nextLine();
builder.append(pan);
builder.append(Localization.lang("Replace (regular expression)") + ':');
builder.append(Localization.lang("by") + ':');
builder.nextLine();
builder.append(pan);
builder.append(keyPatternRegex);
builder.append(keyPatternReplacement);
builder.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
con.gridx = 1;
con.gridy = 3;
con.gridwidth = GridBagConstraints.REMAINDER;
con.weightx = 1;
con.fill = GridBagConstraints.BOTH;
gbl.setConstraints(builder.getPanel(), con);
add(builder.getPanel());
dontOverwrite.addChangeListener(e -> warnBeforeOverwriting.setEnabled(!dontOverwrite.isSelected()));
}
use of com.jgoodies.forms.builder.DefaultFormBuilder in project jgnash by ccavanaugh.
the class AccountSecuritiesDialog method layoutMainPanel.
private void layoutMainPanel() {
initComponents();
FormLayout layout = new FormLayout("p:g", "f:p:g(1.0)");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.border(Borders.DIALOG);
builder.append(panel);
builder.nextLine();
builder.appendUnrelatedComponentsGapRow();
builder.nextLine();
builder.append(StaticUIMethods.buildOKCancelBar(okButton, cancelButton));
getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
}
use of com.jgoodies.forms.builder.DefaultFormBuilder in project jgnash by ccavanaugh.
the class AmortizeDialog method layoutMainPanel.
private void layoutMainPanel() {
initComponents();
FormLayout layout = new FormLayout("right:max(40dlu;pref), $lcgap, max(75dlu;pref):grow(1.0)", "");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.border(Borders.DIALOG);
builder.rowGroupingEnabled(true);
builder.appendSeparator(rb.getString("Title.AmortizationSetup"));
builder.append(rb.getString("Label.AnIntRate"), interestField);
builder.nextLine();
builder.append(rb.getString("Label.OrigLoanAmt"), loanAmountField);
builder.nextLine();
builder.append(rb.getString("Label.LoanTerm"), loanTermField);
builder.nextLine();
builder.append(rb.getString("Label.PayPerTerm"), payPeriodsField);
builder.nextLine();
builder.append(rb.getString("Label.CompPerTerm"), intPeriodsField);
builder.nextLine();
builder.append(rb.getString("Label.FirstPayDate"), dateField);
builder.nextLine();
builder.append(rb.getString("Label.EscrowPmi"), feesField);
builder.nextLine();
builder.leadingColumnOffset(2);
builder.append(useDaysButton);
builder.leadingColumnOffset(0);
builder.nextLine();
builder.append(rb.getString("Label.CompDaysPerYear"), daysField);
builder.appendSeparator(rb.getString("Title.TransactionSetup"));
builder.append(rb.getString("Label.InterestAccount"), interestAccButton);
builder.nextLine();
builder.append(rb.getString("Label.BankAccount"), bankAccButton);
builder.nextLine();
builder.append(rb.getString("Label.FeesAccount"), feesAccButton);
builder.nextLine();
builder.append(rb.getString("Label.Payee"), payeeField);
builder.nextLine();
builder.append(rb.getString("Label.Memo"), memoField);
builder.nextLine();
builder.appendUnrelatedComponentsGapRow();
builder.nextLine();
builder.append(StaticUIMethods.buildOKCancelBar(okButton, cancelButton), 3);
getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
}
use of com.jgoodies.forms.builder.DefaultFormBuilder in project jgnash by ccavanaugh.
the class AccountPanel method layoutMainPanel.
private void layoutMainPanel() {
initComponents();
FormLayout layout = new FormLayout("right:max(20dlu;pref), $lcgap, d, $lcgap, d:g", "");
DefaultFormBuilder builder = new DefaultFormBuilder(layout, this);
builder.appendSeparator(rb.getString("Title.AccountInfo"));
builder.rowGroupingEnabled(true);
builder.append(rb.getString("Label.Name"), nameField, 3);
builder.nextLine();
builder.append(rb.getString("Label.Description"), descriptionField, 3);
builder.nextLine();
builder.append(rb.getString("Label.AccountNumber"), accountNumberField, 3);
builder.nextLine();
builder.append(rb.getString("Label.AccountCode"), accountCodeField, 3);
builder.nextLine();
builder.append(rb.getString("Label.BankID"), bankIdField, 3);
builder.nextLine();
builder.append(rb.getString("Label.Currency"), currencyCombo, 3);
builder.nextLine();
builder.append(rb.getString("Label.Securities"), securityButton, 3);
builder.nextLine();
builder.append(rb.getString("Label.AccountType"), accountTypeCombo, 3);
builder.nextLine();
builder.append(rb.getString("Label.AccountOptions"), lockedCheckBox, hideCheckBox);
builder.nextLine();
builder.append("", placeholderCheckBox, excludeBudgetCheckBox);
builder.rowGroupingEnabled(false);
builder.appendSeparator(rb.getString("Title.ParentAccount"));
builder.append(parentButton, 5);
builder.appendSeparator(rb.getString("Title.Notes"));
JScrollPane pane = new JScrollPane(notesArea);
pane.setAutoscrolls(true);
builder.appendRow("f:60dlu:g(1.0)");
builder.append(pane, 5);
}
Aggregations