View | Details | Raw Unified | Return to bug 263281 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jst/pagedesigner/editors/HTMLEditor.java (-14 / +75 lines)
Lines 21-28 Link Here
21
import org.eclipse.core.resources.IProject;
21
import org.eclipse.core.resources.IProject;
22
import org.eclipse.core.resources.IResource;
22
import org.eclipse.core.resources.IResource;
23
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.CoreException;
24
import org.eclipse.core.runtime.IConfigurationElement;
25
import org.eclipse.core.runtime.IExtension;
26
import org.eclipse.core.runtime.IExtensionPoint;
24
import org.eclipse.core.runtime.IProgressMonitor;
27
import org.eclipse.core.runtime.IProgressMonitor;
25
import org.eclipse.core.runtime.NullProgressMonitor;
28
import org.eclipse.core.runtime.NullProgressMonitor;
29
import org.eclipse.core.runtime.Platform;
26
import org.eclipse.gef.DefaultEditDomain;
30
import org.eclipse.gef.DefaultEditDomain;
27
import org.eclipse.gef.palette.PaletteRoot;
31
import org.eclipse.gef.palette.PaletteRoot;
28
import org.eclipse.gef.ui.palette.PaletteViewerProvider;
32
import org.eclipse.gef.ui.palette.PaletteViewerProvider;
Lines 36-41 Link Here
36
import org.eclipse.jface.viewers.SelectionChangedEvent;
40
import org.eclipse.jface.viewers.SelectionChangedEvent;
37
import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
41
import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
38
import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
42
import org.eclipse.jst.jsf.common.ui.internal.utils.ResourceUtils;
43
import org.eclipse.jst.pagedesigner.IJMTConstants;
39
import org.eclipse.jst.pagedesigner.PDPlugin;
44
import org.eclipse.jst.pagedesigner.PDPlugin;
40
import org.eclipse.jst.pagedesigner.dnd.internal.DesignerSourceMouseTrackAdapter;
45
import org.eclipse.jst.pagedesigner.dnd.internal.DesignerSourceMouseTrackAdapter;
41
import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
46
import org.eclipse.jst.pagedesigner.editors.pagedesigner.PageDesignerResources;
Lines 144-150 Link Here
144
149
145
	private List PREVIEW_FILES_LIST = new ArrayList();
150
	private List PREVIEW_FILES_LIST = new ArrayList();
146
151
147
	private WPETabbedPropertySheetPage _tabbedPropSheet;
152
	private IPropertySheetPage _tabbedPropSheet;
148
153
149
	private ISelectionChangedListener _selChangedListener;
154
	private ISelectionChangedListener _selChangedListener;
150
155
Lines 891-910 Link Here
891
		return getTextEditor().isDirty();
896
		return getTextEditor().isDirty();
892
	}
897
	}
893
898
894
	private IPropertySheetPage getPropertySheetPage() {
899
	private IPropertySheetPage getPropertySheetPage()
895
		if (_tabbedPropSheet == null){
900
    {
896
			_tabbedPropSheet = new org.eclipse.jst.pagedesigner.properties.WPETabbedPropertySheetPage(
901
        if (_tabbedPropSheet == null)
897
					this, this);
902
        {
898
		}
903
            IPropertySheetPageFactory factory = getPageFactory();
899
		return _tabbedPropSheet;
904
            if (factory != null)
900
	}
905
            {
906
                final IFile file = ((IFileEditorInput)getEditorInput()).getFile();
907
                _tabbedPropSheet = factory.createPage(file);
908
            }
909
            else
910
            {
911
                _tabbedPropSheet = new WPETabbedPropertySheetPage(this,this);
912
            }
913
        }
914
        return _tabbedPropSheet;
915
    }
916
917
    private IPropertySheetPageFactory getPageFactory()
918
    {
919
        //List<IElementEditFactory> result = new ArrayList<IElementEditFactory>();
920
        IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
921
                .getExtensionPoint(PDPlugin.getPluginId(),
922
                        IJMTConstants.EXTENSION_POINT_PAGEDESIGNER);
923
        IExtension[] extensions = extensionPoint.getExtensions();
924
925
        for (int i = 0; i < extensions.length; i++)
926
        {
927
            IExtension ext = extensions[i];
928
            IConfigurationElement[] elementEditElement = ext
929
                    .getConfigurationElements();
901
930
902
	private PaletteViewerPage getPaletteViewerPage() {
931
            for (int j = 0; j < elementEditElement.length; j++)
903
		if (null == _paletteViewerPage) {
932
            {
904
			DefaultEditDomain editDomain = getEditDomain();
933
                final IConfigurationElement element = elementEditElement[j];
905
			PaletteItemManager manager = PaletteItemManager
934
                if (element.getName().equals(
906
					.getInstance(getCurrentProject(getEditorInput()));
935
                        IJMTConstants.PROPERTY_PAGE_FACTORY))
907
			manager.reset();
936
                {
937
                    elementEditElement[j].getAttribute("factory"); //$NON-NLS-1$
938
                    Object obj;
939
                    try
940
                    {
941
                        obj = elementEditElement[j]
942
                                .createExecutableExtension("factory"); //$NON-NLS-1$
943
944
                        // TODO: we need a policy based solution here,
945
                        // but this will do for now
946
                        if (obj instanceof IPropertySheetPageFactory)
947
                        {
948
                            return (IPropertySheetPageFactory) obj;
949
                        }
950
                    } 
951
                    catch (CoreException e)
952
                    {
953
                        PDPlugin.log("Problem loading element edit extension for "+element.toString(), e); //$NON-NLS-1$
954
                    }
955
                }
956
            }
957
        }
958
        return null;
959
    }
960
961
    private PaletteViewerPage getPaletteViewerPage()
962
    {
963
        if (null == _paletteViewerPage)
964
        {
965
            DefaultEditDomain editDomain = getEditDomain();
966
            PaletteItemManager manager = PaletteItemManager
967
                    .getInstance(getCurrentProject(getEditorInput()));
968
            manager.reset();
908
            PaletteRoot paletteRoot = _designViewer.getPaletteRoot();
969
            PaletteRoot paletteRoot = _designViewer.getPaletteRoot();
909
            editDomain.setPaletteRoot(paletteRoot);
970
            editDomain.setPaletteRoot(paletteRoot);
910
            
971
            
(-)src/org/eclipse/jst/pagedesigner/IJMTConstants.java (+4 lines)
Lines 95-98 Link Here
95
	 */
95
	 */
96
	public static final String LINK_CREATOR = "linkCreator"; //$NON-NLS-1$
96
	public static final String LINK_CREATOR = "linkCreator"; //$NON-NLS-1$
97
    
97
    
98
	/**
99
	 * extension for property page factory
100
	 */
101
	public static final String PROPERTY_PAGE_FACTORY = "propertyPageFactory"; //$NON-NLS-1$
98
}
102
}
(-)schema/pageDesignerExtension.exsd (-25 / +46 lines)
Lines 1-16 Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.jst.pagedesigner">
3
<schema targetNamespace="org.eclipse.jst.pagedesigner" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
4
<annotation>
5
      <appInfo>
5
      <appinfo>
6
         <meta.schema plugin="org.eclipse.jst.pagedesigner" id="pageDesignerExtension" name="Web Page Editor Extension"/>
6
         <meta.schema plugin="org.eclipse.jst.pagedesigner" id="pageDesignerExtension" name="Web Page Editor Extension"/>
7
      </appInfo>
7
      </appinfo>
8
      <documentation>
8
      <documentation>
9
         &lt;p&gt;&lt;b&gt;This extension point is provisional and subject to change&lt;/b&gt;&lt;/p&gt;
9
         &lt;p&gt;&lt;b&gt;This extension point is provisional and subject to change&lt;/b&gt;&lt;/p&gt;
10
      </documentation>
10
      </documentation>
11
   </annotation>
11
   </annotation>
12
12
13
   <element name="extension">
13
   <element name="extension">
14
      <annotation>
15
         <appinfo>
16
            <meta.element />
17
         </appinfo>
18
      </annotation>
14
      <complexType>
19
      <complexType>
15
         <sequence>
20
         <sequence>
16
            <element ref="localDropHandler" minOccurs="0" maxOccurs="unbounded"/>
21
            <element ref="localDropHandler" minOccurs="0" maxOccurs="unbounded"/>
Lines 20-25 Link Here
20
            <element ref="linkCreator" minOccurs="0" maxOccurs="unbounded"/>
25
            <element ref="linkCreator" minOccurs="0" maxOccurs="unbounded"/>
21
            <element ref="tagAttributeCellEditorFactory" minOccurs="0" maxOccurs="unbounded"/>
26
            <element ref="tagAttributeCellEditorFactory" minOccurs="0" maxOccurs="unbounded"/>
22
            <element ref="tagTransformOperation" minOccurs="0" maxOccurs="unbounded"/>
27
            <element ref="tagTransformOperation" minOccurs="0" maxOccurs="unbounded"/>
28
            <element ref="propertyPageFactory" minOccurs="0" maxOccurs="unbounded"/>
23
         </sequence>
29
         </sequence>
24
         <attribute name="point" type="string" use="required">
30
         <attribute name="point" type="string" use="required">
25
            <annotation>
31
            <annotation>
Lines 52-60 Link Here
52
               <documentation>
58
               <documentation>
53
                  
59
                  
54
               </documentation>
60
               </documentation>
55
               <appInfo>
61
               <appinfo>
56
                  <meta.attribute kind="java"/>
62
                  <meta.attribute kind="java"/>
57
               </appInfo>
63
               </appinfo>
58
            </annotation>
64
            </annotation>
59
         </attribute>
65
         </attribute>
60
      </complexType>
66
      </complexType>
Lines 72-80 Link Here
72
               <documentation>
78
               <documentation>
73
                  
79
                  
74
               </documentation>
80
               </documentation>
75
               <appInfo>
81
               <appinfo>
76
                  <meta.attribute kind="java" deprecated="true"/>
82
                  <meta.attribute kind="java" deprecated="true"/>
77
               </appInfo>
83
               </appinfo>
78
            </annotation>
84
            </annotation>
79
         </attribute>
85
         </attribute>
80
      </complexType>
86
      </complexType>
Lines 92-100 Link Here
92
               <documentation>
98
               <documentation>
93
                  
99
                  
94
               </documentation>
100
               </documentation>
95
               <appInfo>
101
               <appinfo>
96
                  <meta.attribute kind="java" basedOn=":org.eclipse.jst.pagedesigner.meta.ITagAttributeCellEditorFactory"/>
102
                  <meta.attribute kind="java" basedOn=":org.eclipse.jst.pagedesigner.meta.ITagAttributeCellEditorFactory"/>
97
               </appInfo>
103
               </appinfo>
98
            </annotation>
104
            </annotation>
99
         </attribute>
105
         </attribute>
100
      </complexType>
106
      </complexType>
Lines 107-115 Link Here
107
               <documentation>
113
               <documentation>
108
                  
114
                  
109
               </documentation>
115
               </documentation>
110
               <appInfo>
116
               <appinfo>
111
                  <meta.attribute kind="java"/>
117
                  <meta.attribute kind="java"/>
112
               </appInfo>
118
               </appinfo>
113
            </annotation>
119
            </annotation>
114
         </attribute>
120
         </attribute>
115
      </complexType>
121
      </complexType>
Lines 122-130 Link Here
122
               <documentation>
128
               <documentation>
123
                  
129
                  
124
               </documentation>
130
               </documentation>
125
               <appInfo>
131
               <appinfo>
126
                  <meta.attribute kind="java"/>
132
                  <meta.attribute kind="java"/>
127
               </appInfo>
133
               </appinfo>
128
            </annotation>
134
            </annotation>
129
         </attribute>
135
         </attribute>
130
      </complexType>
136
      </complexType>
Lines 137-145 Link Here
137
               <documentation>
143
               <documentation>
138
                  
144
                  
139
               </documentation>
145
               </documentation>
140
               <appInfo>
146
               <appinfo>
141
                  <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.actions.link.ILinkCreator"/>
147
                  <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.actions.link.ILinkCreator"/>
142
               </appInfo>
148
               </appinfo>
143
            </annotation>
149
            </annotation>
144
         </attribute>
150
         </attribute>
145
         <attribute name="linkIdentifier" type="string" use="required">
151
         <attribute name="linkIdentifier" type="string" use="required">
Lines 163-172 Link Here
163
            <annotation>
169
            <annotation>
164
               <documentation>
170
               <documentation>
165
                  The transform operation id.    Referencers will use plugin-qualified references.   i.e if the plugin extending this was &lt;code&gt;org.foo.bar&lt;/code&gt;,  then the meta data instance that referenced this operation would specify:
171
                  The transform operation id.    Referencers will use plugin-qualified references.   i.e if the plugin extending this was &lt;code&gt;org.foo.bar&lt;/code&gt;,  then the meta data instance that referenced this operation would specify:
166
	&lt;pre&gt;
172
 &lt;pre&gt;
167
		&lt;operation id=&quot;org.foo.bar.MyTransformId&quot;/&gt;
173
  &lt;operation id=&quot;org.foo.bar.MyTransformId&quot;/&gt;
168
	&lt;/pre&gt;
174
 &lt;/pre&gt;
169
	
175
 
170
The exception to this rule is that if the reference is not plugin-qualified, then the reference is assumed to be a &lt;i&gt;core&lt;/i&gt; transformation and uses the &lt;code&gt;org.eclipse.jst.pagedesigner&lt;/code&gt; prefix.
176
The exception to this rule is that if the reference is not plugin-qualified, then the reference is assumed to be a &lt;i&gt;core&lt;/i&gt; transformation and uses the &lt;code&gt;org.eclipse.jst.pagedesigner&lt;/code&gt; prefix.
171
               </documentation>
177
               </documentation>
172
            </annotation>
178
            </annotation>
Lines 176-193 Link Here
176
               <documentation>
182
               <documentation>
177
                  class extending the &lt;code&gt;org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation&lt;/code&gt;
183
                  class extending the &lt;code&gt;org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation&lt;/code&gt;
178
               </documentation>
184
               </documentation>
179
               <appInfo>
185
               <appinfo>
180
                  <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation:"/>
186
                  <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation:"/>
181
               </appInfo>
187
               </appinfo>
188
            </annotation>
189
         </attribute>
190
      </complexType>
191
   </element>
192
193
   <element name="propertyPageFactory">
194
      <complexType>
195
         <attribute name="class" type="string" use="required">
196
            <annotation>
197
               <documentation>
198
                  Provisional API.  If an extension point is found in the system, the Web Page Editor will use the factory implementation to provide its property page.
199
               </documentation>
200
               <appinfo>
201
                  <meta.attribute kind="java" basedOn="org.eclipse.jst.pagedesigner.editors.AbstractPropertySheetPageFactory:"/>
202
               </appinfo>
182
            </annotation>
203
            </annotation>
183
         </attribute>
204
         </attribute>
184
      </complexType>
205
      </complexType>
185
   </element>
206
   </element>
186
207
187
   <annotation>
208
   <annotation>
188
      <appInfo>
209
      <appinfo>
189
         <meta.section type="since"/>
210
         <meta.section type="since"/>
190
      </appInfo>
211
      </appinfo>
191
      <documentation>
212
      <documentation>
192
         2.0
213
         2.0
193
      </documentation>
214
      </documentation>
Lines 197-205 Link Here
197
218
198
219
199
   <annotation>
220
   <annotation>
200
      <appInfo>
221
      <appinfo>
201
         <meta.section type="copyright"/>
222
         <meta.section type="copyright"/>
202
      </appInfo>
223
      </appinfo>
203
      <documentation>
224
      <documentation>
204
         Copyright 2006 Sybase and others
225
         Copyright 2006 Sybase and others
205
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
226
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
(-)src/org/eclipse/jst/pagedesigner/editors/IPropertySheetPageFactory.java (+35 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2001, 2009 Oracle Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     Oracle Corporation - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.jst.pagedesigner.editors;
13
14
import org.eclipse.core.resources.IFile;
15
import org.eclipse.ui.views.properties.IPropertySheetPage;
16
17
/**
18
 * A factory that can be used with the pageDesignerExtension to override
19
 * the default property sheet page provided by the WPE when tag elements are
20
 * selected by the user.
21
 * 
22
 * This interface should not be implemented or extended by clients.  Use
23
 * AbstractPropertySheetPageFactory instead.
24
 * 
25
 * @author cbateman
26
 *
27
 */
28
public interface IPropertySheetPageFactory
29
{
30
    /**
31
     * @param file
32
     * @return the  property sheet page for the file.
33
     */
34
    IPropertySheetPage  createPage(final IFile file);
35
}
(-)src/org/eclipse/jst/pagedesigner/editors/AbstractPropertySheetPageFactory.java (+32 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2001, 2009 Oracle Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     Oracle Corporation - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.jst.pagedesigner.editors;
13
14
import org.eclipse.core.resources.IFile;
15
import org.eclipse.ui.views.properties.IPropertySheetPage;
16
17
/**
18
 * Abstract class that should be extended to provide a property sheet page
19
 * factory.
20
 * 
21
 * @author cbateman
22
 *
23
 */
24
public abstract class AbstractPropertySheetPageFactory implements
25
        IPropertySheetPageFactory
26
{
27
28
    /* (non-Javadoc)
29
     * @see org.eclipse.jst.pagedesigner.editors.IPropertySheetPageFactory#createPage(org.eclipse.core.resources.IFile)
30
     */
31
    public abstract IPropertySheetPage createPage(IFile file);
32
}

Return to bug 263281