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 27091 Details for
Bug 109468
get rid of subclasses of StructuredTextEditor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
org.eclipse.wst.html.ui.patch
org.eclipse.wst.html.ui.patch (text/plain), 19.83 KB, created by
Amy Wu
on 2005-09-14 02:19:57 EDT
(
hide
)
Description:
org.eclipse.wst.html.ui.patch
Filename:
MIME Type:
Creator:
Amy Wu
Created:
2005-09-14 02:19:57 EDT
Size:
19.83 KB
patch
obsolete
>Index: plugin.properties >=================================================================== >RCS file: /home/webtools/wst/components/html/plugins/org.eclipse.wst.html.ui/plugin.properties,v >retrieving revision 1.10 >diff -u -r1.10 plugin.properties >--- plugin.properties 26 Jun 2005 00:28:08 -0000 1.10 >+++ plugin.properties 14 Sep 2005 06:17:43 -0000 >@@ -32,4 +32,22 @@ > AddTask.label=Add &Task... > AddTask.tooltip=Add Task... > AddBookmark.label=Add Boo&kmark... >-AddBookmark.tooltip=Add Bookmark... >\ No newline at end of file >+AddBookmark.tooltip=Add Bookmark... >+## >+CleanupDocument_label=Cleanup Document... >+CleanupDocument_tooltip=Cleanup Document >+ToggleComment_label=Toggle Comment >+ToggleComment_tooltip=Toggle Comment >+AddBlockComment_label=Add Block Comment >+AddBlockComment_tooltip=Add Block Comment >+RemoveBlockComment_label=Remove Block Comment >+RemoveBlockComment_tooltip=Remove Block Comment >+FindOccurrences_label=Occurrences in File >+StructureSelectEnclosing_label=Enclosing Element >+StructureSelectEnclosing_tooltip=Expand selection to include enclosing element >+StructureSelectNext_label=Next Element >+StructureSelectNext_tooltip=Expand selection to include next sibling >+StructureSelectPrevious_label=Previous Element >+StructureSelectPrevious_tooltip=Expand selection to include previous sibling >+StructureSelectHistory_label=Restore Last Selection >+StructureSelectHistory_tooltip=Restore last selection >\ No newline at end of file >Index: plugin.xml >=================================================================== >RCS file: /home/webtools/wst/components/html/plugins/org.eclipse.wst.html.ui/plugin.xml,v >retrieving revision 1.37 >diff -u -r1.37 plugin.xml >--- plugin.xml 7 Sep 2005 23:49:25 -0000 1.37 >+++ plugin.xml 14 Sep 2005 06:17:43 -0000 >@@ -12,7 +12,7 @@ > icon="icons/full/obj16/sourceEditor.gif" > default="true" > contributorClass="org.eclipse.wst.html.ui.internal.edit.ui.ActionContributorHTML" >- class="org.eclipse.wst.html.ui.internal.provisional.StructuredTextEditorHTML" >+ class="org.eclipse.wst.sse.ui.internal.StructuredTextEditor" > symbolicFontName="org.eclipse.wst.sse.ui.textfont" > id="org.eclipse.wst.html.core.htmlsource.source"> > <contentTypeBinding >@@ -385,4 +385,82 @@ > </action> > </viewerContribution> > </extension> >+ >+ <extension point="org.eclipse.ui.editorActions"> >+ <editorContribution >+ id="org.eclipse.wst.html.core.htmlsource.source.editorActions" >+ targetID="org.eclipse.wst.html.core.htmlsource.source"> >+ <action >+ id="CleanupDocument" >+ label="%CleanupDocument_label" >+ definitionId="org.eclipse.wst.sse.ui.cleanup.document" >+ tooltip="%CleanupDocument_tooltip" >+ class="org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTMLDelegate" >+ actionID="CleanupDocument"> >+ </action> >+ <action >+ id="ToggleComment" >+ label="%ToggleComment_label" >+ definitionId="org.eclipse.wst.sse.ui.toggle.comment" >+ tooltip="%ToggleComment_tooltip" >+ class="org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXMLDelegate" >+ actionID="ToggleComment"> >+ </action> >+ <action >+ id="AddBlockComment" >+ label="%AddBlockComment_label" >+ definitionId="org.eclipse.wst.sse.ui.add.block.comment" >+ tooltip="%AddBlockComment_tooltip" >+ class="org.eclipse.wst.xml.ui.internal.actions.AddBlockCommentActionXMLDelegate" >+ actionID="AddBlockComment"> >+ </action> >+ <action >+ id="RemoveBlockComment" >+ label="%RemoveBlockComment_label" >+ definitionId="org.eclipse.wst.sse.ui.remove.block.comment" >+ tooltip="%RemoveBlockComment_tooltip" >+ class="org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXMLDelegate" >+ actionID="RemoveBlockComment"> >+ </action> >+ <action >+ id="FindOccurrences" >+ label="%FindOccurrences_label" >+ definitionId="org.eclipse.wst.sse.ui.search.find.occurrences" >+ class="org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesActionDelegate" >+ actionID="FindOccurrences"> >+ </action> >+ <action >+ id="StructureSelectEnclosing" >+ label="%StructureSelectEnclosing_label" >+ definitionId="org.eclipse.wst.sse.ui.structure.select.enclosing" >+ tooltip="%StructureSelectEnclosing_tooltip" >+ class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectEnclosingXMLActionDelegate" >+ actionID="StructureSelectEnclosing"> >+ </action> >+ <action >+ id="StructureSelectNext" >+ label="%StructureSelectNext_label" >+ definitionId="org.eclipse.wst.sse.ui.structure.select.next" >+ tooltip="%StructureSelectNext_tooltip" >+ class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectNextXMLActionDelegate" >+ actionID="StructureSelectNext"> >+ </action> >+ <action >+ id="StructureSelectPrevious" >+ label="%StructureSelectPrevious_label" >+ definitionId="org.eclipse.wst.sse.ui.structure.select.previous" >+ tooltip="%StructureSelectPrevious_tooltip" >+ class="org.eclipse.wst.xml.ui.internal.selection.StructuredSelectPreviousXMLActionDelegate" >+ actionID="StructureSelectPrevious"> >+ </action> >+ <action >+ id="StructureSelectHistory" >+ label="%StructureSelectHistory_label" >+ definitionId="org.eclipse.wst.sse.ui.structure.select.last" >+ tooltip="%StructureSelectHistory_tooltip" >+ class="org.eclipse.wst.sse.ui.internal.selection.StructuredSelectHistoryActionDelegate" >+ actionID="StructureSelectHistory"> >+ </action> >+ </editorContribution> >+ </extension> > </plugin> >Index: src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties >=================================================================== >RCS file: /home/webtools/wst/components/html/plugins/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties,v >retrieving revision 1.5 >diff -u -r1.5 HTMLUIPluginResources.properties >--- src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties 25 May 2005 21:11:10 -0000 1.5 >+++ src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties 14 Sep 2005 06:17:43 -0000 >@@ -30,19 +30,19 @@ > Creating_files_encoding=Creating files encoding preference > MESSAGE_HTML_VALIDATION_MESSAGE_UI_=HTML Syntax : {0} > # Copied from sse.ui >-CleanupDocument_label=C&leanup Document... >+CleanupDocument_label=Cleanup Document... > CleanupDocument_tooltip=Cleanup Document > CleanupDocument_description=Cleanup Document >-ToggleComment_label=Togg&le Comment >+ToggleComment_label=Toggle Comment > ToggleComment_tooltip=Toggle Comment > ToggleComment_description=Toggle Comment >-AddBlockComment_label=Add &Block Comment >+AddBlockComment_label=Add Block Comment > AddBlockComment_tooltip=Add Block Comment > AddBlockComment_description=Add Block Comment >-RemoveBlockComment_label=Remove Bloc&k Comment >+RemoveBlockComment_label=Remove Block Comment > RemoveBlockComment_tooltip=Remove Block Comment > RemoveBlockComment_description=Remove Block Comment >-FindOccurrences_label=O&ccurrences in File >+FindOccurrences_label=Occurrences in File > Creating_files=Creating files > Encoding_desc=The following encoding will apply: > Preferred_markup_case_UI_=Preferred markup case for content assist, and code generation >Index: src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTML.java >=================================================================== >RCS file: /home/webtools/wst/components/html/plugins/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTML.java,v >retrieving revision 1.2 >diff -u -r1.2 CleanupActionHTML.java >--- src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTML.java 11 Aug 2005 03:16:45 -0000 1.2 >+++ src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTML.java 14 Sep 2005 06:17:44 -0000 >@@ -24,6 +24,9 @@ > import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument; > import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel; > >+/** >+ * @deprecated Use CleanupActionHTMLDelegate instead. >+ */ > public class CleanupActionHTML extends CleanupAction { > protected IStructuredCleanupProcessor fCleanupProcessor; > >Index: src/org/eclipse/wst/html/ui/internal/provisional/StructuredTextEditorHTML.java >=================================================================== >RCS file: /home/webtools/wst/components/html/plugins/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/provisional/StructuredTextEditorHTML.java,v >retrieving revision 1.2 >diff -u -r1.2 StructuredTextEditorHTML.java >--- src/org/eclipse/wst/html/ui/internal/provisional/StructuredTextEditorHTML.java 28 May 2005 19:10:27 -0000 1.2 >+++ src/org/eclipse/wst/html/ui/internal/provisional/StructuredTextEditorHTML.java 14 Sep 2005 06:17:44 -0000 >@@ -25,6 +25,10 @@ > import org.eclipse.wst.xml.ui.internal.actions.RemoveBlockCommentActionXML; > import org.eclipse.wst.xml.ui.internal.actions.ToggleCommentActionXML; > >+/** >+ * @deprecated HTML editor is created from StructuredTextEditor with >+ * HTML configurations >+ */ > public class StructuredTextEditorHTML extends StructuredTextEditor { > private final static String UNDERSCORE = "_"; //$NON-NLS-1$ > >Index: src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java >=================================================================== >RCS file: /home/webtools/wst/components/html/plugins/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java,v >retrieving revision 1.6 >diff -u -r1.6 HTMLFindOccurrencesAction.java >--- src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java 28 May 2005 01:25:45 -0000 1.6 >+++ src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java 14 Sep 2005 06:17:44 -0000 >@@ -22,7 +22,7 @@ > /** > * Configures a BasicFindOccurrencesAction with HTML partitions and regions > * >- * @author pavery >+ * @deprecated use HTMLFindOccurrencesProcessor instead > */ > public class HTMLFindOccurrencesAction extends BasicFindOccurrencesAction { > >Index: src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java >=================================================================== >RCS file: src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java >diff -N src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTMLDelegate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,163 @@ >+/******************************************************************************* >+ * Copyright (c) 2005 IBM Corporation 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 >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ * >+ *******************************************************************************/ >+ >+package org.eclipse.wst.html.ui.internal.edit.ui; >+ >+import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.text.IDocument; >+import org.eclipse.jface.text.ITextSelection; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.window.Window; >+import org.eclipse.swt.custom.BusyIndicator; >+import org.eclipse.swt.widgets.Event; >+import org.eclipse.ui.IActionDelegate2; >+import org.eclipse.ui.IEditorActionDelegate; >+import org.eclipse.ui.IEditorPart; >+import org.eclipse.ui.IViewActionDelegate; >+import org.eclipse.ui.IViewPart; >+import org.eclipse.ui.texteditor.ITextEditor; >+import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl; >+import org.eclipse.wst.html.ui.internal.HTMLUIMessages; >+import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor; >+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel; >+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager; >+import org.eclipse.wst.sse.ui.internal.SSEUIMessages; >+import org.eclipse.wst.sse.ui.internal.StructuredTextEditor; >+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument; >+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel; >+ >+/** >+ * Cleanup action delegate for HTML editor >+ */ >+public class CleanupActionHTMLDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate { >+ private IEditorPart fEditor; >+ private IStructuredCleanupProcessor fCleanupProcessor; >+ >+ public void setActiveEditor(IAction action, IEditorPart targetEditor) { >+ fEditor = targetEditor; >+ } >+ >+ public void dispose() { >+ // nulling out just in case >+ fEditor = null; >+ fCleanupProcessor = null; >+ } >+ >+ public void init(IAction action) { >+ if (action != null) { >+ action.setText(HTMLUIMessages.CleanupDocument_label); >+ action.setToolTipText(HTMLUIMessages.CleanupDocument_tooltip); >+ action.setDescription(HTMLUIMessages.CleanupDocument_description); >+ } >+ } >+ >+ public void runWithEvent(IAction action, Event event) { >+ run(action); >+ } >+ >+ public void init(IViewPart view) { >+ // do nothing >+ } >+ >+ public void run(IAction action) { >+ if (fEditor instanceof StructuredTextEditor) { >+ final StructuredTextEditor editor = (StructuredTextEditor) fEditor; >+ CleanupDialogHTML cleanupDialog = new CleanupDialogHTML(editor.getSite().getShell()); >+ cleanupDialog.setisXHTMLType(isXHTML()); >+ if (cleanupDialog.open() == Window.OK) { >+ // setup runnable >+ Runnable runnable = new Runnable() { >+ public void run() { >+ IStructuredCleanupProcessor cleanupProcessor = getCleanupProcessor(); >+ if (cleanupProcessor != null) { >+ IStructuredModel model = null; >+ try { >+ model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput())); >+ if (model != null) >+ cleanupProcessor.cleanupModel(model); >+ } >+ finally { >+ if (model != null) >+ model.releaseFromEdit(); >+ } >+ } >+ } >+ }; >+ >+ // TODO: make independent of 'model'. >+ IStructuredModel model = null; >+ try { >+ model = StructuredModelManager.getModelManager().getExistingModelForEdit(editor.getDocumentProvider().getDocument(editor.getEditorInput())); >+ if (model != null) { >+ // begin recording >+ ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection(); >+ model.beginRecording(this, SSEUIMessages.Cleanup_Document_UI_, SSEUIMessages.Cleanup_Document_UI_, selection.getOffset(), selection.getLength()); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ // tell the model that we are about to make a big >+ // model change >+ model.aboutToChangeModel(); >+ >+ // run >+ BusyIndicator.showWhile(editor.getTextViewer().getControl().getDisplay(), runnable); >+ } >+ } >+ finally { >+ if (model != null) { >+ // tell the model that we are done with the big >+ // model >+ // change >+ model.changedModel(); >+ >+ // end recording >+ ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection(); >+ model.endRecording(this, selection.getOffset(), selection.getLength()); >+ model.releaseFromEdit(); >+ } >+ } >+ } >+ } >+ } >+ >+ public void selectionChanged(IAction action, ISelection selection) { >+ // do nothing >+ } >+ >+ IStructuredCleanupProcessor getCleanupProcessor() { >+ if (fCleanupProcessor == null) >+ fCleanupProcessor = new HTMLCleanupProcessorImpl(); >+ >+ return fCleanupProcessor; >+ } >+ >+ private boolean isXHTML() { >+ boolean isxhtml = false; >+ if (fEditor instanceof ITextEditor) { >+ ITextEditor textEditor = (ITextEditor) fEditor; >+ IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()); >+ IStructuredModel model = null; >+ try { >+ model = StructuredModelManager.getModelManager().getExistingModelForRead(document); >+ if (model instanceof IDOMModel) { >+ IDOMDocument domDocument = ((IDOMModel) model).getDocument(); >+ if (domDocument != null) >+ isxhtml = domDocument.isXMLType(); >+ } >+ } >+ finally { >+ if (model != null) { >+ model.releaseFromRead(); >+ } >+ } >+ } >+ return isxhtml; >+ } >+} >Index: src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java >=================================================================== >RCS file: src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java >diff -N src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesActionDelegate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,34 @@ >+/******************************************************************************* >+ * Copyright (c) 2005 IBM Corporation 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 >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ * >+ *******************************************************************************/ >+ >+package org.eclipse.wst.html.ui.internal.search; >+ >+import java.util.ArrayList; >+import java.util.List; >+ >+import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionDelegate; >+ >+/** >+ * Sets up FindOccurrencesActionDelegate for html find occurrences processors >+ */ >+public class HTMLFindOccurrencesActionDelegate extends FindOccurrencesActionDelegate { >+ private List fProcessors; >+ >+ protected List getProcessors() { >+ if (fProcessors == null) { >+ fProcessors = new ArrayList(); >+ HTMLFindOccurrencesProcessor htmlProcessor = new HTMLFindOccurrencesProcessor(); >+ fProcessors.add(htmlProcessor); >+ } >+ return fProcessors; >+ } >+} >Index: src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java >=================================================================== >RCS file: src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java >diff -N src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesProcessor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,32 @@ >+/******************************************************************************* >+ * Copyright (c) 2005 IBM Corporation 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 >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ * >+ *******************************************************************************/ >+ >+package org.eclipse.wst.html.ui.internal.search; >+ >+import org.eclipse.wst.html.core.internal.provisional.text.IHTMLPartitionTypes; >+import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor; >+import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions; >+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext; >+ >+/** >+ * Configures a FindOccurrencesProcessor with HTML partitions and regions >+ */ >+public class HTMLFindOccurrencesProcessor extends FindOccurrencesProcessor { >+ >+ protected String[] getPartitionTypes() { >+ return new String[]{IHTMLPartitionTypes.HTML_DEFAULT, IXMLPartitions.XML_DEFAULT}; >+ } >+ >+ protected String[] getRegionTypes() { >+ return new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE}; >+ } >+}
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 109468
:
27089
|
27090
| 27091 |
27092
|
27093
|
27094
|
27095
|
27128