web UI branding moved to separate plugin from core
authorVictor Kirhenshtein <victor@netxms.org>
Sun, 16 Oct 2016 16:11:46 +0000 (19:11 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Sun, 16 Oct 2016 16:11:46 +0000 (19:11 +0300)
webui/webapp/Branding/.classpath [new file with mode: 0644]
webui/webapp/Branding/.project [new file with mode: 0644]
webui/webapp/Branding/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
webui/webapp/Branding/META-INF/MANIFEST.MF [new file with mode: 0644]
webui/webapp/Branding/build.properties [new file with mode: 0644]
webui/webapp/Branding/icons/favicon.png [moved from webui/webapp/Core/icons/favicon.png with 100% similarity]
webui/webapp/Branding/plugin.xml [new file with mode: 0644]
webui/webapp/Branding/src/org/netxms/ui/eclipse/branding/Activator.java [new file with mode: 0644]
webui/webapp/Core/plugin.xml
webui/webapp/Core/src/org/netxms/ui/eclipse/console/ApplicationWorkbenchWindowAdvisor.java

diff --git a/webui/webapp/Branding/.classpath b/webui/webapp/Branding/.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/webui/webapp/Branding/.project b/webui/webapp/Branding/.project
new file mode 100644 (file)
index 0000000..da1cb77
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>Branding</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>
diff --git a/webui/webapp/Branding/.settings/org.eclipse.jdt.core.prefs b/webui/webapp/Branding/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..c537b63
--- /dev/null
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/webui/webapp/Branding/META-INF/MANIFEST.MF b/webui/webapp/Branding/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..208cce9
--- /dev/null
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: NetXMS Console branding
+Bundle-SymbolicName: org.netxms.ui.eclipse.branding;singleton:=true
+Bundle-Version: 2.1.0
+Bundle-Activator: org.netxms.ui.eclipse.branding.Activator
+Bundle-Vendor: netxms.org
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.rap.ui;bundle-version="3.1.0",
+ org.netxms.webui.core;bundle-version="2.1.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
diff --git a/webui/webapp/Branding/build.properties b/webui/webapp/Branding/build.properties
new file mode 100644 (file)
index 0000000..6c480f3
--- /dev/null
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               icons/
diff --git a/webui/webapp/Branding/plugin.xml b/webui/webapp/Branding/plugin.xml
new file mode 100644 (file)
index 0000000..cb8ecad
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         id="product"
+         name="NetXMS Management Console"
+         point="org.eclipse.core.runtime.products">
+      <product
+            application="nxmc"
+            name="NetXMS Management Console">
+         <property
+               name="preferenceCustomization"
+               value="plugin_customization.ini">
+         </property>
+      </product>
+   </extension>
+   <extension
+         point="org.eclipse.rap.ui.entrypoint">
+      <entrypoint
+            applicationId="org.netxms.ui.eclipse.branding.nxmc"
+            brandingId="org.netxms.webui.design.branding.classic"
+            id="org.netxms.webui.entrypoint"
+            path="/nxmc">
+      </entrypoint>
+   </extension>
+   <extension
+         id="nxmc"
+         name="NetXMS Management Console"
+         point="org.eclipse.core.runtime.applications">
+      <application
+            cardinality="singleton-global"
+            thread="main"
+            visible="true">
+         <run
+               class="org.netxms.ui.eclipse.console.Application">
+         </run>
+      </application>
+   </extension>
+   <extension
+         point="org.eclipse.rap.ui.branding">
+      <branding
+            favicon="icons/favicon.png"
+            id="org.netxms.webui.design.branding.classic"
+            themeId="org.netxms.webui.design.theme.classic"
+            title="NetXMS Management Console">
+         <presentationFactory
+               id="org.netxms.ui.eclipse.console.factory.classic"
+               viewActionsVisible="true">
+         </presentationFactory>
+      </branding>
+   </extension>
+
+</plugin>
diff --git a/webui/webapp/Branding/src/org/netxms/ui/eclipse/branding/Activator.java b/webui/webapp/Branding/src/org/netxms/ui/eclipse/branding/Activator.java
new file mode 100644 (file)
index 0000000..5e83b29
--- /dev/null
@@ -0,0 +1,50 @@
+package org.netxms.ui.eclipse.branding;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+       // The plug-in ID
+       public static final String PLUGIN_ID = "org.netxms.ui.eclipse.branding"; //$NON-NLS-1$
+
+       // The shared instance
+       private static Activator plugin;
+       
+       /**
+        * The constructor
+        */
+       public Activator() {
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+        */
+       public void start(BundleContext context) throws Exception {
+               super.start(context);
+               plugin = this;
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+        */
+       public void stop(BundleContext context) throws Exception {
+               plugin = null;
+               super.stop(context);
+       }
+
+       /**
+        * Returns the shared instance
+        *
+        * @return the shared instance
+        */
+       public static Activator getDefault() {
+               return plugin;
+       }
+
+}
index 776cf60..2191f1a 100644 (file)
@@ -5,19 +5,6 @@
    <extension-point id="org.netxms.ui.eclipse.branding" name="NetXMS Console Branding" schema="schema/org.netxms.ui.eclipse.branding.exsd"/>
    <extension-point id="org.netxms.ui.eclipse.sessionproviders" name="Session Providers" schema="schema/org.netxms.ui.eclipse.sessionproviders.exsd"/>
    <extension-point id="org.netxms.ui.eclipse.colorproviders" name="Color Providers" schema="schema/org.netxms.ui.eclipse.colorproviders.exsd"/>
-   <extension
-         id="nxmc"
-         name="NetXMS Management Console"
-         point="org.eclipse.core.runtime.applications">
-      <application
-            thread="main"
-            cardinality="singleton-global"
-            visible="true">
-         <run
-               class="org.netxms.ui.eclipse.console.Application">
-         </run>
-      </application>
-   </extension>
    <extension
          point="org.eclipse.ui.perspectives">
       <perspective
             type="java.lang.Object">
       </propertyTester>
    </extension>
-   <extension
-         point="org.eclipse.rap.ui.branding">
-      <branding
-            favicon="icons/favicon.png"
-            id="org.netxms.webui.design.branding.classic"
-            themeId="org.netxms.webui.design.theme.classic"
-            title="NetXMS Management Console">
-         <presentationFactory
-               id="org.netxms.ui.eclipse.console.factory.classic"
-               viewActionsVisible="true">
-         </presentationFactory>
-      </branding>
-      <branding
-            favicon="icons/favicon.png"
-            id="org.netxms.webui.design.branding.material"
-            themeId="org.netxms.webui.design.theme.material"
-            title="NetXMS Management Console">
-         <presentationFactory
-               defaultLayoutId="org.netxms.ui.eclipse.console.layouts.modern"
-               id="org.netxms.ui.eclipse.console.factory.material"
-               viewActionsVisible="true">
-         </presentationFactory>
-      </branding>
-   </extension>
    <extension
          point="org.eclipse.rap.ui.themes">
       <theme
             name="Material Theme">
       </theme>
    </extension>
-   <extension
-         point="org.eclipse.rap.ui.entrypoint">
-      <entrypoint
-            applicationId="org.netxms.webui.core.nxmc"
-            brandingId="org.netxms.webui.design.branding.classic"
-            id="org.netxms.webui.entrypoint"
-            path="/nxmc">
-      </entrypoint>
-      <entrypoint
-            applicationId="org.netxms.webui.core.nxmc"
-            brandingId="org.netxms.webui.design.branding.material"
-            id="org.netxms.webui.entrypoint"
-            path="/nxmc2">
-      </entrypoint>
-   </extension>
    <extension
       point="org.eclipse.equinox.http.registry.servlets">
     <servlet
             id="downloadServiceHandler">
       </serviceHandler>
    </extension>
-   <extension
-         id="product"
-         name="NetXMS Management Console"
-         point="org.eclipse.core.runtime.products">
-      <product
-            application="nxmc"
-            name="NetXMS Management Console">
-         <property
-               name="preferenceCustomization"
-               value="plugin_customization.ini">
-         </property>
-      </product>
-   </extension>
    <extension
          point="org.eclipse.rap.ui.resources">
       <resource
index 3132b84..cbd1388 100644 (file)
@@ -98,7 +98,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor
          StringBuilder js = new StringBuilder();
          js.append("document.title = "); //$NON-NLS-1$
          js.append("\"");
-         js.append(Messages.get().ApplicationWorkbenchWindowAdvisor_AppTitle);
+         js.append(BrandingManager.getInstance().getProductName());
          js.append(" - [");
          js.append(session.getUserName());
          js.append("@");