Package com.volantis.mcs.eclipse.common.odom

Examples of com.volantis.mcs.eclipse.common.odom.ODOMSelectionManager


                updateListBuilder();
            }
        };
        // retrieve the ODOMSelectionManager. This is managing device
        // selections in the device hierarchy
        ODOMSelectionManager selectionManager =
                context.getODOMSelectionManager();

        // Create a filter so that only device elements are included in
        // the selection.
        ODOMSelectionFilter deviceFilter = new ODOMSelectionFilter(null,
                new String[]{DeviceRepositorySchemaConstants.DEVICE_ELEMENT_NAME},
                new ODOMSelectionFilterConfiguration(true, true));

        // register an ODOMSelection listener with the ODOMSelectionManager
        // so that we can update the list builder whenever a device is selected
        selectionManager.addSelectionListener(
                new ODOMElementSelectionListener() {
                    // javadoc inherited
                    public void selectionChanged(ODOMElementSelectionEvent event) {
                        if (selectedDevice != null) {
                            selectedDevice.removeChangeListener(odomChangeListener);
View Full Code Here


                            context.getRootElement().getName(),
                            LayoutSchemaType.CANVAS_LAYOUT.getName(),
                            LayoutSchemaType.MONTAGE_LAYOUT.getName()
                        });

        final ODOMSelectionManager manager = context.getODOMSelectionManager();

        manager.addSelectionListener(listener, filter);

        formatComposite.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent event) {
                manager.removeSelectionListener(listener, filter);
                // Set the selection to the device layout element otherwise
                // nothing will be selected.
                ArrayList selection = new ArrayList();
                selection.add(deviceLayout);
                manager.setSelection(selection);
            }
        });
    }
View Full Code Here

        }

        // create this sections display area
        createDisplayArea(TITLE, MESSAGE);

        final ODOMSelectionManager selectionManager =
                context.getODOMSelectionManager();

        // create a listener that responds to ODOMElement selections
        ODOMElementSelectionListener deviceSelectionListener =
                new ODOMElementSelectionListener() {
                    // javadoc inherited
                    public void selectionChanged(
                            ODOMElementSelectionEvent event) {
                        treeViewer.removeSelectionChangedListener(
                                selectionManager);
                        treeViewer.setSelection(event.getSelection(), true);
                        treeViewer.getTree().showSelection();
                        treeViewer.addSelectionChangedListener(
                                selectionManager);

                        ODOMElement selected = getSelectedDevice();
                        boolean enable = (selected != null &&
                                !isRootDevice(selected) &&
                                (context.isAdminProject() ||
                                !context.getDeviceRepositoryAccessorManager().
                                isStandardDevice(getDeviceName(selected))));

                        // Disable the delete and move actions if there
                        // is no selection or the master device is selected or
                        // if the device is a standard device and the project
                        // is not in admin mode.
                        deleteAction.setEnabled(enable);
                        moveAction.setEnabled(enable);
                        renameAction.setEnabled(enable);

                        // The new action is always enabled if there is a
                        // selection.
                        newAction.setEnabled(selected != null);
                        viewDeviceXMLAction.setEnabled(selected != null);

                    }
                };
        // register the ODOM selection listener with the contexts selection
        // manager
        selectionManager.addSelectionListener(deviceSelectionListener,
                DEVICE_FILTER);

        // we want to update the tree whenever a hierarchy element is modified
        ODOMChangeListener rootElementListener = new ODOMChangeListener() {
            public void changed(ODOMObservable node,
View Full Code Here

     *
     * @return a ODOMSelectionManager instance
     */
    protected ODOMSelectionManager createODOMSelectionManager() {
        // don't need a filter
        return new ODOMSelectionManager(null);
    }
View Full Code Here

                updateListBuilder();
            }
        };
        // retrieve the ODOMSelectionManager. This is managing device
        // selections in the device hierarchy
        ODOMSelectionManager selectionManager =
                context.getODOMSelectionManager();


        // Create a filter so that only device elements are included in
        // the selection.
        ODOMSelectionFilter deviceFilter = new ODOMSelectionFilter(null,
                new String[]{DeviceRepositorySchemaConstants.
                DEVICE_ELEMENT_NAME},
                new ODOMSelectionFilterConfiguration(true, true));

        // register an ODOMSelection listener with the ODOMSelectionManager
        // so that we can update the list builder whenever a device is selected
        selectionManager.addSelectionListener(
                new ODOMElementSelectionListener() {
                    // javadoc inherited
                    public void selectionChanged(ODOMElementSelectionEvent event) {
                        if (selectedDevice != null) {
                            selectedDevice.removeChangeListener(odomChangeListener);
View Full Code Here

     * Constructs the actions and places them in a map, indexed by their
     * action IDs.
     */
    public static Map createActions(final ODOMEditorContext context) {
        final Map actions = new HashMap();
        final ODOMSelectionManager manager = context.
                getODOMSelectionManager();

        actions.put(ActionID.CANVAS_NEW_MENU,
                new SubMenuAction(
                        new NewMenuActionCommand(manager),
View Full Code Here

        final ElementChildrenTreeContentProvider contentProvider =
                new ElementChildrenTreeContentProvider(skipElements,
                        stopElements, attributesAsChildren, false);

        final TreeViewer treeViewer = getTreeViewer();
        final ODOMSelectionManager selectionManager =
                context.getODOMSelectionManager();
        treeViewer.addSelectionChangedListener(selectionManager);

        ODOMElementSelectionListener selectionListener =
                new ODOMElementSelectionListener() {
                    public void
                            selectionChanged(ODOMElementSelectionEvent event) {
                        treeViewer.
                                removeSelectionChangedListener(selectionManager);
                        treeViewer.setSelection(event.getSelection(), true);
                        treeViewer.addSelectionChangedListener(selectionManager);
                    }
                };

        selectionManager.addSelectionListener(selectionListener,
                selectionFilter);

        treeViewer.setContentProvider(contentProvider);

View Full Code Here

                updateListBuilder();
            }
        };
        // retrieve the ODOMSelectionManager. This is managing device
        // selections in the device hierarchy
        ODOMSelectionManager selectionManager =
                context.getODOMSelectionManager();

        // register an ODOMSelection listener with the ODOMSelectionManager
        // so that we can update the list builder whenever a device is selected
        selectionManager.addSelectionListener(
                new ODOMElementSelectionListener() {
                    // javadoc inherited
                    public void selectionChanged(ODOMElementSelectionEvent event) {
                        if (selectedDevice != null) {
                            selectedDevice.removeChangeListener(odomChangeListener);
View Full Code Here

            e.printStackTrace();
        } catch (RepositoryException e) {
            e.printStackTrace();
        }

        manager = new ODOMSelectionManager(null);

        // Create the widgets for the test
        createDeviceCombo(comboContainer);
        createCategoryCombo(comboContainer);
        createCategoryComposite(currentCategory = categoryCombo.getText());
View Full Code Here

            // Create the section detail first so we have something to add the
            // attributes composite controls into.
            SectionDetailsComposite sdc = new SectionDetailsComposite(
                    scrollable, SWT.NONE, section, element,
                    project,
                    new ODOMSelectionManager(null),
                    filter,
                    null);
            sdc.setBackground(colors[colourIndex%colors.length]);
            ++colourIndex;
            sectionDetailsComposites.add(sdc);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.common.odom.ODOMSelectionManager

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.