Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Start OrientDB+ Mongo Runtime.

  • Loading branch information...
commit 1ac1dcda4197d09b6431e1d5e2635da954252249 1 parent 5b45b8c
@angelozerr angelozerr authored
Showing with 2,384 additions and 52 deletions.
  1. 0  TargetPlatform/launch/{MongoDB IDE - Eclipse IDE.launch → NoSQL IDE - Eclipse IDE.launch}
  2. +32 −32 TargetPlatform/launch/{MongoDB IDE - Eclipse MacOSX.launch → NoSQL IDE - Eclipse MacOSX.launch}
  3. +3 −3 TargetPlatform/launch/{MongoDB IDE - Eclipse RAP.launch → NoSQL IDE - Eclipse RAP.launch}
  4. +1 −1  TargetPlatform/launch/{MongoDB IDE - Eclipse RCP (win32).launch → NoSQL IDE - Eclipse RCP (win32).launch}
  5. 0  TargetPlatform/{mongodb-ide.target → nosql-ide.target}
  6. +1 −1  TargetPlatform/{mongodb-rap.target → nosql-rap.target}
  7. 0  TargetPlatform/{mongodb-rcp.target → nosql-rcp.target}
  8. BIN  TargetPlatform/warproduct/demo/mongoide-rapdemo.war
  9. 0  TargetPlatform/warproduct/demo/{mongodb_ide-rap-demo.warproduct → nosql-rap-demo.warproduct}
  10. +21 −0 com.orientechnologies.orient/.classpath
  11. +28 −0 com.orientechnologies.orient/.project
  12. +8 −0 com.orientechnologies.orient/.settings/org.eclipse.jdt.core.prefs
  13. +151 −0 com.orientechnologies.orient/META-INF/MANIFEST.MF
  14. +18 −0 com.orientechnologies.orient/build.properties
  15. BIN  com.orientechnologies.orient/lib/hazelcast-2.1.2.jar
  16. BIN  com.orientechnologies.orient/lib/hibernate-jpa-2.0-api-1.0.0.Final.jar
  17. BIN  com.orientechnologies.orient/lib/javassist.jar
  18. BIN  com.orientechnologies.orient/lib/jna-3.4.0.jar
  19. BIN  com.orientechnologies.orient/lib/orient-commons-1.1.0.jar
  20. BIN  com.orientechnologies.orient/lib/orientdb-client-1.1.0.jar
  21. BIN  com.orientechnologies.orient/lib/orientdb-core-1.1.0.jar
  22. BIN  com.orientechnologies.orient/lib/orientdb-distributed-1.1.0.jar
  23. BIN  com.orientechnologies.orient/lib/orientdb-enterprise-1.1.0.jar
  24. BIN  com.orientechnologies.orient/lib/orientdb-nativeos-1.1.0.jar
  25. BIN  com.orientechnologies.orient/lib/orientdb-object-1.1.0.jar
  26. BIN  com.orientechnologies.orient/lib/orientdb-server-1.1.0.jar
  27. BIN  com.orientechnologies.orient/lib/orientdb-tools-1.1.0.jar
  28. BIN  com.orientechnologies.orient/lib/platform.jar
  29. +2 −0  fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/IServerRuntimeManager.java
  30. +1 −0  fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/Platform.java
  31. +59 −0 fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/model/AbstractServerRuntime.java
  32. +5 −0 fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/model/IServerRuntime.java
  33. +13 −0 fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/utils/CollectionUtils.java
  34. +51 −0 fr.opensagres.nosql.ide.mongodb.core/src/fr/opensagres/nosql/ide/mongodb/core/model/MongoServerRuntime.java
  35. +3 −0  fr.opensagres.nosql.ide.mongodb.ui/META-INF/MANIFEST.MF
  36. +9 −0 fr.opensagres.nosql.ide.mongodb.ui/plugin.xml
  37. +71 −0 fr.opensagres.nosql.ide.mongodb.ui/src/fr/opensagres/nosql/ide/mongodb/ui/dialogs/MongoRuntimeDialog.java
  38. +9 −1 fr.opensagres.nosql.ide.mongodb.ui/src/fr/opensagres/nosql/ide/mongodb/ui/internal/Messages.java
  39. +9 −1 fr.opensagres.nosql.ide.mongodb.ui/src/fr/opensagres/nosql/ide/mongodb/ui/internal/Messages.properties
  40. +14 −0 ...sql.ide.mongodb.ui/src/fr/opensagres/nosql/ide/mongodb/ui/internal/extension/MongoRuntimeDialogFactory.java
  41. +4 −0 fr.opensagres.nosql.ide.orientdb.core/META-INF/MANIFEST.MF
  42. +11 −1 fr.opensagres.nosql.ide.orientdb.core/plugin.properties
  43. +14 −1 fr.opensagres.nosql.ide.orientdb.core/plugin.xml
  44. +41 −0 ...ql.ide.orientdb.core/src/fr/opensagres/nosql/ide/orientdb/core/internal/extensions/ConnectServerRunner.java
  45. +1 −1  .../fr/opensagres/nosql/ide/orientdb/core/{model/internal → internal/extensions}/OrientServerFactory.java
  46. +17 −0 fr.opensagres.nosql.ide.orientdb.core/src/fr/opensagres/nosql/ide/orientdb/core/model/Database.java
  47. +23 −2 fr.opensagres.nosql.ide.orientdb.core/src/fr/opensagres/nosql/ide/orientdb/core/model/OrientServer.java
  48. +8 −1 ...agres.nosql.ide.orientdb.ui/src/fr/opensagres/nosql/ide/orientdb/ui/wizards/server/NewServerWizardPage.java
  49. +7 −1 fr.opensagres.nosql.ide.ui/plugin.properties
  50. +21 −2 fr.opensagres.nosql.ide.ui/plugin.xml
  51. +102 −0 fr.opensagres.nosql.ide.ui/schema/dialogFactories.exsd
  52. +2 −2 fr.opensagres.nosql.ide.ui/schema/serverImages.exsd
  53. +105 −0 fr.opensagres.nosql.ide.ui/schema/serverViewers.exsd
  54. +7 −1 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/PlatformUI.java
  55. +184 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/dialogs/AbstractRuntimeDialog.java
  56. +10 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/extensions/IDialogFactory.java
  57. +9 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/extensions/IDialogFactoryRegistry.java
  58. +63 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/Messages.java
  59. +55 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/Messages.properties
  60. +145 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/Trace.java
  61. +155 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/extensions/DialogFactoryRegistry.java
  62. +7 −1 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/extensions/ServerImageRegistry.java
  63. +84 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/preferences/AbstractTableBlock.java
  64. +575 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/preferences/InstalledRuntimesBlock.java
  65. +35 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/preferences/NoSQLPreferencePage.java
  66. +130 −0 ...pensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/preferences/ServerRuntimePreferencePage.java
  67. +34 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/viewers/ServerTypeContentProvider.java
  68. +26 −0 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/viewers/ServerTypeLabelProvider.java
View
0  ...tPlatform/launch/MongoDB IDE - Eclipse IDE.launch → TargetPlatform/launch/NoSQL IDE - Eclipse IDE.launch
File renamed without changes
View
64 ...atform/launch/MongoDB IDE - Eclipse MacOSX.launch → ...Platform/launch/NoSQL IDE - Eclipse MacOSX.launch
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
-<booleanAttribute key="append.args" value="true"/>
-<stringAttribute key="application" value="fr.opensagres.mongodb.ide.ui.application"/>
-<booleanAttribute key="askclear" value="true"/>
-<booleanAttribute key="automaticAdd" value="false"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="false"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/MongoDB IDE - Eclipse MacOSX"/>
-<booleanAttribute key="default" value="false"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../runtime-fr.opensagres.mongodb.ide.ui.application"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m"/>
-<booleanAttribute key="pde.generated.config" value="false"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.epp.package.rcp.product"/>
-<stringAttribute key="selected_target_plugins" value="com.ibm.icu@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.cocoa.macosx.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default"/>
-<stringAttribute key="selected_workspace_plugins" value="com.mongodb.tools@default:default,fr.opensagres.mongodb.ide.core@default:default,fr.opensagres.mongodb.ide.ui@default:default,org.eclipse.nebula.widgets.pagination@default:default,org.mongodb.mongo-java-driver@default:default"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<booleanAttribute key="useProduct" value="false"/>
-<booleanAttribute key="usefeatures" value="false"/>
-</launchConfiguration>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
+<booleanAttribute key="append.args" value="true"/>
+<stringAttribute key="application" value="fr.opensagres.mongodb.ide.ui.application"/>
+<booleanAttribute key="askclear" value="true"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="false"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/MongoDB IDE - Eclipse MacOSX"/>
+<booleanAttribute key="default" value="false"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../runtime-fr.opensagres.mongodb.ide.ui.application"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m"/>
+<booleanAttribute key="pde.generated.config" value="false"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.epp.package.rcp.product"/>
+<stringAttribute key="selected_target_plugins" value="com.ibm.icu@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="com.mongodb.tools@default:default,fr.opensagres.mongodb.ide.core@default:default,fr.opensagres.mongodb.ide.ui@default:default,org.eclipse.nebula.widgets.pagination@default:default,org.mongodb.mongo-java-driver@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useProduct" value="false"/>
+<booleanAttribute key="usefeatures" value="false"/>
+</launchConfiguration>
View
6 ...tPlatform/launch/MongoDB IDE - Eclipse RAP.launch → TargetPlatform/launch/NoSQL IDE - Eclipse RAP.launch
@@ -18,7 +18,7 @@
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true&#13;&#10;-Dorg.eclipse.equinox.http.jetty.log.stderr.threshold=info"/>
<stringAttribute key="org.eclipse.rap.launch.browserMode" value="INTERNAL"/>
<stringAttribute key="org.eclipse.rap.launch.contextpath" value=""/>
-<stringAttribute key="org.eclipse.rap.launch.dataLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.rap.ui.launch/MongoDBIDE-EclipseRAP"/>
+<stringAttribute key="org.eclipse.rap.launch.dataLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.rap.ui.launch/NoSQLIDE-EclipseRAP"/>
<stringAttribute key="org.eclipse.rap.launch.entryPoint" value="fr.opensagres.mongodb.ide.ui.application"/>
<stringAttribute key="org.eclipse.rap.launch.libraryVariant" value="STANDARD"/>
<stringAttribute key="org.eclipse.rap.launch.logLevel" value="OFF"/>
@@ -33,9 +33,9 @@
<booleanAttribute key="org.eclipse.rap.launch.useSessionTimeout" value="false"/>
<stringAttribute key="pde.version" value="3.3"/>
<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="target_bundles" value="com.ibm.icu.base@default:default,javax.servlet@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.http.servletbridge@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.servletbridge.extensionbundle@default:false,org.eclipse.equinox.servletbridge@default:default,org.eclipse.equinox.util@default:default,org.eclipse.help@default:default,org.eclipse.jetty.continuation@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.rap.demo.databinding@default:default,org.eclipse.rap.demo@default:default,org.eclipse.rap.design.example@default:default,org.eclipse.rap.jface.databinding@default:default,org.eclipse.rap.jface@default:default,org.eclipse.rap.rwt.osgi@default:default,org.eclipse.rap.rwt@default:default,org.eclipse.rap.ui.forms@default:default,org.eclipse.rap.ui.views@default:default,org.eclipse.rap.ui.workbench@default:default,org.eclipse.rap.ui@default:default"/>
+<stringAttribute key="target_bundles" value="javax.servlet@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:true,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.help@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<stringAttribute key="workspace_bundles" value="com.mongodb.tools@default:default,fr.opensagres.mongodb.ide.core@default:default,fr.opensagres.mongodb.ide.demo@default:default,fr.opensagres.mongodb.ide.ui-rap@default:default,fr.opensagres.mongodb.ide.ui@default:default,org.eclipse.nebula.widgets.pagination@default:default,org.mongodb.mongo-java-driver@default:default"/>
+<stringAttribute key="workspace_bundles" value="com.mongodb.tools@default:default,fr.opensagres.mongodb.ide.core@default:default,fr.opensagres.mongodb.ide.demo@default:default,fr.opensagres.mongodb.ide.ui@default:default,org.eclipse.nebula.widgets.pagination@default:default,org.mongodb.mongo-java-driver@default:default"/>
</launchConfiguration>
View
2  ...m/launch/MongoDB IDE - Eclipse RCP (win32).launch → ...orm/launch/NoSQL IDE - Eclipse RCP (win32).launch
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
<booleanAttribute key="append.args" value="true"/>
-<stringAttribute key="application" value="fr.opensagres.mongodb.ide.ui.application"/>
+<stringAttribute key="application" value="fr.opensagres.nosql.ide.ui.application"/>
<booleanAttribute key="askclear" value="true"/>
<booleanAttribute key="automaticAdd" value="false"/>
<booleanAttribute key="automaticValidate" value="false"/>
View
0  TargetPlatform/mongodb-ide.target → TargetPlatform/nosql-ide.target
File renamed without changes
View
2  TargetPlatform/mongodb-rap.target → TargetPlatform/nosql-rap.target
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.6"?>
-<target name="Base RCP (Binary Only)" sequenceNumber="14">
+<target name="NoSQL IDE RAP Target Platform" sequenceNumber="14">
<locations>
<location includeAllPlatforms="true" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.rap.runtime.requirements.feature.group" version="1.5.0.20120612-1510"/>
View
0  TargetPlatform/mongodb-rcp.target → TargetPlatform/nosql-rcp.target
File renamed without changes
View
BIN  TargetPlatform/warproduct/demo/mongoide-rapdemo.war
Binary file not shown
View
0  ...m/warproduct/demo/mongodb_ide-rap-demo.warproduct → ...latform/warproduct/demo/nosql-rap-demo.warproduct
File renamed without changes
View
21 com.orientechnologies.orient/.classpath
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/hazelcast-2.1.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-jpa-2.0-api-1.0.0.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/javassist.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jna-3.4.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/orient-commons-1.1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/orientdb-client-1.1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/orientdb-core-1.1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/orientdb-distributed-1.1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/orientdb-enterprise-1.1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/orientdb-nativeos-1.1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/orientdb-object-1.1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/orientdb-server-1.1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/orientdb-tools-1.1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/platform.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
28 com.orientechnologies.orient/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.orientechnologies.orient</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>
View
8 com.orientechnologies.orient/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Mon Sep 03 12:17:40 CEST 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
View
151 com.orientechnologies.orient/META-INF/MANIFEST.MF
@@ -0,0 +1,151 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Orient
+Bundle-SymbolicName: com.orientechnologies.orient
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: ORIENTECHNOLOGIES
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ClassPath: lib/hazelcast-2.1.2.jar,
+ lib/hibernate-jpa-2.0-api-1.0.0.Final.jar,
+ lib/javassist.jar,
+ lib/jna-3.4.0.jar,
+ lib/orient-commons-1.1.0.jar,
+ lib/orientdb-client-1.1.0.jar,
+ lib/orientdb-core-1.1.0.jar,
+ lib/orientdb-distributed-1.1.0.jar,
+ lib/orientdb-enterprise-1.1.0.jar,
+ lib/orientdb-nativeos-1.1.0.jar,
+ lib/orientdb-object-1.1.0.jar,
+ lib/orientdb-server-1.1.0.jar,
+ lib/orientdb-tools-1.1.0.jar,
+ lib/platform.jar,
+ .
+Export-Package: com.orientechnologies.common.collection,
+ com.orientechnologies.common.comparator,
+ com.orientechnologies.common.concur,
+ com.orientechnologies.common.concur.lock,
+ com.orientechnologies.common.concur.resource,
+ com.orientechnologies.common.console,
+ com.orientechnologies.common.console.annotation,
+ com.orientechnologies.common.exception,
+ com.orientechnologies.common.factory,
+ com.orientechnologies.common.io,
+ com.orientechnologies.common.listener,
+ com.orientechnologies.common.log,
+ com.orientechnologies.common.parser,
+ com.orientechnologies.common.profiler,
+ com.orientechnologies.common.reflection,
+ com.orientechnologies.common.synch,
+ com.orientechnologies.common.test,
+ com.orientechnologies.common.thread,
+ com.orientechnologies.common.types,
+ com.orientechnologies.common.util,
+ com.orientechnologies.nio,
+ com.orientechnologies.orient.client.db,
+ com.orientechnologies.orient.client.remote,
+ com.orientechnologies.orient.console,
+ com.orientechnologies.orient.core,
+ com.orientechnologies.orient.core.annotation,
+ com.orientechnologies.orient.core.cache,
+ com.orientechnologies.orient.core.command,
+ com.orientechnologies.orient.core.command.script,
+ com.orientechnologies.orient.core.command.traverse,
+ com.orientechnologies.orient.core.config,
+ com.orientechnologies.orient.core.db,
+ com.orientechnologies.orient.core.db.document,
+ com.orientechnologies.orient.core.db.graph,
+ com.orientechnologies.orient.core.db.object,
+ com.orientechnologies.orient.core.db.raw,
+ com.orientechnologies.orient.core.db.record,
+ com.orientechnologies.orient.core.db.tool,
+ com.orientechnologies.orient.core.dictionary,
+ com.orientechnologies.orient.core.engine,
+ com.orientechnologies.orient.core.engine.local,
+ com.orientechnologies.orient.core.engine.memory,
+ com.orientechnologies.orient.core.entity,
+ com.orientechnologies.orient.core.exception,
+ com.orientechnologies.orient.core.fetch,
+ com.orientechnologies.orient.core.fetch.json,
+ com.orientechnologies.orient.core.fetch.remote,
+ com.orientechnologies.orient.core.hook,
+ com.orientechnologies.orient.core.id,
+ com.orientechnologies.orient.core.index,
+ com.orientechnologies.orient.core.intent,
+ com.orientechnologies.orient.core.iterator,
+ com.orientechnologies.orient.core.iterator.object,
+ com.orientechnologies.orient.core.memory,
+ com.orientechnologies.orient.core.metadata,
+ com.orientechnologies.orient.core.metadata.schema,
+ com.orientechnologies.orient.core.metadata.security,
+ com.orientechnologies.orient.core.query,
+ com.orientechnologies.orient.core.query.nativ,
+ com.orientechnologies.orient.core.record,
+ com.orientechnologies.orient.core.record.impl,
+ com.orientechnologies.orient.core.security,
+ com.orientechnologies.orient.core.serialization,
+ com.orientechnologies.orient.core.serialization.serializer,
+ com.orientechnologies.orient.core.serialization.serializer.binary,
+ com.orientechnologies.orient.core.serialization.serializer.binary.impl,
+ com.orientechnologies.orient.core.serialization.serializer.binary.impl.index,
+ com.orientechnologies.orient.core.serialization.serializer.object,
+ com.orientechnologies.orient.core.serialization.serializer.record,
+ com.orientechnologies.orient.core.serialization.serializer.record.string,
+ com.orientechnologies.orient.core.serialization.serializer.stream,
+ com.orientechnologies.orient.core.serialization.serializer.string,
+ com.orientechnologies.orient.core.sql,
+ com.orientechnologies.orient.core.sql.filter,
+ com.orientechnologies.orient.core.sql.functions,
+ com.orientechnologies.orient.core.sql.functions.coll,
+ com.orientechnologies.orient.core.sql.functions.geo,
+ com.orientechnologies.orient.core.sql.functions.math,
+ com.orientechnologies.orient.core.sql.functions.misc,
+ com.orientechnologies.orient.core.sql.operator,
+ com.orientechnologies.orient.core.sql.operator.math,
+ com.orientechnologies.orient.core.sql.query,
+ com.orientechnologies.orient.core.storage,
+ com.orientechnologies.orient.core.storage.fs,
+ com.orientechnologies.orient.core.storage.impl.local,
+ com.orientechnologies.orient.core.storage.impl.memory,
+ com.orientechnologies.orient.core.tx,
+ com.orientechnologies.orient.core.type,
+ com.orientechnologies.orient.core.type.tree,
+ com.orientechnologies.orient.core.type.tree.provider,
+ com.orientechnologies.orient.enterprise.channel,
+ com.orientechnologies.orient.enterprise.channel.binary,
+ com.orientechnologies.orient.enterprise.channel.text,
+ com.orientechnologies.orient.enterprise.command,
+ com.orientechnologies.orient.enterprise.command.script,
+ com.orientechnologies.orient.object.db,
+ com.orientechnologies.orient.object.db.graph,
+ com.orientechnologies.orient.object.dictionary,
+ com.orientechnologies.orient.object.enhancement,
+ com.orientechnologies.orient.object.entity,
+ com.orientechnologies.orient.object.enumerations,
+ com.orientechnologies.orient.object.fetch,
+ com.orientechnologies.orient.object.iterator,
+ com.orientechnologies.orient.object.iterator.graph,
+ com.orientechnologies.orient.object.jpa,
+ com.orientechnologies.orient.object.serialization,
+ com.orientechnologies.orient.server,
+ com.orientechnologies.orient.server.config,
+ com.orientechnologies.orient.server.db,
+ com.orientechnologies.orient.server.distributed,
+ com.orientechnologies.orient.server.distributed.conflict,
+ com.orientechnologies.orient.server.handler,
+ com.orientechnologies.orient.server.hazelcast,
+ com.orientechnologies.orient.server.journal,
+ com.orientechnologies.orient.server.managed,
+ com.orientechnologies.orient.server.network,
+ com.orientechnologies.orient.server.network.protocol,
+ com.orientechnologies.orient.server.network.protocol.binary,
+ com.orientechnologies.orient.server.network.protocol.http,
+ com.orientechnologies.orient.server.network.protocol.http.command,
+ com.orientechnologies.orient.server.network.protocol.http.command.all,
+ com.orientechnologies.orient.server.network.protocol.http.command.delete,
+ com.orientechnologies.orient.server.network.protocol.http.command.get,
+ com.orientechnologies.orient.server.network.protocol.http.command.options,
+ com.orientechnologies.orient.server.network.protocol.http.command.post,
+ com.orientechnologies.orient.server.network.protocol.http.command.put,
+ com.orientechnologies.orient.server.network.protocol.http.multipart,
+ com.orientechnologies.orient.server.task,
+ com.orientechnologies.orient.server.tx
View
18 com.orientechnologies.orient/build.properties
@@ -0,0 +1,18 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ lib/hazelcast-2.1.2.jar,\
+ lib/hibernate-jpa-2.0-api-1.0.0.Final.jar,\
+ lib/javassist.jar,\
+ lib/jna-3.4.0.jar,\
+ lib/orient-commons-1.1.0.jar,\
+ lib/orientdb-client-1.1.0.jar,\
+ lib/orientdb-core-1.1.0.jar,\
+ lib/orientdb-distributed-1.1.0.jar,\
+ lib/orientdb-enterprise-1.1.0.jar,\
+ lib/orientdb-nativeos-1.1.0.jar,\
+ lib/orientdb-object-1.1.0.jar,\
+ lib/orientdb-server-1.1.0.jar,\
+ lib/orientdb-tools-1.1.0.jar,\
+ lib/platform.jar
View
BIN  com.orientechnologies.orient/lib/hazelcast-2.1.2.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/hibernate-jpa-2.0-api-1.0.0.Final.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/javassist.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/jna-3.4.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/orient-commons-1.1.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/orientdb-client-1.1.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/orientdb-core-1.1.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/orientdb-distributed-1.1.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/orientdb-enterprise-1.1.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/orientdb-nativeos-1.1.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/orientdb-object-1.1.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/orientdb-server-1.1.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/orientdb-tools-1.1.0.jar
Binary file not shown
View
BIN  com.orientechnologies.orient/lib/platform.jar
Binary file not shown
View
2  fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/IServerRuntimeManager.java
@@ -16,4 +16,6 @@
void removeRuntime(IServerRuntime runtime) throws Exception;
IServerRuntime findRuntime(String runtimeId);
+
+ void setRuntimes(IServerRuntime[] runtimes) throws Exception;
}
View
1  fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/Platform.java
@@ -36,4 +36,5 @@ public static IServerRunnerRegistry getServerRunnerRegistry() {
public static IShellCommandManagerRegistry getShellCommandManagerRegistry() {
return ShellCommandManagerRegistry.getInstance();
}
+
}
View
59 fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/model/AbstractServerRuntime.java
@@ -0,0 +1,59 @@
+package fr.opensagres.nosql.ide.core.model;
+
+import fr.opensagres.nosql.ide.core.Platform;
+import fr.opensagres.nosql.ide.core.extensions.IServerType;
+
+public abstract class AbstractServerRuntime implements IServerRuntime {
+
+ private final String id;
+ private String name;
+ private String installDir;
+ private final IServerType serverType;
+
+ public AbstractServerRuntime(String serverTypeId, String name, String path)
+ throws Exception {
+ this(serverTypeId, String.valueOf(System.currentTimeMillis()), name,
+ path);
+ }
+
+ public AbstractServerRuntime(String serverTypeId, String id, String name,
+ String path) throws Exception {
+ this.id = id;
+ setName(name);
+ setInstallDir(path);
+ serverType = Platform.getServerTypeRegistry().getType(serverTypeId);
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getLabel() {
+ return getName();
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getInstallDir() {
+ return installDir;
+ }
+
+ public void setInstallDir(String installDir) throws Exception {
+ validateInstallDir(installDir);
+ this.installDir = installDir;
+ }
+
+ public final IServerType getServerType() {
+ return serverType;
+ }
+
+ protected abstract void validateInstallDir(String installDir)
+ throws Exception;
+
+}
View
5 fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/model/IServerRuntime.java
@@ -6,4 +6,9 @@
IServerType getServerType();
+ String getInstallDir();
+
+ void setInstallDir(String installDir) throws Exception;
+
+ void setName(String name);
}
View
13 fr.opensagres.nosql.ide.core/src/fr/opensagres/nosql/ide/core/utils/CollectionUtils.java
@@ -0,0 +1,13 @@
+package fr.opensagres.nosql.ide.core.utils;
+
+import java.util.Collection;
+
+public class CollectionUtils {
+
+ public static <E> E getFirstElement(Collection<E> c) {
+ for (E e : c) {
+ return e;
+ }
+ return null;
+ }
+}
View
51 fr.opensagres.nosql.ide.mongodb.core/src/fr/opensagres/nosql/ide/mongodb/core/model/MongoServerRuntime.java
@@ -0,0 +1,51 @@
+package fr.opensagres.nosql.ide.mongodb.core.model;
+
+import org.eclipse.core.runtime.Path;
+
+import com.mongodb.tools.process.MongoDBTools;
+import com.mongodb.tools.process.MongoProcessFiles;
+
+import fr.opensagres.nosql.ide.core.model.AbstractServerRuntime;
+
+/**
+ *
+ * MongoRuntime stores an installation directory of a MongoDB dababase. It is
+ * used :
+ *
+ * <ul>
+ * <li>start/stop a local MongoDB server from ServerExplorer View with launch by
+ * calling INSTAL_DIR/bin/mongod.exe/sh process.</li> * *
+ * <li>start/stop a MongoDB Shell from ServerExplorer View (by selecting a
+ * database) with launch by calling INSTAL_DIR/bin/mongo.exe/sh process.</li>
+ * </ul>
+ *
+ */
+public class MongoServerRuntime extends AbstractServerRuntime {
+
+ private Path mongoProcessLocation;
+ private Path mongodProcessLocation;
+
+ public MongoServerRuntime(String name, String path) throws Exception {
+ super(MongoServer.TYPE_ID, name, path);
+ }
+
+ public MongoServerRuntime(String id, String name, String path)
+ throws Exception {
+ super(MongoServer.TYPE_ID, id, name, path);
+ }
+
+ @Override
+ protected void validateInstallDir(String installDir) throws Exception {
+ MongoProcessFiles files = MongoDBTools.validateMongoHomeDir(installDir);
+ this.mongoProcessLocation = new Path(files.getMongoFile().getPath());
+ this.mongodProcessLocation = new Path(files.getMongodFile().getPath());
+ }
+
+ public Path getMongoProcessLocation() {
+ return mongoProcessLocation;
+ }
+
+ public Path getMongodProcessLocation() {
+ return mongodProcessLocation;
+ }
+}
View
3  fr.opensagres.nosql.ide.mongodb.ui/META-INF/MANIFEST.MF
@@ -19,6 +19,9 @@ Import-Package: com.mongodb,
com.mongodb.gridfs,
com.mongodb.tools.driver,
com.mongodb.tools.driver.pagination,
+ com.mongodb.tools.process,
+ com.mongodb.tools.process.mongo,
+ com.mongodb.tools.process.mongod,
com.mongodb.tools.shell,
org.bson
Bundle-Activator: fr.opensagres.nosql.ide.mongodb.ui.internal.Activator
View
9 fr.opensagres.nosql.ide.mongodb.ui/plugin.xml
@@ -10,6 +10,15 @@
</serverImage>
</extension>
+ <extension
+ point="fr.opensagres.nosql.ide.ui.dialogFactories">
+ <dialogFactory
+ class="fr.opensagres.nosql.ide.mongodb.ui.internal.extension.MongoRuntimeDialogFactory"
+ dialogType="runtimeDialog"
+ serverType="fr.opensagres.nosql.ide.mongodb.core">
+ </dialogFactory>
+ </extension>
+
<extension
point="org.eclipse.ui.newWizards">
<category
View
71 fr.opensagres.nosql.ide.mongodb.ui/src/fr/opensagres/nosql/ide/mongodb/ui/dialogs/MongoRuntimeDialog.java
@@ -0,0 +1,71 @@
+package fr.opensagres.nosql.ide.mongodb.ui.dialogs;
+
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Shell;
+
+import com.mongodb.tools.process.InvalidMongoHomeDirException;
+import com.mongodb.tools.process.MongoDBTools;
+import com.mongodb.tools.process.MongoProcessFiles;
+import com.mongodb.tools.process.mongod.MongodTools;
+
+import fr.opensagres.nosql.ide.core.model.IServerRuntime;
+import fr.opensagres.nosql.ide.core.utils.StringUtils;
+import fr.opensagres.nosql.ide.mongodb.core.model.MongoServerRuntime;
+import fr.opensagres.nosql.ide.mongodb.ui.internal.Messages;
+import fr.opensagres.nosql.ide.ui.dialogs.AbstractRuntimeDialog;
+
+public class MongoRuntimeDialog extends
+ AbstractRuntimeDialog<MongoProcessFiles> {
+
+ public MongoRuntimeDialog(Shell parentShell) {
+ super(parentShell);
+ }
+
+ @Override
+ protected MongoProcessFiles validateInstallDir() {
+ // 1) validate install dir
+ if (StringUtils.isEmpty(installDir.getText())) {
+ setErrorMessage(Messages.errorInstallDirRequired);
+ return null;
+ }
+ try {
+ return MongoDBTools.validateMongoHomeDir(installDir.getText());
+ } catch (InvalidMongoHomeDirException e) {
+ String errorMessage = null;
+ switch (e.getType()) {
+ case baseDirNotExists:
+ errorMessage = NLS.bind(
+ Messages.errorInstallDir_baseDirNotExists, e.getFile()
+ .getPath());
+ break;
+ case baseDirNotDir:
+ errorMessage = NLS.bind(Messages.errorInstallDir_baseDirNotDir,
+ e.getFile().getPath());
+ break;
+ case binDirNotExists:
+ errorMessage = NLS.bind(
+ Messages.errorInstallDir_binDirNotExists, e.getFile()
+ .getPath());
+ break;
+ case processFileNotExists:
+ errorMessage = NLS.bind(
+ Messages.errorInstallDir_processFileNotExists, e
+ .getFile().getPath());
+ break;
+ }
+ setErrorMessage(errorMessage);
+ return null;
+ }
+ }
+
+ @Override
+ protected IServerRuntime createRuntime(String name, String installDir)
+ throws Exception {
+ return new MongoServerRuntime(name, installDir);
+ }
+
+ @Override
+ protected String getGeneratedName(MongoProcessFiles files) throws Exception {
+ return MongodTools.getDBVersion(files.getMongodFile());
+ }
+}
View
10 fr.opensagres.nosql.ide.mongodb.ui/src/fr/opensagres/nosql/ide/mongodb/ui/internal/Messages.java
@@ -62,7 +62,7 @@
public static String NewCollectionAction_toolTipText;
public static String NewDocumentAction_text;
public static String NewDocumentAction_toolTipText;
-
+
// ****************** RefreshAction ******************
public static String RefreshAction_text;
public static String RefreshAction_toolTipText;
@@ -171,6 +171,14 @@
public static String database_validation_required;
public static String collection_validation_required;
+ // Runtime error
+ public static String errorRuntimeNameRequired;
+ public static String errorInstallDirRequired;
+ public static String errorInstallDir_baseDirNotExists;
+ public static String errorInstallDir_baseDirNotDir;
+ public static String errorInstallDir_binDirNotExists;
+ public static String errorInstallDir_processFileNotExists;
+
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
View
10 fr.opensagres.nosql.ide.mongodb.ui/src/fr/opensagres/nosql/ide/mongodb/ui/internal/Messages.properties
@@ -181,4 +181,12 @@ columnMD5=MD5
server_validation_required=The server is required.
server_validation_notConnected=The server ''{0}'' is not connected.
database_validation_required=Database name field is required.
-collection_validation_required=Collection name field is required.
+collection_validation_required=Collection name field is required.
+
+# Runtime Error Messages
+errorRuntimeNameRequired=Name is required.
+errorInstallDirRequired=Install directory is required.
+errorInstallDir_baseDirNotExists=The MongoDB {0} base directory doesn't exist.
+errorInstallDir_baseDirNotDir=The MongoDB {0} path is not a directory.
+errorInstallDir_binDirNotExists=The MongoDB {0} directory doesn't exist.
+errorInstallDir_processFileNotExists=The MongoDB {0} process file doesn't exist.
View
14 ....ide.mongodb.ui/src/fr/opensagres/nosql/ide/mongodb/ui/internal/extension/MongoRuntimeDialogFactory.java
@@ -0,0 +1,14 @@
+package fr.opensagres.nosql.ide.mongodb.ui.internal.extension;
+
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+
+import fr.opensagres.nosql.ide.mongodb.ui.dialogs.MongoRuntimeDialog;
+import fr.opensagres.nosql.ide.ui.extensions.IDialogFactory;
+
+public class MongoRuntimeDialogFactory implements IDialogFactory {
+
+ public Window create(Shell shell) {
+ return new MongoRuntimeDialog(shell);
+ }
+}
View
4 fr.opensagres.nosql.ide.orientdb.core/META-INF/MANIFEST.MF
@@ -9,3 +9,7 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Require-Bundle: fr.opensagres.nosql.ide.core;bundle-version="1.0.0"
Export-Package: fr.opensagres.nosql.ide.orientdb.core.model
+Import-Package: com.orientechnologies.orient.client.remote,
+ com.orientechnologies.orient.core.db,
+ com.orientechnologies.orient.core.db.document,
+ com.orientechnologies.orient.core.storage
View
12 fr.opensagres.nosql.ide.orientdb.core/plugin.properties
@@ -11,4 +11,14 @@
pluginName=OrientDB IDE Core
providerName=Opensagres
-serverType.name=OrientDB
+serverType.name=OrientDB
+
+# Server runner
+ExternalServerRunner.startName=Start external server
+ExternalServerRunner.stopName=Stop external server
+ExternalServerRunner.startDesc=start Orient server by opening cmd/sh shell command.
+ExternalServerRunner.stopDesc=
+ConnectServerRunner.startName=Connect
+ConnectServerRunner.stopName=Disconnect
+ConnectServerRunner.startDesc=Connect to the server
+ConnectServerRunner.stopDesc=Disconnect to the server
View
15 fr.opensagres.nosql.ide.orientdb.core/plugin.xml
@@ -14,8 +14,21 @@
point="fr.opensagres.nosql.ide.core.serverFactories">
<serverFactory
serverType="fr.opensagres.nosql.ide.orientdb.core"
- class="fr.opensagres.nosql.ide.orientdb.core.model.internal.OrientServerFactory">
+ class="fr.opensagres.nosql.ide.orientdb.core.internal.extensions.OrientServerFactory">
</serverFactory>
</extension>
+ <extension
+ point="fr.opensagres.nosql.ide.core.serverRunners">
+ <serverRunner
+ serverType="fr.opensagres.nosql.ide.orientdb.core"
+ class="fr.opensagres.nosql.ide.orientdb.core.internal.extensions.ConnectServerRunner"
+ id="fr.opensagres.nosql.ide.orientdb.core.internal.extensions.ConnectServerRunner"
+ startName="%ConnectServerRunner.startName"
+ startDescription="%ConnectServerRunner.startDesc"
+ stopName="%ConnectServerRunner.stopName"
+ stopDescription="%ConnectServerRunner.stopDesc">
+ </serverRunner>
+ </extension>
+
</plugin>
View
41 ...ide.orientdb.core/src/fr/opensagres/nosql/ide/orientdb/core/internal/extensions/ConnectServerRunner.java
@@ -0,0 +1,41 @@
+package fr.opensagres.nosql.ide.orientdb.core.internal.extensions;
+
+import fr.opensagres.nosql.ide.core.extensions.AbstractServerRunner;
+import fr.opensagres.nosql.ide.core.model.IServer;
+import fr.opensagres.nosql.ide.core.model.ServerState;
+
+public class ConnectServerRunner extends AbstractServerRunner {
+
+ @Override
+ protected boolean doCanSupport(IServer server) {
+ return true;
+ }
+
+ public void start(IServer server) throws Exception {
+ server.setServerState(ServerState.Connecting);
+ //server.getChildren();
+ //if (server.getStatus() == NodeStatus.StartedWithError) {
+ // server.setServerState(ServerState.Disconnected);
+ //}
+ //else {
+ server.setServerState(ServerState.Connected);
+ //}
+// // Try to connect
+// try {
+// MongoDriverHelper.tryConnection(((MongoServer) server).getMongo(),
+// server.getDatabaseName());
+// server.setServerState(ServerState.Connected);
+// } catch (Throwable e) {
+// server.getChildren().add(new Error(e));
+// server.setServerState(ServerState.Disconnected);
+// }
+ // MongoDriverHelper.tryConnection(getMongo());
+ // Connection is OK, update the server state as connected.
+
+ }
+
+ public void stop(IServer server, boolean force) throws Exception {
+ server.setServerState(ServerState.Disconnected);
+ }
+
+}
View
2  ...ntdb/core/model/internal/OrientServerFactory.java → ...core/internal/extensions/OrientServerFactory.java
@@ -1,4 +1,4 @@
-package fr.opensagres.nosql.ide.orientdb.core.model.internal;
+package fr.opensagres.nosql.ide.orientdb.core.internal.extensions;
import java.net.URL;
View
17 fr.opensagres.nosql.ide.orientdb.core/src/fr/opensagres/nosql/ide/orientdb/core/model/Database.java
@@ -0,0 +1,17 @@
+package fr.opensagres.nosql.ide.orientdb.core.model;
+
+import fr.opensagres.nosql.ide.core.model.AbstractDatabase;
+
+public class Database extends AbstractDatabase {
+
+ public Database(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void doGetChildren() throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
+}
View
25 fr.opensagres.nosql.ide.orientdb.core/src/fr/opensagres/nosql/ide/orientdb/core/model/OrientServer.java
@@ -2,12 +2,17 @@
import java.net.URL;
+import com.orientechnologies.orient.client.remote.OServerAdmin;
+import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
+import com.orientechnologies.orient.core.storage.OStorageProxy;
+
import fr.opensagres.nosql.ide.core.model.AbstractServer;
public class OrientServer extends AbstractServer {
public static final String TYPE_ID = "fr.opensagres.nosql.ide.orientdb.core";
private URL url;
+ private OServerAdmin serverAdmin;
public OrientServer(String name, URL url) {
super(TYPE_ID, name);
@@ -37,13 +42,29 @@ public String getDatabaseName() {
@Override
protected void loadDatabases() throws Exception {
- // TODO Auto-generated method stub
+ // see
+ // http://code.google.com/p/orient/source/browse/trunk/tools/src/main/java/com/orientechnologies/orient/console/OConsoleDatabaseApp.java
}
@Override
protected void loadDatabase(String databaseName) throws Exception {
- // TODO Auto-generated method stub
+ // see
+ // http://code.google.com/p/orient/source/browse/trunk/tools/src/main/java/com/orientechnologies/orient/console/OConsoleDatabaseApp.java
+ ODatabaseDocumentTx currentDatabase = new ODatabaseDocumentTx("remote:127.0.0.1/demo");
+ // if (currentDatabase == null)
+ // throw new OException("Database " + iURL + " not found");
+
+ // currentDatabase.registerListener(new OConsoleDatabaseListener(this));
+ currentDatabase.open("admin", "admin");
+
+ // currentDatabaseName = currentDatabase.getName();
+ if (currentDatabase.getStorage() instanceof OStorageProxy)
+ serverAdmin = new OServerAdmin(currentDatabase.getStorage()
+ .getURL());
+
+ Database database = new Database(databaseName);
+ super.addNode(database);
}
}
View
9 ...es.nosql.ide.orientdb.ui/src/fr/opensagres/nosql/ide/orientdb/ui/wizards/server/NewServerWizardPage.java
@@ -275,6 +275,7 @@ private void updateURLField(Widget widget) {
private void updateFieldsFromURL() {
try {
String host = null;
+ int portAsInt = -1;
String port = null;
String userName = null;
String password = null;
@@ -282,8 +283,14 @@ private void updateFieldsFromURL() {
try {
URL url = new URL(urlText.getText());
host = url.getHost();
- // port = url.getPort();
+ portAsInt = url.getPort();
+ port = portAsInt >= 0 ? String.valueOf(portAsInt) : null;
databaseName = url.getPath();
+ if (StringUtils.isNotEmpty(databaseName)
+ && databaseName.startsWith("/")) {
+ databaseName = databaseName.substring(1,
+ databaseName.length());
+ }
// MongoURI mongoURI = new MongoURI(mongoURIText.getText());
// Retrieve host and port fields from the MongoURI
// List<String> hosts = mongoURI.getHosts();
View
8 fr.opensagres.nosql.ide.ui/plugin.properties
@@ -13,6 +13,8 @@ providerName=Opensagres
# Extension Point
serverImagesContributionName=NoSQL Server images contribution.
+serverViewersContributionName=NoSQL Server viewers contribution.
+dialogFactoriesContributionName=Dialog Factories.
# Perspective
perspectiveName=NoSQL IDE
@@ -20,4 +22,8 @@ perspectiveName=NoSQL IDE
# Views
NoSQL.category=NoSQL IDE
ServersExplorer.name=NoSQL Servers
-ShellCommandsView.name=Shell Commands
+ShellCommandsView.name=Shell Commands
+
+# Preferences
+preferenceNoSQLTitle=NoSQL
+preferenceRuntimesTitle=Server Runtimes
View
23 fr.opensagres.nosql.ide.ui/plugin.xml
@@ -4,7 +4,9 @@
<extension-point id="serverImages" name="%serverImagesContributionName"
schema="schema/serverImages.exsd" />
-
+ <extension-point id="dialogFactories" name="%dialogFactoriesContributionName"
+ schema="schema/dialogFactories.exsd" />
+
<extension
id="application"
point="org.eclipse.core.runtime.applications">
@@ -52,5 +54,22 @@
class="fr.opensagres.nosql.ide.ui.internal.views.ShellCommandsView"
id="fr.opensagres.nosql.ide.ui.views.ShellCommandsView">
</view>
- </extension>
+ </extension>
+
+ <extension point="org.eclipse.ui.preferencePages">
+ <page
+ id="fr.opensagres.nosql.ide.ui.preferencePage"
+ name="%preferenceNoSQLTitle"
+ class="fr.opensagres.nosql.ide.ui.internal.preferences.NoSQLPreferencePage">
+ </page>
+ </extension>
+ <extension point="org.eclipse.ui.preferencePages">
+ <page
+ id="fr.opensagres.nosql.ide.ui.preferences.ServerRuntimePreferencePage"
+ name="%preferenceRuntimesTitle"
+ category="fr.opensagres.nosql.ide.ui.preferencePage"
+ class="fr.opensagres.nosql.ide.ui.internal.preferences.ServerRuntimePreferencePage">
+ </page>
+ </extension>
+
</plugin>
View
102 fr.opensagres.nosql.ide.ui/schema/dialogFactories.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="fr.opensagres.nosql.ide.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="fr.opensagres.nosql.ide.ui" id="dialogFactories" name="Dialog Factories."/>
+ </appinfo>
+ <documentation>
+ Extension point for dialog factories.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="dialogFactory" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully-qualified name of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ an optional id
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ an optional name
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="dialogFactory">
+ <complexType>
+ <sequence>
+ </sequence>
+ <attribute name="serverType" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="fr.opensagres.nosql.ide.core.serverTypes/serverType/@id"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="dialogType" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 2.0
+ </documentation>
+ </annotation>
+
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ This plugin itself does not have any predefined builders.
+ </documentation>
+ </annotation>
+
+
+</schema>
View
4 fr.opensagres.nosql.ide.ui/schema/serverImages.exsd
@@ -1,9 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
-<schema targetNamespace="fr.opensagres.nosql.ide.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<schema targetNamespace="fr.opensagres.nosql.ide.ui" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
- <meta.schema plugin="fr.opensagres.nosql.ide.core" id="serverImages" name="Server Image."/>
+ <meta.schema plugin="fr.opensagres.nosql.ide.ui" id="serverImages" name="Server Image."/>
</appinfo>
<documentation>
Extension point for add NoSQL Server Images.
View
105 fr.opensagres.nosql.ide.ui/schema/serverViewers.exsd
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="fr.opensagres.nosql.ide.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="fr.opensagres.nosql.ide.ui" id="AddRuntimeDialog" name="Server Viewer."/>
+ </appinfo>
+ <documentation>
+ Extension point for add NoSQL Server LabelProvider and ContentProvider.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="serverViewer" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully-qualified name of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ an optional id
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ an optional name
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="serverViewer">
+ <complexType>
+ <sequence>
+ </sequence>
+ <attribute name="serverType" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="fr.opensagres.nosql.ide.core.serverTypes/serverType/@id"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="labelProvider" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.jface.viewers.LabelProvider:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="contentProvider" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.jface.viewers.ITreeContentProvider"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 2.0
+ </documentation>
+ </annotation>
+
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ This plugin itself does not have any predefined builders.
+ </documentation>
+ </annotation>
+
+
+</schema>
View
8 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/PlatformUI.java
@@ -1,6 +1,8 @@
package fr.opensagres.nosql.ide.ui;
+import fr.opensagres.nosql.ide.ui.extensions.IDialogFactoryRegistry;
import fr.opensagres.nosql.ide.ui.extensions.IServerImageRegistry;
+import fr.opensagres.nosql.ide.ui.internal.extensions.DialogFactoryRegistry;
import fr.opensagres.nosql.ide.ui.internal.extensions.ServerImageRegistry;
public class PlatformUI {
@@ -8,6 +10,10 @@
private final static IServerImageRegistry SERVER_IMAGE_REGISTRY_INSTANCE = new ServerImageRegistry();
public static IServerImageRegistry getServerImageRegistry() {
- return SERVER_IMAGE_REGISTRY_INSTANCE;
+ return ServerImageRegistry.getInstance();
+ }
+
+ public static IDialogFactoryRegistry getDialogFactoryRegistry() {
+ return DialogFactoryRegistry.getInstance();
}
}
View
184 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/dialogs/AbstractRuntimeDialog.java
@@ -0,0 +1,184 @@
+package fr.opensagres.nosql.ide.ui.dialogs;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import fr.opensagres.nosql.ide.core.model.IServerRuntime;
+import fr.opensagres.nosql.ide.core.utils.StringUtils;
+import fr.opensagres.nosql.ide.ui.internal.Messages;
+
+/**
+ * Dialog used to create and edit {@link IServerRuntime}.
+ *
+ */
+public abstract class AbstractRuntimeDialog<E> extends TitleAreaDialog {
+
+ public static final String DIALOG_TYPE = "runtimeDialog";
+
+ protected Text name;
+ protected Text installDir;
+ protected IServerRuntime runtime;
+
+ public AbstractRuntimeDialog(Shell parentShell) {
+ super(parentShell);
+ this.runtime = null;
+ }
+
+ public void setRuntime(IServerRuntime runtime) {
+ this.runtime = runtime;
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+
+ String title = runtime == null ? Messages.AddRuntimeDialog_title
+ : Messages.EditRuntimeDialog_title;
+ getShell().setText(title);
+ setTitle(title);
+ setMessage(Messages.AddRuntimeDialog_desc);
+
+ Composite comp = (Composite) super.createDialogArea(parent);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ comp.setLayout(layout);
+ comp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ // Installation directory field.
+ Label label = new Label(comp, SWT.NONE);
+ label.setText(Messages.AddRuntimeDialog_installDir);
+ GridData data = new GridData();
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+
+ installDir = new Text(comp, SWT.BORDER);
+ if (runtime != null) {
+ installDir.setText(runtime.getInstallDir());
+ }
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ installDir.setLayoutData(data);
+ installDir.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ E files = validate();
+ if (files != null) {
+ if (StringUtils.isEmpty(name.getText())) {
+ try {
+ String generatedName = getGeneratedName(files);
+ if (generatedName != null) {
+ name.setText(generatedName);
+ }
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+ }
+ });
+
+ Button browse = new Button(comp, SWT.NONE);
+ browse.setText(Messages.browseButton);
+ browse.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent se) {
+ DirectoryDialog dialog = new DirectoryDialog(
+ AbstractRuntimeDialog.this.getShell());
+ dialog.setMessage(Messages.AddRuntimeDialog_selectInstallDir);
+ dialog.setFilterPath(installDir.getText());
+ String selectedDirectory = dialog.open();
+ if (selectedDirectory != null)
+ installDir.setText(selectedDirectory);
+ }
+ });
+
+ // Name field
+ label = new Label(comp, SWT.NONE);
+ label.setText(Messages.AddRuntimeDialog_runtimeName);
+ data = new GridData();
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+
+ name = new Text(comp, SWT.BORDER);
+ if (runtime != null) {
+ name.setText(runtime.getName());
+ }
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ name.setLayoutData(data);
+ name.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+
+ Dialog.applyDialogFont(comp);
+ return comp;
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Control contents = super.createContents(parent);
+ validate();
+ return contents;
+ }
+
+ protected E validate() {
+ E files = validateInstallDir();
+ if (files == null) {
+ super.getButton(IDialogConstants.OK_ID).setEnabled(false);
+ return null;
+ }
+ // 2) validate name
+ if (StringUtils.isEmpty(name.getText())) {
+ super.getButton(IDialogConstants.OK_ID).setEnabled(false);
+ setErrorMessage(Messages.errorRuntimeNameRequired);
+ } else {
+ super.getButton(IDialogConstants.OK_ID).setEnabled(true);
+ setErrorMessage(null);
+ }
+ return files;
+
+ }
+
+ @Override
+ protected void okPressed() {
+ if (runtime == null) {
+ try {
+ runtime = createRuntime(name.getText(), installDir.getText());
+ } catch (Exception e) {
+ e.printStackTrace();
+ return;
+ }
+ } else {
+ runtime.setName(name.getText());
+ try {
+ runtime.setInstallDir(installDir.getText());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ super.okPressed();
+ }
+
+ public IServerRuntime getRuntime() {
+ return runtime;
+ }
+
+ protected abstract E validateInstallDir();
+
+ protected abstract IServerRuntime createRuntime(String name,
+ String installDir) throws Exception;
+
+ protected abstract String getGeneratedName(E files) throws Exception;
+}
View
10 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/extensions/IDialogFactory.java
@@ -0,0 +1,10 @@
+package fr.opensagres.nosql.ide.ui.extensions;
+
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+
+public interface IDialogFactory {
+
+ Window create(Shell shell);
+
+}
View
9 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/extensions/IDialogFactoryRegistry.java
@@ -0,0 +1,9 @@
+package fr.opensagres.nosql.ide.ui.extensions;
+
+import fr.opensagres.nosql.ide.core.extensions.IServerType;
+
+public interface IDialogFactoryRegistry {
+
+ IDialogFactory getFactory(IServerType serverType, String dialogType);
+
+}
View
63 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/Messages.java
@@ -0,0 +1,63 @@
+package fr.opensagres.nosql.ide.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "fr.opensagres.nosql.ide.ui.internal.Messages";//$NON-NLS-1$
+
+ public static String browseButton;
+ public static String addButton;
+ public static String editButton;
+ public static String removeButton;
+
+ // ****************** ServerLaunchConfigurationTab ******************
+
+ public static String ServerLaunchConfigurationTab_name;
+
+ // ****************** MongoRuntimePreferencePage ******************
+ public static String ServerRuntimePreferencePage_title;
+ public static String ServerRuntimePreferencePage_desc;
+ public static String ServerRuntimePreferencePage_serverType;
+ public static String InstalledRuntimesBlock_desc;
+ public static String InstalledRuntimesBlock_nameColumn;
+ public static String InstalledRuntimesBlock_installDirColumn;
+
+ // ****************** AddRuntimeDialog ******************
+ public static String AddRuntimeDialog_title;
+ public static String EditRuntimeDialog_title;
+ public static String AddRuntimeDialog_desc;
+ public static String AddRuntimeDialog_runtimeName;
+ public static String AddRuntimeDialog_installDir;
+ public static String AddRuntimeDialog_selectInstallDir;
+
+ // MongodLaunchConfigurationTab
+ public static String jobStarting;
+ public static String jobRestarting;
+ public static String jobStopping;
+ public static String serverLaunchDescription;
+ public static String serverLaunchServer;
+ public static String serverLaunchHost;
+ public static String serverLaunchRuntime;
+
+ // Server Error
+ public static String errorServerAlreadyRunning;
+ public static String errorInvalidServer;
+ public static String errorNoServerSelected;
+ public static String errorStartFailed;
+ public static String errorStartTimeout;
+ public static String errorStopFailed;
+ // Runtime error
+ public static String errorRuntimeNameRequired;
+ public static String errorInstallDirRequired;
+ public static String errorInstallDir_baseDirNotExists;
+ public static String errorInstallDir_baseDirNotDir;
+ public static String errorInstallDir_binDirNotExists;
+ public static String errorInstallDir_processFileNotExists;
+
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+}
View
55 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/Messages.properties
@@ -0,0 +1,55 @@
+browseButton=Browse...
+addButton=Add...
+editButton=Edit..
+removeButton=Remove
+
+#################################################################
+# NewServerWizardPage
+#################################################################
+ServerLaunchConfigurationTab_name=Server
+
+#################################################################
+# ServerRuntimePreferencePage
+#################################################################
+ServerRuntimePreferencePage_title=NoSQL Server Runtime Environments
+ServerRuntimePreferencePage_desc=Add, remove, or edit Server runtime environments.
+ServerRuntimePreferencePage_serverType=Server type (to add):
+InstalledRuntimesBlock_desc=Server runtime e&nvironments:
+InstalledRuntimesBlock_nameColumn=Name
+InstalledRuntimesBlock_installDirColumn=Install directory
+
+#################################################################
+# AddRuntimeDialog
+#################################################################
+AddRuntimeDialog_title=New MongoDB Runtime Environnment
+EditRuntimeDialog_title=Edit MongoDB Runtime Environnment
+AddRuntimeDialog_desc=Select the MongoDB installation directory.
+AddRuntimeDialog_runtimeName=Name\:
+AddRuntimeDialog_installDir=Installation directory:
+AddRuntimeDialog_selectInstallDir=Select the MongoDB installation directory.
+
+# Server launch configuration tab
+serverLaunchDescription=This launch configuration can be used to launch the local MongoDB server specified below. To access further options for configuring the server, open the server's editor from the MongoDB Explorer.
+serverLaunchServer=Server:
+serverLaunchRuntime=Runtime Environment:
+serverLaunchHost=Host name:
+
+# Server Error Messages
+errorServerAlreadyRunning=Server already running
+errorNoServerSelected=No server selected
+errorInvalidServer=The server is invalid or missing
+errorStartTimeout=Server {0} was unable to start within {1} seconds. If the server requires more time, try increasing the timeout in the server editor.
+errorStartFailed=Server {0} failed to start.
+errorStopFailed=Server {0} failed to stop.
+
+# Runtime Error Messages
+errorRuntimeNameRequired=Name is required.
+errorInstallDirRequired=Install directory is required.
+errorInstallDir_baseDirNotExists=The MongoDB {0} base directory doesn't exist.
+errorInstallDir_baseDirNotDir=The MongoDB {0} path is not a directory.
+errorInstallDir_binDirNotExists=The MongoDB {0} directory doesn't exist.
+errorInstallDir_processFileNotExists=The MongoDB {0} process file doesn't exist.
+
+jobStarting=Starting {0}
+jobStopping=Stopping {0}
+jobRestarting=Restarting {0}
View
145 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/Trace.java
@@ -0,0 +1,145 @@
+package fr.opensagres.nosql.ide.ui.internal;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.service.debug.DebugOptions;
+import org.eclipse.osgi.service.debug.DebugOptionsListener;
+
+/**
+ * Helper class to route trace output.
+ */
+public class Trace implements DebugOptionsListener {
+
+ private static final SimpleDateFormat sdf = new SimpleDateFormat(
+ "dd/MM/yy HH:mm.ss.SSS"); //$NON-NLS-1$
+
+ private static Set<String> logged = new HashSet<String>();
+
+ // tracing enablement flags
+ public static boolean CONFIG = false;
+ public static boolean INFO = false;
+ public static boolean WARNING = false;
+ public static boolean SEVERE = false;
+ public static boolean FINER = false;
+ public static boolean FINEST = false;
+ public static boolean RESOURCES = false;
+ public static boolean EXTENSION_POINT = false;
+ public static boolean LISTENERS = false;
+ public static boolean RUNTIME_TARGET = false;
+ public static boolean PERFORMANCE = false;
+ public static boolean PUBLISHING = false;
+
+ // tracing levels. One most exist for each debug option
+ public final static String STRING_CONFIG = "/config"; //$NON-NLS-1$
+ public final static String STRING_INFO = "/info"; //$NON-NLS-1$
+ public final static String STRING_WARNING = "/warning"; //$NON-NLS-1$
+ public final static String STRING_SEVERE = "/severe"; //$NON-NLS-1$
+ public final static String STRING_FINER = "/finer"; //$NON-NLS-1$
+ public final static String STRING_FINEST = "/finest"; //$NON-NLS-1$
+ public final static String STRING_RESOURCES = "/resources"; //$NON-NLS-1$
+ public final static String STRING_EXTENSION_POINT = "/extension_point"; //$NON-NLS-1$
+ public final static String STRING_LISTENERS = "/listeners"; //$NON-NLS-1$
+ public final static String STRING_RUNTIME_TARGET = "/runtime_target"; //$NON-NLS-1$
+ public final static String STRING_PERFORMANCE = "/performance"; //$NON-NLS-1$
+ public final static String STRING_PUBLISHING = "/publishing"; //$NON-NLS-1$
+
+ /**
+ * Trace constructor. This should never be explicitly called by clients and
+ * is used to register this class with the {@link DebugOptions} service.
+ */
+ public Trace() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org
+ * .eclipse.osgi.service.debug.DebugOptions)
+ */
+ public void optionsChanged(DebugOptions options) {
+ Trace.CONFIG = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_CONFIG, false);
+ Trace.INFO = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_INFO, false);
+ Trace.WARNING = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_WARNING, false);
+ Trace.SEVERE = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_SEVERE, false);
+ Trace.FINER = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_FINER, false);
+ Trace.FINEST = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_FINEST, false);
+ Trace.RESOURCES = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_RESOURCES, false);
+ Trace.EXTENSION_POINT = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_EXTENSION_POINT, false);
+ Trace.LISTENERS = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_LISTENERS, false);
+ Trace.RUNTIME_TARGET = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_RUNTIME_TARGET, false);
+ Trace.PERFORMANCE = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_PERFORMANCE, false);
+ Trace.PUBLISHING = options.getBooleanOption(Activator.PLUGIN_ID
+ + Trace.STRING_PUBLISHING, false);
+ }
+
+ /**
+ * Trace the given message.
+ *
+ * @param level
+ * The tracing level.
+ * @param s
+ * The message to trace
+ */
+ public static void trace(final String level, String s) {
+
+ Trace.trace(level, s, null);
+ }
+
+ /**
+ * Trace the given message and exception.
+ *
+ * @param level
+ * The tracing level.
+ * @param s
+ * The message to trace
+ * @param t
+ * A {@link Throwable} to trace
+ */
+ public static void trace(final String level, String s, Throwable t) {
+ if (s == null) {
+ return;
+ }
+ if (Trace.STRING_SEVERE.equals(level)) {
+ if (!logged.contains(s)) {
+ Activator
+ .getDefault()
+ .getLog()
+ .log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, s,
+ t));
+ logged.add(s);
+ }
+ }
+ if (Activator.getDefault().isDebugging()) {
+ final StringBuffer sb = new StringBuffer(Activator.PLUGIN_ID);
+ sb.append(" "); //$NON-NLS-1$
+ sb.append(level);
+ sb.append(" "); //$NON-NLS-1$
+ sb.append(sdf.format(new Date()));
+ sb.append(" "); //$NON-NLS-1$
+ sb.append(s);
+ System.out.println(sb.toString());
+ if (t != null) {
+ t.printStackTrace();
+ }
+ }
+ }
+
+}
View
155 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/extensions/DialogFactoryRegistry.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (C) 2012 Angelo Zerr <angelo.zerr@gmail.com>, Pascal Leclercq <pascal.leclercq@gmail.com>
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Angelo ZERR - initial API and implementation
+ * Pascal Leclercq - initial API and implementation
+ *******************************************************************************/
+package fr.opensagres.nosql.ide.ui.internal.extensions;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionDelta;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+
+import fr.opensagres.nosql.ide.core.extensions.AbstractRegistry;
+import fr.opensagres.nosql.ide.core.extensions.IServerType;
+import fr.opensagres.nosql.ide.ui.extensions.IDialogFactory;
+import fr.opensagres.nosql.ide.ui.extensions.IDialogFactoryRegistry;
+import fr.opensagres.nosql.ide.ui.internal.Activator;
+import fr.opensagres.nosql.ide.ui.internal.Trace;
+
+/**
+ * Registry which holds instance of {@link IDialogFactory} created by the
+ * fr.opensagres.nosql.ide.core.dialogFactorys" extension point.
+ *
+ */
+public class DialogFactoryRegistry extends AbstractRegistry implements
+ IDialogFactoryRegistry {
+
+ private static final IDialogFactoryRegistry INSTANCE = new DialogFactoryRegistry();
+
+ private static final String DIALOG_FACTORY_ELT = "dialogFactory";
+ public static final String SERVER_TYPE_ATTR = "serverType";
+ private static final String DIALOG_TYPE_ATTR = "dialogType";
+ private static final String DIALOG_FACTORIES_EXTENSION_POINT = "dialogFactories";
+
+ public static IDialogFactoryRegistry getInstance() {
+ return INSTANCE;
+ }
+
+ private Map<String, IDialogFactory> dialogFactories = new HashMap<String, IDialogFactory>();
+
+ /**
+ * Return the {@link IDialogFactory} retrieved by the given id.
+ *
+ * @param id
+ * @return
+ */
+ public IDialogFactory getFactory(IServerType serverType, String dialogType) {
+ if (serverType == null || dialogType == null) {
+ throw new IllegalArgumentException();
+ }
+ loadRegistryIfNedded();
+ String key = getKey(serverType, dialogType);
+ return dialogFactories.get(key);
+ }
+
+ private String getKey(IServerType serverType, String dialogType) {
+ return new StringBuilder(serverType.getId()).append("_").append(dialogType)
+ .toString();
+ }
+
+ /**
+ * Return the list of the {@link IDialogFactory}.
+ *
+ * @return
+ */
+ public Collection<IDialogFactory> getFactories() {
+ loadRegistryIfNedded();
+ return dialogFactories.values();
+ }
+
+ @Override
+ protected void handleExtensionDelta(IExtensionDelta delta) {
+ if (delta.getKind() == IExtensionDelta.ADDED) {
+ IConfigurationElement[] cf = delta.getExtension()
+ .getConfigurationElements();
+ parseDialogFactoryManagers(cf);
+ } else {
+ // TODO : remove references
+ }
+
+ }
+
+ protected synchronized void loadRegistry() {
+ if (isRegistryIntialized()) {
+ return;
+ }
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ if (registry != null) {
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(
+ getPluginId(), getExtensionPoint());
+ parseDialogFactoryManagers(cf);
+ }
+ }
+
+ /**
+ * Parse elements of the extension poit and create for each dialog element
+ * an instance of {@link IDialogFactory}.
+ *
+ * <pre>
+ * <extension
+ * point="fr.opensagres.nosql.ide.ui.dialogFactoryies">
+ * <dialogFactory
+ * id="fr.opensagres.nosql.ide.mongodb.core"
+ * name="%dialogFactory.name">
+ * </dialogFactory>
+ * </extension>
+ * </pre>
+ *
+ * @param cf
+ */
+ private void parseDialogFactoryManagers(IConfigurationElement[] cf) {
+ for (IConfigurationElement ce : cf) {
+ IServerType serverType = null;
+ String serverTypeId = null;
+ String dialogType = null;
+ IDialogFactory factory = null;
+ if (DIALOG_FACTORY_ELT.equals(ce.getName())) {
+ serverTypeId = ce.getAttribute(SERVER_TYPE_ATTR);
+ serverType = fr.opensagres.nosql.ide.core.Platform
+ .getServerTypeRegistry().getType(serverTypeId);
+ dialogType = ce.getAttribute(DIALOG_TYPE_ATTR);
+ try {
+ factory = (IDialogFactory) ce
+ .createExecutableExtension(CLASS_ATTR);
+ String key = getKey(serverType, dialogType);
+ dialogFactories.put(key, factory);
+ } catch (CoreException e) {
+ Trace.trace(Trace.STRING_SEVERE, e.getMessage());
+ }
+ }
+ }
+ }
+
+ @Override
+ protected String getPluginId() {
+ return Activator.PLUGIN_ID;
+ }
+
+ @Override
+ protected String getExtensionPoint() {
+ return DIALOG_FACTORIES_EXTENSION_POINT;
+ }
+
+}
View
8 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/extensions/ServerImageRegistry.java
@@ -35,6 +35,8 @@
public class ServerImageRegistry extends AbstractUIRegistry implements
IServerImageRegistry {
+ private static final IServerImageRegistry INSTANCE = new ServerImageRegistry();
+
private static final String SERVER_IMAGE_ELT = "serverImage";
public static final String SERVER_TYPE_ATTR = "serverType";
@@ -42,6 +44,10 @@
private Map<IServerType, IServerImage> serverImages = new HashMap<IServerType, IServerImage>();
+ public static IServerImageRegistry getInstance() {
+ return INSTANCE;
+ }
+
/**
* Return the {@link IServerImage} retrieved by the given id.
*
@@ -118,7 +124,7 @@ private void parseServerImageManagers(IConfigurationElement[] cf) {
for (IConfigurationElement ce : cf) {
String serverTypeId = null;
Image icon = null;
- if (SERVER_IMAGE_ELT.equals(ce.getName())) {
+ if (SERVER_IMAGE_ELT.equals(ce.getName())) {
serverTypeId = ce.getAttribute(SERVER_TYPE_ATTR);
IServerType serverType = fr.opensagres.nosql.ide.core.Platform
.getServerTypeRegistry().getType(serverTypeId);
View
84 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/preferences/AbstractTableBlock.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Doug Satchwell (Chase Technology Ltd) - initial API and implementation
+ *******************************************************************************/
+package fr.opensagres.nosql.ide.ui.internal.preferences;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.widgets.Table;
+
+/**
+ * An <code>AbstractLaunchConfigurationTab</code> specialised for blocks that
+ * contain a table. This abstract class conveniently saves and restores the
+ * table's column settings.
+ *
+ * @author Doug Satchwell
+ * @since 1.0
+ */
+public abstract class AbstractTableBlock {
+ private int fSortColumn;
+
+ protected abstract Table getTable();
+
+ protected abstract IDialogSettings getDialogSettings();
+
+ protected abstract String getQualifier();
+
+ protected void setSortColumn(int column) {
+ fSortColumn = column;
+ }
+
+ /**
+ * Persist table settings into the give dialog store, prefixed with the
+ * given key.
+ */
+ public void saveColumnSettings() {
+ int columnCount = getTable().getColumnCount();
+ for (int i = 0; i < columnCount; i++) {
+ getDialogSettings()
+ .put(
+ getQualifier() + ".columnWidth" + i, getTable().getColumn(i).getWidth()); //$NON-NLS-1$
+ }
+ getDialogSettings().put(getQualifier() + ".sortColumn", fSortColumn); //$NON-NLS-1$
+ }
+
+ /**
+ * Restore table settings from the given dialog store using the given key.
+ */
+ public void restoreColumnSettings() {
+ getTable().layout(true);
+ restoreColumnWidths(getDialogSettings(), getQualifier());
+ int col = 0;
+ try {
+ col = getDialogSettings().getInt(getQualifier() + ".sortColumn"); //$NON-NLS-1$
+ } catch (NumberFormatException e) {
+ col = 1;
+ }
+ setSortColumn(col);
+ }
+
+ private void restoreColumnWidths(IDialogSettings settings, String qualifier) {
+ int columnCount = getTable().getColumnCount();
+ for (int i = 0; i < columnCount; i++) {
+ int width = -1;
+ try {
+ width = settings.getInt(qualifier + ".columnWidth" + i); //$NON-NLS-1$
+ } catch (NumberFormatException e) {
+ }
+
+ if (width > 0)
+ getTable().getColumn(i).setWidth(width);
+ }
+ }
+
+ public void dispose() {
+ if (getTable() != null && !getTable().isDisposed())
+ saveColumnSettings();
+ }
+}
View
575 fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/preferences/InstalledRuntimesBlock.java
@@ -0,0 +1,575 @@
+package fr.opensagres.nosql.ide.ui.internal.preferences;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+
+import fr.opensagres.nosql.ide.core.Platform;
+import fr.opensagres.nosql.ide.core.extensions.IServerType;
+import fr.opensagres.nosql.ide.core.model.IServerRuntime;
+import fr.opensagres.nosql.ide.core.utils.CollectionUtils;
+import fr.opensagres.nosql.ide.ui.PlatformUI;
+import fr.opensagres.nosql.ide.ui.dialogs.AbstractRuntimeDialog;
+import fr.opensagres.nosql.ide.ui.extensions.IDialogFactory;
+import fr.opensagres.nosql.ide.ui.internal.Activator;
+import fr.opensagres.nosql.ide.ui.internal.Messages;
+import fr.opensagres.nosql.ide.ui.viewers.ServerTypeContentProvider;
+import fr.opensagres.nosql.ide.ui.viewers.ServerTypeLabelProvider;
+
+public class InstalledRuntimesBlock extends AbstractTableBlock implements
+ ISelectionProvider {
+ private Composite fControl;
+ private final List<IServerRuntime> runtimes = new ArrayList<IServerRuntime>();
+ private CheckboxTableViewer tableViewer;
+ private Button fAddButton;
+ private Button fRemoveButton;
+ private Button fEditButton;
+ private final ListenerList fSelectionListeners = new ListenerList();
+ private ISelection fPrevSelection = new StructuredSelection();
+ private ComboViewer serverTypeViewer;
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ fSelectionListeners.add(listener);
+ }
+
+ public void removeSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ fSelectionListeners.remove(listener);
+ }
+
+ public ISelection getSelection() {
+ return new StructuredSelection(tableViewer.getCheckedElements());
+ }
+
+ public void setSelection(ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ if (!selection.equals(fPrevSelection)) {
+ fPrevSelection = selection;
+ Object jre = ((IStructuredSelection) selection)
+ .getFirstElement();
+ if (jre == null) {
+ tableViewer.setCheckedElements(new Object[0]);
+ } else {
+ tableViewer.setCheckedElements(new Object[] { jre });
+ tableViewer.reveal(jre);
+ }
+ fireSelectionChanged();
+ }
+ }
+ }
+
+ public void createControl(Composite ancestor) {
+
+ Composite parent = new Composite(ancestor, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ parent.setLayout(layout);
+ Font font = ancestor.getFont();
+ parent.setFont(font);
+ fControl = parent;
+
+ GridData data;
+
+ // Server type combo
+ Composite p = new Composite(parent, SWT.NONE);
+ layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ p.setLayout(layout);