Package com.sshtools.ui.awt.options

Examples of com.sshtools.ui.awt.options.Option


        else if (e.getSource() == parent) {
            gotoParent();
        }
        else if (e.getSource() == remove) {
            File f = getSelectedFile();
            Option choice = OptionDialog.prompt(this, OptionDialog.WARNING, Messages.getString("AWTFileSelector.confirmRemove"), MessageFormat.format(Messages.getString("AWTFileSelector.confirmRemoveText"), //$NON-NLS-1$ //$NON-NLS-2$
                            new Object[] { f.getPath() } ), OptionDialog.CHOICES_YES_NO);
            if (choice == OptionDialog.CHOICE_YES)
                if (!f.delete()) {
                    OptionDialog.error(this, Messages.getString("AWTFileSelector.error"), Messages.getString("AWTFileSelector.failedToRemove")); //$NON-NLS-1$ //$NON-NLS-2$
                } else {
View Full Code Here


        }
        path.setText(sel != null ? sel : ""); //$NON-NLS-1$
    }

    public Option showDialog(Component parent, String title) {
        Option choice = OptionDialog.prompt(parent, OptionDialog.UNCATEGORISED, title, this, OptionDialog.CHOICES_OK_CANCEL, null,  showHiddenFiles);
        return choice;
    }
View Full Code Here

            }           
        });
       
        stopButton = new Button(Messages.getString("PortMonitor.stop")); //$NON-NLS-1$
        stopButton.addActionListener(new ActionListener() {
            Option stop = new Option(Messages.getString("PortMonitor.stop")); //$NON-NLS-1$
           public void actionPerformed(ActionEvent evt) {
               Option opt = OptionDialog.prompt(AWTPortMonitorWindow.this, OptionDialog.WARNING, Messages.getString("PortMonitor.close.title"), //$NON-NLS-1$
                   Messages.getString("PortMonitor.close.text"), //$NON-NLS-1$
                   new Option[] { stop, OptionDialog.CHOICE_CANCEL } );
               if(opt == stop) {
                   for(Enumeration e = getSelectedPorts().elements(); e.hasMoreElements(); ) {
                       AbstractPortItem t = (AbstractPortItem)e.nextElement();
View Full Code Here

   *
   * @see com.adito.agent.client.AgentClientGUI#confirm(int, java.lang.String,
   *      java.lang.String, java.lang.String, java.lang.String)
   */
  public boolean confirm(int dialogType, String okText, String cancelText, String title, String message) {
    Option ok = new Option(okText);
    Option cancel = cancelText == null ? null : new Option(cancelText);
    if (OptionDialog.prompt(getGUIComponent(), dialogType, title, message, cancel == null ? new Option[] { ok }
      : new Option[] { ok, cancel }) != ok) { //$NON-NLS-1$$  //$NON-NLS-2$$
      return false;
    }
    return true;
View Full Code Here

   * @see com.adito.agent.client.AgentClientGUI#error(java.lang.String,
   *      java.lang.String, java.lang.String, java.lang.String,
   *      java.lang.Throwable)
   */
  public boolean error(String okText, String cancelText, String title, String message, Throwable ex) {
    Option ok = new Option(okText);
    Option cancel = cancelText == null ? null : new Option(cancelText);
    if (OptionDialog.error(getGUIComponent(), title, message, ex, cancel == null ? new Option[] { ok }
      : new Option[] { ok, cancel }) != ok) { //$NON-NLS-1$$  //$NON-NLS-2$$
      return false;
    }
    return true;
View Full Code Here

        File cwd = new File(getText());
        if(!cwd.exists()) {
            cwd = new File(System.getProperty("user.home")); //$NON-NLS-1$
        }
        chooser.setWorkingDirectory(cwd);
        Option option = chooser.showDialog(this, Messages.getString("FilenameTextField.selectAFile")); //$NON-NLS-1$
        if(option == OptionDialog.CHOICE_OK) {
            setText(chooser.getSelectedFile().getAbsolutePath());           
        }
        textField.requestFocus();
    }
View Full Code Here

TOP

Related Classes of com.sshtools.ui.awt.options.Option

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.