Fixed properties tester for ObjectTools. issue #723
authorzev <zev@radensolutions.com>
Mon, 5 Sep 2016 14:34:26 +0000 (17:34 +0300)
committerzev <zev@radensolutions.com>
Mon, 5 Sep 2016 14:34:26 +0000 (17:34 +0300)
src/java/netxms-eclipse/ObjectTools/plugin.xml
src/java/netxms-eclipse/ObjectTools/src/org/netxms/ui/eclipse/objecttools/ObjectToolsPopertyTester.java
webui/webapp/ObjectTools/plugin.xml
webui/webapp/ObjectTools/src/org/netxms/ui/eclipse/objecttools/ObjectToolsPopertyTester.java

index 576ff6d..61deca9 100644 (file)
             id="org.netxms.ui.eclipse.objecttools.propertypages.Columns#4"
             name="%page.name.Columns">
          <enabledWhen>
-            <test
-                  forcePluginActivation="true"
-                  property="org.netxms.ui.eclipse.objecttools.hasType">
-            </test>
+            <and>
+               <instanceof
+                     value="org.netxms.client.objecttools.ObjectTool">
+               </instanceof>
+               <test
+                     property="org.netxms.ui.eclipse.objecttools.hasObjectToolsType">
+               </test>
+            </and>
          </enabledWhen>
       </page>
       <page
             class="org.netxms.ui.eclipse.objecttools.ObjectToolsPopertyTester"
             id="org.netxms.ui.eclipse.objecttools.ObjectToolsPropertyTester"
             namespace="org.netxms.ui.eclipse.objecttools"
-            properties="hasType"
+            properties="hasObjectToolsType"
             type="org.netxms.client.objecttools.ObjectTool">
       </propertyTester>
    </extension>
index 8f50f97..ff53062 100644 (file)
@@ -30,7 +30,7 @@ public class ObjectToolsPopertyTester extends PropertyTester
    @Override
    public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
    {
-      if (!(receiver instanceof ObjectTool))
+      if (!(receiver instanceof ObjectTool) || !property.equals("hasObjectToolsType"))
          return false;
 
       ObjectTool objectTool = (ObjectTool)receiver;
index 249e387..66a1799 100644 (file)
             id="org.netxms.ui.eclipse.objecttools.propertypages.Columns#4"
             name="%page.name.Columns">
          <enabledWhen>
-            <test
-                  forcePluginActivation="true"
-                  property="org.netxms.ui.eclipse.objecttools.hasType">
-            </test>
+            <and>
+               <instanceof
+                     value="org.netxms.client.objecttools.ObjectTool">
+               </instanceof>
+               <test
+                     property="org.netxms.ui.eclipse.objecttools.hasObjectToolsType">
+               </test>
+            </and>
          </enabledWhen>
       </page>
       <page
             class="org.netxms.ui.eclipse.objecttools.ObjectToolsPopertyTester"
             id="org.netxms.ui.eclipse.objecttools.ObjectToolsPropertyTester"
             namespace="org.netxms.ui.eclipse.objecttools"
-            properties="hasType"
+            properties="hasObjectToolsType"
             type="org.netxms.client.objecttools.ObjectTool">
       </propertyTester>
    </extension>
index 8f50f97..ff53062 100644 (file)
@@ -30,7 +30,7 @@ public class ObjectToolsPopertyTester extends PropertyTester
    @Override
    public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
    {
-      if (!(receiver instanceof ObjectTool))
+      if (!(receiver instanceof ObjectTool) || !property.equals("hasObjectToolsType"))
          return false;
 
       ObjectTool objectTool = (ObjectTool)receiver;