Package com.volantis.mcs.eclipse.controls

Examples of com.volantis.mcs.eclipse.controls.ComboViewer


            String assetName = (String) elements.get(i);
            String resourceName = EclipseCommonMessages.getString(
                        "PolicyName." + assetName); //$NON-NLS-1$
            items[i] = new PresentableItem(assetName, resourceName);
        }
        assetTypeCombo = new ComboViewer(displayArea, SWT.READ_ONLY |
                SWT.DROP_DOWN, items);
        GridData comboData = new GridData(GridData.FILL_HORIZONTAL);
        assetTypeCombo.setLayoutData(comboData);
        String name = odomElement.getName();
        // On Windows it is necessary to deselect to set to something not
View Full Code Here


     * @param values The values to display in the combo box
     * @return The created {@link ComboViewer}
     */
    private ComboViewer addCombo(Composite parent, PresentableItem[] values) {
        int style = (SWT.READ_ONLY | SWT.DROP_DOWN);
        final ComboViewer combo =
                new ComboViewer(parent, style, values);

        GridData comboGridData = new GridData(GridData.FILL_HORIZONTAL);
        combo.setLayoutData(comboGridData);

        return combo;
    }
View Full Code Here

        Label compositionLabel = new Label(container, SWT.NONE);
        compositionLabel.setText(COMPOSITION_TEXT);

        PresentableItem[] compItems = DevicesMessages.getLocalizedCompositions();

        compositionCombo = new ComboViewer(container, SWT.READ_ONLY, compItems);
        compositionCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

        // Add a listener which responds to composition selections by
        // populating the type Combo with the appropriate PolicyTypes.
        compositionCombo.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                populateTypeCombo();
            }
        });

        Label typeLabel = new Label(container, SWT.NONE);
        typeLabel.setText(TYPE_TEXT);

        PresentableItem[] typeItems =
                DevicesMessages.getLocalizedPolicyTypes(
                        (PolicyTypeComposition) compItems[0].realValue);

        typeCombo = new ComboViewer(container, SWT.READ_ONLY, typeItems);
        typeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

        // Set the initial composition selection and populate the type Combo.
        compositionCombo.getCombo().select(0);
        populateTypeCombo();
View Full Code Here

        // @todo there is a problem on windows that results in editable combo viewers behaving incorrectly.
        // @todo this will be fixed.
        //int style = editable ? SWT.DROP_DOWN : (SWT.READ_ONLY | SWT.DROP_DOWN);
        int style = (SWT.READ_ONLY | SWT.DROP_DOWN);
        final ComboViewer combo =
                new ComboViewer(controlDetails.attributesComposite, style,
                        items);

        controlDetails.attributesComposite.
                setData(controlDetails.attribute, combo);

        combo.setData(AttributesComposite.ATTRIBUTE_ACCESSOR_KEY,
                new AttributesComposite.AttributeAccessor() {
                    public String getValue(String attribute) {
                        return (String) combo.getValue();
                    }

                    public void setValue(String attribute, String value) {
                        combo.getCombo().deselectAll();
                        combo.setValue(value);
                    }
                });

        combo.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                Object oldValue = null;
                Object newValue = combo.getValue();
                PropertyChangeEvent propertyChange = new PropertyChangeEvent(
                        combo, controlDetails.attribute, oldValue, newValue);
                controlDetails.attributesComposite.
                        propertyChange(propertyChange);
            }
        });

        // Add an accessible listener
        addAccessibleListener(combo, controlDetails);

        GridData comboGridData = new GridData(GridData.FILL_HORIZONTAL);
        combo.setLayoutData(comboGridData);

        combo.setData(ATTRIBUTE_NAME_KEY, controlDetails.attribute);

        associateHandlerWithCombo(controlDetails.handler, combo.getCombo());
    }
View Full Code Here

     * Adds a Combo control that will be used to edit the type of the currently
     * selected policy.
     */
    private void addPolicyTypeCombo() {
        createLabel(TYPE_LABEL);
        typeCombo = new ComboViewer(displayArea,
                                    SWT.READ_ONLY,
                                    new PresentableItem[] {
                                        new PresentableItem("", "")
                                    });

View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.controls.ComboViewer

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.