@Override
  public ButtonPanel createButtonPanel() {
    ButtonPanel buttonPanel = new ButtonPanel(0);
    JButton okButton = new JButton();
    JButton cancelButton = new JButton();
    okButton.setName("OK");
    cancelButton.setName("CANCEL");
    buttonPanel.addButton(okButton, "AFFIRMATIVE");
    buttonPanel.addButton(cancelButton, "CANCEL");

    okButton.setAction(
        new AbstractAction(UIDefaultsLookup.getString("OptionPane.okButtonText")) {
          @Override
          public void actionPerformed(ActionEvent e) {
            ColumnOptionDialog.this.fnHideColumn();
            ColumnOptionDialog.this.setDialogResult(0);
            ColumnOptionDialog.this.setVisible(false);
            ColumnOptionDialog.this.dispose();
          }
        });
    cancelButton.setAction(
        new AbstractAction(UIDefaultsLookup.getString("OptionPane.cancelButtonText")) {
          @Override
          public void actionPerformed(ActionEvent e) {
            ColumnOptionDialog.this.setDialogResult(-1);
            ColumnOptionDialog.this.setVisible(false);
            ColumnOptionDialog.this.dispose();
          }
        });
    setDefaultCancelAction(cancelButton.getAction());
    setDefaultAction(okButton.getAction());
    getRootPane().setDefaultButton(okButton);
    buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    return buttonPanel;
  }
Exemplo n.º 2
0
 @Override
 public void installUI(JComponent c) {
   _painter = (ThemePainter) UIDefaultsLookup.get("Theme.painter");
   _gripperPainter = (Painter) UIDefaultsLookup.get("Gripper.painter");
   installDefaults((Gripper) c);
   installListeners((Gripper) c);
 }
Exemplo n.º 3
0
  @Override
  public ButtonPanel createButtonPanel() {
    ButtonPanel buttonPanel = new ButtonPanel();
    JButton okButton = new JButton();
    JButton cancelButton = new JButton();
    JButton helpButton = new JButton();
    okButton.setName(OK);
    cancelButton.setName(CANCEL);
    helpButton.setName(HELP);
    buttonPanel.addButton(okButton, ButtonPanel.AFFIRMATIVE_BUTTON);
    buttonPanel.addButton(cancelButton, ButtonPanel.CANCEL_BUTTON);
    buttonPanel.addButton(helpButton, ButtonPanel.HELP_BUTTON);

    okButton.setAction(
        new AbstractAction(UIDefaultsLookup.getString("OptionPane.okButtonText")) {
          public void actionPerformed(ActionEvent e) {
            setDialogResult(RESULT_AFFIRMED);
            setVisible(false);
            dispose();
          }
        });
    cancelButton.setAction(
        new AbstractAction(UIDefaultsLookup.getString("OptionPane.cancelButtonText")) {
          public void actionPerformed(ActionEvent e) {
            setDialogResult(RESULT_CANCELLED);
            setVisible(false);
            dispose();
          }
        });
    final ResourceBundle resourceBundle = ButtonResources.getResourceBundle(Locale.getDefault());
    helpButton.setAction(
        new AbstractAction(resourceBundle.getString("Button.help")) {
          public void actionPerformed(ActionEvent e) {
            // do something
          }
        });
    helpButton.setMnemonic(resourceBundle.getString("Button.help.mnemonic").charAt(0));

    setDefaultCancelAction(cancelButton.getAction());
    setDefaultAction(okButton.getAction());
    getRootPane().setDefaultButton(okButton);
    buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    return buttonPanel;
  }
Exemplo n.º 4
0
 protected void installDefaults(Gripper s) {
   _size = UIDefaultsLookup.getInt("Gripper.size");
 }