+ public void removeListener(ILabelProviderListener arg0) {
+
+ }
+
+ @Override
+ public Image getColumnImage(Object element, int col) {
+ if (col == 2) {
+ if (element instanceof AttributeElement) {
+ // Ignore for non-single resource
+ Resource res = resourceManager
+ .getCurrentResourceInSelection();
+ if (res instanceof SingleResource) {
+ AttributeElement attrElement = (AttributeElement) element;
+ if (attrElement.isAutoUpdateSupport()
+ && !attrElement.isReadOnly()) {
+ if (attrElement.isAutoUpdateInProgress()) {
+ return Activator.getDefault()
+ .getImageRegistry()
+ .get(Constants.CHECKED);
+ } else {
+ return Activator.getDefault()
+ .getImageRegistry()
+ .get(Constants.UNCHECKED);
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getColumnText(Object element, int column) {
+ if (element instanceof AttributeElement) {
+ AttributeElement attrElement = (AttributeElement) element;
+ switch (column) {
+ case 0: // Attribute name column
+ {
+ SimulatorResourceAttribute attribute = attrElement
+ .getSimulatorResourceAttribute();
+ return attribute.name();
+ }
+
+ case 1: // Attribute value column
+ {
+ SimulatorResourceAttribute attribute = attrElement
+ .getSimulatorResourceAttribute();
+
+ if (attribute.value().typeInfo().mBaseType != ValueType.RESOURCEMODEL)
+ return Utility.getAttributeValueAsString(attribute
+ .value());
+ return null;
+ }
+
+ case 2: {
+ // Ignore for non-single resource
+ Resource res = resourceManager
+ .getCurrentResourceInSelection();
+ if (res instanceof SingleResource) {
+ SimulatorResourceAttribute attribute = attrElement
+ .getSimulatorResourceAttribute();
+ TypeInfo type = attribute.value().typeInfo();
+ if (type.mType == AttributeValue.ValueType.ARRAY) {
+ if (type.mBaseType != AttributeValue.ValueType.RESOURCEMODEL) {
+ return "NA";
+ }
+ } else if (type.mType != AttributeValue.ValueType.RESOURCEMODEL) {
+ Object parent = attrElement.getParent();
+ if (null != parent
+ && !(parent instanceof ResourceRepresentation)) {
+ return "NA";
+ } else if (attrElement.isReadOnly()) {
+ return "NA";
+ } else if (attrElement.isAutoUpdateSupport()) {
+ if (attrElement.isAutoUpdateInProgress())
+ return Constants.ENABLED;
+ else
+ return Constants.DISABLED;
+ }
+ }
+ }
+
+ return "";
+ }
+ }
+ }
+
+ return null;