use of com.sldeditor.common.vendoroption.selection.VersionCellEditor in project sldeditor by robward-scisys.
the class VendorOptionUI method createUI.
/**
* Creates the UI.
*/
public void createUI() {
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
// Vendor options
JPanel vendorOptionSelectionPanel = new JPanel();
vendorOptionSelectionPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), Localisation.getString(VendorOptionUI.class, "VendorOptionUI.vendorOptions"), TitledBorder.LEADING, TitledBorder.TOP, null, null));
vendorOptionSelectionPanel.setLayout(new BorderLayout());
add(vendorOptionSelectionPanel);
vendorOptionTable = new JTable();
JScrollPane scrollPane = new JScrollPane(vendorOptionTable);
vendorOptionSelectionPanel.add(scrollPane, BorderLayout.CENTER);
vendorOptionSelectionPanel.setPreferredSize(new Dimension(400, 100));
vendorOptionModel = new VendorOptionTableModel(options, getClass());
vendorOptionTable.setModel(vendorOptionModel);
vendorOptionTable.getColumnModel().getColumn(1).setCellRenderer(new VersionCellRenderer());
vendorOptionTable.getColumnModel().getColumn(1).setCellEditor(new VersionCellEditor(vendorOptionModel));
// Vendor option information
VendorOptionInfoPanel vendorOptionInfoPanel = VendorOptionInfoManager.getInstance().getPanel(getClass());
vendorOptionInfoPanel.setPreferredSize(new Dimension(400, 200));
add(vendorOptionInfoPanel);
// VendorOption present table
JPanel voPresentPanel = new JPanel();
voPresentPanel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), Localisation.getString(VendorOptionUI.class, "VendorOptionUI.loadedSymbol"), TitledBorder.LEADING, TitledBorder.TOP, null, null));
voPresentPanel.setLayout(new BorderLayout());
voPresentPanel.setPreferredSize(new Dimension(400, 300));
vendorOptionPresentTable = new JTable();
vendorOptionPresentTable.setModel(vendorOptionPresentModel);
JScrollPane scrollPaneTable = new JScrollPane(vendorOptionPresentTable);
voPresentPanel.add(scrollPaneTable, BorderLayout.CENTER);
add(voPresentPanel);
JPanel panel = new JPanel();
voPresentPanel.add(panel, BorderLayout.SOUTH);
panel.setLayout(new BorderLayout(0, 0));
JPanel panel_2 = new JPanel();
panel.add(panel_2, BorderLayout.EAST);
JButton btnHelp = new JButton(Localisation.getString(VendorOptionUI.class, "common.help"));
panel_2.add(btnHelp);
btnHelp.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Help.getInstance().display(CONTEXT_HELP);
}
});
JPanel panel_1 = new JPanel();
panel.add(panel_1, BorderLayout.CENTER);
btnLatestVO = new JButton(Localisation.getString(VendorOptionUI.class, "VendorOptionUI.latest"));
panel_1.add(btnLatestVO);
btnLatestVO.setEnabled(false);
btnMinimumVendorOption = new JButton(Localisation.getString(VendorOptionUI.class, "VendorOptionUI.minimumVO"));
panel_1.add(btnMinimumVendorOption);
btnMinimumVendorOption.setEnabled(false);
btnMinimumVendorOption.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
vendorOptionsUpdated(vendorOptionPresentModel.getMinimum());
}
});
btnLatestVO.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
vendorOptionsUpdated(VendorOptionManager.getInstance().getLatest());
}
});
}
Aggregations