public InfoFormsPane(BagView bagView) { super(); this.bagView = bagView; this.bag = bagView.getBag(); createUiComponent(false); updateBagHandler = new UpdateBagHandler(bagView); }
private void createUiComponent(boolean enabled) { bagSettingsPanel = createSettingsPanel(); infoPanel = new JPanel(new GridBagLayout()); infoPanel.setToolTipText(bagView.getPropertyMessage("bagView.bagInfoInputPane.help")); Border emptyBorder = new EmptyBorder(5, 5, 5, 5); infoPanel.setBorder(emptyBorder); GridBagConstraints gbc = LayoutUtil.buildGridBagConstraints( 0, 0, 1, 1, 0, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); infoPanel.add(bagSettingsPanel, gbc); bagInfoInputPane = new BagInfoInputPane(bagView, false); bagInfoInputPane.setToolTipText(bagView.getPropertyMessage("bagView.bagInfoInputPane.help")); bagInfoInputPane.setEnabled(false); gbc = LayoutUtil.buildGridBagConstraints( 0, 1, 1, 1, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.WEST); infoPanel.add(bagInfoInputPane, gbc); this.setViewportView(infoPanel); }
public void updateInfoFormsPane(boolean enabled) { // need to remove something? infoPanel.remove(bagInfoInputPane); infoPanel.validate(); bagInfoInputPane = new BagInfoInputPane(bagView, enabled); bagInfoInputPane.setToolTipText(bagView.getPropertyMessage("bagView.bagInfoInputPane.help")); GridBagConstraints gbc = LayoutUtil.buildGridBagConstraints( 0, 1, 1, 1, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.WEST); infoPanel.add(bagInfoInputPane, gbc); this.validate(); }
public BagView getBagView() { return BagView.getInstance(); }
private JPanel createBagSettingsPanel() { JPanel pane = new JPanel(); pane.setLayout(new GridBagLayout()); // bag name int row = 0; JLabel lblBagName = new JLabel(bagView.getPropertyMessage("bag.label.name")); GridBagConstraints gbc = LayoutUtil.buildGridBagConstraints( 0, row, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(lblBagName, gbc); bagNameValue = new JLabel(bagView.getPropertyMessage("bag.label.noname")); gbc = LayoutUtil.buildGridBagConstraints( 1, row, 3, 1, 3, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(bagNameValue, gbc); // bag profile row++; JLabel bagProfileLabel = new JLabel("Profile:"); gbc = LayoutUtil.buildGridBagConstraints( 0, row, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(bagProfileLabel, gbc); bagProfileValue = new JLabel(""); gbc = LayoutUtil.buildGridBagConstraints( 1, row, 1, 1, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(bagProfileValue, gbc); // bag version JLabel bagVersionLabel = new JLabel(bagView.getPropertyMessage("bag.label.version")); bagVersionLabel.setToolTipText(bagView.getPropertyMessage("bag.versionlist.help")); gbc = LayoutUtil.buildGridBagConstraints( 2, row, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(bagVersionLabel, gbc); bagVersionValue = new JLabel(""); gbc = LayoutUtil.buildGridBagConstraints( 3, row, 1, 1, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(bagVersionValue, gbc); // is Holey bag? row++; JLabel holeyLabel = new JLabel(bagView.getPropertyMessage("bag.label.isholey")); holeyLabel.setToolTipText(bagView.getPropertyMessage("bag.isholey.help")); gbc = LayoutUtil.buildGridBagConstraints( 0, row, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(holeyLabel, gbc); holeyValue = new JLabel(""); gbc = LayoutUtil.buildGridBagConstraints( 1, row, 1, 1, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(holeyValue, gbc); // is packed? JLabel serializeLabel = new JLabel(bagView.getPropertyMessage("bag.label.ispackage")); serializeLabel.setToolTipText(bagView.getPropertyMessage("bag.serializetype.help")); gbc = LayoutUtil.buildGridBagConstraints( 2, row, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(serializeLabel, gbc); serializeValue = new JLabel(""); gbc = LayoutUtil.buildGridBagConstraints( 3, row, 1, 1, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST); gbc.insets = new Insets(0, 0, 5, 5); pane.add(serializeValue, gbc); return pane; }