id="org.netxms.ui.eclipse.objecttools.propertypages.Columns#4"
name="%page.name.Columns">
<enabledWhen>
- <instanceof
- value="org.netxms.client.objecttools.ObjectTool">
- </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.netxms.ui.eclipse.objecttools.hasType">
+ </test>
</enabledWhen>
</page>
<page
id="wakeup">
</handler>
</extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.netxms.ui.eclipse.objecttools.ObjectToolsPopertyTester"
+ id="org.netxms.ui.eclipse.objecttools.ObjectToolsPropertyTester"
+ namespace="org.netxms.ui.eclipse.objecttools"
+ properties="hasType"
+ type="org.netxms.client.objecttools.ObjectTool">
+ </propertyTester>
+ </extension>
</plugin>
--- /dev/null
+/**
+ * NetXMS - open source network management system
+ * Copyright (C) 2016 RadenSolutions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.netxms.ui.eclipse.objecttools;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.netxms.client.objecttools.ObjectTool;
+
+/**
+ * Property tester for ObjectTool
+ *
+ */
+public class ObjectToolsPopertyTester extends PropertyTester
+{
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
+ {
+ if (!(receiver instanceof ObjectTool))
+ return false;
+
+ ObjectTool objectTool = (ObjectTool)receiver;
+ switch(objectTool.getType())
+ {
+ case ObjectTool.TYPE_TABLE_AGENT:
+ case ObjectTool.TYPE_TABLE_SNMP:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+}
id="org.netxms.ui.eclipse.objecttools.propertypages.Columns#4"
name="%page.name.Columns">
<enabledWhen>
- <instanceof
- value="org.netxms.client.objecttools.ObjectTool">
- </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.netxms.ui.eclipse.objecttools.hasType">
+ </test>
</enabledWhen>
</page>
<page
id="wakeup">
</handler>
</extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.netxms.ui.eclipse.objecttools.ObjectToolsPopertyTester"
+ id="org.netxms.ui.eclipse.objecttools.ObjectToolsPropertyTester"
+ namespace="org.netxms.ui.eclipse.objecttools"
+ properties="hasType"
+ type="org.netxms.client.objecttools.ObjectTool">
+ </propertyTester>
+ </extension>
</plugin>
--- /dev/null
+/**
+ * NetXMS - open source network management system
+ * Copyright (C) 2016 RadenSolutions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.netxms.ui.eclipse.objecttools;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.netxms.client.objecttools.ObjectTool;
+
+/**
+ * Property tester for ObjectTool
+ *
+ */
+public class ObjectToolsPopertyTester extends PropertyTester
+{
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
+ {
+ if (!(receiver instanceof ObjectTool))
+ return false;
+
+ ObjectTool objectTool = (ObjectTool)receiver;
+ switch(objectTool.getType())
+ {
+ case ObjectTool.TYPE_TABLE_AGENT:
+ case ObjectTool.TYPE_TABLE_SNMP:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+}