Search in sources :

Example 26 with XBayaDialog

use of org.apache.airavata.xbaya.ui.dialogs.XBayaDialog in project airavata by apache.

the class WebResigtryWindow method initGUI.

/**
 * Initializes the GUI.
 */
private void initGUI() {
    this.urlTextField = new XBayaTextField();
    XBayaLabel urlLabel = new XBayaLabel("URL", this.urlTextField);
    GridPanel infoPanel = new GridPanel();
    infoPanel.add(urlLabel);
    infoPanel.add(this.urlTextField);
    infoPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            ok();
        }
    });
    JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            hide();
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(okButton);
    buttonPanel.add(cancelButton);
    this.dialog = new XBayaDialog(this.engine.getGUI(), "Web Registry", infoPanel, buttonPanel);
    this.dialog.setDefaultButton(okButton);
}
Also used : JPanel(javax.swing.JPanel) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Example 27 with XBayaDialog

use of org.apache.airavata.xbaya.ui.dialogs.XBayaDialog in project airavata by apache.

the class MemoConfigurationDialog method initGui.

/**
 * Initializes the GUI.
 */
private void initGui() {
    this.memoTextArea = new XBayaTextArea();
    XBayaLabel memoLabel = new XBayaLabel("Memo", this.memoTextArea);
    GridPanel gridPanel = new GridPanel();
    gridPanel.add(memoLabel);
    gridPanel.add(this.memoTextArea);
    gridPanel.layout(1, 2, 0, 1);
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            setInput();
        }
    });
    JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            hide();
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(okButton);
    buttonPanel.add(cancelButton);
    this.dialog = new XBayaDialog(this.engine.getGUI(), "Memo", gridPanel, buttonPanel);
    this.dialog.setDefaultButton(okButton);
}
Also used : JPanel(javax.swing.JPanel) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) XBayaTextArea(org.apache.airavata.xbaya.ui.widgets.XBayaTextArea) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Example 28 with XBayaDialog

use of org.apache.airavata.xbaya.ui.dialogs.XBayaDialog in project airavata by apache.

the class OutputConfigurationDialog method initGui.

/**
 * Initializes the GUI.
 */
private void initGui() {
    this.nameTextField = new XBayaTextField();
    XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
    this.dataTypeField = new XBayaTextField(this.node.getParameterType().toString());
    this.dataTypeField.setEditable(false);
    this.dataTypeLabel = new XBayaLabel("Type", this.dataTypeField);
    this.descriptionTextArea = new XBayaTextArea();
    XBayaLabel descriptionLabel = new XBayaLabel("Description", this.descriptionTextArea);
    GridPanel mainPanel = new GridPanel();
    mainPanel.add(nameLabel);
    mainPanel.add(this.nameTextField);
    mainPanel.add(this.dataTypeLabel);
    mainPanel.add(this.dataTypeField);
    mainPanel.add(descriptionLabel);
    mainPanel.add(this.descriptionTextArea);
    mainPanel.layout(3, 2, 2, 1);
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            setInput();
        }
    });
    JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            hide();
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(okButton);
    buttonPanel.add(cancelButton);
    this.dialog = new XBayaDialog(this.xbayaGUI, "Input Parameter Configuration", mainPanel, buttonPanel);
    this.dialog.setDefaultButton(okButton);
}
Also used : JPanel(javax.swing.JPanel) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) XBayaTextArea(org.apache.airavata.xbaya.ui.widgets.XBayaTextArea) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Example 29 with XBayaDialog

use of org.apache.airavata.xbaya.ui.dialogs.XBayaDialog in project airavata by apache.

the class S3FileChooser method initGUI.

private void initGUI() {
    /*
         * ScrollPane for S3 Tree
         */
    // add tree listener to this
    this.s3Tree = new S3Tree();
    this.s3Tree.addTreeSelectionListener(this);
    JScrollPane scrollPane = new JScrollPane(this.s3Tree);
    /*
         * Button Panel
         */
    JButton refreshButton = new JButton("Connect/Refresh");
    refreshButton.addActionListener(new AbstractAction() {

        private ChangeCredentialWindow credentialWindow;

        @Override
        public void actionPerformed(ActionEvent e) {
            if (AmazonCredential.getInstance().getAwsAccessKeyId().isEmpty() || AmazonCredential.getInstance().getAwsSecretAccessKey().isEmpty()) {
                S3FileChooser.this.xbayaGUI.getErrorWindow().warning(S3FileChooser.this.dialog.getDialog(), "Error", "Aws Access Key not set!");
                if (this.credentialWindow == null) {
                    this.credentialWindow = new ChangeCredentialWindow(S3FileChooser.this.dialog.getDialog());
                }
                try {
                    this.credentialWindow.show();
                } catch (Exception e1) {
                    S3FileChooser.this.xbayaGUI.getErrorWindow().error(e1);
                }
                return;
            }
            S3FileChooser.this.s3Tree.clean();
            try {
                // create S3Service
                S3Service s3Service = new RestS3Service(new AWSCredentials(AmazonCredential.getInstance().getAwsAccessKeyId(), AmazonCredential.getInstance().getAwsSecretAccessKey()));
                BucketsLoader bucketsLoader = new BucketsLoader(S3FileChooser.this.xbayaGUI, S3FileChooser.this.dialog.getDialog());
                bucketsLoader.load(s3Service, S3FileChooser.this.s3Tree);
            } catch (S3ServiceException s3ex) {
                S3FileChooser.this.xbayaGUI.getErrorWindow().error(s3ex);
            }
        }
    });
    JButton okButton = new JButton("Ok");
    okButton.addActionListener(new AbstractAction() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (S3FileChooser.this.chosenFile != null) {
                S3FileChooser.this.inputNode.setDefaultValue(new String(S3FileChooser.this.chosenFile));
            }
            hide();
        }
    });
    JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new AbstractAction() {

        @Override
        public void actionPerformed(ActionEvent e) {
            hide();
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(refreshButton);
    buttonPanel.add(okButton);
    buttonPanel.add(cancelButton);
    this.dialog = new XBayaDialog(this.xbayaGUI, "Amazon S3 Input Chooser", scrollPane, buttonPanel);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) S3Tree(org.apache.airavata.xbaya.ui.widgets.amazon.S3Tree) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) S3ServiceException(org.jets3t.service.S3ServiceException) AWSCredentials(org.jets3t.service.security.AWSCredentials) S3ServiceException(org.jets3t.service.S3ServiceException) BucketsLoader(org.apache.airavata.xbaya.ui.dialogs.amazon.BucketsLoader) RestS3Service(org.jets3t.service.impl.rest.httpclient.RestS3Service) ChangeCredentialWindow(org.apache.airavata.xbaya.ui.dialogs.amazon.ChangeCredentialWindow) AbstractAction(javax.swing.AbstractAction) RestS3Service(org.jets3t.service.impl.rest.httpclient.RestS3Service) S3Service(org.jets3t.service.S3Service)

Example 30 with XBayaDialog

use of org.apache.airavata.xbaya.ui.dialogs.XBayaDialog in project airavata by apache.

the class StreamSourceConfigurationDialog method initGui.

/**
 * Initializes the GUI.
 */
private void initGui() {
    this.wsdlTextField = new XBayaTextField();
    this.wsdlLabel = new XBayaLabel("The EPR of the Stream Source", this.wsdlTextField);
    this.descriptionTextField = new XBayaTextField();
    this.descriptionLabel = new XBayaLabel("Description", this.descriptionTextField);
    this.gridPanel = new GridPanel();
    this.gridPanel.add(wsdlLabel);
    this.gridPanel.add(this.wsdlTextField);
    this.gridPanel.add(descriptionLabel);
    this.gridPanel.add(this.descriptionTextField);
    this.gridPanel.layout(2, 2, 1, 1);
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            setInput();
        }
    });
    JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            hide();
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(okButton);
    buttonPanel.add(cancelButton);
    this.dialog = new XBayaDialog(this.xbayaGUI, "Configure Streaming Data source", this.gridPanel, buttonPanel);
    this.dialog.setDefaultButton(okButton);
}
Also used : JPanel(javax.swing.JPanel) XBayaDialog(org.apache.airavata.xbaya.ui.dialogs.XBayaDialog) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) XBayaTextField(org.apache.airavata.xbaya.ui.widgets.XBayaTextField) AbstractAction(javax.swing.AbstractAction) XBayaLabel(org.apache.airavata.xbaya.ui.widgets.XBayaLabel)

Aggregations

ActionEvent (java.awt.event.ActionEvent)35 XBayaDialog (org.apache.airavata.xbaya.ui.dialogs.XBayaDialog)35 GridPanel (org.apache.airavata.xbaya.ui.widgets.GridPanel)33 XBayaLabel (org.apache.airavata.xbaya.ui.widgets.XBayaLabel)31 XBayaTextField (org.apache.airavata.xbaya.ui.widgets.XBayaTextField)30 AbstractAction (javax.swing.AbstractAction)29 JButton (javax.swing.JButton)29 JPanel (javax.swing.JPanel)28 XBayaTextArea (org.apache.airavata.xbaya.ui.widgets.XBayaTextArea)9 JSpinner (javax.swing.JSpinner)8 SpinnerNumberModel (javax.swing.SpinnerNumberModel)8 ActionListener (java.awt.event.ActionListener)3 JLabel (javax.swing.JLabel)3 EtchedBorder (javax.swing.border.EtchedBorder)3 TitledBorder (javax.swing.border.TitledBorder)3 XBayaComboBox (org.apache.airavata.xbaya.ui.widgets.XBayaComboBox)3 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)2 JCheckBox (javax.swing.JCheckBox)2 AiravataClientConnectException (org.apache.airavata.model.error.AiravataClientConnectException)2 AiravataClientException (org.apache.airavata.model.error.AiravataClientException)2