Package org.apache.airavata.xbaya.ui.widgets

Examples of org.apache.airavata.xbaya.ui.widgets.GridPanel


      setTitle("Update Application Description: "+getOriginalDeploymentDescription().getType().getApplicationName().getStringValue());
    }
    setBounds(100, 100, 600, 620);
        setModal(true);
        setLocationRelativeTo(null);
        GridPanel buttonPane = new GridPanel();
//        getContentPane().setLayout(new BorderLayout());
        {
         
//            buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
//            getContentPane().add(buttonPane, BorderLayout.SOUTH);

            lblError = new JLabel("");
            lblError.setForeground(Color.RED);
            buttonPane.add(lblError);
            if (!isNewDescritor()){
              JButton resetButton = new JButton("Reset");
                resetButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        loadData();
                    }
                });
                buttonPane.add(resetButton);
            }
            {
                okButton = new JButton("Save");
                if (!isNewDescritor()){
                  okButton.setText("Update");
                }
                okButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        saveApplicationDescription();
                        close();
                    }
                });
                okButton.setEnabled(false);
                okButton.setActionCommand("OK");
                buttonPane.add(okButton);
                getRootPane().setDefaultButton(okButton);
            }
            {
                JButton cancelButton = new JButton("Cancel");
                cancelButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        setApplicationDescCreated(false);
                        close();
                    }
                });
                cancelButton.setActionCommand("Cancel");
                buttonPane.add(cancelButton);
            }
        }
        {
//            JPanel panel = new JPanel();
//            getContentPane().add(panel, BorderLayout.CENTER);
          JPanel execPath=new JPanel();
            txtExecPath = new XBayaTextField();
            txtExecPath.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setExecutablePath(txtExecPath.getText());
                }
            });
            txtExecPath.getTextField().addFocusListener(new FocusAdapter() {
              @Override
              public void focusLost(FocusEvent e) {
                super.focusLost(e);
                updateTempDirWithExecPath(txtExecPath.getText());
              }
      });
            txtExecPath.setColumns(10);
            btnExecBrowse=new JButton(MenuIcons.OPEN_ICON);
            btnExecBrowse.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed(ActionEvent arg0) {
          JFileChooser c = new JFileChooser();
          int rVal = c.showOpenDialog(null);
          if (rVal == JFileChooser.APPROVE_OPTION) {
            txtExecPath.setText(c.getSelectedFile().toString());
            setExecutablePath(txtExecPath.getText());
          }
        }
            });
            execPath.add(txtExecPath.getSwingComponent());
            execPath.add(btnExecBrowse);
            JButton btnIOParameters = new JButton("IO Parameters...");
            btnIOParameters.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed(ActionEvent event) {
          try {
                        ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),getServiceDescription()==null,getServiceDescription(),false,getApplicationName());
                        serviceDescriptionDialog.setLocationRelativeTo(getContentPane());
                        serviceDescriptionDialog.open();
                        if (serviceDescriptionDialog.isServiceCreated()) {
                          setServiceDescription(serviceDescriptionDialog.getServiceDescription());
                        }
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
        }
            });
            execPath.add(new JLabel("   "));
            execPath.add(btnIOParameters);
           
            setupLayoutForBrowse(execPath,txtExecPath.getSwingComponent());

            txtAppName = new XBayaTextField();
            txtAppName.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent arg0) {
                    setApplicationName(txtAppName.getText());
                }
            });
            txtAppName.setColumns(10);
            XBayaLabel lblApplicationName = new XBayaLabel("Application name",txtAppName);
            JLabel lblExecutablePath = new JLabel("Executable path");
          JPanel tmpDirPath=new JPanel();

            txtTempDir = new XBayaTextField();
            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    setTempDir(txtTempDir.getText());
                }
            });
            txtTempDir.setColumns(10);
            btnTmpDirBrowse=new JButton(MenuIcons.OPEN_DIR_ICON);
            btnTmpDirBrowse.addActionListener(new ActionListener(){
        @Override
        public void actionPerformed(ActionEvent arg0) {
          JFileChooser c = new JFileChooser();
          c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
          int rVal = c.showOpenDialog(null);
          if (rVal == JFileChooser.APPROVE_OPTION) {
            txtTempDir.setText(c.getSelectedFile().toString());
            setTempDir(txtTempDir.getText());
          }
        }
            });
            JTextField component = txtTempDir.getSwingComponent();
      tmpDirPath.add(component);
            tmpDirPath.add(btnTmpDirBrowse);
//            tmpDirPath.layout(1, 2, 0, 0);
           
            setupLayoutForBrowse(tmpDirPath, component);


            JLabel lblTemporaryDirectory = new JLabel("Scratch working directory");

            JButton btnAdvance = new JButton("Advanced application configurations...");
            btnAdvance.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        ApplicationDescriptionAdvancedOptionDialog serviceDescriptionDialog = new ApplicationDescriptionAdvancedOptionDialog(
                                getRegistry(), getShellApplicationDescription());
                        serviceDescriptionDialog.open();
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
                }
            });

//            cmbServiceName.setRenderer(new DefaultListCellRenderer());
            cmbHostName = new JComboBox();
            cmbHostName.addActionListener(this);

            XBayaLabel lblHostName = new XBayaLabel("Application host",cmbHostName);
//            lblHostName.getSwingComponent().setFont(new Font("Tahoma", Font.ITALIC, 11));
            XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
            lnkNewHost.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine.getConfiguration().getJcrComponentRegistry().getRegistry());
                        hostDescriptionDialog.setLocationRelativeTo(getContentPane());
                        hostDescriptionDialog.open();

                        if (hostDescriptionDialog.isHostCreated()) {
                          ProgressMonitor progressMonitor = new ProgressMonitor(getContentPane(), "Host Descriptions", "Refreshing host list..", 0, 200);
                          int progress=1;
                          progressMonitor.setProgress(progress++);
                          while(cmbHostName.getSelectedIndex()==-1 || !cmbHostName.getSelectedItem().toString().equals(hostDescriptionDialog.getHostLocation())){
                              loadHostDescriptions();
                              cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
                              progressMonitor.setProgress(progress++);
                              Thread.sleep(50);
                          }
                          progressMonitor.setProgress(200);
                        }
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
                }
            });
            lnkNewHost.setText("Create new host...");
            lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);

//            JLabel lblBindThisDeployment = new JLabel("Bind this deployment description to:");
//            lblBindThisDeployment.setFont(new Font("Tahoma", Font.BOLD, 11));

            btnHostAdvanceOptions=new JButton("HPC Configuration...");
            btnHostAdvanceOptions.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
          try {
            ApplicationDescriptionHostAdvancedOptionDialog hostAdvancedOptionsDialog = new ApplicationDescriptionHostAdvancedOptionDialog(getRegistry(),getShellApplicationDescription());
                        hostAdvancedOptionsDialog.open();
                    } catch (Exception e1) {
                        e1.printStackTrace();
                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                    }
        }
      });
            btnHostAdvanceOptions.setVisible(false);
            GridPanel hostPanel=new GridPanel();
            hostPanel.add(cmbHostName);
            hostPanel.add(btnHostAdvanceOptions);
           
            SwingUtil.layoutToGrid(hostPanel.getSwingComponent(), 1, 2, 0, 0);
            GridPanel infoPanel0 = new GridPanel();

            infoPanel0.add(lblApplicationName);
            infoPanel0.add(txtAppName);
           
            GridPanel infoPanel1 = new GridPanel();

           
            infoPanel1.add(lblExecutablePath);
            infoPanel1.add(execPath);
//            infoPanel1.add(new JLabel());
//            infoPanel1.add(btnIOParameters);
            infoPanel1.add(lblTemporaryDirectory);
            infoPanel1.add(tmpDirPath);
//            infoPanel1.add(new JLabel());
//            infoPanel1.add(btnAdvance);
           
//            GridPanel infoPanel2 = new GridPanel();
//            infoPanel2.add(new JSeparator());
//            infoPanel2.add(lblBindThisDeployment);
           
            GridPanel infoPanel3 = new GridPanel();

            infoPanel3.add(lblHostName);
            infoPanel3.add(hostPanel);
            infoPanel3.add(new JLabel());
            infoPanel3.add(lnkNewHost);
           
            GridPanel infoPanel4=new GridPanel();
            infoPanel4.add(new JLabel());
            infoPanel4.add(btnAdvance);
            infoPanel4.layout(1, 2, 0, 0);
           
            SwingUtil.layoutToGrid(infoPanel0.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, 1);

            SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 4, 1, SwingUtil.WEIGHT_NONE, 0);
//            SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE, 0);
            SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);

            GridPanel infoPanel = new GridPanel();
            infoPanel.add(infoPanel0);
            infoPanel.add(new JSeparator());
            infoPanel.add(infoPanel1);
            infoPanel.add(new JSeparator());
//          infoPanel.add(infoPanel2);
      infoPanel.add(infoPanel3);
     

            infoPanel.add(new JSeparator());
            infoPanel.add(infoPanel4);
           
            SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 7, 1, SwingUtil.WEIGHT_NONE, 0);
            SwingUtil.layoutToGrid(buttonPane.getSwingComponent(), 1, buttonPane.getContentPanel().getComponentCount(),SwingUtil.WEIGHT_NONE,0);
            getContentPane().add(infoPanel.getSwingComponent());
            getContentPane().add(buttonPane.getSwingComponent());
           
            buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
            infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());

            SwingUtil.layoutToGrid(getContentPane(), 2, 1, -1, 0);
//            loadServiceDescriptions();
            loadHostDescriptions();
        }
View Full Code Here


        XBayaLabel urlLabel = new XBayaLabel("URL", this.urlTextField);
        XBayaLabel userLabel = new XBayaLabel("Username", this.usernameTextField);
        XBayaLabel passLabel = new XBayaLabel("Password", this.passwordTextField);
        XBayaLabel confirmPassLabel = new XBayaLabel("Confirm Password", this.confirmPasswordTextField);

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(urlLabel);
        infoPanel.add(this.urlTextField);
        infoPanel.add(userLabel);
        infoPanel.add(this.usernameTextField);
        infoPanel.add(passLabel);
        infoPanel.add(this.passwordTextField);
        infoPanel.add(confirmPassLabel);
        infoPanel.add(this.confirmPasswordTextField);

        infoPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);

        urlTextField.getSwingComponent().addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent event) {
                updateURL();
View Full Code Here

            public void actionPerformed(ActionEvent e) {
                createNewUser();
            }
        });

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(urlLabel);
        infoPanel.add(this.urlTextField);
        infoPanel.add(nameLabel);
        infoPanel.add(this.usernameTextField);
        infoPanel.add(passLabel);
        infoPanel.add(this.passwordTextField);
        infoPanel.add(emptyLabel);
        infoPanel.add(this.newUserButton);
        infoPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);
       
        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());

        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();
            }
        });

        GridPanel buttonPanel = new GridPanel();
        buttonPanel.add(okButton);
        buttonPanel.add(cancelButton);
        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());

        this.dialog = new XBayaDialog(this.engine.getGUI(), "Airavata Registry", infoPanel, buttonPanel);
        this.dialog.setDefaultButton(okButton);
    }
View Full Code Here

        XBayaLabel sourceEprLabel = new XBayaLabel("Source Endpoint", this.sourceEndpointTextField);
        XBayaLabel sourceFilePathLabel = new XBayaLabel("Source File Path", this.sourceFilePathTextField);
        XBayaLabel destEprLabel = new XBayaLabel("Destination Endpoint", this.destEndpointTextField);
        XBayaLabel destFilePathLabel = new XBayaLabel("Destination FIle path", this.destFilePathTextField);

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(nameLabel);
        infoPanel.add(this.usernameTextField);
        infoPanel.add(caFileLabel);
        infoPanel.add(this.caFileTextField);
        infoPanel.add(certFileLabel);
        infoPanel.add(certFileTextField);
        infoPanel.add(keyFileLabel);
        infoPanel.add(this.keyFileTextField);
        infoPanel.add(sourceEprLabel);
        infoPanel.add(this.sourceEndpointTextField);
        infoPanel.add(sourceFilePathLabel);
        infoPanel.add(this.sourceFilePathTextField);
        infoPanel.add(destEprLabel);
        infoPanel.add(this.destEndpointTextField);
        infoPanel.add(destFilePathLabel);
        infoPanel.add(this.destFilePathTextField);
        infoPanel.layout(8, 2, GridPanel.WEIGHT_NONE, 1);

        JButton okButton = new JButton("OK");
        okButton.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                ok();
View Full Code Here

                    RegistryLoaderWindow.this.deleteButton.setEnabled(false);
                }
            }
        });

        GridPanel mainPanel = new GridPanel();
        TitledBorder border = new TitledBorder(new EtchedBorder(), "Select a workflow to load");
        mainPanel.getSwingComponent().setBorder(border);
        mainPanel.add(this.list);
        mainPanel.layout(1, 1, 0, 0);

        JPanel buttonPanel = new JPanel();
        this.okButton = new JButton("Load");
        this.okButton.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
View Full Code Here

          if (e.getClickCount()==2){
            editDescriptor();
          }
        }
      });
      GridPanel infoPanel=new GridPanel();
        infoPanel.add(pane);
        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
        SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 1, 1, 0, 0);

        JButton newButton = new JButton("New...");
        newButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              newDescriptor();
            }
        });
        descriptorList.addListSelectionListener(new ListSelectionListener(){
      @Override
      public void valueChanged(ListSelectionEvent e) {
        boolean isSelected=descriptorList.getSelectedIndex()!=-1;
        editButton.setEnabled(isSelected);
        removeButton.setEnabled(isSelected);
      }
         
        });
        editButton = new JButton("Edit...");
        editButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              editDescriptor();
            }

        });
        removeButton = new JButton("Remove");
        removeButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              deleteDescriptor();
            }
        });
        JButton closeButton = new JButton("Close");
        closeButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                hide();
            }
        });
       

        GridPanel buttonPanel = new GridPanel();
        buttonPanel.add(newButton);
        buttonPanel.add(editButton);
        buttonPanel.add(removeButton);
        buttonPanel.add(closeButton);
        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
        String title=null;
        switch (descriptorType){
          case HOST:
            title="Host Descriptions";
            break;
View Full Code Here

        serviceTypeButtonGroup.add(this.existKeyButton);

        this.keyComboBox = new XBayaComboBox(new DefaultComboBoxModel());
        this.keyComboBox.getJComboBox().setEnabled(false);

        GridPanel radioPanel = new GridPanel();
        radioPanel.add(this.noKeyButton);
        radioPanel.add(new JPanel());
        radioPanel.add(this.existKeyButton);
        radioPanel.add(this.keyComboBox);
        radioPanel.layout(2, 2, 0, 1);

        XBayaLabel keyLabel = new XBayaLabel("Key Pair", radioPanel);

        GridPanel mainPanel = new GridPanel(true);
        mainPanel.add(amiLabel);
        mainPanel.add(this.amiTextField);
        mainPanel.add(nInstanceLabel);
        mainPanel.add(this.numberOfInstanceSpinner);
        mainPanel.add(instanceTypeLabel);
        mainPanel.add(this.instanceTypeComboBox);
        mainPanel.add(keyLabel);
        mainPanel.add(radioPanel);
        mainPanel.layout(4, 2, 0, GridPanel.WEIGHT_EQUALLY);

        /*
         * Button Panel
         */
        JButton lunchButton = new JButton("Launch");
View Full Code Here

        XBayaLabel fileLabel = new XBayaLabel("Upload File Path", this.fileTextField);

        this.uploadBucketTextField = new XBayaTextField();
        XBayaLabel uploadBucketLabel = new XBayaLabel("Bucket Name", this.uploadBucketTextField);

        GridPanel uploadPanel = new GridPanel();
        uploadPanel.getSwingComponent().setBorder(BorderFactory.createTitledBorder("Upload"));
        uploadPanel.add(fileLabel);
        uploadPanel.add(this.fileTextField);
        uploadPanel.add(uploadBucketLabel);
        uploadPanel.add(this.uploadBucketTextField);
        uploadPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);

        /*
         * Download Panel
         */if (AmazonCredential.getInstance().getAwsAccessKeyId().equals("AKIAI3GNMQVYA5LSQNEQ")) { // Avoid to use
                                                                                                    // default Aws
                                                                                                    // Access Key
            JOptionPane.showMessageDialog(AmazonS3UtilsWindow.this.dialog.getDialog(), "Aws Access Key not set!",
                    "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        this.downloadBucketTextField = new XBayaTextField();
        XBayaLabel downloadBucketLabel = new XBayaLabel("Bucket Name", this.downloadBucketTextField);

        this.keyTextField = new XBayaTextField();
        XBayaLabel keyLabel = new XBayaLabel("Key Name", this.keyTextField);

        this.folderTextField = new XBayaTextField();
        XBayaLabel folderLabel = new XBayaLabel("Download Location", this.folderTextField);

        GridPanel downloadPanel = new GridPanel();
        downloadPanel.getSwingComponent().setBorder(BorderFactory.createTitledBorder("Download"));
        downloadPanel.add(downloadBucketLabel);
        downloadPanel.add(this.downloadBucketTextField);
        downloadPanel.add(keyLabel);
        downloadPanel.add(this.keyTextField);
        downloadPanel.add(folderLabel);
        downloadPanel.add(this.folderTextField);
        downloadPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);

        /*
         * 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()) {
                    JOptionPane.showMessageDialog(AmazonS3UtilsWindow.this.dialog.getDialog(),
                            "Aws Access Key not set!", "Error", JOptionPane.ERROR_MESSAGE);

                    if (this.credentialWindow == null) {
                        this.credentialWindow = new ChangeCredentialWindow(AmazonS3UtilsWindow.this.dialog.getDialog());
                    }
                    try {
                        this.credentialWindow.show();
                    } catch (Exception e1) {
                        xBayaEngine.getGUI().getErrorWindow().error(e1);
                    }

                    return;
                }
                AmazonS3UtilsWindow.this.s3Tree.clean();
                BucketsLoader bucketsLoader = new BucketsLoader(xBayaEngine.getGUI(), window.dialog.getDialog());
                bucketsLoader.load(getS3Service(), AmazonS3UtilsWindow.this.s3Tree);
            }
        });

        JButton uploadButton = new JButton("Upload");
        uploadButton.addActionListener(new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if ((window.fileTextField.getText().length() != 0)
                        && (window.uploadBucketTextField.getText().length() != 0)) {
                    S3Uploader s3Uploader = new S3Uploader(xBayaEngine, window.dialog.getDialog());
                    s3Uploader.upload(getS3Service(), AmazonS3UtilsWindow.this.s3Tree,
                            window.uploadBucketTextField.getText(), window.fileTextField.getText());

                    window.fileTextField.setText("");
                    window.folderTextField.setText("");
                } else {
                    xBayaEngine.getGUI().getErrorWindow().error(window.dialog.getDialog(),
                            "Please give input to every upload fields");
                }
            }
        });

        JButton downloadButton = new JButton("Download");
        downloadButton.addActionListener(new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if ((window.downloadBucketTextField.getText().length() != 0)
                        && (window.keyTextField.getText().length() != 0)
                        && (window.folderTextField.getText().length() != 0)) {
                    S3Downloader s3Downloader = new S3Downloader(xBayaEngine, window.dialog.getDialog());
                    s3Downloader.download(getS3Service(), window.downloadBucketTextField.getText(),
                            window.keyTextField.getText(), window.folderTextField.getText());

                    window.downloadBucketTextField.setText("");
                    window.keyTextField.setText("");
                    window.folderTextField.setText("");

                } else {
                    xBayaEngine.getGUI().getErrorWindow().error(window.dialog.getDialog(),
                            "Please give input to every download fields");
                }
            }
        });

        JButton fileButton = new JButton("Choose File & Flolder");
        fileButton.addActionListener(new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                final JFileChooser fc = new JFileChooser();
                fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
                int returnVal = fc.showOpenDialog(AmazonS3UtilsWindow.this.dialog.getDialog());

                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    String filePath = fc.getSelectedFile().getAbsolutePath();
                    File file = fc.getSelectedFile();
                    if (file.isFile()) {
                        window.fileTextField.setText(filePath);
                        window.folderTextField.setText("");
                    } else if (file.isDirectory()) {
                        window.folderTextField.setText(filePath);
                        window.fileTextField.setText("");
                    }
                }
            }
        });

        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(uploadButton);
        buttonPanel.add(downloadButton);
        buttonPanel.add(fileButton);
        buttonPanel.add(cancelButton);

        /*
         * Main Panel
         */
        GridPanel mainPanel = new GridPanel(true);
        this.s3Tree = new S3Tree();
        mainPanel.add(new JScrollPane(this.s3Tree));
        mainPanel.add(uploadPanel);
        mainPanel.add(downloadPanel);
        mainPanel.layout(3, 1, 0, GridPanel.WEIGHT_EQUALLY);

        this.s3Tree.addTreeSelectionListener(new TreeSelectionListener() {
            @Override
            public void valueChanged(TreeSelectionEvent e) {
                DefaultMutableTreeNode node = AmazonS3UtilsWindow.this.s3Tree.getSelectedNode();
View Full Code Here

        XBayaLabel accessKeyIDLabel = new XBayaLabel("Access Key", this.accessKeyIDTextField);

        this.secretAccessKeyTextField = new XBayaTextField();
        XBayaLabel secretAccessKeyLabel = new XBayaLabel("Secret Access Key", this.secretAccessKeyTextField);

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(accessKeyIDLabel);
        infoPanel.add(this.accessKeyIDTextField);
        infoPanel.add(secretAccessKeyLabel);
        infoPanel.add(this.secretAccessKeyTextField);

        infoPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);

        GridPanel mainPanel = new GridPanel();
        mainPanel.add(infoPanel);
        mainPanel.layout(1, 1, GridPanel.WEIGHT_EQUALLY, GridPanel.WEIGHT_EQUALLY);

        JButton okButton = new JButton("Ok");
        okButton.addActionListener(new AbstractAction() {

            @Override
View Full Code Here

        this.inputLocationOnS3TextField.setText("s3n://xbaya-ec2-test/input/");
        this.outputLocationOnS3TextField.setText("s3n://xbaya-ec2-test/output/");
        this.jarFilePathOnS3TextField.setText("s3n://xbaya-ec2-test/jars/Hadoopv400.jar");
        this.mainClassNameTextField.setText("edu.indiana.extreme.HadoopRayTracer");

        GridPanel infoPanel = new GridPanel();
        infoPanel.add(accessKeyIDLabel);
        infoPanel.add(this.accessKeyIDTextField);
        infoPanel.add(secretAccessKeyLabel);
        infoPanel.add(this.secretAccessKeyTextField);
        infoPanel.add(keyPairNameLabel);
        infoPanel.add(this.keyPairNameTextField);
        infoPanel.add(numOfInstancesLabel);
        infoPanel.add(this.numOfInstancesTextField);
        infoPanel.add(jobFlowNameLabel);
        infoPanel.add(this.jobFlowNameTextField);
        infoPanel.add(logLocationOnS3Label);
        infoPanel.add(this.logLocationOnS3TextField);
        infoPanel.add(inputLocationOnS3Label);
        infoPanel.add(this.inputLocationOnS3TextField);
        infoPanel.add(outputLocationOnS3Label);
        infoPanel.add(this.outputLocationOnS3TextField);
        infoPanel.add(jarFilePathOnS3Label);
        infoPanel.add(this.jarFilePathOnS3TextField);
        infoPanel.add(mainClassNameLabel);
        infoPanel.add(this.mainClassNameTextField);

        infoPanel.layout(10, 2, GridPanel.WEIGHT_NONE, 1);

        GridPanel mainPanel = new GridPanel();
        mainPanel.add(infoPanel);
        mainPanel.layout(1, 1, 0, 0);

        this.invokeButton = new JButton("Invoke");
        this.invokeButton.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                execute();
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.ui.widgets.GridPanel

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.