Search in sources :

Example 6 with XBayaTextArea

use of org.apache.airavata.xbaya.ui.widgets.XBayaTextArea in project airavata by apache.

the class ErrorWindow method showErrorDialog.

private void showErrorDialog(Component parent, String title, String message, Throwable e) {
    String[] options = new String[] { "OK", "Detail" };
    int result = JOptionPane.showOptionDialog(parent, message, title, JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, null, options, options[0]);
    if (result == 1) {
        // A user clicked "Detail".
        // Gets the stack trace as a string
        StringWriter stringWriter = new StringWriter();
        PrintWriter printWriter = new PrintWriter(stringWriter);
        if (e != null) {
            e.printStackTrace(printWriter);
        }
        printWriter.close();
        String stackTrace = stringWriter.toString();
        JLabel messageLabel = new JLabel(messageSplitter(message));
        XBayaTextArea textArea = new XBayaTextArea();
        textArea.setEditable(false);
        textArea.setSize(800, 600);
        textArea.setText(stackTrace);
        GridPanel mainPanel = new GridPanel();
        mainPanel.add(messageLabel);
        mainPanel.add(textArea);
        mainPanel.layout(2, 1, 1, 0);
        JButton okButton = new JButton("OK");
        okButton.setDefaultCapable(true);
        JPanel buttonPanel = new JPanel();
        buttonPanel.add(okButton);
        final XBayaDialog dialog = new XBayaDialog(SwingUtilities.getWindowAncestor(parent), title, mainPanel, buttonPanel);
        okButton.addActionListener(new AbstractAction() {

            public void actionPerformed(ActionEvent event) {
                dialog.hide();
            }
        });
        dialog.setDefaultButton(okButton);
        dialog.show();
    }
}
Also used : JPanel(javax.swing.JPanel) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) StringWriter(java.io.StringWriter) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) XBayaTextArea(org.apache.airavata.xbaya.ui.widgets.XBayaTextArea) AbstractAction(javax.swing.AbstractAction) PrintWriter(java.io.PrintWriter)

Example 7 with XBayaTextArea

use of org.apache.airavata.xbaya.ui.widgets.XBayaTextArea in project airavata by apache.

the class ParameterPropertyPanel method initGUI.

private void initGUI() {
    this.parameterList = new XBayaList();
    this.parameterList.addListSelectionListener(new ListSelectionListener() {

        public void valueChanged(ListSelectionEvent event) {
            selectionChanged();
        }
    });
    this.upButton = new JButton("UP");
    this.upButton.setEnabled(false);
    this.upButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            up();
        }
    });
    this.downButton = new JButton("DOWN");
    this.downButton.setEnabled(false);
    this.downButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            down();
        }
    });
    GridPanel buttonPanel = new GridPanel();
    buttonPanel.add(this.upButton);
    buttonPanel.add(this.downButton);
    buttonPanel.layout(2, 1, GridPanel.WEIGHT_NONE, 0);
    GridPanel reorderingPanel = new GridPanel();
    reorderingPanel.add(this.parameterList);
    reorderingPanel.add(buttonPanel);
    reorderingPanel.layout(1, 2, 0, 0);
    this.metadataTextArea = new XBayaTextArea();
    JLabel metadataLabel = new JLabel("Metadata");
    metadataLabel.setLabelFor(this.metadataTextArea.getSwingComponent());
    this.panel = new GridPanel();
    this.panel.add(reorderingPanel);
    this.panel.add(metadataLabel);
    this.panel.add(this.metadataTextArea);
    this.panel.layout(3, 1, 2, 0);
    TitledBorder border = BorderFactory.createTitledBorder(this.title);
    this.panel.getSwingComponent().setBorder(border);
}
Also used : ActionEvent(java.awt.event.ActionEvent) GridPanel(org.apache.airavata.xbaya.ui.widgets.GridPanel) XBayaList(org.apache.airavata.xbaya.ui.widgets.XBayaList) ListSelectionEvent(javax.swing.event.ListSelectionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) XBayaTextArea(org.apache.airavata.xbaya.ui.widgets.XBayaTextArea) TitledBorder(javax.swing.border.TitledBorder) AbstractAction(javax.swing.AbstractAction) ListSelectionListener(javax.swing.event.ListSelectionListener)

Example 8 with XBayaTextArea

use of org.apache.airavata.xbaya.ui.widgets.XBayaTextArea 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 9 with XBayaTextArea

use of org.apache.airavata.xbaya.ui.widgets.XBayaTextArea 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 10 with XBayaTextArea

use of org.apache.airavata.xbaya.ui.widgets.XBayaTextArea in project airavata by apache.

the class ServiceInteractionWindow method initGui.

/**
 */
private void initGui() {
    GridPanel mainPanel = new GridPanel();
    MonitorPanel monitorPanel = new MonitorPanel(this.xbayaGUI, this.nodeID, monitor);
    this.consoleTextArea = new XBayaTextArea();
    XBayaLabel consoleLabel = new XBayaLabel("Console", this.consoleTextArea);
    this.commandField = new XBayaTextField();
    XBayaLabel commandLabel = new XBayaLabel("Command", this.commandField);
    mainPanel.add(monitorPanel);
    mainPanel.add(consoleLabel);
    mainPanel.add(this.consoleTextArea);
    mainPanel.add(commandLabel);
    mainPanel.add(this.commandField);
    mainPanel.layout(5, 1, GridPanel.WEIGHT_NONE, 1);
    JButton sendButton = new JButton("Send");
    sendButton.addActionListener(new AbstractAction() {

        /**
         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
         */
        public void actionPerformed(ActionEvent e) {
            send();
        }
    });
    JButton cancelButton = new JButton("Done");
    cancelButton.addActionListener(new AbstractAction() {

        public void actionPerformed(ActionEvent e) {
            hide();
        }
    });
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(sendButton);
    buttonPanel.add(cancelButton);
    this.dialog = new XBayaDialog(this.xbayaGUI, "Deploy workflow to ODE and Registry", mainPanel, buttonPanel);
    this.dialog.setDefaultButton(sendButton);
}
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) MonitorPanel(org.apache.airavata.xbaya.ui.views.MonitorPanel) XBayaTextArea(org.apache.airavata.xbaya.ui.widgets.XBayaTextArea) 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)11 AbstractAction (javax.swing.AbstractAction)11 JButton (javax.swing.JButton)11 GridPanel (org.apache.airavata.xbaya.ui.widgets.GridPanel)11 XBayaTextArea (org.apache.airavata.xbaya.ui.widgets.XBayaTextArea)11 JPanel (javax.swing.JPanel)10 XBayaDialog (org.apache.airavata.xbaya.ui.dialogs.XBayaDialog)9 XBayaLabel (org.apache.airavata.xbaya.ui.widgets.XBayaLabel)9 XBayaTextField (org.apache.airavata.xbaya.ui.widgets.XBayaTextField)8 JLabel (javax.swing.JLabel)2 TitledBorder (javax.swing.border.TitledBorder)2 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 JCheckBox (javax.swing.JCheckBox)1 EtchedBorder (javax.swing.border.EtchedBorder)1 ListSelectionEvent (javax.swing.event.ListSelectionEvent)1 ListSelectionListener (javax.swing.event.ListSelectionListener)1 MonitorPanel (org.apache.airavata.xbaya.ui.views.MonitorPanel)1 XBayaList (org.apache.airavata.xbaya.ui.widgets.XBayaList)1