Author: mareshkau
Date: 2008-10-20 14:35:49 -0400 (Mon, 20 Oct 2008)
New Revision: 11010
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/schema/
trunk/jst/plugins/org.jboss.tools.jst.jsp/schema/visual_editors.exsd
trunk/jst/plugins/org.jboss.tools.jst.jsp/schema/visulaEditorImplementations.exsd
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
Log:
=JBIDE-2674, visual editor implementations extension point was added
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-10-20 18:24:50 UTC (rev
11009)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-10-20 18:35:49 UTC (rev
11010)
@@ -3,7 +3,9 @@
<plugin>
<extension-point id="occurrenceStructureProviders"
- name="%occurrenceStructureProvidersExtensionPoint" />
+ name="%occurrenceStructureProvidersExtensionPoint" />
+ <extension-point id="visulaEditorImplementations" name="Visual Editor
Implementations" schema="schema/visulaEditorImplementations.exsd">
+ </extension-point>
<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
<sourceViewerConfiguration
@@ -401,4 +403,4 @@
</extension>
-</plugin>
\ No newline at end of file
+</plugin>
Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/schema/visual_editors.exsd
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/schema/visual_editors.exsd
(rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/schema/visual_editors.exsd 2008-10-20
18:35:49 UTC (rev 11010)
@@ -0,0 +1,84 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.jst.jsp"
xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.jst.jsp"
id="visual_editors" name="VisualEditors"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <attribute name="point" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Added: trunk/jst/plugins/org.jboss.tools.jst.jsp/schema/visulaEditorImplementations.exsd
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/schema/visulaEditorImplementations.exsd
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/schema/visulaEditorImplementations.exsd 2008-10-20
18:35:49 UTC (rev 11010)
@@ -0,0 +1,115 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.jst.jsp"
xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.jst.jsp"
id="visulaEditorImplementations" name="Visual Editor
Implementations"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="visualEditorImplementation"/>
+ </sequence>
+ <attribute name="point" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="visualEditorImplementation">
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ The name of visual editor implementation
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string"
use="required">
+ <annotation>
+ <documentation>
+ Class which implement visual editor factory
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.jst.jsp.editor.IVisualEditorFactory"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-20
18:24:50 UTC (rev 11009)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-20
18:35:49 UTC (rev 11010)
@@ -19,6 +19,8 @@
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
@@ -80,7 +82,6 @@
import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
import org.jboss.tools.jst.web.tld.VpeTaglibManagerProvider;
-import org.osgi.framework.Bundle;
// Fix for EXIN-232: The IMultiPageEditor interface implementation is added.
public class JSPMultiPageEditor extends JSPMultiPageEditorPart implements
@@ -101,8 +102,12 @@
private static final String PREVIEW_TAB="Preview"; //$NON-NLS-1$
//visual tab
private static final String VISUAL_SOURCE_TAB="Visual/Source"; //$NON-NLS-1$
+
+ private static final String
VPE_VISUAL_EDITOR_IMPL_ID="org.jboss.tools.vpe.org.jboss.tools.vpe.editor.VpeEditorPartFactory";
//$NON-NLS-1$
//source tab
private static final String SOURCE_TAB="Source"; //$NON-NLS-1$
+
+ private static final String
VISUAL_EDITOR_IMPL_EXTENSION_POINT_NAME="visulaEditorImplementations";
//$NON-NLS-1$
private IVisualEditor visualEditor;
@@ -137,19 +142,32 @@
static IVisualEditorFactory visualEditorFactory;
static {
+ //Fix For JBIDE-2674
try {
- Bundle b = Platform.getBundle("org.jboss.tools.vpe"); //$NON-NLS-1$
- //FIX for JBIDE-2248
- if(b!=null) {
- Class cls = b
- .loadClass("org.jboss.tools.vpe.editor.VpeEditorPartFactory");
//$NON-NLS-1$
- visualEditorFactory = (IVisualEditorFactory) cls.newInstance();
+ IExtension visualEditorExtension = Platform.getExtensionRegistry()
+ .getExtension(JspEditorPlugin.PLUGIN_ID,
+ VISUAL_EDITOR_IMPL_EXTENSION_POINT_NAME,
+ VPE_VISUAL_EDITOR_IMPL_ID);
+ if (visualEditorExtension != null) {
+ IConfigurationElement[] configurationElements = visualEditorExtension
+ .getConfigurationElements();
+ if (configurationElements != null
+ && configurationElements.length == 1) {
+ visualEditorFactory = (IVisualEditorFactory) configurationElements[0]
+ .createExecutableExtension("class"); //$NON-NLS-1$
+ } else {
+ JspEditorPlugin
+ .getPluginLog()
+ .logError(
+ "Visual Editor Extension Point not configured correctly");
//$NON-NLS-1$
+ }
} else {
- JspEditorPlugin.getPluginLog().logError("Plugin org.jboss.tools.vpe not
available," + //$NON-NLS-1$
- " visual page editor will be not available"); //$NON-NLS-1$
+ JspEditorPlugin.getPluginLog().logError(
+ "Visual Editor Implementation not available"); //$NON-NLS-1$
}
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError("Error in loading visual editor
factory", e); //$NON-NLS-1$
+ } catch (CoreException e) {
+ JspEditorPlugin.getPluginLog().logError(
+ "Visual Editor Implementation not available" + e); //$NON-NLS-1$
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-10-20 18:24:50 UTC (rev 11009)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2008-10-20 18:35:49 UTC (rev 11010)
@@ -71,4 +71,8 @@
contextId="org.jboss.tools.vpe.editorContext"
sequence="M1+M2+Tab"/>
</extension>
+ <extension
+ point="org.jboss.tools.jst.jsp.visulaEditorImplementations"
id="org.jboss.tools.vpe.editor.VpeEditorPartFactory">
+ <visualEditorImplementation name="XulRunner Visual Editor"
class="org.jboss.tools.vpe.editor.VpeEditorPartFactory"/>
+ </extension>
</plugin>