2 * Copyright 2015 Samsung Electronics All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package oic.simulator.serviceprovider.view;
19 import org.eclipse.jface.dialogs.MessageDialog;
20 import org.eclipse.jface.viewers.ILabelProviderListener;
21 import org.eclipse.jface.viewers.IStructuredSelection;
22 import org.eclipse.jface.viewers.ITableLabelProvider;
23 import org.eclipse.jface.viewers.ITreeContentProvider;
24 import org.eclipse.jface.viewers.StructuredSelection;
25 import org.eclipse.jface.viewers.TreeViewer;
26 import org.eclipse.jface.viewers.TreeViewerColumn;
27 import org.eclipse.jface.viewers.Viewer;
28 import org.eclipse.jface.window.Window;
29 import org.eclipse.swt.SWT;
30 import org.eclipse.swt.events.MenuAdapter;
31 import org.eclipse.swt.events.MenuEvent;
32 import org.eclipse.swt.events.SelectionAdapter;
33 import org.eclipse.swt.events.SelectionEvent;
34 import org.eclipse.swt.graphics.Color;
35 import org.eclipse.swt.graphics.Image;
36 import org.eclipse.swt.layout.GridData;
37 import org.eclipse.swt.layout.GridLayout;
38 import org.eclipse.swt.widgets.Composite;
39 import org.eclipse.swt.widgets.Display;
40 import org.eclipse.swt.widgets.Group;
41 import org.eclipse.swt.widgets.Menu;
42 import org.eclipse.swt.widgets.MenuItem;
43 import org.eclipse.swt.widgets.MessageBox;
44 import org.eclipse.swt.widgets.Tree;
45 import org.eclipse.swt.widgets.TreeColumn;
46 import org.eclipse.swt.widgets.TreeItem;
47 import org.eclipse.ui.part.ViewPart;
49 import java.util.ArrayList;
50 import java.util.Collections;
51 import java.util.HashMap;
52 import java.util.List;
55 import org.oic.simulator.ArrayProperty;
56 import org.oic.simulator.AttributeProperty;
57 import org.oic.simulator.AttributeValue;
58 import org.oic.simulator.AttributeValue.TypeInfo;
59 import org.oic.simulator.AttributeValue.ValueType;
60 import org.oic.simulator.ModelProperty;
61 import org.oic.simulator.SimulatorResourceAttribute;
62 import org.oic.simulator.SimulatorResourceModel;
64 import oic.simulator.serviceprovider.Activator;
65 import oic.simulator.serviceprovider.listener.IAutomationListener;
66 import oic.simulator.serviceprovider.listener.IDataChangeListener;
67 import oic.simulator.serviceprovider.listener.ISelectionChangedListener;
68 import oic.simulator.serviceprovider.manager.ResourceManager;
69 import oic.simulator.serviceprovider.manager.UiListenerHandler;
70 import oic.simulator.serviceprovider.model.AttributeElement;
71 import oic.simulator.serviceprovider.model.Resource;
72 import oic.simulator.serviceprovider.model.ResourceRepresentation;
73 import oic.simulator.serviceprovider.model.SingleResource;
74 import oic.simulator.serviceprovider.utils.Constants;
75 import oic.simulator.serviceprovider.utils.Utility;
76 import oic.simulator.serviceprovider.view.dialogs.ModelArrayAddItemDialog;
79 * This class manages and shows the attribute view in the perspective.
81 public class AttributeView extends ViewPart {
83 public static final String VIEW_ID = "oic.simulator.serviceprovider.view.attribute";
85 private TreeViewer attViewer;
87 private AttributeEditingSupport attributeEditor;
89 private ISelectionChangedListener resourceSelectionChangedListener;
90 private IAutomationListener automationUIListener;
91 private IDataChangeListener dataChangeListener;
93 private final String[] attTblHeaders = { "Name", "Value",
95 private final Integer[] attTblColWidth = { 150, 190, 150 };
97 private ResourceManager resourceManager;
99 public AttributeView() {
101 resourceManager = Activator.getDefault().getResourceManager();
103 resourceSelectionChangedListener = new ISelectionChangedListener() {
106 public void onResourceSelectionChange(final Resource resource) {
107 Display.getDefault().asyncExec(new Runnable() {
110 if (null != attViewer) {
111 Tree tree = attViewer.getTree();
112 if (null == tree || tree.isDisposed()) {
116 // Enabling/disabling the tree based on the resource
117 // and automation status.
118 if (resource instanceof SingleResource)
119 if (((SingleResource) resource)
120 .isResourceAutomationInProgress())
121 tree.setEnabled(false);
123 tree.setEnabled(true);
127 .getResourceRepresentation()) {
128 attViewer.setInput(resource
129 .getResourceRepresentation());
130 attViewer.expandAll();
131 tree.setLinesVisible(true);
134 attViewer.setInput(null);
135 tree.setLinesVisible(false);
143 dataChangeListener = new IDataChangeListener() {
146 public void add(final AttributeElement attribute) {
147 Display.getDefault().asyncExec(new Runnable() {
150 attViewer.refresh(attribute.getParent());
151 attViewer.expandAll();
157 public void remove(final AttributeElement attribute) {
158 Display.getDefault().asyncExec(new Runnable() {
161 attViewer.refresh(attribute.getParent());
162 attViewer.expandAll();
168 public void update(final AttributeElement attribute) {
169 Display.getDefault().asyncExec(new Runnable() {
172 attViewer.update(attribute, null);
173 attViewer.expandAll();
179 automationUIListener = new IAutomationListener() {
182 public void onResourceAutomationStart(final SingleResource resource) {
183 Display.getDefault().asyncExec(new Runnable() {
187 if (null == resource || null == attViewer) {
190 Resource resourceInSelection = resourceManager
191 .getCurrentResourceInSelection();
192 if (null == resourceInSelection) {
195 // Checking whether attributes view is currently
196 // displaying the attributes of the
197 // resource whose automation has just started
198 if (resource == resourceInSelection) {
200 tree = attViewer.getTree();
201 if (!tree.isDisposed()) {
202 // Disabling the table to prevent interactions
203 // during the automation
204 tree.setEnabled(false);
213 public void onAutomationComplete(final SingleResource resource,
214 final String attName) {
215 // This method notifies the completion of attribute level
217 Display.getDefault().asyncExec(new Runnable() {
221 if (null == resource) {
224 // Check if the given resourceURI is the uri of the
225 // resource whose attributes are currently being
226 // displayed by this view.
227 Resource resourceInSelection = resourceManager
228 .getCurrentResourceInSelection();
229 if (null == resourceInSelection) {
232 if (resource != resourceInSelection) {
236 tree = attViewer.getTree();
237 if (!tree.isDisposed()) {
238 tree.setEnabled(true);
247 public void createPartControl(Composite parent) {
248 Color color = Display.getDefault().getSystemColor(SWT.COLOR_WHITE);
250 parent.setLayout(new GridLayout());
251 GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
252 parent.setLayoutData(gd);
254 Group attGroup = new Group(parent, SWT.NONE);
255 attGroup.setLayout(new GridLayout());
256 gd = new GridData(SWT.FILL, SWT.FILL, true, true);
257 attGroup.setLayoutData(gd);
258 attGroup.setText("Attributes");
259 attGroup.setBackground(color);
261 Tree addressTree = new Tree(attGroup, SWT.SINGLE | SWT.BORDER
262 | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
263 addressTree.setHeaderVisible(true);
265 attViewer = new TreeViewer(addressTree);
267 createAttributeColumns(attViewer);
269 // make lines and header visible
270 Tree tree = attViewer.getTree();
271 tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
272 tree.setHeaderVisible(true);
273 tree.setLinesVisible(true);
275 attViewer.setContentProvider(new AttributeContentProvider());
276 attViewer.setLabelProvider(new AttributeLabelProvider());
278 addManagerListeners();
280 // Check whether there is any resource selected already
281 Resource resource = resourceManager.getCurrentResourceInSelection();
282 if (resource != null) {
283 attViewer.setInput(resource.getResourceRepresentation());
287 public void createAttributeColumns(TreeViewer viewer) {
288 Tree tree = viewer.getTree();
290 attributeEditor = new AttributeEditingSupport();
292 TreeColumn attName = new TreeColumn(tree, SWT.NONE);
293 attName.setWidth(attTblColWidth[0]);
294 attName.setText(attTblHeaders[0]);
296 TreeColumn attValue = new TreeColumn(tree, SWT.NONE);
297 attValue.setWidth(attTblColWidth[1]);
298 attValue.setText(attTblHeaders[1]);
300 TreeViewerColumn attValueVwrCol = new TreeViewerColumn(attViewer,
302 attValueVwrCol.setEditingSupport(attributeEditor
303 .createAttributeValueEditor(attViewer, true));
305 TreeColumn automation = new TreeColumn(tree, SWT.NONE);
306 automation.setWidth(attTblColWidth[2]);
307 automation.setText(attTblHeaders[2]);
308 TreeViewerColumn automationVwrCol = new TreeViewerColumn(attViewer,
310 automationVwrCol.setEditingSupport(attributeEditor
311 .createAutomationEditor(attViewer));
313 addColumnListeners();
318 private void addColumnListeners() {
319 TreeColumn[] columns = attViewer.getTree().getColumns();
320 for (TreeColumn column : columns) {
321 column.addSelectionListener(new SelectionAdapter() {
323 public void widgetSelected(SelectionEvent e) {
324 // Refreshing the viewer. If combo list is open,
325 // then click events on other parts of the view or outside
326 // the combo should hide the editor.
327 // Refreshing the viewer hides the combo and other editors
335 private void addMenuItems() {
336 if (null != attViewer) {
337 final Tree resourceTreeHead = attViewer.getTree();
338 if (null != resourceTreeHead) {
339 // Below code creates menu entries and shows them on right
340 // clicking a resource
341 final Menu menu = new Menu(resourceTreeHead);
342 resourceTreeHead.setMenu(menu);
343 menu.addMenuListener(new MenuAdapter() {
345 public void menuShown(MenuEvent e) {
346 // Clear existing menu items
347 MenuItem[] items = menu.getItems();
348 for (int index = 0; index < items.length; index++) {
349 items[index].dispose();
352 IStructuredSelection selection = ((IStructuredSelection) attViewer
354 final AttributeElement attElement = (AttributeElement) selection
356 if (null == attElement) {
360 // Check the type of attribute.
361 SimulatorResourceAttribute attribute = attElement
362 .getSimulatorResourceAttribute();
363 if (null == attribute) {
367 AttributeValue value = attribute.value();
368 if (null == value || null == value.get()) {
372 TypeInfo type = value.typeInfo();
374 final Object parent = attElement.getParent();
376 if ((type.mType == ValueType.ARRAY
377 && type.mBaseType == ValueType.RESOURCEMODEL && type.mDepth == 1)
378 && (null == parent || parent instanceof ResourceRepresentation)) {
379 addMenuToOneDimensionalTopLevelModelAttributes(menu);
384 && !(parent instanceof ResourceRepresentation)) {
385 Object grandParent = ((AttributeElement) parent)
387 if (null == grandParent
388 || grandParent instanceof ResourceRepresentation) {
389 AttributeElement parentElement = (AttributeElement) parent;
391 // Check the type of attribute.
392 SimulatorResourceAttribute parentAttribute = parentElement
393 .getSimulatorResourceAttribute();
394 if (null != parentAttribute
395 && null != parentAttribute.value()
396 && null != parentAttribute.value()
398 AttributeValue parentValue = parentAttribute
401 TypeInfo parentType = parentValue
403 if (parentType.mType == ValueType.ARRAY
404 && parentType.mBaseType == ValueType.RESOURCEMODEL
405 && parentType.mDepth == 1) {
406 addDeleteMenuToArrayItemsOfOneDimensionalModelAttribute(
407 menu, attElement, parentElement);
420 private void addMenuToOneDimensionalTopLevelModelAttributes(Menu menu) {
421 // Menu to add items to the array.
422 MenuItem addItems = new MenuItem(menu, SWT.NONE);
423 addItems.setText("Add Items");
424 addItems.addSelectionListener(new SelectionAdapter() {
426 public void widgetSelected(SelectionEvent e) {
427 // Get the attributes.
428 ResourceRepresentation representation;
429 representation = getRepresentationForOneDimensionTopLevelAttribute();
430 if (null == representation) {
432 .openError(Display.getDefault().getActiveShell(),
433 "Unable to perform the operation.",
434 "Failed to obtain the required data. Operation cannot be performed.");
436 // Check whether a new item can be added to the array by
438 // the array property of the current attribute in
439 // selection(Model Array type attribute).
440 AttributeElement attElement = getSelectedElement();
441 SimulatorResourceAttribute attribute = attElement
442 .getSimulatorResourceAttribute();
444 AttributeValue attValue = attribute.value();
445 AttributeProperty attProperty = attribute.property();
446 if (null != attProperty
447 && attProperty instanceof ArrayProperty) {
448 ArrayProperty prop = attProperty.asArray();
449 if (null != prop && !prop.isVariable()) {
450 SimulatorResourceModel[] model = (SimulatorResourceModel[]) attValue
453 && model.length >= prop.maxItems()) {
458 "Unable to perform the operation.",
459 "Exceeding the maximum number of array elements allowed for this attribute.\n"
460 + "Maximum number of allowed array element(s): "
467 ModelArrayAddItemDialog dialog = new ModelArrayAddItemDialog(
468 Display.getDefault().getActiveShell(),
470 if (Window.OK == dialog.open()) {
471 // Add the new item to the local resource
473 AttributeElement newElement = (AttributeElement) representation
474 .getAttributes().values().toArray()[0];
475 SimulatorResourceAttribute newAttribute = newElement
476 .getSimulatorResourceAttribute();
477 SimulatorResourceModel newModel = (SimulatorResourceModel) newAttribute
480 SimulatorResourceModel[] modelArray = (SimulatorResourceModel[]) attribute
482 SimulatorResourceModel[] newModelArray = new SimulatorResourceModel[modelArray.length + 1];
485 for (i = 0; i < modelArray.length; i++) {
486 newModelArray[i] = modelArray[i];
488 newModelArray[i] = newModel;
490 AttributeValue newValue = new AttributeValue(
493 newAttribute.setValue(newValue);
495 newAttribute.setProperty(attribute.property());
497 attElement.update(newAttribute);
499 boolean updated = resourceManager.attributeValueUpdated(
500 (SingleResource) resourceManager
501 .getCurrentResourceInSelection(),
502 attribute.name(), newValue);
505 attribute.setValue(new AttributeValue(modelArray));
506 attElement.update(newAttribute);
509 .openInformation(Display.getDefault()
512 "Failed to insert a new item in the array.");
514 // Highlight the newly added item.
515 AttributeElement addedElement = attElement
516 .getChildren().get("[" + i + "]");
517 attViewer.setSelection(new StructuredSelection(
518 addedElement), true);
526 private void addDeleteMenuToArrayItemsOfOneDimensionalModelAttribute(
527 final Menu menu, final AttributeElement elementToDelete,
528 final AttributeElement parentElement) {
529 // Menu to add items to the array.
530 MenuItem addItems = new MenuItem(menu, SWT.NONE);
531 addItems.setText("Delete Item");
532 addItems.addSelectionListener(new SelectionAdapter() {
534 public void widgetSelected(SelectionEvent e) {
535 // Check whether any existing item can be removed from the array
537 // the array property of the current attribute in
538 // selection(Model Array type attribute).
539 SimulatorResourceAttribute parentSRA = parentElement
540 .getSimulatorResourceAttribute();
541 AttributeValue value = parentSRA.value();
542 AttributeProperty attProperty = parentSRA.property();
543 if (null != attProperty && attProperty instanceof ArrayProperty) {
544 ArrayProperty prop = attProperty.asArray();
546 SimulatorResourceModel[] model = (SimulatorResourceModel[]) value
548 if (null != model && model.length <= prop.minItems()) {
553 "Unable to perform the operation.",
554 "Violating the minimum number of array elements allowed for this attribute.\n"
555 + "Minimum number of allowed array element(s): "
562 MessageBox dialog = new MessageBox(menu.getShell(),
563 SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
564 dialog.setText("Confirm action");
565 dialog.setMessage("Do you want to delete this item from the array?");
566 int retval = dialog.open();
567 if (retval != SWT.OK) {
571 // Removing the element from the attribute value.
572 SimulatorResourceModel[] modelArray = (SimulatorResourceModel[]) value
575 String elementIndexName = elementToDelete
576 .getSimulatorResourceAttribute().name();
577 int elementIndex = Integer.parseInt(elementIndexName.substring(
578 elementIndexName.indexOf('[') + 1,
579 elementIndexName.indexOf(']')));
581 SimulatorResourceModel[] newModelArray = new SimulatorResourceModel[modelArray.length - 1];
582 int sIndex = 0, dIndex = 0;
583 for (SimulatorResourceModel model : modelArray) {
584 if (sIndex != elementIndex)
585 newModelArray[dIndex++] = model;
589 // Setting the new model array in the attribute.
590 AttributeValue newValue = new AttributeValue(newModelArray);
591 parentSRA.setValue(newValue);
593 // Removing the element from the child map.
594 Map<String, AttributeElement> elements = parentElement
596 List<AttributeElement> attElementList = new ArrayList<AttributeElement>();
597 attElementList.addAll(elements.values());
598 Collections.sort(attElementList, Utility.attributeComparator);
600 // Renaming the index of the elements.
601 AttributeElement[] attElementArray = attElementList
602 .toArray(new AttributeElement[0]);
603 boolean deleted = false;
605 for (index = 0, newIndex = 0; index < attElementArray.length; index++) {
606 if (index == elementIndex) {
607 elements.remove(elementIndexName);
611 AttributeElement element = attElementArray[index];
612 String curIndexStr = "[" + index + "]";
613 String newIndexStr = "[" + newIndex + "]";
615 element.getSimulatorResourceAttribute().setName(
618 elements.remove(curIndexStr);
619 elements.put(newIndexStr, element);
625 resourceManager.attributeValueUpdated(
626 (SingleResource) resourceManager
627 .getCurrentResourceInSelection(), parentSRA
630 attViewer.refresh(parentElement);
635 private ResourceRepresentation getRepresentationForOneDimensionTopLevelAttribute() {
636 ResourceRepresentation representation = null;
638 AttributeValue value = null;
639 ModelProperty property = null;
640 SimulatorResourceAttribute attribute;
642 AttributeElement element = getSelectedElement();
646 SimulatorResourceAttribute modelArrayAtt = element
647 .getSimulatorResourceAttribute();
648 if (null == modelArrayAtt) {
652 AttributeValue attValue = modelArrayAtt.value();
653 if (null == attValue) {
657 TypeInfo type = attValue.typeInfo();
659 if (!(type.mType == ValueType.ARRAY
660 && type.mBaseType == ValueType.RESOURCEMODEL && type.mDepth == 1)) {
664 SimulatorResourceModel[] modelValue = (SimulatorResourceModel[]) attValue
666 if (null == modelValue || modelValue.length < 0) {
670 // Clone an instance of model value.
672 value = Utility.cloneAttributeValue(new AttributeValue(
674 } catch (Exception e) {
682 // Get the model property of the model value instance.
683 AttributeProperty attProperty = modelArrayAtt.property();
684 if (null != attProperty && attProperty instanceof ArrayProperty) {
685 ArrayProperty prop = attProperty.asArray();
687 AttributeProperty elementProperty = prop.getElementProperty();
688 if (null != elementProperty && elementProperty.isModel()) {
689 property = elementProperty.asModel();
694 attribute = new SimulatorResourceAttribute(modelArrayAtt.name(), value,
697 Map<String, SimulatorResourceAttribute> attributes = new HashMap<String, SimulatorResourceAttribute>();
698 attributes.put(attribute.name(), attribute);
700 representation = new ResourceRepresentation(attributes);
702 return representation;
705 private AttributeElement getSelectedElement() {
706 IStructuredSelection selection = (IStructuredSelection) attViewer
708 if (null == selection) {
712 Object obj = selection.getFirstElement();
717 Tree t = attViewer.getTree();
718 TreeItem item = t.getSelection()[0];
723 if (!(item.getData() instanceof AttributeElement)) {
727 return (AttributeElement) item.getData();
730 private void addManagerListeners() {
731 UiListenerHandler.getInstance().addResourceSelectionChangedUIListener(
732 resourceSelectionChangedListener);
733 UiListenerHandler.getInstance().addDataChangeListener(
735 UiListenerHandler.getInstance().addAutomationUIListener(
736 automationUIListener);
739 class AttributeContentProvider implements ITreeContentProvider {
742 public void dispose() {
746 public void inputChanged(Viewer viewer, Object oldAttribute,
747 Object newAttribute) {
751 public Object[] getChildren(Object attribute) {
752 if (attribute instanceof AttributeElement) {
753 List<AttributeElement> attElementList = new ArrayList<AttributeElement>();
754 Map<String, AttributeElement> children = ((AttributeElement) attribute)
756 if (null != children) {
757 attElementList.addAll(children.values());
758 Collections.sort(attElementList,
759 Utility.attributeComparator);
760 return attElementList.toArray();
764 return new Object[0];
768 public Object getParent(Object attribute) {
769 if (attribute instanceof AttributeElement)
770 return ((AttributeElement) attribute).getParent();
775 public boolean hasChildren(Object attribute) {
776 if (attribute instanceof AttributeElement)
777 return ((AttributeElement) attribute).hasChildren();
782 public Object[] getElements(Object resourceModel) {
783 if (resourceModel instanceof ResourceRepresentation) {
784 return ((ResourceRepresentation) resourceModel).getAttributes()
788 return new Object[0];
792 class AttributeLabelProvider implements ITableLabelProvider {
795 public void addListener(ILabelProviderListener arg0) {
799 public void dispose() {
803 public boolean isLabelProperty(Object arg0, String arg1) {
808 public void removeListener(ILabelProviderListener arg0) {
813 public Image getColumnImage(Object element, int col) {
815 if (element instanceof AttributeElement) {
816 // Ignore for non-single resource
817 Resource res = resourceManager
818 .getCurrentResourceInSelection();
819 if (res instanceof SingleResource) {
820 AttributeElement attrElement = (AttributeElement) element;
821 if (attrElement.isAutoUpdateSupport()
822 && !attrElement.isReadOnly()) {
823 if (attrElement.isAutoUpdateInProgress()) {
824 return Activator.getDefault()
826 .get(Constants.CHECKED);
828 return Activator.getDefault()
830 .get(Constants.UNCHECKED);
840 public String getColumnText(Object element, int column) {
841 if (element instanceof AttributeElement) {
842 AttributeElement attrElement = (AttributeElement) element;
844 case 0: // Attribute name column
846 SimulatorResourceAttribute attribute = attrElement
847 .getSimulatorResourceAttribute();
848 return attribute.name();
851 case 1: // Attribute value column
853 SimulatorResourceAttribute attribute = attrElement
854 .getSimulatorResourceAttribute();
856 if (attribute.value().typeInfo().mBaseType != ValueType.RESOURCEMODEL) {
857 String value = Utility
858 .getAttributeValueAsString(attribute
869 // Ignore for non-single resource
870 Resource res = resourceManager
871 .getCurrentResourceInSelection();
872 if (res instanceof SingleResource) {
873 SimulatorResourceAttribute attribute = attrElement
874 .getSimulatorResourceAttribute();
875 TypeInfo type = attribute.value().typeInfo();
876 if (type.mType == AttributeValue.ValueType.ARRAY) {
877 if (type.mBaseType != AttributeValue.ValueType.RESOURCEMODEL) {
880 } else if (type.mType != AttributeValue.ValueType.RESOURCEMODEL) {
881 Object parent = attrElement.getParent();
883 && !(parent instanceof ResourceRepresentation)) {
885 } else if (attrElement.isReadOnly()) {
887 } else if (attrElement.isAutoUpdateSupport()) {
888 if (attrElement.isAutoUpdateInProgress())
889 return Constants.ENABLED;
891 return Constants.DISABLED;
907 public void dispose() {
908 // Unregister the selection listener
909 if (null != resourceSelectionChangedListener) {
910 UiListenerHandler.getInstance()
911 .removeResourceSelectionChangedUIListener(
912 resourceSelectionChangedListener);
915 // Unregister the data model change listener
916 if (null != dataChangeListener) {
917 UiListenerHandler.getInstance().removeDataChangeListener(
921 // Unregister the automation complete listener
922 if (null != automationUIListener) {
923 UiListenerHandler.getInstance().removeAutomationUIListener(
924 automationUIListener);
931 public void setFocus() {