code refactoring; object properties dialog added
authorVictor Kirhenshtein <victor@netxms.org>
Sun, 22 Feb 2009 21:20:48 +0000 (21:20 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Sun, 22 Feb 2009 21:20:48 +0000 (21:20 +0000)
38 files changed:
.gitattributes
src/java/netxms-eclipse/AlarmViewer/src/org/netxms/ui/eclipse/alarmviewer/AlarmComparator.java
src/java/netxms-eclipse/AlarmViewer/src/org/netxms/ui/eclipse/alarmviewer/AlarmListFilter.java
src/java/netxms-eclipse/AlarmViewer/src/org/netxms/ui/eclipse/alarmviewer/AlarmListLabelProvider.java
src/java/netxms-eclipse/AlarmViewer/src/org/netxms/ui/eclipse/alarmviewer/AlarmView.java
src/java/netxms-eclipse/AlarmViewer/src/org/netxms/ui/eclipse/alarmviewer/actions/AcknowledgeAlarm.java
src/java/netxms-eclipse/AlarmViewer/src/org/netxms/ui/eclipse/alarmviewer/actions/TerminateAlarm.java
src/java/netxms-eclipse/ObjectBrowser/META-INF/MANIFEST.MF
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/ObjectBrowser.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/ObjectList.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/ObjectTree.java
src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/ObjectTreeFilter.java
src/java/netxms-eclipse/ObjectManager/.classpath [new file with mode: 0644]
src/java/netxms-eclipse/ObjectManager/.project [new file with mode: 0644]
src/java/netxms-eclipse/ObjectManager/META-INF/MANIFEST.MF [copied from src/java/netxms-eclipse/ObjectBrowser/META-INF/MANIFEST.MF with 56% similarity]
src/java/netxms-eclipse/ObjectManager/build.properties [new file with mode: 0644]
src/java/netxms-eclipse/ObjectManager/plugin.xml [new file with mode: 0644]
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/Activator.java [new file with mode: 0644]
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/General.java [new file with mode: 0644]
src/java/netxms-eclipse/ObjectView/META-INF/MANIFEST.MF
src/java/netxms-eclipse/ObjectView/plugin.xml
src/java/netxms-eclipse/ObjectView/src/org/netxms/ui/eclipse/objectview/LastValuesView.java
src/java/netxms-eclipse/ObjectView/src/org/netxms/ui/eclipse/objectview/views/LastValues.java
src/java/netxms-eclipse/ServerConfig/META-INF/MANIFEST.MF
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/ServerConfigurationEditor.java
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/VariableEditDialog.java
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/actions/DeleteVariable.java
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/actions/EditVariable.java
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/Activator.java
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/LoginDialog.java
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/LoginJob.java
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/NXMCActionBarAdvisor.java
src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/NXMCSharedData.java [deleted file]
src/java/netxms-eclipse/library/META-INF/MANIFEST.MF
src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/shared/IActionConstants.java [moved from src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/IActionConstants.java with 85% similarity]
src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/shared/IUIConstants.java [moved from src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/IUIConstants.java with 75% similarity]
src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/shared/NXMCSharedData.java [new file with mode: 0644]
src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/tools/WidgetHelper.java [new file with mode: 0644]

index d84264b..6da3a98 100644 (file)
@@ -361,6 +361,11 @@ src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/Ob
 src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/ObjectTreeLabelProvider.java -text
 src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/actions/BindObject.java -text
 src/java/netxms-eclipse/ObjectBrowser/src/org/netxms/ui/eclipse/objectbrowser/actions/OpenObjectBrowser.java -text
+src/java/netxms-eclipse/ObjectManager/META-INF/MANIFEST.MF -text
+src/java/netxms-eclipse/ObjectManager/build.properties -text
+src/java/netxms-eclipse/ObjectManager/plugin.xml -text
+src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/Activator.java -text
+src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/General.java -text
 src/java/netxms-eclipse/ObjectView/META-INF/MANIFEST.MF -text
 src/java/netxms-eclipse/ObjectView/build.properties -text
 src/java/netxms-eclipse/ObjectView/icons/active.ico -text
@@ -408,18 +413,19 @@ src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/NXMCWorkbenchWind
 src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/ObjectTabOverview.java -text
 src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/Perspective.java -text
 src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/actions/OpenView.java -text
-src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/IActionConstants.java -text
 src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/IObjectTabProvider.java -text
-src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/IUIConstants.java -text
-src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/NXMCSharedData.java -text
 src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/ObjectTab.java -text
 src/java/netxms-eclipse/library/META-INF/MANIFEST.MF -text
 src/java/netxms-eclipse/library/build.properties -text
 src/java/netxms-eclipse/library/icons/refresh.png -text
 src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/library/Activator.java -text
+src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/shared/IActionConstants.java -text
+src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/shared/IUIConstants.java -text
+src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/shared/NXMCSharedData.java -text
 src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/tools/RefreshAction.java -text
 src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/tools/SortableTableViewer.java -text
 src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/tools/TableSortingListener.java -text
+src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/tools/WidgetHelper.java -text
 src/java/pom.xml -text
 src/libexpat/Changes -text
 src/libexpat/MANIFEST -text
index 5932d20..a2ce25a 100644 (file)
@@ -10,7 +10,7 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.TableColumn;\r
 import org.netxms.client.NXCAlarm;\r
 import org.netxms.client.NXCObject;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
  * @author victor\r
@@ -55,8 +55,8 @@ public class AlarmComparator extends ViewerComparator
                                rc = compareNumbers(((NXCAlarm)e1).getState(), ((NXCAlarm)e2).getState());\r
                                break;\r
                        case AlarmView.COLUMN_SOURCE:\r
-                               NXCObject obj1 = NXMCSharedData.getSession().findObjectById(((NXCAlarm)e1).getSourceObjectId());\r
-                               NXCObject obj2 = NXMCSharedData.getSession().findObjectById(((NXCAlarm)e2).getSourceObjectId());\r
+                               NXCObject obj1 = NXMCSharedData.getInstance().getSession().findObjectById(((NXCAlarm)e1).getSourceObjectId());\r
+                               NXCObject obj2 = NXMCSharedData.getInstance().getSession().findObjectById(((NXCAlarm)e2).getSourceObjectId());\r
                                String name1 = (obj1 != null) ? obj1.getObjectName() : "<unknown>";\r
                                String name2 = (obj2 != null) ? obj2.getObjectName() : "<unknown>";\r
                                rc = name1.compareToIgnoreCase(name2);\r
index 0b40bf5..bf2d79f 100644 (file)
@@ -7,7 +7,7 @@ import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerFilter;\r
 import org.netxms.client.NXCAlarm;\r
 import org.netxms.client.NXCObject;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
  * @author victor\r
@@ -35,7 +35,7 @@ public class AlarmListFilter extends ViewerFilter
                if ((rootObject == 0) || (rootObject == ((NXCAlarm)element).getSourceObjectId()))\r
                        return true;    // No filtering by object ID or root object is a source\r
                \r
-               NXCObject object = NXMCSharedData.getSession().findObjectById(((NXCAlarm)element).getSourceObjectId());\r
+               NXCObject object = NXMCSharedData.getInstance().getSession().findObjectById(((NXCAlarm)element).getSourceObjectId());\r
                if (object != null)\r
                        return object.isParent(rootObject);\r
                return false;\r
index e1cad79..062fa3e 100644 (file)
@@ -10,7 +10,7 @@ import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.swt.graphics.Image;\r
 import org.netxms.client.NXCAlarm;\r
 import org.netxms.client.NXCObject;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 \r
 /**\r
@@ -69,7 +69,7 @@ public class AlarmListLabelProvider implements ITableLabelProvider
                        case AlarmView.COLUMN_STATE:\r
                                return stateText[((NXCAlarm)element).getState()];\r
                        case AlarmView.COLUMN_SOURCE:\r
-                               NXCObject object = NXMCSharedData.getSession().findObjectById(((NXCAlarm)element).getSourceObjectId());\r
+                               NXCObject object = NXMCSharedData.getInstance().getSession().findObjectById(((NXCAlarm)element).getSourceObjectId());\r
                                return (object != null) ? object.getObjectName() : null;\r
                        case AlarmView.COLUMN_MESSAGE:\r
                                return ((NXCAlarm)element).getMessage();\r
index d7ddbc3..18c1c34 100644 (file)
@@ -29,7 +29,7 @@ import org.netxms.client.NXCException;
 import org.netxms.client.NXCListener;\r
 import org.netxms.client.NXCNotification;\r
 import org.netxms.client.NXCSession;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.tools.SortableTableViewer;\r
 \r
 /**\r
@@ -58,7 +58,7 @@ public class AlarmView extends Composite
        public AlarmView(ViewPart viewPart, Composite parent, int style)\r
        {\r
                super(parent, style);\r
-               session = NXMCSharedData.getSession();\r
+               session = NXMCSharedData.getInstance().getSession();\r
                this.viewPart = viewPart;               \r
                \r
                // Setup table columns\r
index a03e4be..f4bed25 100644 (file)
@@ -17,7 +17,7 @@ import org.netxms.client.NXCAlarm;
 import org.netxms.client.NXCException;\r
 import org.netxms.ui.eclipse.alarmviewer.Activator;\r
 import org.netxms.ui.eclipse.alarmviewer.AlarmView;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 \r
 /**\r
@@ -50,7 +50,7 @@ public class AcknowledgeAlarm implements IObjectActionDelegate
                        {\r
                                for(int i = 0; i < selection.length; i++)\r
                                        if (selection[i] instanceof NXCAlarm)\r
-                                               NXMCSharedData.getSession().acknowledgeAlarm(((NXCAlarm)selection[i]).getId());\r
+                                               NXMCSharedData.getInstance().getSession().acknowledgeAlarm(((NXCAlarm)selection[i]).getId());\r
                                status = Status.OK_STATUS;\r
                        }\r
                        catch(Exception e)\r
index 92ce816..4ea0da2 100644 (file)
@@ -17,7 +17,7 @@ import org.netxms.client.NXCAlarm;
 import org.netxms.client.NXCException;\r
 import org.netxms.ui.eclipse.alarmviewer.Activator;\r
 import org.netxms.ui.eclipse.alarmviewer.AlarmView;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 \r
 /**\r
@@ -50,7 +50,7 @@ public class TerminateAlarm implements IObjectActionDelegate
                        {\r
                                for(int i = 0; i < selection.length; i++)\r
                                        if (selection[i] instanceof NXCAlarm)\r
-                                               NXMCSharedData.getSession().terminateAlarm(((NXCAlarm)selection[i]).getId());\r
+                                               NXMCSharedData.getInstance().getSession().terminateAlarm(((NXCAlarm)selection[i]).getId());\r
                                status = Status.OK_STATUS;\r
                        }\r
                        catch(Exception e)\r
index eae6430..7a93f4b 100644 (file)
@@ -7,7 +7,6 @@ Bundle-Activator: org.netxms.ui.eclipse.objectbrowser.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.netxms.ui.eclipse.console;bundle-version="1.0.0",
  org.netxms.ui.eclipse.library;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
index 02f54f0..d02d399 100644 (file)
@@ -16,8 +16,9 @@ import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;\r
 import org.eclipse.swt.widgets.Menu;\r
 import org.eclipse.ui.IWorkbenchActionConstants;\r
+import org.eclipse.ui.dialogs.PropertyDialogAction;\r
 import org.eclipse.ui.part.ViewPart;\r
-import org.netxms.ui.eclipse.console.extensionproviders.IActionConstants;\r
+import org.netxms.ui.eclipse.shared.IActionConstants;\r
 \r
 \r
 /**\r
@@ -78,6 +79,7 @@ public class ObjectBrowser extends ViewPart
                mgr.add(new GroupMarker(IActionConstants.MB_DATA_COLLECTION));\r
                mgr.add(new Separator());\r
                mgr.add(new GroupMarker(IActionConstants.MB_PROPERTIES));\r
+               mgr.add(new PropertyDialogAction(getSite(), objectTree.getTreeViewer()));\r
        }\r
 \r
        \r
index a061a29..bd40b24 100644 (file)
@@ -24,7 +24,7 @@ import org.eclipse.ui.progress.UIJob;
 import org.netxms.client.NXCListener;\r
 import org.netxms.client.NXCNotification;\r
 import org.netxms.client.NXCSession;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
  * @author Victor\r
@@ -54,7 +54,7 @@ public class ObjectList extends Composite
                FormLayout formLayout = new FormLayout();\r
                setLayout(formLayout);\r
                \r
-               NXCSession session = NXMCSharedData.getSession();\r
+               NXCSession session = NXMCSharedData.getInstance().getSession();\r
 \r
                objectList = new TableViewer(this, SWT.SINGLE | SWT.FULL_SELECTION | (((options & CHECKBOXES) == CHECKBOXES) ? SWT.CHECK : 0));\r
                objectList.setContentProvider(new ArrayContentProvider());\r
@@ -106,7 +106,7 @@ public class ObjectList extends Composite
                                                @Override\r
                                                public IStatus runInUIThread(IProgressMonitor monitor)\r
                                                {\r
-                                                       objectList.setInput(NXMCSharedData.getSession().getAllObjects());\r
+                                                       objectList.setInput(NXMCSharedData.getInstance().getSession().getAllObjects());\r
                                                        objectList.refresh();\r
                                                        return Status.OK_STATUS;\r
                                                }\r
index ca38bd9..341b239 100644 (file)
@@ -24,7 +24,7 @@ import org.netxms.client.NXCListener;
 import org.netxms.client.NXCNotification;\r
 import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
  * @author victor\r
@@ -54,7 +54,7 @@ public class ObjectTree extends Composite
                FormLayout formLayout = new FormLayout();\r
                setLayout(formLayout);\r
                \r
-               NXCSession session = NXMCSharedData.getSession();\r
+               NXCSession session = NXMCSharedData.getInstance().getSession();\r
 \r
                objectTree = new TreeViewer(this, SWT.VIRTUAL | SWT.SINGLE | (((options & CHECKBOXES) == CHECKBOXES) ? SWT.CHECK : 0));\r
                objectTree.setContentProvider(new ObjectTreeContentProvider());\r
index 9f4a94d..e815f40 100644 (file)
@@ -9,7 +9,7 @@ import java.util.Map;
 import org.eclipse.jface.viewers.Viewer;\r
 import org.eclipse.jface.viewers.ViewerFilter;\r
 import org.netxms.client.NXCObject;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
  * @author Victor\r
@@ -71,7 +71,7 @@ public class ObjectTreeFilter extends ViewerFilter
                {\r
                        if (doFullSearch)\r
                        {\r
-                               NXCObject[] fullList = NXMCSharedData.getSession().getAllObjects();\r
+                               NXCObject[] fullList = NXMCSharedData.getInstance().getSession().getAllObjects();\r
                                objectList = new HashMap<Long, NXCObject>();\r
                                for(int i = 0; i < fullList.length; i++)\r
                                        if (fullList[i].getObjectName().toLowerCase().startsWith(filterString))\r
diff --git a/src/java/netxms-eclipse/ObjectManager/.classpath b/src/java/netxms-eclipse/ObjectManager/.classpath
new file mode 100644 (file)
index 0000000..ad32c83
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/src/java/netxms-eclipse/ObjectManager/.project b/src/java/netxms-eclipse/ObjectManager/.project
new file mode 100644 (file)
index 0000000..d9cbc70
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>nxmc-objectmanager</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
@@ -1,13 +1,12 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: NXMC Object Browser Plug-in
-Bundle-SymbolicName: org.netxms.ui.eclipse.objectbrowser;singleton:=true
+Bundle-Name: NXMC Basic Object Management Plug-in
+Bundle-SymbolicName: org.netxms.ui.eclipse.objectmanager;singleton:=true
 Bundle-Version: 1.0.0
-Bundle-Activator: org.netxms.ui.eclipse.objectbrowser.Activator
+Bundle-Activator: org.netxms.ui.eclipse.objectmanager.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.netxms.ui.eclipse.console;bundle-version="1.0.0",
  org.netxms.ui.eclipse.library;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
diff --git a/src/java/netxms-eclipse/ObjectManager/build.properties b/src/java/netxms-eclipse/ObjectManager/build.properties
new file mode 100644 (file)
index 0000000..6f20375
--- /dev/null
@@ -0,0 +1,5 @@
+source.. = src/\r
+output.. = bin/\r
+bin.includes = META-INF/,\\r
+               .,\\r
+               plugin.xml\r
diff --git a/src/java/netxms-eclipse/ObjectManager/plugin.xml b/src/java/netxms-eclipse/ObjectManager/plugin.xml
new file mode 100644 (file)
index 0000000..b5e3bdc
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<?eclipse version="3.2"?>\r
+<plugin>\r
+\r
+  <extension\r
+     point = "org.eclipse.ui.propertyPages">\r
+        <page\r
+           id="org.netxms.ui.eclipse.objectmanager.propertypages.General"\r
+           name="General"\r
+              class="org.netxms.ui.eclipse.objectmanager.propertypages.General">\r
+          <enabledWhen>\r
+             <instanceof\r
+                  value="org.netxms.client.NXCObject">\r
+             </instanceof>\r
+          </enabledWhen>\r
+        </page>\r
+  </extension>\r
+\r
+</plugin>\r
diff --git a/src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/Activator.java b/src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/Activator.java
new file mode 100644 (file)
index 0000000..da710f6
--- /dev/null
@@ -0,0 +1,74 @@
+package org.netxms.ui.eclipse.objectmanager;\r
+\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.eclipse.ui.plugin.AbstractUIPlugin;\r
+import org.osgi.framework.BundleContext;\r
+\r
+/**\r
+ * The activator class controls the plug-in life cycle\r
+ */\r
+public class Activator extends AbstractUIPlugin\r
+{\r
+\r
+       // The plug-in ID\r
+       public static final String PLUGIN_ID = "org.netxms.ui.eclipse.objectmanager";\r
+\r
+       // The shared instance\r
+       private static Activator plugin;\r
+\r
+       /**\r
+        * The constructor\r
+        */\r
+       public Activator()\r
+       {\r
+       }\r
+\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see\r
+        * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext\r
+        * )\r
+        */\r
+       public void start(BundleContext context) throws Exception\r
+       {\r
+               super.start(context);\r
+               plugin = this;\r
+       }\r
+\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see\r
+        * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext\r
+        * )\r
+        */\r
+       public void stop(BundleContext context) throws Exception\r
+       {\r
+               plugin = null;\r
+               super.stop(context);\r
+       }\r
+\r
+       /**\r
+        * Returns the shared instance\r
+        * \r
+        * @return the shared instance\r
+        */\r
+       public static Activator getDefault()\r
+       {\r
+               return plugin;\r
+       }\r
+\r
+       /**\r
+        * Returns an image descriptor for the image file at the given plug-in\r
+        * relative path\r
+        * \r
+        * @param path\r
+        *           the path\r
+        * @return the image descriptor\r
+        */\r
+       public static ImageDescriptor getImageDescriptor(String path)\r
+       {\r
+               return imageDescriptorFromPlugin(PLUGIN_ID, path);\r
+       }\r
+}\r
diff --git a/src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/General.java b/src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/propertypages/General.java
new file mode 100644 (file)
index 0000000..67062fe
--- /dev/null
@@ -0,0 +1,73 @@
+/**\r
+ * \r
+ */\r
+package org.netxms.ui.eclipse.objectmanager.propertypages;\r
+\r
+import org.eclipse.jface.dialogs.MessageDialog;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Control;\r
+import org.eclipse.swt.widgets.Text;\r
+import org.eclipse.ui.dialogs.PropertyPage;\r
+import org.netxms.client.NXCObject;\r
+import org.netxms.ui.eclipse.tools.WidgetHelper;\r
+\r
+/**\r
+ * @author Victor\r
+ *\r
+ */\r
+public class General extends PropertyPage\r
+{\r
+       private Text textName;\r
+       private String initialName;\r
+       \r
+       \r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)\r
+        */\r
+       @Override\r
+       protected Control createContents(Composite parent)\r
+       {\r
+               Composite dialogArea = new Composite(parent, SWT.NONE);\r
+               \r
+               NXCObject object = (NXCObject)getElement().getAdapter(NXCObject.class);\r
+               if (object == null)     // Paranoid check\r
+                       return dialogArea;\r
+               \r
+               GridLayout layout = new GridLayout();\r
+               layout.verticalSpacing = WidgetHelper.OUTER_SPACING;\r
+//      layout.marginWidth = IUIConstants.DIALOG_WIDTH_MARGIN;\r
+//      layout.marginHeight = IUIConstants.DIALOG_HEIGHT_MARGIN;\r
+      dialogArea.setLayout(layout);\r
+      \r
+      // Object ID\r
+      WidgetHelper.createLabeledText(dialogArea, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, "Object ID",\r
+                                     Long.toString(object.getObjectId()), null);\r
+      \r
+               // Object class\r
+      WidgetHelper.createLabeledText(dialogArea, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, "Object class",\r
+                                     Long.toString(object.getObjectClass()), null);\r
+               \r
+               // Object name\r
+      initialName = new String(object.getObjectName());\r
+      textName = WidgetHelper.createLabeledText(dialogArea, SWT.SINGLE | SWT.BORDER, "Object name",\r
+                                                   initialName, null);\r
+               \r
+               return dialogArea;\r
+       }\r
+\r
+       \r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.jface.preference.PreferencePage#performOk()\r
+        */\r
+       @Override\r
+       public boolean performOk()\r
+       {\r
+               if (!textName.getText().equals(initialName))\r
+               {\r
+                       MessageDialog.openInformation(null, "OK", textName.getText());\r
+               }\r
+               return true;\r
+       }\r
+}\r
index 44e3b12..53561f1 100644 (file)
@@ -7,7 +7,6 @@ Bundle-Activator: org.netxms.ui.eclipse.objectview.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.netxms.ui.eclipse.library;bundle-version="1.0.0",
- org.netxms.ui.eclipse.console;bundle-version="1.0.0"
+ org.netxms.ui.eclipse.library;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
index 33326a5..59bd98b 100644 (file)
@@ -8,7 +8,7 @@
             name="Last Values"\r
             allowMultiple="true"\r
             icon="icons/last_values.png"\r
-            class="org.netxms.ui.eclipse.objectview.LastValuesBrowser"\r
+            class="org.netxms.ui.eclipse.objectview.views.LastValues"\r
             id="org.netxms.ui.eclipse.objectview.view.last_values">\r
       </view>\r
    </extension>\r
index acd220c..c9ed70c 100644 (file)
@@ -26,7 +26,7 @@ import org.netxms.client.NXCDCIValue;
 import org.netxms.client.NXCException;\r
 import org.netxms.client.NXCNode;\r
 import org.netxms.client.NXCSession;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 import org.netxms.ui.eclipse.tools.SortableTableViewer;\r
 \r
 /**\r
@@ -51,7 +51,7 @@ public class LastValuesView extends Composite
        public LastValuesView(ViewPart viewPart, Composite parent, int style, NXCNode _node)\r
        {\r
                super(parent, style);\r
-               session = NXMCSharedData.getSession();\r
+               session = NXMCSharedData.getInstance().getSession();\r
                this.viewPart = viewPart;               \r
                this.node = _node;\r
                \r
index f9d8cea..2abf966 100644 (file)
@@ -14,8 +14,8 @@ import org.eclipse.ui.part.ViewPart;
 import org.netxms.client.NXCNode;\r
 import org.netxms.client.NXCObject;\r
 import org.netxms.client.NXCSession;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
 import org.netxms.ui.eclipse.objectview.LastValuesView;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
  * @author Victor\r
@@ -45,7 +45,7 @@ public class LastValues extends ViewPart
        {\r
                super.init(site);\r
                \r
-               session = NXMCSharedData.getSession();\r
+               session = NXMCSharedData.getInstance().getSession();\r
                NXCObject obj = session.findObjectById(Long.parseLong(site.getSecondaryId()));\r
                node = ((obj != null) && (obj instanceof NXCNode)) ? (NXCNode)obj : null;\r
                setPartName("Last Values - " + ((node != null) ? node.getObjectName() : "<error>"));\r
index c6bd08a..9352974 100644 (file)
@@ -7,7 +7,6 @@ Bundle-Activator: org.netxms.ui.eclipse.serverconfig.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.netxms.ui.eclipse.library;bundle-version="1.0.0",
- org.netxms.ui.eclipse.console;bundle-version="1.0.0"
+ org.netxms.ui.eclipse.library;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
index 2875bc4..b6e6514 100644 (file)
@@ -20,7 +20,7 @@ import org.eclipse.swt.SWT;
 import org.netxms.client.NXCException;
 import org.netxms.client.NXCServerVariable;
 import org.netxms.client.NXCSession;
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;
+import org.netxms.ui.eclipse.shared.NXMCSharedData;
 import org.netxms.ui.eclipse.tools.RefreshAction;
 import org.netxms.ui.eclipse.tools.SortableTableViewer;
 
@@ -199,7 +199,7 @@ public class ServerConfigurationEditor extends ViewPart
                contributeToActionBars();
                createPopupMenu();
                
-               session = NXMCSharedData.getSession();
+               session = NXMCSharedData.getInstance().getSession();
 
                Job job = new RefreshJob();
                IWorkbenchSiteProgressService siteService =
@@ -317,7 +317,7 @@ public class ServerConfigurationEditor extends ViewPart
                                        
                                        try
                                        {
-                                               NXMCSharedData.getSession().setServerVariable(dlg.getVarName(), dlg.getVarValue());
+                                               NXMCSharedData.getInstance().getSession().setServerVariable(dlg.getVarName(), dlg.getVarValue());
                                                actionRefresh.run();
                                                status = Status.OK_STATUS;
                                        }
index a0688be..a89632f 100644 (file)
@@ -11,7 +11,7 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;\r
 import org.eclipse.swt.widgets.Shell;\r
 import org.eclipse.swt.widgets.Text;\r
-import org.netxms.ui.eclipse.console.extensionproviders.IUIConstants;\r
+import org.netxms.ui.eclipse.shared.IUIConstants;\r
 \r
 \r
 /**\r
index 7dfafd2..efc4acb 100644 (file)
@@ -16,9 +16,9 @@ import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
 import org.netxms.client.NXCException;\r
 import org.netxms.client.NXCServerVariable;\r
 import org.netxms.client.NXCSession;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
 import org.netxms.ui.eclipse.serverconfig.Activator;\r
 import org.netxms.ui.eclipse.serverconfig.ServerConfigurationEditor;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
  * @author victor\r
@@ -46,7 +46,7 @@ public class DeleteVariable implements IObjectActionDelegate
                                \r
                                try\r
                                {\r
-                                       NXCSession session = NXMCSharedData.getSession();\r
+                                       NXCSession session = NXMCSharedData.getInstance().getSession();\r
                                        for(int i = 0; i < currentSelection.length; i++)\r
                                        {\r
                                                session.deleteServerVariable(((NXCServerVariable)currentSelection[i]).getName());\r
index 3fbf928..08b1708 100644 (file)
@@ -16,10 +16,10 @@ import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.progress.IWorkbenchSiteProgressService;\r
 import org.netxms.client.NXCException;\r
 import org.netxms.client.NXCServerVariable;\r
-import org.netxms.ui.eclipse.console.extensionproviders.NXMCSharedData;\r
 import org.netxms.ui.eclipse.serverconfig.Activator;\r
 import org.netxms.ui.eclipse.serverconfig.ServerConfigurationEditor;\r
 import org.netxms.ui.eclipse.serverconfig.VariableEditDialog;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 /**\r
  * @author victor\r
@@ -53,7 +53,7 @@ public class EditVariable implements IObjectActionDelegate
                                                \r
                                                try\r
                                                {\r
-                                                       NXMCSharedData.getSession().setServerVariable(dlg.getVarName(), dlg.getVarValue());\r
+                                                       NXMCSharedData.getInstance().getSession().setServerVariable(dlg.getVarName(), dlg.getVarValue());\r
                                                        if (wbPart instanceof ServerConfigurationEditor)\r
                                                                ((ServerConfigurationEditor)wbPart).refreshVariablesList();\r
                                                        status = Status.OK_STATUS;\r
index bb93b50..d8c4d06 100644 (file)
@@ -3,7 +3,6 @@ package org.netxms.ui.eclipse.console;
 import org.eclipse.jface.action.StatusLineContributionItem;\r
 import org.eclipse.jface.resource.ImageDescriptor;\r
 import org.eclipse.ui.plugin.AbstractUIPlugin;\r
-import org.netxms.client.NXCSession;\r
 import org.osgi.framework.BundleContext;\r
 \r
 /**\r
@@ -18,7 +17,6 @@ public class Activator extends AbstractUIPlugin
        private static Activator plugin;\r
        \r
        // Shared data\r
-       private NXCSession session;\r
        private StatusLineContributionItem statusItemConnection;\r
        \r
        /**\r
@@ -71,22 +69,6 @@ public class Activator extends AbstractUIPlugin
        }\r
 \r
        /**\r
-        * @return the session\r
-        */\r
-       public NXCSession getSession()\r
-       {\r
-               return session;\r
-       }\r
-\r
-       /**\r
-        * @param session the session to set\r
-        */\r
-       public void setSession(NXCSession session)\r
-       {\r
-               this.session = session;\r
-       }\r
-\r
-       /**\r
         * @return the statusItemConnection\r
         */\r
        public StatusLineContributionItem getStatusItemConnection()\r
index 7e4cb9c..1ac8d2d 100644 (file)
@@ -24,7 +24,7 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Monitor;\r
 import org.eclipse.swt.widgets.Shell;\r
 import org.eclipse.swt.widgets.Text;\r
-import org.netxms.ui.eclipse.console.extensionproviders.IUIConstants;\r
+import org.netxms.ui.eclipse.shared.IUIConstants;\r
 \r
 /**\r
  * @author Victor\r
index 61a160a..fec4dd9 100644 (file)
@@ -8,6 +8,7 @@ import java.lang.reflect.InvocationTargetException;
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.jface.operation.IRunnableWithProgress;\r
 import org.netxms.client.*;\r
+import org.netxms.ui.eclipse.shared.NXMCSharedData;\r
 \r
 \r
 /**\r
@@ -47,7 +48,7 @@ public class LoginJob implements IRunnableWithProgress
                        session.subscribe(NXCSession.CHANNEL_ALARMS | NXCSession.CHANNEL_OBJECTS);\r
                        monitor.worked(5);\r
                        \r
-                       Activator.getDefault().setSession(session);\r
+                       NXMCSharedData.getInstance().setSession(session);\r
                }\r
                catch(IOException e)\r
                {\r
index 53bd1c9..a21fdf3 100644 (file)
@@ -17,7 +17,7 @@ import org.eclipse.ui.actions.ActionFactory;
 import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
 import org.eclipse.ui.application.ActionBarAdvisor;
 import org.eclipse.ui.application.IActionBarConfigurer;
-import org.netxms.ui.eclipse.console.extensionproviders.IActionConstants;
+import org.netxms.ui.eclipse.shared.IActionConstants;
 
 public class NXMCActionBarAdvisor extends ActionBarAdvisor
 {
diff --git a/src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/NXMCSharedData.java b/src/java/netxms-eclipse/core/src/org/netxms/ui/eclipse/console/extensionproviders/NXMCSharedData.java
deleted file mode 100644 (file)
index 5ee2be8..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/**\r
- * \r
- */\r
-package org.netxms.ui.eclipse.console.extensionproviders;\r
-\r
-import org.netxms.ui.eclipse.console.Activator;\r
-import org.netxms.client.NXCSession;\r
-\r
-/**\r
- * Shared data for NXMC extensions\r
- * \r
- * @author Victor\r
- *\r
- */\r
-public class NXMCSharedData\r
-{\r
-       /**\r
-        * Get NetXMS client session\r
-        * \r
-        * @return NetXMS client session\r
-        */\r
-       public static NXCSession getSession()\r
-       {\r
-               return Activator.getDefault().getSession();\r
-       }\r
-}\r
index 2df9ded..683089c 100644 (file)
@@ -11,6 +11,7 @@ Bundle-ClassPath: .,
  jar/netxms-client-0.9.0-rc1.jar
 Export-Package: org.netxms.base,
  org.netxms.client,
+ org.netxms.ui.eclipse.shared,
  org.netxms.ui.eclipse.tools
 Require-Bundle: org.eclipse.ui;bundle-version="3.4.1",
  org.eclipse.core.runtime;bundle-version="3.4.0"
diff --git a/src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/shared/NXMCSharedData.java b/src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/shared/NXMCSharedData.java
new file mode 100644 (file)
index 0000000..f7c8a33
--- /dev/null
@@ -0,0 +1,56 @@
+/**\r
+ * \r
+ */\r
+package org.netxms.ui.eclipse.shared;\r
+\r
+import org.netxms.client.NXCSession;\r
+\r
+/**\r
+ * Shared data for NXMC extensions\r
+ * \r
+ * @author Victor\r
+ *\r
+ */\r
+public class NXMCSharedData\r
+{\r
+       private static NXMCSharedData instance = new NXMCSharedData();\r
+       private NXCSession session = null;\r
+       \r
+       /**\r
+        * Private constructor\r
+        */\r
+       private NXMCSharedData()\r
+       {\r
+       }\r
+       \r
+       \r
+       /**\r
+        * Get instance of shared data object\r
+        * \r
+        * @return Shared data instance\r
+        */\r
+       public static NXMCSharedData getInstance()\r
+       {\r
+               return instance;\r
+       }\r
+       \r
+       /**\r
+        * Get current NetXMS client library session\r
+        * \r
+        * @return Current session\r
+        */\r
+       public NXCSession getSession()\r
+       {\r
+               return session;\r
+       }\r
+\r
+       /**\r
+        * Set current NetXMS client library session\r
+        * \r
+        * @param session Current session\r
+        */\r
+       public void setSession(NXCSession session)\r
+       {\r
+               this.session = session;\r
+       }\r
+}\r
diff --git a/src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/tools/WidgetHelper.java b/src/java/netxms-eclipse/library/src/org/netxms/ui/eclipse/tools/WidgetHelper.java
new file mode 100644 (file)
index 0000000..13c4783
--- /dev/null
@@ -0,0 +1,69 @@
+/**\r
+ * \r
+ */\r
+package org.netxms.ui.eclipse.tools;\r
+\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.layout.GridData;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Label;\r
+import org.eclipse.swt.widgets.Text;\r
+\r
+/**\r
+ * @author Victor\r
+ * @param \r
+ *\r
+ */\r
+public class WidgetHelper\r
+{\r
+       public static int INNER_SPACING = 2;\r
+       public static int OUTER_SPACING = 4;\r
+       \r
+       \r
+       /**\r
+    * Create pair of label and input field, with label above\r
+        * \r
+        * @param parent Parent composite\r
+        * @param flags Flags for Text creation\r
+        * @param labelText Label's text\r
+        * @param initialText Initial text for input field (may be null)\r
+        * @param layoutData Layout data for label/input pair. If null, default GridData will be assigned.\r
+        * @return Created Text object\r
+        */\r
+       public static Text createLabeledText(final Composite parent, int flags, final String labelText,\r
+                                            final String initialText, Object layoutData)\r
+       {\r
+               Composite group = new Composite(parent, SWT.NONE);\r
+               GridLayout layout = new GridLayout();\r
+               layout.verticalSpacing = INNER_SPACING;\r
+               layout.marginTop = 0;\r
+               layout.marginBottom = 0;\r
+               group.setLayout(layout);\r
+\r
+               if (layoutData != null)\r
+               {\r
+                       group.setLayoutData(layoutData);\r
+               }\r
+               else\r
+               {\r
+                       GridData gridData = new GridData();\r
+                       gridData.horizontalAlignment = GridData.FILL;\r
+                       gridData.grabExcessHorizontalSpace = true;\r
+                       group.setLayoutData(gridData);\r
+               }\r
+               \r
+               Label label = new Label(group, SWT.NONE);\r
+               label.setText(labelText);\r
+\r
+               Text text = new Text(group, flags);\r
+               if (initialText != null)\r
+                       text.setText(initialText);\r
+               GridData gridData = new GridData();\r
+               gridData.horizontalAlignment = GridData.FILL;\r
+               gridData.grabExcessHorizontalSpace = true;\r
+               text.setLayoutData(gridData);           \r
+               \r
+               return text;\r
+       }\r
+}\r