Package com.volantis.mcs.eclipse.ab.editors.themes

Examples of com.volantis.mcs.eclipse.ab.editors.themes.StyleValueComposite


     */
    private void addControlRow(Composite parent, StyleValueType[] types) {

        Set valueTypes = createTypeSet(types);
        // create the StyleValueComposite object
        final StyleValueComposite styleValueComposite =
            createStyleValueComposite(parent, valueTypes);

        GridData data = new GridData(GridData.FILL_HORIZONTAL);
        styleValueComposite.setLayoutData(data);
       
        // new container that the 2 supporting controls will be added to.
        GridLayout layout = new GridLayout(2, false);
        Composite container = new Composite(parent, SWT.DEFAULT);
        container.setLayout(layout);
        container.setLayoutData(new GridData(GridData.FILL_BOTH));

        // create the drop down that will call the displayElement method
        // on the StyleValueComposite whenever an item is selected
        createLabel(container, "Display Element Type: ");
        final Combo combo = createDiplayElememntSelection(container,
                                                          valueTypes);
        combo.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                StyleValueType type = StyleValueType.get(combo.getText());
                Element element = (Element) elements.get(type);
                styleValueComposite.displayElement(element);
            }
        });

        // add the text field that will display the value that the
        // StyleValueComposites getValue method returns
        createLabel(container, "value: ");
        final Text textField = createTextField(container);

        styleValueComposite.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                textField.setText(styleValueComposite.getValue());
            }
        });
    }
View Full Code Here


     * @param valueTypes the StyleValueTypes that the control should support
     * @return a StyleValueComposite instance
     */
    private StyleValueComposite createStyleValueComposite(Composite parent,
                                                          Set valueTypes) {
        final StyleValueComposite composite =
            new StyleValueComposite(parent,
                                    valueTypes,
                                    createKeywordMapper(),
                                    createBrowseAction(),
                                    null);
        composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER &
                                             GridData.FILL_HORIZONTAL));
        return composite;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.ab.editors.themes.StyleValueComposite

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.