use of org.jdesktop.swingx.VerticalLayout in project com.revolsys.open by revolsys.
the class AbstractUpdateField method initDialog.
protected void initDialog() {
setLayout(new VerticalLayout());
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(final WindowEvent e) {
cancel();
}
});
final JPanel fieldPanel = initFieldPanel();
final String fieldTitle = this.fieldDefinition.getTitle();
fieldPanel.setBorder(BorderFactory.createTitledBorder("Set " + fieldTitle + " = "));
add(fieldPanel);
final JLabel recordCountLabel = new JLabel("<html><b style='color:#32CD32'>" + getRecordCountString() + "</b> records will be updated.</html>");
recordCountLabel.setBorder(BorderFactory.createEmptyBorder(1, 5, 1, 5));
add(recordCountLabel);
final JComponent errorsPanel = initErrorsPanel();
if (errorsPanel != null) {
add(errorsPanel);
}
final JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
add(buttonsPanel);
final JButton cancelButton = RunnableAction.newButton("Cancel", this::cancel);
buttonsPanel.add(cancelButton);
this.okButton = RunnableAction.newButton("OK", this::finish);
if (this.fieldDefinition.isRequired()) {
this.okButton.setEnabled(false);
}
buttonsPanel.add(this.okButton);
pack();
SwingUtil.autoAdjustPosition(this);
}
use of org.jdesktop.swingx.VerticalLayout in project com.revolsys.open by revolsys.
the class RecordLayerTablePanel method getHeaderMenu.
@Override
public JPopupMenu getHeaderMenu(final int columnIndex) {
final JPopupMenu headerMenu = super.getHeaderMenu(columnIndex);
final String columnName = this.tableModel.getColumnName(columnIndex);
final JMenuItem menuItem = new JMenuItem();
final JLabel title = new JLabel(columnName);
title.setFont(menuItem.getFont().deriveFont(Font.BOLD));
title.setBackground(menuItem.getBackground());
title.setHorizontalAlignment(SwingConstants.CENTER);
title.setHorizontalTextPosition(SwingConstants.CENTER);
final JPanel labelPanel = new JPanel(new VerticalLayout());
labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
labelPanel.setOpaque(false);
labelPanel.add(title);
headerMenu.add(labelPanel, 0);
headerMenu.add(new JPopupMenu.Separator(), 1);
return headerMenu;
}
use of org.jdesktop.swingx.VerticalLayout in project com.revolsys.open by revolsys.
the class MergeRecordsDialog method initDialog.
protected void initDialog() {
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
setMinimumSize(new Dimension(600, 100));
addWindowListener(this);
final BasePanel panel = new BasePanel(new BorderLayout());
add(new JScrollPane(panel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED));
this.mergedRecordsPanel = new JPanel(new VerticalLayout());
panel.add(this.mergedRecordsPanel, BorderLayout.CENTER);
final JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
add(buttonsPanel, BorderLayout.SOUTH);
final JButton cancelButton = RunnableAction.newButton("Cancel", this::cancel);
buttonsPanel.add(cancelButton);
this.okButton = RunnableAction.newButton("OK", this::finish);
this.okButton.setEnabled(false);
buttonsPanel.add(this.okButton);
pack();
SwingUtil.autoAdjustPosition(this);
}
Aggregations