Updated the order of imports in the source files of simulator plugins.
[platform/upstream/iotivity.git] / service / simulator / java / eclipse-plugin / ServiceProviderPlugin / src / oic / simulator / serviceprovider / view / AttributeView.java
index 1d80604..56eac4b 100644 (file)
 
 package oic.simulator.serviceprovider.view;
 
-import oic.simulator.serviceprovider.Activator;
-import oic.simulator.serviceprovider.listener.IAutomationListener;
-import oic.simulator.serviceprovider.listener.IDataChangeListener;
-import oic.simulator.serviceprovider.listener.ISelectionChangedListener;
-import oic.simulator.serviceprovider.manager.ResourceManager;
-import oic.simulator.serviceprovider.manager.UiListenerHandler;
-import oic.simulator.serviceprovider.model.AttributeElement;
-import oic.simulator.serviceprovider.model.Resource;
-import oic.simulator.serviceprovider.model.ResourceRepresentation;
-import oic.simulator.serviceprovider.model.SingleResource;
-import oic.simulator.serviceprovider.utils.Constants;
-import oic.simulator.serviceprovider.utils.Utility;
-
 import org.eclipse.jface.viewers.ILabelProviderListener;
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.ITreeContentProvider;
@@ -48,11 +35,25 @@ import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeColumn;
 import org.eclipse.ui.part.ViewPart;
+
 import org.oic.simulator.AttributeValue;
 import org.oic.simulator.AttributeValue.TypeInfo;
 import org.oic.simulator.AttributeValue.ValueType;
 import org.oic.simulator.SimulatorResourceAttribute;
 
+import oic.simulator.serviceprovider.Activator;
+import oic.simulator.serviceprovider.listener.IAutomationListener;
+import oic.simulator.serviceprovider.listener.IDataChangeListener;
+import oic.simulator.serviceprovider.listener.ISelectionChangedListener;
+import oic.simulator.serviceprovider.manager.ResourceManager;
+import oic.simulator.serviceprovider.manager.UiListenerHandler;
+import oic.simulator.serviceprovider.model.AttributeElement;
+import oic.simulator.serviceprovider.model.Resource;
+import oic.simulator.serviceprovider.model.ResourceRepresentation;
+import oic.simulator.serviceprovider.model.SingleResource;
+import oic.simulator.serviceprovider.utils.Constants;
+import oic.simulator.serviceprovider.utils.Utility;
+
 /**
  * This class manages and shows the attribute view in the perspective.
  */
@@ -162,7 +163,7 @@ public class AttributeView extends ViewPart {
 
                     @Override
                     public void run() {
-                        if (null == resource) {
+                        if (null == resource || null == attViewer) {
                             return;
                         }
                         Resource resourceInSelection = resourceManager
@@ -177,8 +178,6 @@ public class AttributeView extends ViewPart {
                             Tree tree;
                             tree = attViewer.getTree();
                             if (!tree.isDisposed()) {
-                                attViewer.refresh();
-
                                 // Disabling the table to prevent interactions
                                 // during the automation
                                 tree.setEnabled(false);
@@ -216,7 +215,6 @@ public class AttributeView extends ViewPart {
                         tree = attViewer.getTree();
                         if (!tree.isDisposed()) {
                             tree.setEnabled(true);
-                            attViewer.refresh();
                         }
                     }
                 });
@@ -454,7 +452,7 @@ public class AttributeView extends ViewPart {
                                         && !(parent instanceof ResourceRepresentation)) {
                                     return "NA";
                                 } else if (attrElement.isReadOnly()) {
-                                    return "Read-only";
+                                    return "NA";
                                 } else if (attrElement.isAutoUpdateSupport()) {
                                     if (attrElement.isAutoUpdateInProgress())
                                         return Constants.ENABLED;