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

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


        });

        // Add a listener to the selection manager which responds to device
        // element selections.
        context.getODOMSelectionManager().
                addSelectionListener(new ODOMElementSelectionListener() {

                    public void selectionChanged(ODOMElementSelectionEvent event) {
                        ODOMElementSelection selection = event.getSelection();

                        if (!selection.isEmpty()) {
View Full Code Here


                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

            // Create a selection listener for the ODOMSelectionManager which
            // updates the PolicyController whenever the device selection
            // changes. The PolicyController only updates if it detects a
            // different device.
            final ODOMElementSelectionListener selectionListener =
                    new ODOMElementSelectionListener() {
                        public void selectionChanged(
                                ODOMElementSelectionEvent event) {
                            // This is a single-select context. Note that this
                            // retrieved element comes from the hierarchy
                            // document and not from a device document.
                            if (!event.getSelection().isEmpty()) {
                                ODOMElement selectedElement = (ODOMElement)
                                        event.getSelection().getFirstElement();

                                String deviceName =
                                        selectedElement.getAttributeValue(
                                                DeviceRepositorySchemaConstants.
                                        DEVICE_NAME_ATTRIBUTE);

                                controller.setDeviceName(deviceName);
                            }
                        }
                    };

            selectionListenerList.add(selectionListener);

            context.getODOMSelectionManager().addSelectionListener(selectionListener,
                    DEVICE_FILTER);

            if (selectedDeviceName != null) {
                controller.setDeviceName(selectedDeviceName);
            }
        }

        // Adds a dispose listener to the built category composite. This
        // listener cleans up by removing the selection listeners added to
        // the selection manager (above) for each PolicyController, and
        // disposes of each PolicyController.
        categoryComposite.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
                // The selection listeners inform the policy controllers
                // of changes. Logically, it is safest to remove the listeners
                // before dealing with the policy controller cleanup.
                Iterator it = selectionListenerList.iterator();
                while (selectionListenerList.size() > 0) {
                    ODOMElementSelectionListener listener =
                            (ODOMElementSelectionListener)
                            selectionListenerList.remove(0);

                    context.getODOMSelectionManager().
                            removeSelectionListener(listener,
View Full Code Here

        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);
View Full Code Here

                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

        // so that it knows at the time of building what the selected device
        // is. It is possible for the selected device to be null at the
        // time the CategoryComposite is built e.g. before any device is
        // selected when the editor is first loaded. The
        // CategoryCompositeBuilder should handle this scenario.        
        final ODOMElementSelectionListener selectionListener =
                new ODOMElementSelectionListener() {
                    public void selectionChanged(
                            ODOMElementSelectionEvent event) {
                        // This is a single-select context. Note that this
                        // retrieved element comes from the hierarchy
                        // document and not from a device document.
View Full Code Here

TOP

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

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.