Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 124454 Details for
Bug 263281
Non-breaking API change required to support custom property editors in WPE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Non-breaking API addition
patch.txt (text/plain), 13.30 KB, created by
Cameron Bateman
on 2009-02-02 14:08:01 EST
(
hide
)
Description:
Non-breaking API addition
Filename:
MIME Type:
Creator:
Cameron Bateman
Created:
2009-02-02 14:08:01 EST
Size:
13.30 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.pagedesigner >Index: src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsf/components/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java,v >retrieving revision 1.17 >diff -u -r1.17 HTMLEditor.java >--- src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java 21 Jan 2008 23:46:19 -0000 1.17 >+++ src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java 31 Jan 2009 17:37:49 -0000 >@@ -21,8 +21,12 @@ > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IExtension; >+import org.eclipse.core.runtime.IExtensionPoint; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.gef.DefaultEditDomain; > import org.eclipse.gef.palette.PaletteRoot; > import org.eclipse.gef.ui.palette.PaletteViewerProvider; >@@ -36,6 +40,7 @@ > import org.eclipse.jface.viewers.SelectionChangedEvent; > import org.eclipse.jst.jsf.common.ui.internal.logging.Logger; > import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils; >+import org.eclipse.jst.pagedesigner.IJMTConstants; > import org.eclipse.jst.pagedesigner.PDPlugin; > import org.eclipse.jst.pagedesigner.dnd.internal.DesignerSourceMouseTrackAdapter; > import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources; >@@ -144,7 +149,7 @@ > > private List PREVIEW_FILES_LIST = new ArrayList(); > >- private WPETabbedPropertySheetPage _tabbedPropSheet; >+ private IPropertySheetPage _tabbedPropSheet; > > private ISelectionChangedListener _selChangedListener; > >@@ -891,20 +896,76 @@ > return getTextEditor().isDirty(); > } > >- private IPropertySheetPage getPropertySheetPage() { >- if (_tabbedPropSheet == null){ >- _tabbedPropSheet = new org.eclipse.jst.pagedesigner.properties.WPETabbedPropertySheetPage( >- this, this); >- } >- return _tabbedPropSheet; >- } >+ private IPropertySheetPage getPropertySheetPage() >+ { >+ if (_tabbedPropSheet == null) >+ { >+ IPropertySheetPageFactory factory = getPageFactory(); >+ if (factory != null) >+ { >+ final IFile file = ((IFileEditorInput)getEditorInput()).getFile(); >+ _tabbedPropSheet = factory.createPage(file); >+ } >+ else >+ { >+ _tabbedPropSheet = new WPETabbedPropertySheetPage(this,this); >+ } >+ } >+ return _tabbedPropSheet; >+ } >+ >+ private IPropertySheetPageFactory getPageFactory() >+ { >+ //List<IElementEditFactory> result = new ArrayList<IElementEditFactory>(); >+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry() >+ .getExtensionPoint(PDPlugin.getPluginId(), >+ IJMTConstants.EXTENSION_POINT_PAGEDESIGNER); >+ IExtension[] extensions = extensionPoint.getExtensions(); >+ >+ for (int i = 0; i < extensions.length; i++) >+ { >+ IExtension ext = extensions[i]; >+ IConfigurationElement[] elementEditElement = ext >+ .getConfigurationElements(); > >- private PaletteViewerPage getPaletteViewerPage() { >- if (null == _paletteViewerPage) { >- DefaultEditDomain editDomain = getEditDomain(); >- PaletteItemManager manager = PaletteItemManager >- .getInstance(getCurrentProject(getEditorInput())); >- manager.reset(); >+ for (int j = 0; j < elementEditElement.length; j++) >+ { >+ final IConfigurationElement element = elementEditElement[j]; >+ if (element.getName().equals( >+ IJMTConstants.PROPERTY_PAGE_FACTORY)) >+ { >+ elementEditElement[j].getAttribute("factory"); //$NON-NLS-1$ >+ Object obj; >+ try >+ { >+ obj = elementEditElement[j] >+ .createExecutableExtension("factory"); //$NON-NLS-1$ >+ >+ // TODO: we need a policy based solution here, >+ // but this will do for now >+ if (obj instanceof IPropertySheetPageFactory) >+ { >+ return (IPropertySheetPageFactory) obj; >+ } >+ } >+ catch (CoreException e) >+ { >+ PDPlugin.log("Problem loading element edit extension for "+element.toString(), e); //$NON-NLS-1$ >+ } >+ } >+ } >+ } >+ return null; >+ } >+ >+ private PaletteViewerPage getPaletteViewerPage() >+ { >+ if (null == _paletteViewerPage) >+ { >+ DefaultEditDomain editDomain = getEditDomain(); >+ PaletteItemManager manager = PaletteItemManager >+ .getInstance(getCurrentProject(getEditorInput())); >+ manager.reset(); > PaletteRoot paletteRoot = _designViewer.getPaletteRoot(); > editDomain.setPaletteRoot(paletteRoot); > >Index: src/org/eclipse/jst/pagedesigner/IJMTConstants.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsf/components/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/IJMTConstants.java,v >retrieving revision 1.6 >diff -u -r1.6 IJMTConstants.java >--- src/org/eclipse/jst/pagedesigner/IJMTConstants.java 1 Feb 2008 20:20:20 -0000 1.6 >+++ src/org/eclipse/jst/pagedesigner/IJMTConstants.java 31 Jan 2009 17:37:49 -0000 >@@ -95,4 +95,8 @@ > */ > public static final String LINK_CREATOR = "linkCreator"; //$NON-NLS-1$ > >+ /** >+ * extension for property page factory >+ */ >+ public static final String PROPERTY_PAGE_FACTORY = "propertyPageFactory"; //$NON-NLS-1$ > } >Index: schema/pageDesignerExtension.exsd >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsf/components/jsf/plugins/org.eclipse.jst.pagedesigner/schema/pageDesignerExtension.exsd,v >retrieving revision 1.5 >diff -u -r1.5 pageDesignerExtension.exsd >--- schema/pageDesignerExtension.exsd 1 Feb 2008 20:20:21 -0000 1.5 >+++ schema/pageDesignerExtension.exsd 31 Jan 2009 17:37:49 -0000 >@@ -1,16 +1,21 @@ > <?xml version='1.0' encoding='UTF-8'?> > <!-- Schema file written by PDE --> >-<schema targetNamespace="org.eclipse.jst.pagedesigner"> >+<schema targetNamespace="org.eclipse.jst.pagedesigner" xmlns="http://www.w3.org/2001/XMLSchema"> > <annotation> >- <appInfo> >+ <appinfo> > <meta.schema plugin="org.eclipse.jst.pagedesigner" id="pageDesignerExtension" name="Web Page Editor Extension"/> >- </appInfo> >+ </appinfo> > <documentation> > <p><b>This extension point is provisional and subject to change</b></p> > </documentation> > </annotation> > > <element name="extension"> >+ <annotation> >+ <appinfo> >+ <meta.element /> >+ </appinfo> >+ </annotation> > <complexType> > <sequence> > <element ref="localDropHandler" minOccurs="0" maxOccurs="unbounded"/> >@@ -20,6 +25,7 @@ > <element ref="linkCreator" minOccurs="0" maxOccurs="unbounded"/> > <element ref="tagAttributeCellEditorFactory" minOccurs="0" maxOccurs="unbounded"/> > <element ref="tagTransformOperation" minOccurs="0" maxOccurs="unbounded"/> >+ <element ref="propertyPageFactory"/> > </sequence> > <attribute name="point" type="string" use="required"> > <annotation> >@@ -52,9 +58,9 @@ > <documentation> > > </documentation> >- <appInfo> >+ <appinfo> > <meta.attribute kind="java"/> >- </appInfo> >+ </appinfo> > </annotation> > </attribute> > </complexType> >@@ -72,9 +78,9 @@ > <documentation> > > </documentation> >- <appInfo> >+ <appinfo> > <meta.attribute kind="java" deprecated="true"/> >- </appInfo> >+ </appinfo> > </annotation> > </attribute> > </complexType> >@@ -92,9 +98,9 @@ > <documentation> > > </documentation> >- <appInfo> >+ <appinfo> > <meta.attribute kind="java" basedOn=":org.eclipse.jst.pagedesigner.meta.ITagAttributeCellEditorFactory"/> >- </appInfo> >+ </appinfo> > </annotation> > </attribute> > </complexType> >@@ -107,9 +113,9 @@ > <documentation> > > </documentation> >- <appInfo> >+ <appinfo> > <meta.attribute kind="java"/> >- </appInfo> >+ </appinfo> > </annotation> > </attribute> > </complexType> >@@ -122,9 +128,9 @@ > <documentation> > > </documentation> >- <appInfo> >+ <appinfo> > <meta.attribute kind="java"/> >- </appInfo> >+ </appinfo> > </annotation> > </attribute> > </complexType> >@@ -137,9 +143,9 @@ > <documentation> > > </documentation> >- <appInfo> >+ <appinfo> > <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.actions.link.ILinkCreator"/> >- </appInfo> >+ </appinfo> > </annotation> > </attribute> > <attribute name="linkIdentifier" type="string" use="required"> >@@ -163,10 +169,10 @@ > <annotation> > <documentation> > The transform operation id. Referencers will use plugin-qualified references. i.e if the plugin extending this was <code>org.foo.bar</code>, then the meta data instance that referenced this operation would specify: >- <pre> >- <operation id="org.foo.bar.MyTransformId"/> >- </pre> >- >+ <pre> >+ <operation id="org.foo.bar.MyTransformId"/> >+ </pre> >+ > The exception to this rule is that if the reference is not plugin-qualified, then the reference is assumed to be a <i>core</i> transformation and uses the <code>org.eclipse.jst.pagedesigner</code> prefix. > </documentation> > </annotation> >@@ -176,18 +182,33 @@ > <documentation> > class extending the <code>org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation</code> > </documentation> >- <appInfo> >+ <appinfo> > <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation:"/> >- </appInfo> >+ </appinfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="propertyPageFactory"> >+ <complexType> >+ <attribute name="factory" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appinfo> >+ <meta.attribute kind="java"/> >+ </appinfo> > </annotation> > </attribute> > </complexType> > </element> > > <annotation> >- <appInfo> >+ <appinfo> > <meta.section type="since"/> >- </appInfo> >+ </appinfo> > <documentation> > 2.0 > </documentation> >@@ -197,9 +218,9 @@ > > > <annotation> >- <appInfo> >+ <appinfo> > <meta.section type="copyright"/> >- </appInfo> >+ </appinfo> > <documentation> > Copyright 2006 Sybase and others > 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 >Index: src/org/eclipse/jst/pagedesigner/editors/IPropertySheetPageFactory.java >=================================================================== >RCS file: src/org/eclipse/jst/pagedesigner/editors/IPropertySheetPageFactory.java >diff -N src/org/eclipse/jst/pagedesigner/editors/IPropertySheetPageFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jst/pagedesigner/editors/IPropertySheetPageFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,9 @@ >+package org.eclipse.jst.pagedesigner.editors; >+ >+import org.eclipse.core.resources.IFile; >+import org.eclipse.ui.views.properties.IPropertySheetPage; >+ >+public interface IPropertySheetPageFactory >+{ >+ IPropertySheetPage createPage(final IFile file); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 263281
:
124454
|
124466
|
124483