console: added object property tester isCustomAttributePresented
authorVictor Kirhenshtein <victor@netxms.org>
Sat, 17 Sep 2016 16:45:10 +0000 (19:45 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Sat, 17 Sep 2016 16:45:10 +0000 (19:45 +0300)
src/java/netxms-eclipse/ObjectBrowser/plugin.xml
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/ObjectPropertyTester.java
webui/webapp/ObjectBrowser/plugin.xml
webui/webapp/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/ObjectPropertyTester.java

index 138fed6..47d6365 100644 (file)
            class="org.netxms.ui.eclipse.objectbrowser.ObjectPropertyTester"
            id="org.netxms.ui.eclipse.objectbrowser.ObjectPropertyTester"
            namespace="org.netxms.ui.eclipse.objectbrowser"
-           properties="isAlarmsVisible"
+           properties="isAlarmsVisible,isCustomAttributePresented"
            type="org.netxms.client.objects.AbstractObject">
      </propertyTester>
   </extension>
index 1371f46..f7c5b20 100644 (file)
@@ -38,6 +38,9 @@ public class ObjectPropertyTester extends PropertyTester
       if (property.equals("isAlarmsVisible")) //$NON-NLS-1$
          return ((AbstractObject)receiver).isAlarmsVisible();
       
+      if (property.equals("isCustomAttributePresented") && (args.length > 0)) //$NON-NLS-1$
+         return ((AbstractObject)receiver).getCustomAttributes().containsKey(args[0]);
+      
       return false;
    }
 }
index dd05231..47d6365 100644 (file)
            class="org.netxms.ui.eclipse.objectbrowser.ObjectPropertyTester"
            id="org.netxms.ui.eclipse.objectbrowser.ObjectPropertyTester"
            namespace="org.netxms.ui.eclipse.objectbrowser"
-           properties="isAlarmsVisible"
+           properties="isAlarmsVisible,isCustomAttributePresented"
            type="org.netxms.client.objects.AbstractObject">
      </propertyTester>
   </extension>
            locationURI="popup:org.netxms.ui.eclipse.view.navigation.objectbrowser?before=objectmgmt">
         <command
               commandId="org.netxms.ui.eclipse.objectbrowser.commands.rename_object"
-              label="Rename"
-              style="push">
+              label="%command.Rename.name"
+              style="push"
+              tooltip="%command.Rename.tooltip">
         </command>
      </menuContribution>
   </extension>
index 1371f46..f7c5b20 100644 (file)
@@ -38,6 +38,9 @@ public class ObjectPropertyTester extends PropertyTester
       if (property.equals("isAlarmsVisible")) //$NON-NLS-1$
          return ((AbstractObject)receiver).isAlarmsVisible();
       
+      if (property.equals("isCustomAttributePresented") && (args.length > 0)) //$NON-NLS-1$
+         return ((AbstractObject)receiver).getCustomAttributes().containsKey(args[0]);
+      
       return false;
    }
 }