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

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


    /**
     * Shows the dialog.
     */
    public void show() {
        QName type = this.node.getParameterType();
        XBayaTextComponent textComponent;
        boolean knownType = LEADTypes.isKnownType(type);
        if (knownType) {
            textComponent = this.valueTextField;
            this.valueLabel.setText("Default value");
        } else {
            textComponent = this.valueTextArea;
            this.valueLabel.setText("Default value (in XML)");
        }
        this.valueLabel.setLabelFor(textComponent);
        final int index = 5;
        this.gridPanel.remove(index);
        this.gridPanel.add(textComponent, index);
        if (knownType) {
            this.gridPanel.layout(new double[] { 0, 1.0 / 2, 0, 1.0 / 2 },
                    new double[] { 0, 1 });
        } else {
            this.gridPanel.layout(
                    new double[] { 0, 1.0 / 3, 1.0 / 3, 1.0 / 3 },
                    new double[] { 0, 1 });
        }

        // String name = this.node.getConfiguredName();
        // if (name == null) {
        // name = this.node.getName();
        // }
        String name = this.node.getID(); // Show ID.
        this.nameTextField.setText(name);

        this.descriptionTextArea.setText(this.node.getDescription());
        Object value = this.node.getDefaultValue();
        String valueString;
        if (value == null) {
            valueString = "";
        } else if (value instanceof XmlElement) {
            valueString = XMLUtil.xmlElementToString((XmlElement) value);
        } else {
            valueString = value.toString();
        }
        textComponent.setText(valueString);
        XmlElement metadata = this.node.getMetadata();
        String metadataText;
        if (metadata == null) {
            metadataText = WSConstants.EMPTY_APPINFO;
        } else {
View Full Code Here


        ((DifferedInputNodeGUI)NodeController.getGUI(this.node)).closingDisplay();
    }

    private void setInput() {
        QName type = this.node.getParameterType();
        XBayaTextComponent textComponent;
        if (LEADTypes.isKnownType(type)) {
            textComponent = this.valueTextField;
        } else {
            textComponent = this.valueTextArea;
        }

        String name = this.nameTextField.getText();
        String description = this.descriptionTextArea.getText();
        String valueString = textComponent.getText();
        String metadataText = this.metadataTextArea.getText();

        if (name.length() == 0) {
            String warning = "The name cannot be empty.";
            this.xbayaGUI.getErrorWindow().error(warning);
View Full Code Here

    /**
     * Shows the dialog.
     */
    public void show() {
        QName type = this.node.getParameterType();
        XBayaTextComponent textComponent;
        boolean knownType = LEADTypes.isKnownType(type);
        if (knownType) {
            textComponent = this.valueTextField;
            this.valueLabel.setText("Default value");
        } else {
            textComponent = this.valueTextArea;
            this.valueLabel.setText("Default value (in XML)");
        }
        this.valueLabel.setLabelFor(textComponent);
        final int index = 5;
        this.gridPanel.remove(index);
        this.gridPanel.add(textComponent, index);
        if (knownType) {
            this.gridPanel.layout(new double[] { 0, 1.0 / 2, 0, 1.0 / 2 },
                    new double[] { 0, 1 });
        } else {
            this.gridPanel.layout(
                    new double[] { 0, 1.0 / 3, 1.0 / 3, 1.0 / 3 },
                    new double[] { 0, 1 });
        }

        // String name = this.node.getConfiguredName();
        // if (name == null) {
        // name = this.node.getName();
        // }
        String name = this.node.getID(); // Show ID.
        this.nameTextField.setText(name);

        this.descriptionTextArea.setText(this.node.getDescription());
        Object value = this.node.getDefaultValue();
        String valueString;
        if (value == null) {
            valueString = "";
        } else if (value instanceof XmlElement) {
            valueString = XMLUtil.xmlElementToString((XmlElement) value);
        } else {
            valueString = value.toString();
        }
        textComponent.setText(valueString);
        XmlElement metadata = this.node.getMetadata();
        String metadataText;
        if (metadata == null) {
            metadataText = WSConstants.EMPTY_APPINFO;
        } else {
View Full Code Here

        ((DifferedInputNodeGUI)NodeController.getGUI(this.node)).closingDisplay();
    }

    private void setInput() {
        QName type = this.node.getParameterType();
        XBayaTextComponent textComponent;
        if (LEADTypes.isKnownType(type)) {
            textComponent = this.valueTextField;
        } else {
            textComponent = this.valueTextArea;
        }

        String name = this.nameTextField.getText();
        String description = this.descriptionTextArea.getText();
        String valueString = textComponent.getText();
        String metadataText = this.metadataTextArea.getText();

        if (name.length() == 0) {
            String warning = "The name cannot be empty.";
            this.xbayaGUI.getErrorWindow().error(warning);
View Full Code Here

            String id = input.getName();
            QName type = input.getType();
            JLabel paramLabel = new JLabel(id, SwingConstants.TRAILING);
            JLabel typeLabel = new JLabel(type.getLocalPart());
            XBayaTextComponent paramField;
            if (LEADTypes.isKnownType(type)) {
                paramField = new XBayaTextField();
                columnWeights.add(new Double(0));
            } else {
                paramField = new XBayaTextArea();
                columnWeights.add(new Double(1.0));
            }
            paramLabel.setLabelFor(paramField.getSwingComponent());

            // default value
            Object value = input.getDefaultValue();
            String valueString = null;
            if (value != null) {
                if (value instanceof XmlElement) {
                    XmlElement valueElement = (XmlElement) value;
                    valueString = XMLUtil.xmlElementToString(valueElement);
                } else {
                    // Only string comes here for now.
                    valueString = value.toString();
                }
            }

            if (valueString == null) {
                // show some sample URI to ease inputs.
                final String sampleURI = "gsiftp://rainier.extreme.indiana.edu//tmp/foo.txt";
                if (LEADTypes.isURIType(type)) {
                    valueString = sampleURI;
                } else if (LEADTypes.isURIArrayType(type)) {
                    StringBuffer buf = new StringBuffer();
                    for (int i = 0; i < 4; i++) {
                        buf.append(sampleURI).append(" ");
                    }
                    valueString = buf.toString();
                }
            }
            paramField.setText(valueString);

            this.parameterPanel.add(paramLabel);
            this.parameterPanel.add(typeLabel);
            this.parameterPanel.add(paramField);
            this.parameterTextFields.add(paramField);
View Full Code Here

    /**
     * Shows the dialog.
     */
    public void show() {
        QName type = this.node.getParameterType();
        XBayaTextComponent textComponent;
        boolean knownType = LEADTypes.isKnownType(type);
        if (knownType) {
            textComponent = this.valueTextField;
            this.valueLabel.setText("Default value");
        } else {
            textComponent = this.valueTextArea;
            this.valueLabel.setText("Default value (in XML)");
        }
        this.valueLabel.setLabelFor(textComponent);
        final int index = 5;
        this.gridPanel.remove(index);
        this.gridPanel.add(textComponent, index);
        if (knownType) {
            this.gridPanel.layout(new double[] { 0, 1.0 / 2, 0, 1.0 / 2 },
                    new double[] { 0, 1 });
        } else {
            this.gridPanel.layout(
                    new double[] { 0, 1.0 / 3, 1.0 / 3, 1.0 / 3 },
                    new double[] { 0, 1 });
        }

        // String name = this.node.getConfiguredName();
        // if (name == null) {
        // name = this.node.getName();
        // }
        String name = this.node.getID(); // Show ID.
        this.nameTextField.setText(name);

        this.descriptionTextArea.setText(this.node.getDescription());
        Object value = this.node.getDefaultValue();
        String valueString;
        if (value == null) {
            valueString = "";
        } else if (value instanceof XmlElement) {
            valueString = XMLUtil.xmlElementToString((XmlElement) value);
        } else {
            valueString = value.toString();
        }
        textComponent.setText(valueString);
        XmlElement metadata = this.node.getMetadata();
        String metadataText;
        if (metadata == null) {
            metadataText = WSConstants.EMPTY_APPINFO;
        } else {
View Full Code Here

        ((DifferedInputNodeGUI)NodeController.getGUI(this.node)).closingDisplay();
    }

    private void setInput() {
        QName type = this.node.getParameterType();
        XBayaTextComponent textComponent;
        if (LEADTypes.isKnownType(type)) {
            textComponent = this.valueTextField;
        } else {
            textComponent = this.valueTextArea;
        }

        String name = this.nameTextField.getText();
        String description = this.descriptionTextArea.getText();
        String valueString = textComponent.getText();
        String metadataText = this.metadataTextArea.getText();

        if (name.length() == 0) {
            String warning = "The name cannot be empty.";
            this.xbayaGUI.getErrorWindow().error(warning);
View Full Code Here

    /**
     * Shows the dialog.
     */
    public void show() {
        QName type = this.node.getParameterType();
        XBayaTextComponent textComponent;
        boolean knownType = LEADTypes.isKnownType(type);
        if (knownType) {
            textComponent = this.valueTextField;
            this.valueLabel.setText("Default value");
        } else {
            textComponent = this.valueTextArea;
            this.valueLabel.setText("Default value (in XML)");
        }
        this.valueLabel.setLabelFor(textComponent);
        final int index = 7;
        this.gridPanel.remove(index);
        this.gridPanel.add(textComponent, index);
        if (knownType) {
            this.gridPanel.layout(new double[] { 0, 1.0 / 2,0, 0, 1.0 / 2 }, new double[] { 0, 1 });
        } else {
            this.gridPanel.layout(new double[] { 0, 1.0 / 3,0, 1.0 / 3, 1.0 / 3 }, new double[] { 0, 1 });
        }

        String name = this.node.getID(); // Show ID.
        this.nameTextField.setText(name);

        String visibility = Boolean.toString(this.node.isVisibility());
        this.visibilityTextField.setText(visibility);

        this.descriptionTextArea.setText(this.node.getDescription());
        Object value = this.node.getDefaultValue();
        String valueString;
        if (value == null) {
            valueString = "";
        } else if (value instanceof XmlElement) {
            valueString = XMLUtil.xmlElementToString((XmlElement) value);
        } else {
            valueString = value.toString();
        }
        if (knownType) {
            this.valueTextField.setText(valueString);
        } else {
            this.valueTextArea.setText(valueString);
        }
        textComponent.setText(valueString);
        XmlElement metadata = this.node.getMetadata();
        String metadataText;
        if (metadata == null) {
            metadataText = WSConstants.EMPTY_APPINFO;
        } else {
View Full Code Here

        this.dialog.hide();
    }

    private void setInput() {
        QName type = this.node.getParameterType();
        XBayaTextComponent textComponent;
        if (LEADTypes.isKnownType(type)) {
            textComponent = this.valueTextField;
        } else {
            textComponent = this.valueTextArea;
        }

        String name = this.nameTextField.getText();
        String description = this.descriptionTextArea.getText();
        String valueString = textComponent.getText();
        String metadataText = this.metadataTextArea.getText();
        String visibilityText = this.visibilityTextField.getText();

        if (name.length() == 0) {
            String warning = "The name cannot be empty.";
View Full Code Here

    /**
     * Shows the dialog.
     */
    public void show() {
        QName type = this.node.getType();
        XBayaTextComponent textComponent;
        if (LEADTypes.isKnownType(type)) {
            textComponent = this.valueTextField;
            this.valueLabel.setText("Default value");
        } else {
            textComponent = this.valueTextArea;
            this.valueLabel.setText("Default value (in XML)");
        }
        this.valueLabel.setLabelFor(textComponent);
        final int index = 7;
        this.gridPanel.remove(index);
        this.gridPanel.add(textComponent, index);
        this.gridPanel.layout(4, 2, 3, 1);

        String name = this.node.getName();
        this.nameTextField.setText(name);
        this.idTextField.setText(this.node.getID());
        this.typeTextField.setText(type.toString());
        Object value = this.node.getValue();
        String valueString;
        if (value == null) {
            valueString = "";
        } else if (value instanceof XmlElement) {
            valueString = XMLUtil.xmlElementToString((XmlElement) value);
        } else {
            valueString = value.toString();
        }
        textComponent.setText(valueString);

        this.dialog.show();
    }
View Full Code Here

TOP

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

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.