Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 109468

Summary: get rid of subclasses of StructuredTextEditor
Product: [WebTools] WTP Source Editing Reporter: Amy Wu <for.work.things>
Component: wst.sseAssignee: Nitin Dahyabhai <thatnitind>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.7   
Target Milestone: 1.0 M9   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
org.eclipse.jst.jsp.ui.patch
none
org.eclipse.wst.css.ui.patch
none
org.eclipse.wst.html.ui.patch
none
org.eclipse.wst.sse.ui.patch
none
org.eclipse.wst.wsdl.ui.patch
none
org.eclipse.wst.xml.ui.patch
none
org.eclipse.wst.xsd.ui.patch
none
org.eclipse.wst.sse.unittests.patch none

Description Amy Wu CLA 2005-09-14 01:11:31 EDT
there are several editors that currently subclass StructuredTextEditor

StructuredTextEditorJSP
StructuredTextEditorHTML
StructuredTextEditorCSS
StructuredTextEditorXML
WSDLTextEditor
XSDTextEditor

StructuredTextEditor should not be subclassed.
Comment 1 Amy Wu CLA 2005-09-14 02:19:36 EDT
Created attachment 27089 [details]
org.eclipse.jst.jsp.ui.patch
Comment 2 Amy Wu CLA 2005-09-14 02:19:47 EDT
Created attachment 27090 [details]
org.eclipse.wst.css.ui.patch
Comment 3 Amy Wu CLA 2005-09-14 02:19:57 EDT
Created attachment 27091 [details]
org.eclipse.wst.html.ui.patch
Comment 4 Amy Wu CLA 2005-09-14 02:20:08 EDT
Created attachment 27092 [details]
org.eclipse.wst.sse.ui.patch
Comment 5 Amy Wu CLA 2005-09-14 02:20:20 EDT
Created attachment 27093 [details]
org.eclipse.wst.wsdl.ui.patch
Comment 6 Amy Wu CLA 2005-09-14 02:20:33 EDT
Created attachment 27094 [details]
org.eclipse.wst.xml.ui.patch
Comment 7 Amy Wu CLA 2005-09-14 02:20:43 EDT
Created attachment 27095 [details]
org.eclipse.wst.xsd.ui.patch
Comment 8 Amy Wu CLA 2005-09-14 02:34:26 EDT
StructuredTextEditorJSP
StructuredTextEditorHTML
StructuredTextEditorCSS
StructuredTextEditorXML

were all subclassing StructuredTextEditor to contribute actions.  These 
actions were transformed into ActionDelegates and then contributed to the 
editor via editorActions extension point.  These actions included, cleanup, 
structured selection, comments, etc.

The editor definition in the plugin.xml were also modified so that the editor 
class is StructuredTextEditor instead of the subclass.

For multipage editor parts like XML, WSDL, XSD, the multipageeditorparts were 
modified so that when creating the site for the source page editor, the site 
had an id of org.eclipse.runtime.xml.source.  This basically allows the xml 
editor to be the nested editor inside the multipageeditorparts, and all its 
actions are automatically picked up.
Comment 9 Amy Wu CLA 2005-09-14 02:42:32 EDT
Remaining work:
The following classes were deprecated, but if it looks safe to delete, please 
do so:
StructuredTextEditorJSP
JSPMoveElementAction
JSPRenameElementAction
JSPFindOccurrencesAction
StructuredTextEditorCSS
CleanupActionCSS
StructureSelectCSSAction
StructureSelectEnclosingCSSAction
StructureSelectNextCSSAction
StructureSelectPreviousCSSAction
CleanupActionHTML
StructureTextEditorHTML
HTMLFindOccurrencesAction
BasicFindOccurrencesAction
FindOccurrencesActionProvider
StructureSelectAction
StructureSelectEnclosingAction
StructureSelectNextAction
StructureSelectPreviousAction
AddBlockCommentActionXML
CleanupActionXML
CommentActionXML
RemoveBlockCommentActionXML
ToggleCommentActionXML
UncommentActionXML
StructuredTextEditorXML
XMLFindOccurrencesAction

The following subclasses of StructuredTextEditor still exist for now (I will 
probably open a new bug to investigate removing these subclasses):
WSDLTextEditor
XSDTextEditor
Comment 10 Amy Wu CLA 2005-09-14 02:45:05 EDT
Small writeup on what clients should do:
If clients want to create their own source page editor, they should specify 
org.eclipse.wst.sse.ui.internal.StructuredTextEditor as the editor class in 
the editor definition in the plugin.xml.  If they want to add extra actions to 
their editor, they can use the org.eclipse.ui.editorActions extension point.

If clients want to add the StructuredTextEditor as a page in a multipage 
editor part, when they create the editor pages, they can create a new instance 
of StructuredTextEditor.  Then, if they want to pick up actions for a certain 
type of StructuredTextEditor, in their createSite method, where they create a 
site for the nested StructuredTextEditor, they should make it such that their 
site returns the editor id of their choice.  So for example, if a client 
wanted to embed the html editor as a source page, they would need to make 
multipageeditorsite.getId return "org.eclipse.wst.html.core.htmlsource.source"
Comment 11 Amy Wu CLA 2005-09-14 02:49:29 EDT
Nitin, please apply these patches when you have time.  Please note the comment 
I made in coment #9 about deleting deprecated classes if it looks like no one 
is using them.

Thanks.
Comment 12 Amy Wu CLA 2005-09-14 14:10:06 EDT
Created attachment 27128 [details]
org.eclipse.wst.sse.unittests.patch

found another spot where an editor subclass was being referenced
Comment 13 Nitin Dahyabhai CLA 2005-09-15 08:52:16 EDT
Patches applied and classes removed, thanks, Amy.
Comment 14 David Williams CLA 2005-12-19 03:35:02 EST
verifying some obvious ones on Amy's behalf
Comment 15 David Williams CLA 2005-12-19 03:35:17 EST
verifying some obvious ones on Amy's behalf
Comment 16 David Williams CLA 2005-12-19 03:35:24 EST
verifying some obvious ones on Amy's behalf
Comment 17 Nitin Dahyabhai CLA 2006-06-29 14:27:40 EDT
Closing