/** * Displays the Preferences dialog box and waits until the user selects to cancel the dialog or * to save the properties. * * @param cockpitPreferences * an object with the current cockpit preferences, which will be updated to reflect any changes * the user makes to their preferences. * @param owner * the frame that will own this dialog. * @param hyperlinkListener * the listener that will act on any hyperlink events triggered by the user clicking on HTTP links. */ public static void showDialog(CockpitPreferences cockpitPreferences, Frame owner, HyperlinkActivatedListener hyperlinkListener) { if (preferencesDialog == null) { preferencesDialog = new PreferencesDialog(cockpitPreferences, owner, hyperlinkListener); } preferencesDialog.setVisible(true); }
/** * Creates a modal dialog box with a title. * * @param owner * the frame within which this dialog will be displayed and centred. * @param jets3tHomeDirectory */ private PreferencesDialog(CockpitPreferences cockpitPreferences, Frame owner, HyperlinkActivatedListener hyperlinkListener) { super(owner, "Cockpit Preferences", true); this.cockpitPreferences = cockpitPreferences; this.ownerFrame = owner; this.hyperlinkListener = hyperlinkListener; this.initGui(); }
this.setResizable(false); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = 1478626539912658292L; this.getContentPane().setLayout(new GridBagLayout()); this.getContentPane().add(introductionLabel, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); this.getContentPane().add(tabbedPane, new GridBagConstraints(0, row++, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); this.getContentPane().add(rememberPreferencesCheckBox, new GridBagConstraints(0, row++, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 0, 10), 0, 0)); this.getContentPane().add(rememberPreferencesLabel, new GridBagConstraints(0, row++, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 0, 10), 0, 0)); this.getContentPane().add(buttonsPanel, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); storageClassComboBox.setSelectedItem(cockpitPreferences.getUploadStorageClass()); this.pack(); this.setLocationRelativeTo(this.getOwner());
public void actionPerformed(ActionEvent actionEvent) { setVisible(false); } });
this.setResizable(false); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = 1478626539912658292L; this.getContentPane().setLayout(new GridBagLayout()); this.getContentPane().add(introductionLabel, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); this.getContentPane().add(tabbedPane, new GridBagConstraints(0, row++, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); this.getContentPane().add(rememberPreferencesCheckBox, new GridBagConstraints(0, row++, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 0, 10), 0, 0)); this.getContentPane().add(rememberPreferencesLabel, new GridBagConstraints(0, row++, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 0, 10), 0, 0)); this.getContentPane().add(buttonsPanel, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); storageClassComboBox.setSelectedItem(cockpitPreferences.getUploadStorageClass()); this.pack(); this.setLocationRelativeTo(this.getOwner());
public void actionPerformed(ActionEvent actionEvent) { setVisible(false); } });
/** * Displays the Preferences dialog box and waits until the user selects to cancel the dialog or * to save the properties. * * @param cockpitPreferences * an object with the current cockpit preferences, which will be updated to reflect any changes * the user makes to their preferences. * @param owner * the frame that will own this dialog. * @param hyperlinkListener * the listener that will act on any hyperlink events triggered by the user clicking on HTTP links. */ public static void showDialog(CockpitPreferences cockpitPreferences, Frame owner, HyperlinkActivatedListener hyperlinkListener) { if (preferencesDialog == null) { preferencesDialog = new PreferencesDialog(cockpitPreferences, owner, hyperlinkListener); } preferencesDialog.setVisible(true); }
(String) encryptAlgorithmComboBox.getSelectedItem()); this.setVisible(false); } else if (e.getSource().equals(cancelButton)) { this.setVisible(false);
/** * Creates a modal dialog box with a title. * * @param owner * the frame within which this dialog will be displayed and centred. * @param jets3tHomeDirectory */ private PreferencesDialog(CockpitPreferences cockpitPreferences, Frame owner, HyperlinkActivatedListener hyperlinkListener) { super(owner, "Cockpit Preferences", true); this.cockpitPreferences = cockpitPreferences; this.ownerFrame = owner; this.hyperlinkListener = hyperlinkListener; this.initGui(); }
(String) encryptAlgorithmComboBox.getSelectedItem()); this.setVisible(false); } else if (e.getSource().equals(cancelButton)) { this.setVisible(false);