Package fr.soleil.comete.swing

Examples of fr.soleil.comete.swing.NumberComboBox


        super();
    }

    @Override
    protected NumberComboBox initWidget() {
        NumberComboBox comboBox = new NumberComboBox();
        comboBox.setDisplayedList("0");
        return comboBox;
    }
View Full Code Here


        }
    }

    public void setSelectedText(String text) {
        if (widget != null && isEnabled() && !isReadOnly() && text != null) {
            NumberComboBox combo = (NumberComboBox) widget;

            int index = -1;

            String[] displayedList = combo.getDisplayedList();
            if (displayedList != null) {
                for (int i = 0; i < displayedList.length; i++) {
                    if (text.equals(displayedList[i])) {
                        index = i;
                        break;
                    }
                }
            }

            Number[] numberArray = (Number[]) combo.getNumberArray();
            if (numberArray != null) {
                if (index == -1) {
                    for (int i = 0; i < numberArray.length; i++) {
                        Number anObject = numberArray[i];
                        if (anObject != null && text.equals(anObject.toString())) {
                            index = i;
                            break;
                        }
                    }
                }

                if (index > -1) {
                    combo.setSelectedValue(numberArray[index]);
                }
            }
        }
    }
View Full Code Here

    private static final long serialVersionUID = 8334838473411401965L;
    private final TangoWidgetHelper m_cmdhelper = new TangoWidgetHelper();

    @Override
    public IComponent initWidget() {
        return new NumberComboBox();
    }
View Full Code Here

        super();
    }

    @Override
    protected NumberComboBox initWidget() {
        NumberComboBox comboBox = new NumberComboBox();
        comboBox.setDisplayedList("0");
        return comboBox;
    }
View Full Code Here

        return result;
    }

    public void setSelectedText(String text) {
        if (widget != null && isEnabled() && !isSourceReadOnly() && text != null) {
            NumberComboBox combo = (NumberComboBox) widget;

            int index = -1;

            String[] displayedList = combo.getDisplayedList();
            if (displayedList != null) {
                for (int i = 0; i < displayedList.length; i++) {
                    if (text.equals(displayedList[i])) {
                        index = i;
                        break;
                    }
                }
            }

            Number[] numberArray = (Number[]) combo.getNumberArray();
            if (numberArray != null) {
                if (index == -1) {
                    for (int i = 0; i < numberArray.length; i++) {
                        Number anObject = numberArray[i];
                        if (anObject != null && text.equals(anObject.toString())) {
                            index = i;
                            break;
                        }
                    }
                }

                if (index > -1) {
                    combo.setSelectedValue(numberArray[index]);
                }
            }
        }
    }
View Full Code Here

        super();
    }

    @Override
    protected NumberComboBox initWidget() {
        NumberComboBox comboBox = new NumberComboBox();
        comboBox.setDisplayedList("0");
        return comboBox;
    }
View Full Code Here

        return result;
    }

    public void setSelectedText(String text) {
        if (widget != null && isEnabled() && !isReadOnly() && text != null) {
            NumberComboBox combo = (NumberComboBox) widget;

            int index = -1;

            String[] displayedList = combo.getDisplayedList();
            if (displayedList != null) {
                for (int i = 0; i < displayedList.length; i++) {
                    if (text.equals(displayedList[i])) {
                        index = i;
                        break;
                    }
                }
            }

            Number[] numberArray = (Number[]) combo.getNumberArray();
            if (numberArray != null) {
                if (index == -1) {
                    for (int i = 0; i < numberArray.length; i++) {
                        Number anObject = numberArray[i];
                        if (anObject != null && text.equals(anObject.toString())) {
                            index = i;
                            break;
                        }
                    }
                }

                if (index > -1) {
                    combo.setSelectedValue(numberArray[index]);
                }
            }
        }
    }
View Full Code Here

        Label stringLabel = new Label();
        Label numberLabel = new Label();
        Label booleanLabel = new Label();

        ComboBox stringCombo = new ComboBox();
        NumberComboBox numberCombo = new NumberComboBox();
        BooleanComboBox booleanCombo = new BooleanComboBox();
        StringMatrixComboBoxViewer matrixCombo = new StringMatrixComboBoxViewer();
        matrixCombo.setLinkPopupVisibilityWithEditable(false);

        stringCombo.setObjectArray(new Object[] { "value1", "value2", "value3" });
        stringCombo.setDisplayedList(new String[] { "Label 1", "Label 2", "Label 3" });
        // stringCombo.setEditable(false);

        numberCombo.setObjectArray(new Object[] { Double.valueOf(1), Double.valueOf(2), Double.valueOf(3) });
        numberCombo.setDisplayedList(new String[] { "Label 1", "Label 2", "Label 3" });
        // numberCombo.setEditable(false);

        stringBox.connectWidget(stringLabel, stringScalarKey);
        stringBox.connectWidget(stringCombo, stringScalarWriteKey);
        stringBox.connectWidget(numberLabel, numberScalarKey);
View Full Code Here

TOP

Related Classes of fr.soleil.comete.swing.NumberComboBox

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.