a bunch of refactoring work: - renamed reconcileValidator ext pt - split out IXXXPartitions partition string definitions - made more non-API classes internal - deleted some deprecated classes (ReconcileStepAdapter...ReconcileStrategyForContentModel...)
diff --git a/bundles/org.eclipse.jst.jsp.core/component.xml b/bundles/org.eclipse.jst.jsp.core/component.xml index 7643501..4a27444 100644 --- a/bundles/org.eclipse.jst.jsp.core/component.xml +++ b/bundles/org.eclipse.jst.jsp.core/component.xml
@@ -8,4 +8,6 @@ <package name="org.eclipse.jst.jsp.core" /> <package name="org.eclipse.jst.jsp.core.model.parser" /> <package name="org.eclipse.jst.jsp.core.contenttype" /> + <package name="org.eclipse.jst.jsp.core.text" /> + </component> \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentLoader.java index 50fdb00..4212c1f 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentLoader.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/encoding/JSPDocumentLoader.java
@@ -27,7 +27,7 @@ import org.eclipse.jst.jsp.core.internal.document.PageDirectiveWatcherFactory; import org.eclipse.jst.jsp.core.internal.parser.JSPReParser; import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; +import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP; import org.eclipse.wst.sse.core.INodeNotifier; import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.core.document.AbstractDocumentLoader;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java index f44eada..32c235e 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
@@ -24,7 +24,7 @@ import org.eclipse.jface.text.IDocumentExtension3; import org.eclipse.jface.text.IDocumentPartitioner; import org.eclipse.jst.jsp.core.PageDirectiveAdapter; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; +import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP; import org.eclipse.jst.jsp.core.modelhandler.EmbeddedTypeStateData; import org.eclipse.wst.sse.core.IAdapterFactory; import org.eclipse.wst.sse.core.INodeAdapter;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.java index 7595bab..4525ae7 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/SetupParticipantForJSP.java
@@ -13,7 +13,7 @@ import org.eclipse.core.filebuffers.IDocumentSetupParticipant; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; +import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP; /** * @deprecated - not used and will be removed in WTP 1.0M4
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/NullStructuredDocumentPartitioner.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/NullStructuredDocumentPartitioner.java similarity index 98% rename from bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/NullStructuredDocumentPartitioner.java rename to bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/NullStructuredDocumentPartitioner.java index 022ae4c..fd932d3 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/NullStructuredDocumentPartitioner.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/NullStructuredDocumentPartitioner.java
@@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.jst.jsp.core.internal.text.rules; +package org.eclipse.jst.jsp.core.internal.text; import org.eclipse.jface.text.DocumentEvent; import org.eclipse.jface.text.IDocument;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/StructuredTextPartitionerForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java similarity index 90% rename from bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/StructuredTextPartitionerForJSP.java rename to bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java index 6813d4b..25f487c 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/rules/StructuredTextPartitionerForJSP.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
@@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.jst.jsp.core.internal.text.rules; +package org.eclipse.jst.jsp.core.internal.text; import java.io.IOException; import java.util.ArrayList; @@ -24,8 +24,10 @@ import org.eclipse.jst.jsp.core.encoding.JSPDocumentHeadContentDetector; import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser; import org.eclipse.jst.jsp.core.model.parser.DOMJSPRegionContexts; -import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML; +import org.eclipse.jst.jsp.core.text.IJSPPartitions; +import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML; import org.eclipse.wst.sse.core.internal.parser.ForeignRegion; +import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner; import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandler; import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionHandlerExtension; import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionParser; @@ -34,10 +36,9 @@ import org.eclipse.wst.sse.core.text.IStructuredTextPartitioner; import org.eclipse.wst.sse.core.text.ITextRegion; import org.eclipse.wst.sse.core.text.ITextRegionList; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; import org.eclipse.wst.sse.core.util.StringUtils; +import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML; import org.eclipse.wst.xml.core.parser.XMLRegionContext; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; public class StructuredTextPartitionerForJSP extends StructuredTextPartitioner { @@ -168,20 +169,11 @@ private final static boolean fEnableJSPActionPartitions = true; // list of valid JSP 1.2 tag and action names private static List fJSPActionTagNames = null; - private static final String HTML_CONTENT_TYPE = "text/html"; //$NON-NLS-1$ + private static final String HTML_MIME_TYPE = "text/html"; //$NON-NLS-1$ + private static final String XHTML_MIME_TYPE = "text/xhtml"; //$NON-NLS-1$ + private static final String XML_MIME_TYPE = "text/xml"; //$NON-NLS-1$ - public final static String ST_DEFAULT_JSP = "org.eclipse.jst.jsp.DEFAULT_JSP"; //$NON-NLS-1$ - public final static String ST_JSP_COMMENT = "org.eclipse.jst.jsp.JSP_COMMENT"; //$NON-NLS-1$ - private final static String ST_JSP_SCRIPT = "org.eclipse.jst.jsp.SCRIPT."; //$NON-NLS-1$ - public final static String ST_JSP_CONTENT_DELIMITER = ST_JSP_SCRIPT + "DELIMITER"; //$NON-NLS-1$ - public final static String ST_JSP_CONTENT_JAVA = ST_JSP_SCRIPT + "JAVA"; //$NON-NLS-1$ - public final static String ST_JSP_CONTENT_JAVASCRIPT = ST_JSP_SCRIPT + "JAVASCRIPT"; //$NON-NLS-1$ - public final static String ST_JSP_DEFAULT_EL = ST_JSP_SCRIPT + "JSP_EL"; //$NON-NLS-1$ - public final static String ST_JSP_DIRECTIVE = "org.eclipse.jst.jsp.JSP_DIRECTIVE"; //$NON-NLS-1$ - private static final String XHTML_CONTENT_TYPE = "text/xhtml"; //$NON-NLS-1$ - private static final String XML_CONTENT_TYPE = "text/xml"; //$NON-NLS-1$ - - private final static String[] fConfiguredContentTypes = new String[]{ST_DEFAULT_JSP, ST_JSP_DEFAULT_EL, ST_JSP_DIRECTIVE, ST_JSP_CONTENT_DELIMITER, ST_JSP_CONTENT_JAVA, ST_JSP_CONTENT_JAVASCRIPT, ST_JSP_COMMENT}; + private final static String[] fConfiguredContentTypes = new String[]{IJSPPartitions.JSP_DEFAULT, IJSPPartitions.JSP_DEFAULT_EL, IJSPPartitions.JSP_DIRECTIVE, IJSPPartitions.JSP_CONTENT_DELIMITER, IJSPPartitions.JSP_CONTENT_JAVA, IJSPPartitions.JSP_CONTENT_JAVASCRIPT, IJSPPartitions.JSP_COMMENT}; /** * @return @@ -262,15 +254,15 @@ } // we currently only have two ... eventually should // make or tie-in to existing registry. - if (contentType.equalsIgnoreCase(HTML_CONTENT_TYPE)) { + if (contentType.equalsIgnoreCase(HTML_MIME_TYPE)) { result = new StructuredTextPartitionerForHTML(); result.connect(structuredDocument); } - else if (contentType.equalsIgnoreCase(XHTML_CONTENT_TYPE)) { + else if (contentType.equalsIgnoreCase(XHTML_MIME_TYPE)) { result = new StructuredTextPartitionerForHTML(); result.connect(structuredDocument); } - else if (contentType.equalsIgnoreCase(XML_CONTENT_TYPE)) { + else if (contentType.equalsIgnoreCase(XML_MIME_TYPE)) { result = new StructuredTextPartitionerForXML(); result.connect(structuredDocument); } @@ -371,16 +363,16 @@ result = getPartitionTypeForDocumentLanguage(); } else if (region_type == DOMJSPRegionContexts.JSP_COMMENT_TEXT || region_type == DOMJSPRegionContexts.JSP_COMMENT_OPEN || region_type == DOMJSPRegionContexts.JSP_COMMENT_CLOSE) - result = ST_JSP_COMMENT; + result = IJSPPartitions.JSP_COMMENT; else if (region_type == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME || region_type == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN || region_type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE) - result = ST_JSP_DIRECTIVE; + result = IJSPPartitions.JSP_DIRECTIVE; else if (region_type == DOMJSPRegionContexts.JSP_CLOSE || region_type == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN || region_type == DOMJSPRegionContexts.JSP_EXPRESSION_OPEN || region_type == DOMJSPRegionContexts.JSP_DECLARATION_OPEN) - result = ST_JSP_CONTENT_DELIMITER; + result = IJSPPartitions.JSP_CONTENT_DELIMITER; else if (region_type == DOMJSPRegionContexts.JSP_ROOT_TAG_NAME) - result = ST_DEFAULT_JSP; + result = IJSPPartitions.JSP_DEFAULT; else if (region_type == DOMJSPRegionContexts.JSP_EL_OPEN || region_type == DOMJSPRegionContexts.JSP_EL_CONTENT || region_type == DOMJSPRegionContexts.JSP_EL_CLOSE || region_type == DOMJSPRegionContexts.JSP_EL_DQUOTE || region_type == DOMJSPRegionContexts.JSP_EL_SQUOTE || region_type == DOMJSPRegionContexts.JSP_EL_QUOTED_CONTENT) - result = ST_JSP_DEFAULT_EL; + result = IJSPPartitions.JSP_DEFAULT_EL; else if (region_type == XMLRegionContext.XML_CONTENT) { // possibly between <jsp:scriptlet>, <jsp:expression>, // <jsp:declration> @@ -410,13 +402,13 @@ private String getPartitionTypeForDocumentLanguage() { String result; if (fLanguage == null || fLanguage.equalsIgnoreCase("java")) { //$NON-NLS-1$ - result = ST_JSP_CONTENT_JAVA; + result = IJSPPartitions.JSP_CONTENT_JAVA; } else if (fLanguage.equalsIgnoreCase("javascript")) { //$NON-NLS-1$ - result = ST_JSP_CONTENT_JAVASCRIPT; + result = IJSPPartitions.JSP_CONTENT_JAVASCRIPT; } else { - result = ST_JSP_SCRIPT + getLanguage().toUpperCase(Locale.ENGLISH); + result = IJSPPartitions.JSP_SCRIPT_PREFIX + getLanguage().toUpperCase(Locale.ENGLISH); } return result; } @@ -462,11 +454,11 @@ String documentRegionContext = sdRegion.getType(); if (containedChildRegion != null) { if (documentRegionContext.equals(DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) || documentRegionContext.equals(DOMJSPRegionContexts.JSP_ROOT_TAG_NAME)) { - setInternalPartition(offset, containedChildRegion.getLength(), ST_JSP_DIRECTIVE); + setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitions.JSP_DIRECTIVE); return true; } if (fEnableJSPActionPartitions && isAction(sdRegion, offset)) { - setInternalPartition(offset, containedChildRegion.getLength(), ST_JSP_DIRECTIVE); + setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitions.JSP_DIRECTIVE); return true; } }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/JSPModelLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/JSPModelLoader.java index d6d2d93..99f121b 100644 --- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/JSPModelLoader.java +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/modelhandler/JSPModelLoader.java
@@ -26,10 +26,10 @@ import org.eclipse.jst.jsp.core.internal.domdocument.DOMModelForJSP; import org.eclipse.jst.jsp.core.internal.parser.JSPReParser; import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; +import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP; import org.eclipse.jst.jsp.core.modelquery.ModelQueryAdapterFactoryForJSP; import org.eclipse.wst.html.core.contenttype.ContentTypeIdForHTML; -import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML; +import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML; import org.eclipse.wst.sse.core.AbstractModelLoader; import org.eclipse.wst.sse.core.IAdapterFactory; import org.eclipse.wst.sse.core.INodeNotifier; @@ -54,7 +54,7 @@ import org.eclipse.wst.xml.core.internal.document.XMLModelImpl; import org.eclipse.wst.xml.core.internal.propagate.PropagatingAdapterFactoryImpl; import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML; import org.w3c.dom.Document; public class JSPModelLoader extends AbstractModelLoader {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitions.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitions.java new file mode 100644 index 0000000..9f14225 --- /dev/null +++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitions.java
@@ -0,0 +1,26 @@ +package org.eclipse.jst.jsp.core.text; + +import org.eclipse.wst.sse.core.text.IStructuredPartitions; + +/** + * This interface is not intended to be implemented. + * It defines the partitioning for JSP and all its partitions. + * Clients should reference the partition type Strings defined here directly. + * + * @since 1.0 + */ +public interface IJSPPartitions { + + String JSP_PARTITIONING = IStructuredPartitions.STRUCTURED_PARTITIONING; + + String JSP_DEFAULT = "org.eclipse.jst.jsp.DEFAULT_JSP"; //$NON-NLS-1$ + String JSP_COMMENT = "org.eclipse.jst.jsp.JSP_COMMENT"; //$NON-NLS-1$ + + String JSP_SCRIPT_PREFIX = "org.eclipse.jst.jsp.SCRIPT."; //$NON-NLS-1$ + String JSP_CONTENT_DELIMITER = JSP_SCRIPT_PREFIX + "DELIMITER"; //$NON-NLS-1$ + String JSP_CONTENT_JAVA = JSP_SCRIPT_PREFIX + "JAVA"; //$NON-NLS-1$ + String JSP_CONTENT_JAVASCRIPT = JSP_SCRIPT_PREFIX + "JAVASCRIPT"; //$NON-NLS-1$ + String JSP_DEFAULT_EL = JSP_SCRIPT_PREFIX + "JSP_EL"; //$NON-NLS-1$ + + String JSP_DIRECTIVE = "org.eclipse.jst.jsp.JSP_DIRECTIVE"; //$NON-NLS-1$ +}
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.xml b/bundles/org.eclipse.jst.jsp.ui/plugin.xml index 25d8c2f..22711d4 100644 --- a/bundles/org.eclipse.jst.jsp.ui/plugin.xml +++ b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
@@ -53,7 +53,7 @@ <extension point="org.eclipse.wst.sse.ui.extendedconfiguration"> <configuration type="textviewerconfiguration" - class="org.eclipse.jst.jsp.ui.internal.editor.StructuredTextViewerConfigurationJSP" + class="org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP" target="org.eclipse.jst.jsp.core.jspsource"/> <configuration type="contentoutlineconfiguration"
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/StructuredTextViewerConfigurationJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java similarity index 78% rename from bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/StructuredTextViewerConfigurationJSP.java rename to bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java index 3221089..0788eb3 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/StructuredTextViewerConfigurationJSP.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/StructuredTextViewerConfigurationJSP.java
@@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.jst.jsp.ui.internal.editor; +package org.eclipse.jst.jsp.ui; import java.util.ArrayList; import java.util.List; @@ -34,7 +34,8 @@ import org.eclipse.jface.text.reconciler.IReconciler; import org.eclipse.jface.text.reconciler.IReconcilingStrategy; import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; +import org.eclipse.jst.jsp.core.internal.text.StructuredTextPartitionerForJSP; +import org.eclipse.jst.jsp.core.text.IJSPPartitions; import org.eclipse.jst.jsp.ui.internal.autoedit.StructuredAutoEditStrategyJSP; import org.eclipse.jst.jsp.ui.internal.contentassist.JSPContentAssistProcessor; import org.eclipse.jst.jsp.ui.internal.contentassist.JSPJavaContentAssistProcessor; @@ -53,11 +54,12 @@ import org.eclipse.jst.jsp.ui.internal.taginfo.JSPTagInfoHoverProcessor; import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.wst.css.core.internal.text.rules.StructuredTextPartitionerForCSS; +import org.eclipse.wst.css.core.text.ICSSPartitions; import org.eclipse.wst.css.ui.contentassist.CSSContentAssistProcessor; import org.eclipse.wst.css.ui.style.LineStyleProviderForEmbeddedCSS; import org.eclipse.wst.html.core.format.HTMLFormatProcessorImpl; -import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML; +import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML; +import org.eclipse.wst.html.core.text.IHTMLPartitions; import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor; import org.eclipse.wst.html.ui.style.LineStyleProviderForHTML; import org.eclipse.wst.html.ui.taginfo.HTMLBestMatchHoverProcessor; @@ -70,7 +72,7 @@ import org.eclipse.wst.javascript.common.ui.internal.taginfo.JavaScriptTagInfoHoverProcessor; import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.core.StructuredModelManager; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration; import org.eclipse.wst.sse.ui.format.StructuredFormattingStrategy; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; @@ -82,7 +84,8 @@ import org.eclipse.wst.sse.ui.taginfo.ProblemAnnotationHoverProcessor; import org.eclipse.wst.sse.ui.taginfo.TextHoverManager; import org.eclipse.wst.sse.ui.util.EditorUtility; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.text.IXMLPartitions; import org.eclipse.wst.xml.ui.doubleclick.XMLDoubleClickStrategy; import org.eclipse.wst.xml.ui.internal.correction.CorrectionProcessorXML; import org.eclipse.wst.xml.ui.reconcile.StructuredTextReconcilingStrategyForMarkup; @@ -119,11 +122,11 @@ allStrategies.add(superStrategies[i]); } - if (contentType == StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA) { + if (contentType == IJSPPartitions.JSP_CONTENT_JAVA) { allStrategies.add(getJavaSourceViewerConfiguration().getAutoEditStrategies(sourceViewer, IJavaPartitions.JAVA_PARTITIONING)[0]); } - if (contentType == StructuredTextPartitionerForHTML.ST_DEFAULT_HTML || contentType == StructuredTextPartitionerForHTML.ST_HTML_DECLARATION) { + if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION) { allStrategies.add(new StructuredAutoEditStrategyJSP()); } @@ -137,8 +140,8 @@ String[] jspTypes = StructuredTextPartitionerForJSP.getConfiguredContentTypes(); configuredContentTypes = new String[2 + xmlTypes.length + htmlTypes.length + jspTypes.length]; - configuredContentTypes[0] = StructuredTextPartitioner.ST_DEFAULT_PARTITION; - configuredContentTypes[1] = StructuredTextPartitioner.ST_UNKNOWN_PARTITION; + configuredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION; + configuredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION; int index = 0; System.arraycopy(xmlTypes, 0, configuredContentTypes, index += 2, xmlTypes.length); @@ -163,36 +166,36 @@ IContentAssistProcessor noRegionProcessorJsp = new NoRegionContentAssistProcessorForJSP(); // HTML - setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML); - setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, StructuredTextPartitionerForHTML.ST_HTML_COMMENT); + setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, IHTMLPartitions.HTML_DEFAULT); + setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, IHTMLPartitions.HTML_COMMENT); // HTML JavaScript - setContentAssistProcessor(contentAssistant, jsContentAssistProcessor, StructuredTextPartitionerForHTML.ST_SCRIPT); + setContentAssistProcessor(contentAssistant, jsContentAssistProcessor, IHTMLPartitions.SCRIPT); // CSS - setContentAssistProcessor(contentAssistant, cssContentAssistProcessor, StructuredTextPartitionerForCSS.ST_STYLE); - setContentAssistProcessor(contentAssistant, cssContentAssistProcessor, StructuredTextPartitionerForCSS.ST_STYLE); + setContentAssistProcessor(contentAssistant, cssContentAssistProcessor, ICSSPartitions.STYLE); + setContentAssistProcessor(contentAssistant, cssContentAssistProcessor, ICSSPartitions.STYLE); // JSP - setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, StructuredTextPartitioner.ST_DEFAULT_PARTITION); - setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, StructuredTextPartitionerForXML.ST_DEFAULT_XML); - setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML); - setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, StructuredTextPartitionerForHTML.ST_HTML_COMMENT); - setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, StructuredTextPartitionerForJSP.ST_DEFAULT_JSP); + setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, IStructuredPartitions.DEFAULT_PARTITION); + setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, IXMLPartitions.XML_DEFAULT); + setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, IHTMLPartitions.HTML_DEFAULT); + setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, IHTMLPartitions.HTML_COMMENT); + setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, IJSPPartitions.JSP_DEFAULT); // JSP directives - setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, StructuredTextPartitionerForJSP.ST_JSP_DIRECTIVE); + setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, IJSPPartitions.JSP_DIRECTIVE); // JSP delimiters - setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, StructuredTextPartitionerForJSP.ST_JSP_CONTENT_DELIMITER); + setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, IJSPPartitions.JSP_CONTENT_DELIMITER); // JSP JavaScript - setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT); + setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, IJSPPartitions.JSP_CONTENT_JAVASCRIPT); // JSP Java - setContentAssistProcessor(contentAssistant, jspJavaContentAssistProcessor, StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA); + setContentAssistProcessor(contentAssistant, jspJavaContentAssistProcessor, IJSPPartitions.JSP_CONTENT_JAVA); // unknown - setContentAssistProcessor(contentAssistant, noRegionProcessorJsp, StructuredTextPartitioner.ST_UNKNOWN_PARTITION); + setContentAssistProcessor(contentAssistant, noRegionProcessorJsp, IStructuredPartitions.UNKNOWN_PARTITION); // CMVC 269718 // JSP COMMENT - setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, StructuredTextPartitionerForJSP.ST_JSP_COMMENT); + setContentAssistProcessor(contentAssistant, jspContentAssistProcessor, IJSPPartitions.JSP_COMMENT); } return ca; @@ -206,10 +209,10 @@ ITextEditor editor = getTextEditor(); if (editor != null) { IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(editor); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IHTMLPartitions.HTML_DEFAULT); correctionProcessor = new CorrectionProcessorJSP(editor); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IJSPPartitions.JSP_CONTENT_JAVA); } } @@ -217,23 +220,23 @@ } public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { - MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), StructuredTextPartitionerForXML.ST_DEFAULT_XML); + MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT); formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl())); - formatter.setSlaveStrategy(new FormattingStrategyJSPJava(), StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA); + formatter.setSlaveStrategy(new FormattingStrategyJSPJava(), IJSPPartitions.JSP_CONTENT_JAVA); return formatter; } public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) { - if (contentType.compareTo(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML) == 0) + if (contentType.compareTo(IHTMLPartitions.HTML_DEFAULT) == 0) // HTML return new XMLDoubleClickStrategy(); - else if (contentType.compareTo(StructuredTextPartitionerForHTML.ST_SCRIPT) == 0 || contentType.compareTo(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA) == 0 || contentType.compareTo(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT) == 0) + else if (contentType.compareTo(IHTMLPartitions.SCRIPT) == 0 || contentType.compareTo(IJSPPartitions.JSP_CONTENT_JAVA) == 0 || contentType.compareTo(IJSPPartitions.JSP_CONTENT_JAVASCRIPT) == 0) // HTML JavaScript // JSP Java or JSP JavaScript return getJavaSourceViewerConfiguration().getDoubleClickStrategy(sourceViewer, contentType); - else if (contentType.compareTo(StructuredTextPartitionerForJSP.ST_DEFAULT_JSP) == 0) + else if (contentType.compareTo(IJSPPartitions.JSP_DEFAULT) == 0) // JSP return new XMLDoubleClickStrategy(); else @@ -246,37 +249,37 @@ if (highlighter != null) { // HTML LineStyleProvider htmlLineStyleProvider = new LineStyleProviderForHTML(); - highlighter.addProvider(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, htmlLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForHTML.ST_HTML_COMMENT, htmlLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForHTML.ST_HTML_DECLARATION, htmlLineStyleProvider); + highlighter.addProvider(IHTMLPartitions.HTML_DEFAULT, htmlLineStyleProvider); + highlighter.addProvider(IHTMLPartitions.HTML_COMMENT, htmlLineStyleProvider); + highlighter.addProvider(IHTMLPartitions.HTML_DECLARATION, htmlLineStyleProvider); // HTML JavaScript LineStyleProvider jsLineStyleProvider = new LineStyleProviderForJavaScript(); - highlighter.addProvider(StructuredTextPartitionerForHTML.ST_SCRIPT, jsLineStyleProvider); + highlighter.addProvider(IHTMLPartitions.SCRIPT, jsLineStyleProvider); // CSS LineStyleProvider cssLineStyleProvider = new LineStyleProviderForEmbeddedCSS(); - highlighter.addProvider(StructuredTextPartitionerForCSS.ST_STYLE, cssLineStyleProvider); + highlighter.addProvider(ICSSPartitions.STYLE, cssLineStyleProvider); // JSP LineStyleProvider jspLineStyleProvider = new LineStyleProviderForJSP(); - highlighter.addProvider(StructuredTextPartitionerForJSP.ST_DEFAULT_JSP, jspLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForJSP.ST_JSP_COMMENT, jspLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForJSP.ST_JSP_DIRECTIVE, jspLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_DELIMITER, jspLineStyleProvider); + highlighter.addProvider(IJSPPartitions.JSP_DEFAULT, jspLineStyleProvider); + highlighter.addProvider(IJSPPartitions.JSP_COMMENT, jspLineStyleProvider); + highlighter.addProvider(IJSPPartitions.JSP_DIRECTIVE, jspLineStyleProvider); + highlighter.addProvider(IJSPPartitions.JSP_CONTENT_DELIMITER, jspLineStyleProvider); // XML LineStyleProviderForXML xmlLineStyleProvider = new LineStyleProviderForXML(); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_DEFAULT_XML, xmlLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_XML_COMMENT, xmlLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_XML_CDATA, xmlLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_XML_DECLARATION, xmlLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_XML_PI, xmlLineStyleProvider); + highlighter.addProvider(IXMLPartitions.XML_DEFAULT, xmlLineStyleProvider); + highlighter.addProvider(IXMLPartitions.XML_COMMENT, xmlLineStyleProvider); + highlighter.addProvider(IXMLPartitions.XML_CDATA, xmlLineStyleProvider); + highlighter.addProvider(IXMLPartitions.XML_DECLARATION, xmlLineStyleProvider); + highlighter.addProvider(IXMLPartitions.XML_PI, xmlLineStyleProvider); // JSP Java or JSP JavaScript - highlighter.addProvider(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA, new LineStyleProviderForJava()); - highlighter.addProvider(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT, new LineStyleProviderForJavaScript()); + highlighter.addProvider(IJSPPartitions.JSP_CONTENT_JAVA, new LineStyleProviderForJava()); + highlighter.addProvider(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, new LineStyleProviderForJavaScript()); } return highlighter; @@ -288,15 +291,15 @@ // HTML IInformationProvider htmlInformationProvider = new HTMLInformationProvider(); - fInformationPresenter.setInformationProvider(htmlInformationProvider, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML); + fInformationPresenter.setInformationProvider(htmlInformationProvider, IHTMLPartitions.HTML_DEFAULT); // HTML JavaScript IInformationProvider javascriptInformationProvider = new JavaScriptInformationProvider(); - fInformationPresenter.setInformationProvider(javascriptInformationProvider, StructuredTextPartitionerForHTML.ST_SCRIPT); + fInformationPresenter.setInformationProvider(javascriptInformationProvider, IHTMLPartitions.SCRIPT); // XML IInformationProvider xmlInformationProvider = new XMLInformationProvider(); - fInformationPresenter.setInformationProvider(xmlInformationProvider, StructuredTextPartitionerForXML.ST_DEFAULT_XML); + fInformationPresenter.setInformationProvider(xmlInformationProvider, IXMLPartitions.XML_DEFAULT); fInformationPresenter.setSizeConstraints(60, 10, true, true); } @@ -305,7 +308,7 @@ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) { // html - if (contentType == StructuredTextPartitionerForHTML.ST_DEFAULT_HTML) { + if (contentType == IHTMLPartitions.HTML_DEFAULT) { TextHoverManager.TextHoverDescriptor[] hoverDescs = getTextHovers(); int i = 0; while (i < hoverDescs.length) { @@ -322,7 +325,7 @@ } i++; } - } else if (contentType == StructuredTextPartitionerForHTML.ST_SCRIPT) { + } else if (contentType == IHTMLPartitions.SCRIPT) { // HTML JavaScript TextHoverManager.TextHoverDescriptor[] hoverDescs = getTextHovers(); int i = 0; @@ -340,7 +343,7 @@ } i++; } - } else if ((contentType == StructuredTextPartitionerForJSP.ST_DEFAULT_JSP) || (contentType == StructuredTextPartitionerForJSP.ST_JSP_DIRECTIVE)) { + } else if ((contentType == IJSPPartitions.JSP_DEFAULT) || (contentType == IJSPPartitions.JSP_DIRECTIVE)) { // JSP TextHoverManager.TextHoverDescriptor[] hoverDescs = getTextHovers(); int i = 0; @@ -358,7 +361,7 @@ } i++; } - } else if (contentType == StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA) { + } else if (contentType == IJSPPartitions.JSP_CONTENT_JAVA) { // JSP Java TextHoverManager.TextHoverDescriptor[] hoverDescs = getTextHovers(); int i = 0; @@ -379,7 +382,7 @@ } i++; } - } else if (contentType == StructuredTextPartitionerForXML.ST_DEFAULT_XML) { + } else if (contentType == IXMLPartitions.XML_DEFAULT) { // XML TextHoverManager.TextHoverDescriptor[] hoverDescs = SSEUIPlugin.getDefault().getTextHoverManager().getTextHovers(); int i = 0; @@ -449,13 +452,13 @@ IReconcilingStrategy markupStrategy = new StructuredTextReconcilingStrategyForMarkup((ITextEditor) editorPart); IReconcilingStrategy jspStrategy = new StructuredTextReconcilingStrategyForJSP((ITextEditor) editorPart); - fReconciler.setReconcilingStrategy(markupStrategy, StructuredTextPartitioner.ST_DEFAULT_PARTITION); - fReconciler.setReconcilingStrategy(markupStrategy, StructuredTextPartitionerForXML.ST_DEFAULT_XML); + fReconciler.setReconcilingStrategy(markupStrategy, IStructuredPartitions.DEFAULT_PARTITION); + fReconciler.setReconcilingStrategy(markupStrategy, IXMLPartitions.XML_DEFAULT); - fReconciler.setReconcilingStrategy(jspStrategy, StructuredTextPartitionerForJSP.ST_DEFAULT_JSP); - fReconciler.setReconcilingStrategy(jspStrategy, StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA); - fReconciler.setReconcilingStrategy(jspStrategy, StructuredTextPartitionerForJSP.ST_JSP_CONTENT_DELIMITER); - fReconciler.setReconcilingStrategy(jspStrategy, StructuredTextPartitionerForJSP.ST_JSP_DIRECTIVE); + fReconciler.setReconcilingStrategy(jspStrategy, IJSPPartitions.JSP_DEFAULT); + fReconciler.setReconcilingStrategy(jspStrategy, IJSPPartitions.JSP_CONTENT_JAVA); + fReconciler.setReconcilingStrategy(jspStrategy, IJSPPartitions.JSP_CONTENT_DELIMITER); + fReconciler.setReconcilingStrategy(jspStrategy, IJSPPartitions.JSP_DIRECTIVE); fReconciler.setDefaultStrategy(markupStrategy); @@ -476,7 +479,8 @@ if (fJavaSourceViewerConfiguration == null) { IPreferenceStore store = PreferenceConstants.getPreferenceStore(); JavaTextTools javaTextTools = new JavaTextTools(store); - fJavaSourceViewerConfiguration = new JavaSourceViewerConfiguration(javaTextTools, getTextEditor()); + fJavaSourceViewerConfiguration = new JavaSourceViewerConfiguration(javaTextTools.getColorManager(), store, getTextEditor(), IJavaPartitions.JAVA_PARTITIONING); + //fJavaSourceViewerConfiguration = new JavaSourceViewerConfiguration(javaTextTools, getTextEditor()); } return fJavaSourceViewerConfiguration; }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java index a5c703c..ce0a1aa 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
@@ -27,7 +27,7 @@ import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITypedRegion; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; +import org.eclipse.jst.jsp.core.text.IJSPPartitions; import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IStorageEditorInput; @@ -158,7 +158,7 @@ // custom // tags, // return that position - if (type == StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA || type == StructuredTextPartitionerForJSP.ST_JSP_DIRECTIVE) { + if (type == IJSPPartitions.JSP_CONTENT_JAVA || type == IJSPPartitions.JSP_DIRECTIVE) { result = partitions[i].getOffset(); } }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java index b48e66d..ee509fb 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/CustomTemplateProposal.java
@@ -17,7 +17,7 @@ import org.eclipse.jface.text.templates.TemplateProposal; import org.eclipse.swt.graphics.Image; import org.eclipse.wst.sse.core.util.StringUtils; -import org.eclipse.wst.sse.ui.contentassist.IRelevanceCompletionProposal; +import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal; /** * Purpose of this class is to make the additional proposal info into content
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java index f54c073..d22682c 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionProcessor.java
@@ -33,8 +33,8 @@ import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.ui.IReleasable; import org.eclipse.wst.sse.ui.StructuredTextViewer; -import org.eclipse.wst.sse.ui.contentassist.IResourceDependentProcessor; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.contentassist.IResourceDependentProcessor; import org.eclipse.wst.xml.core.document.XMLDocument; import org.eclipse.wst.xml.core.document.XMLModel; import org.eclipse.wst.xml.core.document.XMLNode;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java index 047814b..b75f19f 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPContentAssistProcessor.java
@@ -35,8 +35,8 @@ import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController; import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager; import org.eclipse.jst.jsp.core.internal.document.PageDirectiveAdapterFactory; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; import org.eclipse.jst.jsp.core.model.parser.DOMJSPRegionContexts; +import org.eclipse.jst.jsp.core.text.IJSPPartitions; import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin; import org.eclipse.jst.jsp.ui.internal.Logger; import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper; @@ -48,7 +48,7 @@ import org.eclipse.wst.html.core.contentmodel.HTMLCMDocumentFactory; import org.eclipse.wst.html.core.contentmodel.HTMLElementDeclaration; import org.eclipse.wst.html.core.contentmodel.JSPCMDocument; -import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML; +import org.eclipse.wst.html.core.text.IHTMLPartitions; import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor; import org.eclipse.wst.javascript.common.ui.internal.contentassist.JavaScriptContentAssistProcessor; import org.eclipse.wst.sse.core.IModelManager; @@ -59,17 +59,17 @@ import org.eclipse.wst.sse.core.parser.BlockMarker; import org.eclipse.wst.sse.core.text.IStructuredDocument; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; import org.eclipse.wst.sse.core.text.ITextRegion; import org.eclipse.wst.sse.core.text.ITextRegionContainer; import org.eclipse.wst.sse.core.text.ITextRegionList; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; import org.eclipse.wst.sse.core.util.StringUtils; import org.eclipse.wst.sse.ui.StructuredTextViewer; -import org.eclipse.wst.sse.ui.contentassist.IRelevanceCompletionProposal; -import org.eclipse.wst.sse.ui.contentassist.IResourceDependentProcessor; import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils; import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal; +import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal; import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceConstants; +import org.eclipse.wst.sse.ui.internal.contentassist.IResourceDependentProcessor; import org.eclipse.wst.sse.ui.registry.AdapterFactoryProvider; import org.eclipse.wst.sse.ui.registry.AdapterFactoryRegistry; import org.eclipse.wst.xml.core.contentmodel.CMDocType; @@ -86,7 +86,7 @@ import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser; import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter; import org.eclipse.wst.xml.core.parser.XMLRegionContext; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.text.IXMLPartitions; import org.eclipse.wst.xml.ui.contentassist.AbstractContentAssistProcessor; import org.eclipse.wst.xml.ui.contentassist.ContentAssistRequest; import org.eclipse.wst.xml.ui.contentassist.NonValidatingModelQueryAction; @@ -146,14 +146,14 @@ XMLContentAssistProcessor xmlProcessor = new XMLContentAssistProcessor(); JavaScriptContentAssistProcessor javascriptProcessor = new JavaScriptContentAssistProcessor(); - fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, htmlProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForXML.ST_DEFAULT_XML, xmlProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitioner.ST_DEFAULT_PARTITION, htmlProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForJSP.ST_DEFAULT_JSP, jspJavaProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForJSP.ST_JSP_DIRECTIVE, xmlProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_HTML_COMMENT, htmlProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT, javascriptProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_SCRIPT, javascriptProcessor); // default + fPartitionToProcessorMap.put(IHTMLPartitions.HTML_DEFAULT, htmlProcessor); + fPartitionToProcessorMap.put(IXMLPartitions.XML_DEFAULT, xmlProcessor); + fPartitionToProcessorMap.put(IStructuredPartitions.DEFAULT_PARTITION, htmlProcessor); + fPartitionToProcessorMap.put(IJSPPartitions.JSP_DEFAULT, jspJavaProcessor); + fPartitionToProcessorMap.put(IJSPPartitions.JSP_DIRECTIVE, xmlProcessor); + fPartitionToProcessorMap.put(IHTMLPartitions.HTML_COMMENT, htmlProcessor); + fPartitionToProcessorMap.put(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, javascriptProcessor); + fPartitionToProcessorMap.put(IHTMLPartitions.SCRIPT, javascriptProcessor); // default // to // javascript // for @@ -611,7 +611,7 @@ // ANOTHER WORKAROUND UNTIL PARTITIONING TAKES CARE OF THIS // check for xml-jsp tags... // CMVC 243657 - if (partitionType == StructuredTextPartitionerForJSP.ST_JSP_DIRECTIVE && fn != null) { + if (partitionType == IJSPPartitions.JSP_DIRECTIVE && fn != null) { IStructuredDocumentRegion possibleXMLJSP = ((fn.getType() == XMLRegionContext.XML_CONTENT) && fn.getPrevious() != null) ? fn.getPrevious() : fn; ITextRegionList regions = possibleXMLJSP.getRegions(); if (regions.size() > 1) { @@ -636,7 +636,7 @@ // ** THIS IS A TEMP FIX UNTIL PARTITIONING TAKES CARE OF THIS... // CMVC 241882 // check for XML-JSP in a <script> region - if (partitionType == StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT || partitionType == StructuredTextPartitionerForHTML.ST_SCRIPT) { + if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) { // fn should be block text IStructuredDocumentRegion decodedSDRegion = decodeScriptBlock(fn.getFullText()); // System.out.println("decoded > " + @@ -671,7 +671,7 @@ // ///////////////////////////////////////////////////////////////////////// // check special JSP delimiter cases - if (fn != null && partitionType == StructuredTextPartitionerForJSP.ST_JSP_CONTENT_DELIMITER) { + if (fn != null && partitionType == IJSPPartitions.JSP_CONTENT_DELIMITER) { IStructuredDocumentRegion fnDelim = fn; // if it's a nested JSP region, need to get the correct @@ -728,7 +728,7 @@ // adapter get the proposals if (documentPosition > 0) { String checkType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1); - if (checkType != StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT) { // this + if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) { // this // check // is // failing @@ -740,7 +740,7 @@ // javascript...) return getJSPJavaCompletionProposals(viewer, documentPosition); } else { - partitionType = StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT; + partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT; } } } else if ((firstRegion.getType() == XMLRegionContext.XML_TAG_OPEN) && documentPosition >= fnDelim.getEndOffset()) { @@ -757,10 +757,10 @@ // JAVASCRIPT adapter get the proposals if (documentPosition > 0) { String checkType = getPartitionType((StructuredTextViewer) viewer, documentPosition - 1); - if (checkType != StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT) { + if (checkType != IJSPPartitions.JSP_CONTENT_JAVASCRIPT) { return getJSPJavaCompletionProposals(viewer, documentPosition); } else { - partitionType = StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT; + partitionType = IJSPPartitions.JSP_CONTENT_JAVASCRIPT; } } } @@ -837,7 +837,7 @@ if (p != null) { embeddedResults = p.computeCompletionProposals(viewer, documentPosition); // get bean methods, objects, and constants if there are any... - if (partitionType == StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT || partitionType == StructuredTextPartitionerForHTML.ST_SCRIPT) { + if (partitionType == IJSPPartitions.JSP_CONTENT_JAVASCRIPT || partitionType == IHTMLPartitions.SCRIPT) { ICompletionProposal[] beanResults = getJSPJavaBeanProposals(viewer, documentPosition); if (beanResults != null && beanResults.length > 0) { ICompletionProposal[] added = new ICompletionProposal[beanResults.length + embeddedResults.length]; @@ -877,7 +877,7 @@ // CMVC 269718 // check for |<%-- --%> first position of jsp comment - if (partitionType == StructuredTextPartitionerForJSP.ST_JSP_COMMENT) { + if (partitionType == IJSPPartitions.JSP_COMMENT) { if (sdRegion.getStartOffset() == documentPosition) { ICompletionProposal[] htmlResults = getHTMLCompletionProposals(viewer, documentPosition); jspResults = merge(jspResults, htmlResults); @@ -959,7 +959,7 @@ */ private ICompletionProposal[] getHTMLCompletionProposals(ITextViewer viewer, int documentPosition) { - IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML); + IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(IHTMLPartitions.HTML_DEFAULT); return p.computeCompletionProposals(viewer, documentPosition); } @@ -970,7 +970,7 @@ * @return ICompletionProposal[] */ protected ICompletionProposal[] getJSPJavaCompletionProposals(ITextViewer viewer, int documentPosition) { - JSPJavaContentAssistProcessor p = (JSPJavaContentAssistProcessor) fPartitionToProcessorMap.get(StructuredTextPartitionerForJSP.ST_DEFAULT_JSP); + JSPJavaContentAssistProcessor p = (JSPJavaContentAssistProcessor) fPartitionToProcessorMap.get(IJSPPartitions.JSP_DEFAULT); p.initialize(fResource); return p.computeCompletionProposals(viewer, documentPosition); }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java index 65132c4..3904143 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPDummyContentAssistProcessor.java
@@ -23,7 +23,7 @@ import org.eclipse.jface.text.contentassist.IContextInformationValidator; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.core.text.ITextRegion; -import org.eclipse.wst.sse.ui.contentassist.IResourceDependentProcessor; +import org.eclipse.wst.sse.ui.internal.contentassist.IResourceDependentProcessor; import org.eclipse.wst.xml.core.document.XMLNode; import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration; import org.eclipse.wst.xml.core.internal.contentmodel.CMContent;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java index 4ab5d53..c0e4bed 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPJavaContentAssistProcessor.java
@@ -20,8 +20,8 @@ import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.contentassist.IContextInformationValidator; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; import org.eclipse.jst.jsp.core.model.parser.DOMJSPRegionContexts; +import org.eclipse.jst.jsp.core.text.IJSPPartitions; import org.eclipse.wst.sse.core.IndexedRegion; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.core.text.ITextRegion; @@ -29,10 +29,10 @@ import org.eclipse.wst.sse.core.text.ITextRegionList; import org.eclipse.wst.sse.ui.IReleasable; import org.eclipse.wst.sse.ui.StructuredTextViewer; -import org.eclipse.wst.sse.ui.contentassist.IResourceDependentProcessor; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils; import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal; +import org.eclipse.wst.sse.ui.internal.contentassist.IResourceDependentProcessor; import org.eclipse.wst.xml.core.document.XMLNode; import org.eclipse.wst.xml.core.parser.XMLRegionContext; import org.eclipse.wst.xml.ui.contentassist.XMLRelevanceConstants; @@ -306,7 +306,7 @@ // need to compute context info here, if it's JSP, call java computer IDocumentPartitioner dp = viewer.getDocument().getDocumentPartitioner(); String type = dp.getPartition(documentOffset).getType(); - if (type == StructuredTextPartitionerForJSP.ST_DEFAULT_JSP || type == StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA) { + if (type == IJSPPartitions.JSP_DEFAULT || type == IJSPPartitions.JSP_CONTENT_JAVA) { // get context info from completion results... ICompletionProposal[] proposals = computeCompletionProposals(viewer, documentOffset); for (int i = 0; i < proposals.length; i++) {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java index e809e8d..c733f43 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JavaTypeCompletionProposal.java
@@ -29,8 +29,8 @@ import org.eclipse.wst.sse.core.text.ITextRegion; import org.eclipse.wst.sse.core.text.ITextRegionList; import org.eclipse.wst.sse.core.util.StringUtils; -import org.eclipse.wst.sse.ui.contentassist.IRelevanceCompletionProposal; import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal; +import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal; import org.eclipse.wst.xml.core.parser.XMLRegionContext; /**
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java index 99ccb66..f2ad51f 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/NoRegionContentAssistProcessorForJSP.java
@@ -13,14 +13,14 @@ import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.jst.jsp.core.JSP11Namespace; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; import org.eclipse.jst.jsp.core.model.parser.DOMJSPRegionContexts; -import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML; +import org.eclipse.jst.jsp.core.text.IJSPPartitions; +import org.eclipse.wst.html.core.text.IHTMLPartitions; import org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML; import org.eclipse.wst.sse.core.text.IStructuredDocument; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; +import org.eclipse.wst.xml.core.text.IXMLPartitions; /** * @@ -42,21 +42,21 @@ super.initPartitionToProcessorMap(); IContentAssistProcessor jspContentAssistProcessor = new JSPContentAssistProcessor(); // JSP - fPartitionToProcessorMap.put(StructuredTextPartitioner.ST_DEFAULT_PARTITION, jspContentAssistProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForXML.ST_DEFAULT_XML, jspContentAssistProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, jspContentAssistProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_HTML_COMMENT, jspContentAssistProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForJSP.ST_DEFAULT_JSP, jspContentAssistProcessor); + fPartitionToProcessorMap.put(IStructuredPartitions.DEFAULT_PARTITION, jspContentAssistProcessor); + fPartitionToProcessorMap.put(IXMLPartitions.XML_DEFAULT, jspContentAssistProcessor); + fPartitionToProcessorMap.put(IHTMLPartitions.HTML_DEFAULT, jspContentAssistProcessor); + fPartitionToProcessorMap.put(IHTMLPartitions.HTML_COMMENT, jspContentAssistProcessor); + fPartitionToProcessorMap.put(IJSPPartitions.JSP_DEFAULT, jspContentAssistProcessor); // JSP directives - fPartitionToProcessorMap.put(StructuredTextPartitionerForJSP.ST_JSP_DIRECTIVE, jspContentAssistProcessor); + fPartitionToProcessorMap.put(IJSPPartitions.JSP_DIRECTIVE, jspContentAssistProcessor); // JSP delimiters - fPartitionToProcessorMap.put(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_DELIMITER, jspContentAssistProcessor); + fPartitionToProcessorMap.put(IJSPPartitions.JSP_CONTENT_DELIMITER, jspContentAssistProcessor); // JSP JavaScript - fPartitionToProcessorMap.put(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVASCRIPT, jspContentAssistProcessor); + fPartitionToProcessorMap.put(IJSPPartitions.JSP_CONTENT_JAVASCRIPT, jspContentAssistProcessor); IContentAssistProcessor jspJavaContentAssistProcessor = new JSPJavaContentAssistProcessor(); // JSP Java - fPartitionToProcessorMap.put(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA, jspJavaContentAssistProcessor); + fPartitionToProcessorMap.put(IJSPPartitions.JSP_CONTENT_JAVA, jspJavaContentAssistProcessor); } /* @@ -96,7 +96,7 @@ if (p == null) { IStructuredDocumentRegion sdRegion = ((IStructuredDocument) viewer.getDocument()).getRegionAtCharacterOffset(documentOffset); if (isJSPRegion(sdRegion)) - p = (IContentAssistProcessor) fPartitionToProcessorMap.get(StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA); + p = (IContentAssistProcessor) fPartitionToProcessorMap.get(IJSPPartitions.JSP_CONTENT_JAVA); } return p; }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java index 4180dd9..c68be58 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/ActionContributorJSP.java
@@ -22,7 +22,7 @@ import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.texteditor.RetargetTextEditorAction; import org.eclipse.wst.html.ui.edit.ui.ActionContributorHTML; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; /** * ActionContributorJSP
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/StructuredTextEditorJSP.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/StructuredTextEditorJSP.java index 5d216c9..cf7eeb9 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/StructuredTextEditorJSP.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/editor/StructuredTextEditorJSP.java
@@ -31,9 +31,9 @@ import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesAction; import org.eclipse.wst.sse.core.StructuredModelManager; import org.eclipse.wst.sse.ui.StructuredTextEditor; -import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionProvider; import org.eclipse.wst.xml.core.document.XMLDocument; import org.eclipse.wst.xml.core.document.XMLModel;
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java index fe8e5ab..9a814d3 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/TaglibHyperlinkDetector.java
@@ -19,7 +19,7 @@ import org.eclipse.jst.jsp.core.internal.contentmodel.ITaglibRecord; import org.eclipse.jst.jsp.core.internal.contentmodel.TLDRecord; import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibIndex; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; +import org.eclipse.jst.jsp.core.text.IJSPPartitions; import org.eclipse.jst.jsp.ui.internal.Logger; import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.core.IndexedRegion; @@ -47,7 +47,7 @@ try { // check if jsp tag/directive first ITypedRegion partition = TextUtilities.getPartition(doc, IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING, region.getOffset(), false); - if (partition != null && partition.getType() == StructuredTextPartitionerForJSP.ST_JSP_DIRECTIVE) { + if (partition != null && partition.getType() == IJSPPartitions.JSP_DIRECTIVE) { // check if jsp taglib directive Node currentNode = getCurrentNode(doc, region.getOffset()); if (currentNode != null && currentNode.getNodeType() == Node.ELEMENT_NODE && JSP11Namespace.ElementName.DIRECTIVE_TAGLIB.equalsIgnoreCase(currentNode.getNodeName())) {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java index 049cc82..b4a64fc 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/BasicRefactorSearchRequestor.java
@@ -37,6 +37,7 @@ import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin; import org.eclipse.jst.jsp.ui.internal.Logger; import org.eclipse.ltk.core.refactoring.Change; +import org.eclipse.ltk.core.refactoring.DocumentChange; import org.eclipse.ltk.core.refactoring.RefactoringStatus; import org.eclipse.text.edits.MalformedTreeException; import org.eclipse.text.edits.MultiTextEdit; @@ -116,7 +117,7 @@ /** * Change class that wraps a text edit on the jsp document */ - private class RenameChange extends Change { + private class RenameChange extends DocumentChange { private TextEdit fEdit = null; private IFile fJSPFile = null; @@ -124,6 +125,7 @@ private String fDescription = JSPUIPlugin.getResourceString("%BasicRefactorSearchRequestor.0"); //$NON-NLS-1$ public RenameChange(IFile jspFile, IDocument jspDoc, TextEdit edit, String description) { + super("JSP Rename Change", jspDoc); this.fEdit = edit; this.fJSPFile = jspFile; this.fJSPDoc = jspDoc; @@ -212,10 +214,6 @@ return false; } - public void initializeValidationData(IProgressMonitor pm) { - // TODO Auto-generated method stub - } - public String getName() { return this.fDescription; }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java index 5566e72..e94ff7f 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/JSPTypeRenameRequestor.java
@@ -42,7 +42,7 @@ String matchText = trans.getJavaText().substring(javaMatch.getOffset(), javaMatch.getOffset() + javaMatch.getLength()); // if it's an import or jsp:useBean or fully qualified type, we need to add the package name as well - if(trans.isImport(javaMatch.getOffset()) || trans.isUseBean(javaMatch.getOffset()) || isFullyQualified(matchText)) { + if(trans.isImport(javaMatch.getOffset()) || /*trans.isUseBean(javaMatch.getOffset()) ||*/ isFullyQualified(matchText)) { if(!pkg.equals("")) //$NON-NLS-1$ renameText = pkg + "." + renameText; //$NON-NLS-1$ }
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameChange.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameChange.java new file mode 100644 index 0000000..3f873c9 --- /dev/null +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/refactoring/RenameChange.java
@@ -0,0 +1,5 @@ +package org.eclipse.jst.jsp.ui.internal.java.refactoring; + +public class RenameChange { + +}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesAction.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesAction.java index 9641ef9..f5ad3e4 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesAction.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/java/search/JSPFindOccurrencesAction.java
@@ -18,8 +18,8 @@ import org.eclipse.jst.jsp.core.internal.java.IJSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapter; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; import org.eclipse.jst.jsp.core.model.parser.DOMJSPRegionContexts; +import org.eclipse.jst.jsp.core.text.IJSPPartitions; import org.eclipse.search.ui.ISearchQuery; import org.eclipse.swt.graphics.Point; import org.eclipse.ui.texteditor.ITextEditor; @@ -96,7 +96,7 @@ * @see com.ibm.sse.editor.internal.search.BasicFindOccurrencesAction#getPartitionTypes() */ public String[] getPartitionTypes() { - return new String[]{StructuredTextPartitionerForJSP.ST_DEFAULT_JSP, StructuredTextPartitionerForJSP.ST_JSP_CONTENT_JAVA}; + return new String[]{IJSPPartitions.JSP_DEFAULT, IJSPPartitions.JSP_CONTENT_JAVA}; } /**
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJava.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJava.java index fe0966d..3e5a868 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJava.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/reconcile/ReconcileStepForJava.java
@@ -24,7 +24,7 @@ import org.eclipse.jface.text.reconciler.IReconcileStep; import org.eclipse.jst.jsp.core.internal.java.JSPTranslation; import org.eclipse.jst.jsp.core.internal.java.JSPTranslationExtension; -import org.eclipse.jst.jsp.core.internal.text.rules.StructuredTextPartitionerForJSP; +import org.eclipse.jst.jsp.core.text.IJSPPartitions; import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.core.StructuredModelManager; import org.eclipse.wst.sse.core.text.IStructuredDocument; @@ -162,7 +162,7 @@ key = createKey(fStructuredDocument.getRegionAtCharacterOffset(jspOffset), ReconcileAnnotationKey.TOTAL); } else { - key = createKey(StructuredTextPartitionerForJSP.ST_DEFAULT_JSP, ReconcileAnnotationKey.TOTAL); + key = createKey(IJSPPartitions.JSP_DEFAULT, ReconcileAnnotationKey.TOTAL); } TemporaryAnnotation annotation = new TemporaryAnnotation(pos, type, problem.getMessage(), key, problem.getID()); annotation.setAdditionalFixInfo(problem);
diff --git a/bundles/org.eclipse.wst.css.core/component.xml b/bundles/org.eclipse.wst.css.core/component.xml index bb6f29e..a35b218 100644 --- a/bundles/org.eclipse.wst.css.core/component.xml +++ b/bundles/org.eclipse.wst.css.core/component.xml
@@ -9,7 +9,13 @@ <package name="org.eclipse.wst.css.core.contenttype" /> <package name="org.eclipse.wst.css.core.parser" /> <package name="org.eclipse.wst.css.core.document" /> - + <package name="org.eclipse.wst.css.core.text" /> + + <!-- ui --> + + <!-- phil --> + <package name="org.eclipse.wst.css.ui" /> + <!-- <package name="org.w3c.dom.css" /> <package name="org.w3c.dom.stylesheets" />
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java index f1f648e..c42f157 100644 --- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java +++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/encoding/CSSDocumentLoader.java
@@ -16,7 +16,7 @@ import org.eclipse.wst.css.core.internal.content.EncodingGuesser; import org.eclipse.wst.css.core.internal.parser.CSSSourceParser; import org.eclipse.wst.css.core.internal.text.CSSStructuredDocumentReParser; -import org.eclipse.wst.css.core.internal.text.rules.StructuredTextPartitionerForCSS; +import org.eclipse.wst.css.core.internal.text.StructuredTextPartitionerForCSS; import org.eclipse.wst.sse.core.document.AbstractDocumentLoader; import org.eclipse.wst.sse.core.document.IDocumentCharsetDetector; import org.eclipse.wst.sse.core.document.IDocumentLoader;
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/rules/StructuredTextPartitionerForCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java similarity index 70% rename from bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/rules/StructuredTextPartitionerForCSS.java rename to bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java index 7366a21..7b6321f 100644 --- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/rules/StructuredTextPartitionerForCSS.java +++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/text/StructuredTextPartitionerForCSS.java
@@ -8,21 +8,23 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.wst.css.core.internal.text.rules; +package org.eclipse.wst.css.core.internal.text; import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.css.core.text.ICSSPartitions; +import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; public class StructuredTextPartitionerForCSS extends StructuredTextPartitioner { - public final static String ST_STYLE = "org.eclipse.wst.css.STYLE"; //$NON-NLS-1$ - public final static String[] legalTypes = new String[]{ST_STYLE, StructuredTextPartitioner.ST_DEFAULT_PARTITION}; + + public final static String[] legalTypes = new String[]{ICSSPartitions.STYLE, IStructuredPartitions.DEFAULT_PARTITION}; public StructuredTextPartitionerForCSS() { super(); } public String getDefault() { - return ST_STYLE; + return ICSSPartitions.STYLE; } public String[] getLegalContentTypes() {
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java new file mode 100644 index 0000000..2a8d8e9 --- /dev/null +++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/text/ICSSPartitions.java
@@ -0,0 +1,17 @@ +package org.eclipse.wst.css.core.text; + +import org.eclipse.wst.sse.core.text.IStructuredPartitions; + +/** + * This interface is not intended to be implemented. + * It defines the partitioning for CSS and all its partitions. + * Clients should reference the partition type Strings defined here directly. + * + * @since 1.0 + */ +public interface ICSSPartitions extends IStructuredPartitions { + + String CSS_PARTITIONING = IStructuredPartitions.STRUCTURED_PARTITIONING; + + String STYLE = "org.eclipse.wst.css.STYLE"; //$NON-NLS-1$ +}
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/ActionContributorCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/ActionContributorCSS.java index 9ac7e57..d6b8629 100644 --- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/ActionContributorCSS.java +++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/ActionContributorCSS.java
@@ -19,10 +19,10 @@ import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; import org.eclipse.ui.texteditor.RetargetTextEditorAction; -import org.eclipse.wst.sse.ui.edit.util.ActionContributor; -import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.ActionContributor; +import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; /** * ActionContributorCSS
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextEditorCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextEditorCSS.java index b111b02..57dee1d 100644 --- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextEditorCSS.java +++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextEditorCSS.java
@@ -15,9 +15,9 @@ import org.eclipse.wst.css.ui.internal.selection.StructureSelectNextCSSAction; import org.eclipse.wst.css.ui.internal.selection.StructureSelectPreviousCSSAction; import org.eclipse.wst.sse.ui.StructuredTextEditor; -import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.selection.SelectionHistory; import org.eclipse.wst.sse.ui.internal.selection.StructureSelectHistoryAction;
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java index 84443af..992ae9f 100644 --- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java +++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/StructuredTextViewerConfigurationCSS.java
@@ -20,12 +20,12 @@ import org.eclipse.jface.text.formatter.MultiPassContentFormatter; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.wst.css.core.format.FormatProcessorCSS; -import org.eclipse.wst.css.core.internal.text.rules.StructuredTextPartitionerForCSS; +import org.eclipse.wst.css.core.text.ICSSPartitions; import org.eclipse.wst.css.ui.autoedit.StructuredAutoEditStrategyCSS; import org.eclipse.wst.css.ui.contentassist.CSSContentAssistProcessor; import org.eclipse.wst.css.ui.style.LineStyleProviderForCSS; import org.eclipse.wst.css.ui.taginfo.CSSBestMatchHoverProcessor; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration; import org.eclipse.wst.sse.ui.format.StructuredFormattingStrategy; import org.eclipse.wst.sse.ui.style.IHighlighter; @@ -47,7 +47,7 @@ allStrategies.add(superStrategies[i]); } - if (contentType == StructuredTextPartitionerForCSS.ST_STYLE) { + if (contentType == ICSSPartitions.STYLE) { allStrategies.add(new StructuredAutoEditStrategyCSS()); } @@ -56,7 +56,7 @@ public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { if (configuredContentTypes == null) { - configuredContentTypes = new String[]{StructuredTextPartitionerForCSS.ST_STYLE, StructuredTextPartitioner.ST_DEFAULT_PARTITION, StructuredTextPartitioner.ST_UNKNOWN_PARTITION}; + configuredContentTypes = new String[]{ICSSPartitions.STYLE, IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION}; } return configuredContentTypes; } @@ -68,17 +68,17 @@ //((ContentAssistant) // contentAssistant).setContentAssistProcessor(new // CSSContentAssistProcessor(), - // StructuredTextPartitionerForCSS.ST_STYLE); + // ICSSPartitions.STYLE); IContentAssistProcessor cssProcessor = new CSSContentAssistProcessor(); - setContentAssistProcessor((ContentAssistant) contentAssistant, cssProcessor, StructuredTextPartitionerForCSS.ST_STYLE); - setContentAssistProcessor((ContentAssistant) contentAssistant, cssProcessor, StructuredTextPartitioner.ST_UNKNOWN_PARTITION); + setContentAssistProcessor((ContentAssistant) contentAssistant, cssProcessor, ICSSPartitions.STYLE); + setContentAssistProcessor((ContentAssistant) contentAssistant, cssProcessor, IStructuredPartitions.UNKNOWN_PARTITION); } return contentAssistant; } public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { - final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), StructuredTextPartitionerForCSS.ST_STYLE); + final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), ICSSPartitions.STYLE); formatter.setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorCSS())); @@ -89,7 +89,7 @@ IHighlighter highlighter = super.getHighlighter(sourceViewer); if (highlighter != null) { - highlighter.addProvider(StructuredTextPartitionerForCSS.ST_STYLE, new LineStyleProviderForCSS()); + highlighter.addProvider(ICSSPartitions.STYLE, new LineStyleProviderForCSS()); } return highlighter;
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/autoedit/StructuredAutoEditStrategyCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/autoedit/StructuredAutoEditStrategyCSS.java index de3b808..ddb0840 100644 --- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/autoedit/StructuredAutoEditStrategyCSS.java +++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/autoedit/StructuredAutoEditStrategyCSS.java
@@ -19,7 +19,7 @@ import org.eclipse.wst.sse.core.text.IStructuredDocument; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.core.text.ITextRegion; -import org.eclipse.wst.sse.ui.edit.util.BasicAutoEditStrategy; +import org.eclipse.wst.sse.ui.internal.autoedit.BasicAutoEditStrategy; public class StructuredAutoEditStrategyCSS extends BasicAutoEditStrategy { protected IStructuredDocument structuredDocument = null;
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupActionCSS.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupActionCSS.java index b3412c7..6144ade 100644 --- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupActionCSS.java +++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/edit/ui/CleanupActionCSS.java
@@ -15,7 +15,7 @@ import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.css.core.internal.cleanup.CleanupProcessorCSS; import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor; -import org.eclipse.wst.sse.ui.edit.util.CleanupAction; +import org.eclipse.wst.sse.ui.internal.actions.CleanupAction; public class CleanupActionCSS extends CleanupAction { protected IStructuredCleanupProcessor fCleanupProcessor;
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java index 363f525..de584c7 100644 --- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java +++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/encoding/DTDDocumentLoader.java
@@ -14,8 +14,8 @@ import org.eclipse.jface.text.IDocumentPartitioner; import org.eclipse.wst.dtd.core.internal.parser.DTDRegionParser; -import org.eclipse.wst.dtd.core.internal.rules.StructuredTextPartitionerForDTD; import org.eclipse.wst.dtd.core.internal.text.DTDStructuredDocumentReParser; +import org.eclipse.wst.dtd.core.internal.text.StructuredTextPartitionerForDTD; import org.eclipse.wst.sse.core.document.AbstractDocumentLoader; import org.eclipse.wst.sse.core.document.IDocumentCharsetDetector; import org.eclipse.wst.sse.core.document.IEncodedDocument;
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/rules/StructuredTextPartitionerForDTD.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java similarity index 73% rename from bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/rules/StructuredTextPartitionerForDTD.java rename to bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java index c821811..99f5d9c 100644 --- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/rules/StructuredTextPartitionerForDTD.java +++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/internal/text/StructuredTextPartitionerForDTD.java
@@ -10,14 +10,14 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.dtd.core.internal.rules; +package org.eclipse.wst.dtd.core.internal.text; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.dtd.core.text.IDTDPartitions; +import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; public class StructuredTextPartitionerForDTD extends StructuredTextPartitioner { - public static final String ST_DTD_DEFAULT = "org.eclipse.wst.dtd.DEFAULT"; //$NON-NLS-1$ - public StructuredTextPartitionerForDTD() { super(); } @@ -28,7 +28,7 @@ * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#getDefault() */ public String getDefault() { - return ST_DTD_DEFAULT; + return IDTDPartitions.DTD_DEFAULT; } /* @@ -37,6 +37,6 @@ * @see org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner#initLegalContentTypes() */ protected void initLegalContentTypes() { - fSupportedTypes = new String[]{ST_DTD_DEFAULT, ST_UNKNOWN_PARTITION}; + fSupportedTypes = new String[]{IDTDPartitions.DTD_DEFAULT, IStructuredPartitions.UNKNOWN_PARTITION}; } }
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java new file mode 100644 index 0000000..d5e6f45 --- /dev/null +++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/text/IDTDPartitions.java
@@ -0,0 +1,17 @@ +package org.eclipse.wst.dtd.core.text; + +import org.eclipse.wst.sse.core.text.IStructuredPartitions; + +/** + * This interface is not intended to be implemented. + * It defines the partitioning for DTD and all its partitions. + * Clients should reference the partition type Strings defined here directly. + * + * @since 1.0 + */ +public interface IDTDPartitions { + + String DTD_PARTITIONING = IStructuredPartitions.STRUCTURED_PARTITIONING; + + String DTD_DEFAULT = "org.eclipse.wst.dtd.DEFAULT"; //$NON-NLS-1$ +}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java index 5bf13c9..211cb99 100644 --- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java +++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/StructuredTextViewerConfigurationDTD.java
@@ -14,11 +14,11 @@ import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.wst.dtd.core.internal.rules.StructuredTextPartitionerForDTD; +import org.eclipse.wst.dtd.core.text.IDTDPartitions; import org.eclipse.wst.dtd.ui.internal.style.LineStyleProviderForDTD; import org.eclipse.wst.dtd.ui.internal.taginfo.DTDBestMatchHoverProcessor; import org.eclipse.wst.sse.core.text.IStructuredDocument; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration; import org.eclipse.wst.sse.ui.style.IHighlighter; import org.eclipse.wst.sse.ui.style.LineStyleProvider; @@ -40,7 +40,7 @@ */ public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { if (configuredContentTypes == null) { - configuredContentTypes = new String[]{StructuredTextPartitionerForDTD.ST_DTD_DEFAULT, StructuredTextPartitioner.ST_DEFAULT_PARTITION, StructuredTextPartitioner.ST_UNKNOWN_PARTITION}; + configuredContentTypes = new String[]{IDTDPartitions.DTD_DEFAULT, IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION}; } return configuredContentTypes; } @@ -56,9 +56,9 @@ LineStyleProvider dtdProvider = new LineStyleProviderForDTD(); LineStyleProvider noopProvider = new LineStyleProviderForNoOp(); - highlighter.addProvider(StructuredTextPartitionerForDTD.ST_DTD_DEFAULT, dtdProvider); - highlighter.addProvider(StructuredTextPartitioner.ST_DEFAULT_PARTITION, dtdProvider); - highlighter.addProvider(StructuredTextPartitioner.ST_UNKNOWN_PARTITION, noopProvider); + highlighter.addProvider(IDTDPartitions.DTD_DEFAULT, dtdProvider); + highlighter.addProvider(IStructuredPartitions.DEFAULT_PARTITION, dtdProvider); + highlighter.addProvider(IStructuredPartitions.UNKNOWN_PARTITION, noopProvider); highlighter.setDocument((IStructuredDocument) sourceViewer.getDocument());
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java index a337214..29cdf2b 100644 --- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java +++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/editor/ActionContributorDTD.java
@@ -12,7 +12,7 @@ *******************************************************************************/ package org.eclipse.wst.dtd.ui.internal.editor; -import org.eclipse.wst.sse.ui.edit.util.ActionContributor; +import org.eclipse.wst.sse.ui.internal.actions.ActionContributor; /** * XMLEditorActionContributor
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java index 39c7ab0..028dfdd 100644 --- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java +++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/internal/style/LineStyleProviderForDTDSubSet.java
@@ -24,7 +24,7 @@ import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.graphics.RGB; import org.eclipse.wst.dtd.core.contenttype.ContentTypeIdForDTD; -import org.eclipse.wst.dtd.core.internal.rules.StructuredTextPartitionerForDTD; +import org.eclipse.wst.dtd.core.text.IDTDPartitions; import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin; import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.core.StructuredModelManager; @@ -115,7 +115,7 @@ * int, int, java.util.Collection) */ public boolean prepareRegions(ITypedRegion typedRegion, int lineRequestStart, int lineRequestLength, Collection holdResults) { - if (!StructuredTextPartitionerForDTD.ST_DTD_DEFAULT.equals(typedRegion.getType())) { + if (!IDTDPartitions.DTD_DEFAULT.equals(typedRegion.getType())) { // compute an internal DTD model and return linestyles for it ITextRegion dtdContentRegion = null; IStructuredDocumentRegion doctype = getDocument().getRegionAtCharacterOffset(typedRegion.getOffset());
diff --git a/bundles/org.eclipse.wst.html.core/component.xml b/bundles/org.eclipse.wst.html.core/component.xml index 9d2f887..13248e9 100644 --- a/bundles/org.eclipse.wst.html.core/component.xml +++ b/bundles/org.eclipse.wst.html.core/component.xml
@@ -6,4 +6,5 @@ <plugin id="org.eclipse.wst.html.ui" /> <package name="org.eclipse.wst.html.core" /> <package name="org.eclipse.wst.html.core.contenttype" /> + <package name="org.eclipse.wst.html.core.text" /> </component> \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/encoding/HTMLDocumentLoader.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/encoding/HTMLDocumentLoader.java index 8c89a63..71c1185 100644 --- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/encoding/HTMLDocumentLoader.java +++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/encoding/HTMLDocumentLoader.java
@@ -20,7 +20,7 @@ import org.eclipse.wst.html.core.htmlcss.HTMLStyleSelectorAdapterFactory; import org.eclipse.wst.html.core.htmlcss.StyleAdapterFactory; import org.eclipse.wst.html.core.internal.contenttype.EncodingGuesser; -import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML; +import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML; import org.eclipse.wst.html.core.modelquery.ModelQueryAdapterFactoryForHTML; import org.eclipse.wst.sse.core.IAdapterFactory; import org.eclipse.wst.sse.core.INodeNotifier;
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/rules/StructuredTextPartitionerForHTML.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java similarity index 85% rename from bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/rules/StructuredTextPartitionerForHTML.java rename to bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java index ef10396..0e7570a 100644 --- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/rules/StructuredTextPartitionerForHTML.java +++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/text/StructuredTextPartitionerForHTML.java
@@ -8,13 +8,14 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.wst.html.core.internal.text.rules; +package org.eclipse.wst.html.core.internal.text; import java.util.Locale; import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.wst.css.core.internal.text.rules.StructuredTextPartitionerForCSS; +import org.eclipse.wst.css.core.text.ICSSPartitions; import org.eclipse.wst.html.core.HTML40Namespace; +import org.eclipse.wst.html.core.text.IHTMLPartitions; import org.eclipse.wst.sse.core.internal.parser.ForeignRegion; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.core.text.IStructuredTextPartitioner; @@ -23,8 +24,8 @@ import org.eclipse.wst.sse.core.text.StructuredTypedRegion; import org.eclipse.wst.sse.core.util.ScriptLanguageKeys; import org.eclipse.wst.sse.core.util.StringUtils; +import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML; import org.eclipse.wst.xml.core.parser.XMLRegionContext; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; /** * Document partitioner for HTML. Client-side scripts of type JavaScript are @@ -33,16 +34,11 @@ */ public class StructuredTextPartitionerForHTML extends StructuredTextPartitionerForXML implements IStructuredTextPartitioner { - public final static String ST_DEFAULT_HTML = "org.eclipse.wst.html.DEFAULT_HTML"; //$NON-NLS-1$ - public final static String ST_HTML_DECLARATION = "org.eclipse.wst.html.HTML_DECLARATION"; //$NON-NLS-1$ - public final static String ST_HTML_COMMENT = "org.eclipse.wst.html.HTML_COMMENT"; //$NON-NLS-1$ - public final static String ST_SCRIPT = "org.eclipse.wst.html.SCRIPT"; //$NON-NLS-1$ - private final static String[] configuredContentTypes = new String[]{ST_DEFAULT_HTML, ST_HTML_DECLARATION, ST_HTML_COMMENT, ST_SCRIPT, StructuredTextPartitionerForCSS.ST_STYLE}; + private final static String[] configuredContentTypes = new String[]{IHTMLPartitions.HTML_DEFAULT, IHTMLPartitions.HTML_DECLARATION, IHTMLPartitions.HTML_COMMENT, IHTMLPartitions.SCRIPT, ICSSPartitions.STYLE}; public static final String JAVASCRIPT = "javascript"; //$NON-NLS-1$ public static final String JAVASCRIPT_APPLICATION = "application/x-javascript"; //$NON-NLS-1$ - /** * Constructor for JSPDocumentPartioner. */ @@ -51,7 +47,7 @@ } public StructuredTypedRegion createPartition(int offset, int length, String type) { - if (type == ST_SCRIPT) { + if (type == IHTMLPartitions.SCRIPT) { IStructuredDocumentRegion node = structuredDocument.getRegionAtCharacterOffset(offset); if (node != null) { String stype = getScriptingPartitionType(node); @@ -67,7 +63,7 @@ */ protected void setInternalPartition(int offset, int length, String type) { String localType = type; - if (type == ST_SCRIPT) { + if (type == IHTMLPartitions.SCRIPT) { IStructuredDocumentRegion node = structuredDocument.getRegionAtCharacterOffset(offset); if (node != null) { localType = getScriptingPartitionType(node); @@ -79,7 +75,7 @@ private String getScriptingPartitionType(IStructuredDocumentRegion coreNode) { String language = null; String type = null; - String result = ST_SCRIPT; + String result = IHTMLPartitions.SCRIPT; IStructuredDocumentRegion node = coreNode; ITextRegion attrNameRegion = null; while (node != null && isValidScriptingRegionType(node.getType())) { @@ -127,15 +123,15 @@ private String lookupScriptType(String type) { for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS.length; i++) if (ScriptLanguageKeys.JAVASCRIPT_MIME_TYPE_KEYS[i].equalsIgnoreCase(type)) - return ST_SCRIPT; - return ST_SCRIPT + ".type." + type.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$ + return IHTMLPartitions.SCRIPT; + return IHTMLPartitions.SCRIPT + ".type." + type.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$ } private String lookupScriptLanguage(String language) { for (int i = 0; i < ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS.length; i++) if (ScriptLanguageKeys.JAVASCRIPT_LANGUAGE_KEYS[i].equalsIgnoreCase(language)) - return ST_SCRIPT; - return ST_SCRIPT + ".language." + language.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$ + return IHTMLPartitions.SCRIPT; + return IHTMLPartitions.SCRIPT + ".language." + language.toUpperCase(Locale.ENGLISH); //$NON-NLS-1$ } /** @@ -144,9 +140,9 @@ public String getPartitionType(ITextRegion region, int offset) { String result = null; if (region.getType() == XMLRegionContext.XML_COMMENT_TEXT || region.getType() == XMLRegionContext.XML_COMMENT_OPEN) - result = ST_HTML_COMMENT; + result = IHTMLPartitions.HTML_COMMENT; else if (region.getType() == XMLRegionContext.XML_DOCTYPE_DECLARATION || region.getType() == XMLRegionContext.XML_DECLARATION_OPEN) - result = ST_HTML_DECLARATION; + result = IHTMLPartitions.HTML_DECLARATION; else result = super.getPartitionType(region, offset); return result; @@ -163,7 +159,7 @@ // return ST_SCRIPT; return getScriptingPartitionType(structuredDocument.getRegionAtCharacterOffset(previousNode.getStartOffset(previousStartTagNameRegion))); else if (name1.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE) && name2.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) - return StructuredTextPartitionerForCSS.ST_STYLE; + return ICSSPartitions.STYLE; return super.getPartitionTypeBetween(previousNode, previousStartTagNameRegion, nextNode, nextEndTagNameRegion); } @@ -177,9 +173,9 @@ result = getUnknown(); } else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.SCRIPT)) - result = ST_SCRIPT; + result = IHTMLPartitions.SCRIPT; else if (tagname.equalsIgnoreCase(HTML40Namespace.ElementName.STYLE)) - result = StructuredTextPartitionerForCSS.ST_STYLE; + result = ICSSPartitions.STYLE; else result = super.getPartitionType(region, offset); @@ -187,7 +183,7 @@ } public String getDefault() { - return ST_DEFAULT_HTML; + return IHTMLPartitions.HTML_DEFAULT; } public IDocumentPartitioner newInstance() {
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java new file mode 100644 index 0000000..bf44601 --- /dev/null +++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/text/IHTMLPartitions.java
@@ -0,0 +1,21 @@ +package org.eclipse.wst.html.core.text; + +import org.eclipse.wst.sse.core.text.IStructuredPartitions; + +/** + * This interface is not intended to be implemented. + * It defines the partitioning for HTML and all its partitions. + * Clients should reference the partition type Strings defined here directly. + * + * @since 1.0 + */ +public interface IHTMLPartitions { + + String HTML_PARTITIONING = IStructuredPartitions.STRUCTURED_PARTITIONING; + + String HTML_DEFAULT = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$ + String HTML_DECLARATION = "org.eclipse.wst.html.HTML_DECLARATION"; //$NON-NLS-1$ + String HTML_COMMENT = "org.eclipse.wst.html.HTML_COMMENT"; //$NON-NLS-1$ + + String SCRIPT = "org.eclipse.wst.html.SCRIPT"; //$NON-NLS-1$ +}
diff --git a/bundles/org.eclipse.wst.html.ui/plugin.xml b/bundles/org.eclipse.wst.html.ui/plugin.xml index 17363f0..4ac53c3 100644 --- a/bundles/org.eclipse.wst.html.ui/plugin.xml +++ b/bundles/org.eclipse.wst.html.ui/plugin.xml
@@ -372,21 +372,21 @@ <!--======================================================================================--> <extension - point="org.eclipse.wst.sse.ui.reconcileValidator"> + point="org.eclipse.wst.sse.ui.sourcevalidation"> <validator scope="total" class="org.eclipse.wst.html.validation.HTMLValidator" - id="org.eclipse.wst.html.htmlreconcilevalidator"> + id="org.eclipse.wst.html.htmlsourcevalidator"> <contentTypeIdentifier id="org.eclipse.wst.html.core.htmlsource"> <partitionType - id="org.eclipse.wst.html.DEFAULT_HTML"> + id="org.eclipse.wst.html.HTML_DEFAULT"> </partitionType> </contentTypeIdentifier> <contentTypeIdentifier id="org.eclipse.jst.jsp.core.jspsource"> <partitionType - id="org.eclipse.wst.html.DEFAULT_HTML"> + id="org.eclipse.wst.html.HTML_DEFAULT"> </partitionType> </contentTypeIdentifier> </validator>
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java index 23e5266..be34187 100644 --- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java +++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java
@@ -17,9 +17,9 @@ import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds; import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesAction; import org.eclipse.wst.sse.ui.StructuredTextEditor; -import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionProvider; import org.eclipse.wst.xml.ui.actions.AddBlockCommentActionXML; import org.eclipse.wst.xml.ui.actions.RemoveBlockCommentActionXML;
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java index 1f41df3..04bda79 100644 --- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java +++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
@@ -35,11 +35,12 @@ import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.wst.css.core.internal.text.rules.StructuredTextPartitionerForCSS; +import org.eclipse.wst.css.core.text.ICSSPartitions; import org.eclipse.wst.css.ui.contentassist.CSSContentAssistProcessor; import org.eclipse.wst.css.ui.style.LineStyleProviderForEmbeddedCSS; import org.eclipse.wst.html.core.format.HTMLFormatProcessorImpl; -import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML; +import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML; +import org.eclipse.wst.html.core.text.IHTMLPartitions; import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor; import org.eclipse.wst.html.ui.internal.contentassist.NoRegionContentAssistProcessorForHTML; import org.eclipse.wst.html.ui.internal.hyperlink.URIHyperlinkDetector; @@ -54,7 +55,7 @@ import org.eclipse.wst.javascript.common.ui.internal.taginfo.JavaScriptTagInfoHoverProcessor; import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.core.StructuredModelManager; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; import org.eclipse.wst.sse.ui.StructuredTextEditor; import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration; import org.eclipse.wst.sse.ui.format.StructuredFormattingStrategy; @@ -66,7 +67,8 @@ import org.eclipse.wst.sse.ui.taginfo.ProblemAnnotationHoverProcessor; import org.eclipse.wst.sse.ui.taginfo.TextHoverManager; import org.eclipse.wst.sse.ui.util.EditorUtility; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.text.IXMLPartitions; import org.eclipse.wst.xml.ui.doubleclick.XMLDoubleClickStrategy; import org.eclipse.wst.xml.ui.internal.autoedit.StructuredAutoEditStrategyXML; import org.eclipse.wst.xml.ui.internal.correction.CorrectionProcessorXML; @@ -98,7 +100,7 @@ allStrategies.add(superStrategies[i]); } - if (contentType == StructuredTextPartitionerForHTML.ST_DEFAULT_HTML || contentType == StructuredTextPartitionerForHTML.ST_HTML_DECLARATION) { + if (contentType == IHTMLPartitions.HTML_DEFAULT || contentType == IHTMLPartitions.HTML_DECLARATION) { allStrategies.add(new StructuredAutoEditStrategyXML()); } @@ -111,8 +113,8 @@ String[] htmlTypes = StructuredTextPartitionerForHTML.getConfiguredContentTypes(); configuredContentTypes = new String[2 + xmlTypes.length + htmlTypes.length]; - configuredContentTypes[0] = StructuredTextPartitioner.ST_DEFAULT_PARTITION; - configuredContentTypes[1] = StructuredTextPartitioner.ST_UNKNOWN_PARTITION; + configuredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION; + configuredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION; int index = 0; System.arraycopy(xmlTypes, 0, configuredContentTypes, index += 2, xmlTypes.length); @@ -134,24 +136,24 @@ IContentAssistProcessor noRegionProcessorForHTML = new NoRegionContentAssistProcessorForHTML(); // HTML - setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML); - setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, StructuredTextPartitionerForHTML.ST_HTML_COMMENT); + setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, IHTMLPartitions.HTML_DEFAULT); + setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, IHTMLPartitions.HTML_COMMENT); // JavaScript - setContentAssistProcessor(contentAssistant, jsContentAssistProcessor, StructuredTextPartitionerForHTML.ST_SCRIPT); + setContentAssistProcessor(contentAssistant, jsContentAssistProcessor, IHTMLPartitions.SCRIPT); // CSS - setContentAssistProcessor(contentAssistant, cssContentAssistProcessor, StructuredTextPartitionerForCSS.ST_STYLE); + setContentAssistProcessor(contentAssistant, cssContentAssistProcessor, ICSSPartitions.STYLE); // unknown - setContentAssistProcessor(contentAssistant, noRegionProcessorForHTML, StructuredTextPartitioner.ST_UNKNOWN_PARTITION); + setContentAssistProcessor(contentAssistant, noRegionProcessorForHTML, IStructuredPartitions.UNKNOWN_PARTITION); } return ca; } public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { - final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), StructuredTextPartitionerForHTML.ST_DEFAULT_HTML); + final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IHTMLPartitions.HTML_DEFAULT); formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl())); @@ -166,12 +168,12 @@ ITextEditor editor = getTextEditor(); if (editor != null) { IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(editor); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_CDATA); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_COMMENT); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_DECLARATION); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_PI); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_DTD_SUBSET); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IHTMLPartitions.HTML_DEFAULT); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_CDATA); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_COMMENT); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DECLARATION); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_PI); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.DTD_SUBSET); } } @@ -179,10 +181,10 @@ } public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) { - if (contentType.compareTo(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML) == 0) + if (contentType.compareTo(IHTMLPartitions.HTML_DEFAULT) == 0) // HTML return new XMLDoubleClickStrategy(); - else if (contentType.compareTo(StructuredTextPartitionerForHTML.ST_SCRIPT) == 0) + else if (contentType.compareTo(IHTMLPartitions.SCRIPT) == 0) // JavaScript return getJavaSourceViewerConfiguration(sourceViewer).getDoubleClickStrategy(sourceViewer, contentType); else @@ -195,17 +197,17 @@ if (highlighter != null) { // HTML LineStyleProvider htmlLineStyleProvider = new LineStyleProviderForHTML(); - highlighter.addProvider(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, htmlLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForHTML.ST_HTML_COMMENT, htmlLineStyleProvider); - highlighter.addProvider(StructuredTextPartitionerForHTML.ST_HTML_DECLARATION, htmlLineStyleProvider); + highlighter.addProvider(IHTMLPartitions.HTML_DEFAULT, htmlLineStyleProvider); + highlighter.addProvider(IHTMLPartitions.HTML_COMMENT, htmlLineStyleProvider); + highlighter.addProvider(IHTMLPartitions.HTML_DECLARATION, htmlLineStyleProvider); // JavaScript LineStyleProvider jsLineStyleProvider = new LineStyleProviderForJavaScript(); - highlighter.addProvider(StructuredTextPartitionerForHTML.ST_SCRIPT, jsLineStyleProvider); + highlighter.addProvider(IHTMLPartitions.SCRIPT, jsLineStyleProvider); // CSS LineStyleProvider cssLineStyleProvider = new LineStyleProviderForEmbeddedCSS(); - highlighter.addProvider(StructuredTextPartitionerForCSS.ST_STYLE, cssLineStyleProvider); + highlighter.addProvider(ICSSPartitions.STYLE, cssLineStyleProvider); } return highlighter; @@ -239,11 +241,11 @@ // HTML IInformationProvider htmlInformationProvider = new HTMLInformationProvider(); - fInformationPresenter.setInformationProvider(htmlInformationProvider, StructuredTextPartitionerForHTML.ST_DEFAULT_HTML); + fInformationPresenter.setInformationProvider(htmlInformationProvider, IHTMLPartitions.HTML_DEFAULT); // JavaScript IInformationProvider javascriptInformationProvider = new JavaScriptInformationProvider(); - fInformationPresenter.setInformationProvider(javascriptInformationProvider, StructuredTextPartitionerForHTML.ST_SCRIPT); + fInformationPresenter.setInformationProvider(javascriptInformationProvider, IHTMLPartitions.SCRIPT); fInformationPresenter.setSizeConstraints(60, 10, true, true); } @@ -292,8 +294,8 @@ IReconcilingStrategy markupStrategy = new StructuredTextReconcilingStrategyForMarkup((ITextEditor) editorPart); - fReconciler.setReconcilingStrategy(markupStrategy, StructuredTextPartitioner.ST_DEFAULT_PARTITION); - fReconciler.setReconcilingStrategy(markupStrategy, StructuredTextPartitionerForXML.ST_DEFAULT_XML); + fReconciler.setReconcilingStrategy(markupStrategy, IStructuredPartitions.DEFAULT_PARTITION); + fReconciler.setReconcilingStrategy(markupStrategy, IXMLPartitions.XML_DEFAULT); fReconciler.setDefaultStrategy(markupStrategy); @@ -318,7 +320,7 @@ String hoverType = hoverDescs[i].getId(); if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) { // treat specially if it's JavaScript, HTML otherwise - if (contentType.equals(StructuredTextPartitionerForHTML.ST_SCRIPT)) { + if (contentType.equals(IHTMLPartitions.SCRIPT)) { hover = new JavaScriptBestMatchHoverProcessor(); } else { @@ -333,7 +335,7 @@ } else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType)) { // treat specially if it's JavaScript, HTML otherwise - if (contentType.equals(StructuredTextPartitionerForHTML.ST_SCRIPT)) { + if (contentType.equals(IHTMLPartitions.SCRIPT)) { hover = new JavaScriptTagInfoHoverProcessor(); } else {
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupActionHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupActionHTML.java index 6ce9638..66f04e0 100644 --- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupActionHTML.java +++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/edit/ui/CleanupActionHTML.java
@@ -17,7 +17,7 @@ import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.html.core.internal.cleanup.HTMLCleanupProcessorImpl; import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor; -import org.eclipse.wst.sse.ui.edit.util.CleanupAction; +import org.eclipse.wst.sse.ui.internal.actions.CleanupAction; public class CleanupActionHTML extends CleanupAction { protected IStructuredCleanupProcessor fCleanupProcessor;
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java index 8056679..94e903f 100644 --- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java +++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
@@ -17,7 +17,7 @@ import org.eclipse.jface.text.templates.TemplateProposal; import org.eclipse.swt.graphics.Image; import org.eclipse.wst.sse.core.util.StringUtils; -import org.eclipse.wst.sse.ui.contentassist.IRelevanceCompletionProposal; +import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal; /** * Purpose of this class is to make the additional proposal info into content
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java index 6486970..1c1652a 100644 --- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java +++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
@@ -11,9 +11,9 @@ package org.eclipse.wst.html.ui.internal.contentassist; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.wst.css.core.internal.text.rules.StructuredTextPartitionerForCSS; +import org.eclipse.wst.css.core.text.ICSSPartitions; import org.eclipse.wst.css.ui.contentassist.CSSContentAssistProcessor; -import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML; +import org.eclipse.wst.html.core.text.IHTMLPartitions; import org.eclipse.wst.javascript.common.ui.internal.contentassist.JavaScriptContentAssistProcessor; import org.eclipse.wst.xml.ui.contentassist.NoRegionContentAssistProcessor; @@ -28,13 +28,13 @@ protected void initPartitionToProcessorMap() { super.initPartitionToProcessorMap(); IContentAssistProcessor htmlProcessor = new HTMLContentAssistProcessor(); - fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, htmlProcessor); - fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_HTML_COMMENT, htmlProcessor); + fPartitionToProcessorMap.put(IHTMLPartitions.HTML_DEFAULT, htmlProcessor); + fPartitionToProcessorMap.put(IHTMLPartitions.HTML_COMMENT, htmlProcessor); IContentAssistProcessor jsContentAssistProcessor = new JavaScriptContentAssistProcessor(); - fPartitionToProcessorMap.put(StructuredTextPartitionerForHTML.ST_SCRIPT, jsContentAssistProcessor); + fPartitionToProcessorMap.put(IHTMLPartitions.SCRIPT, jsContentAssistProcessor); IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor(); - fPartitionToProcessorMap.put(StructuredTextPartitionerForCSS.ST_STYLE, cssContentAssistProcessor); + fPartitionToProcessorMap.put(ICSSPartitions.STYLE, cssContentAssistProcessor); } } \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java index 5790f76..c30659d 100644 --- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java +++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java
@@ -13,10 +13,10 @@ import java.util.ResourceBundle; import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.wst.html.core.internal.text.rules.StructuredTextPartitionerForHTML; +import org.eclipse.wst.html.core.text.IHTMLPartitions; import org.eclipse.wst.sse.ui.internal.search.BasicFindOccurrencesAction; import org.eclipse.wst.xml.core.parser.XMLRegionContext; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.text.IXMLPartitions; /** @@ -35,7 +35,7 @@ */ public String[] getPartitionTypes() { - return new String[]{StructuredTextPartitionerForHTML.ST_DEFAULT_HTML, StructuredTextPartitionerForXML.ST_DEFAULT_XML}; + return new String[]{IHTMLPartitions.HTML_DEFAULT, IXMLPartitions.XML_DEFAULT}; } /**
diff --git a/bundles/org.eclipse.wst.sse.core/component.xml b/bundles/org.eclipse.wst.sse.core/component.xml index 17c0b84..6c210bf 100644 --- a/bundles/org.eclipse.wst.sse.core/component.xml +++ b/bundles/org.eclipse.wst.sse.core/component.xml
@@ -19,6 +19,7 @@ <!-- investigate --> + <!-- phil --> <!-- <package name="org.eclipse.wst.sse.core.format" /> --> <package name="org.eclipse.wst.sse.core.preferences" /> <!-- exclude pref. change listener--> @@ -32,9 +33,7 @@ <package name="org.eclipse.wst.sse.ui" /> <!-- phil--> - <package name="org.eclipse.wst.sse.ui.contentassist" /> -<!-- phil--> - <package name="org.eclipse.wst.sse.ui.edit"/> + <package name="org.eclipse.wst.sse.ui.edit.util"/> <!-- phil--> <package name="org.eclipse.wst.sse.ui.format"/>
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/AbstractModelLoader.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/AbstractModelLoader.java index 508f487..bbee77c 100644 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/AbstractModelLoader.java +++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/AbstractModelLoader.java
@@ -28,6 +28,7 @@ import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento; import org.eclipse.wst.sse.core.internal.encoding.EncodingRule; import org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument; +import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner; import org.eclipse.wst.sse.core.parser.BlockMarker; import org.eclipse.wst.sse.core.parser.BlockTagParser; import org.eclipse.wst.sse.core.parser.RegionParser; @@ -36,7 +37,6 @@ import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionParser; import org.eclipse.wst.sse.core.parser.StructuredDocumentRegionParserExtension; import org.eclipse.wst.sse.core.text.IStructuredDocument; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; import org.eclipse.wst.sse.core.util.Assert;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java index 10abca3..83039da 100644 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java +++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
@@ -59,13 +59,13 @@ import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException; import org.eclipse.wst.sse.core.internal.Logger; import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento; +import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner; import org.eclipse.wst.sse.core.internal.undo.StructuredTextUndoManager; import org.eclipse.wst.sse.core.parser.RegionParser; import org.eclipse.wst.sse.core.text.IStructuredDocument; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegionList; import org.eclipse.wst.sse.core.text.IStructuredTextReParser; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; import org.eclipse.wst.sse.core.undo.IStructuredTextUndoManager; import org.eclipse.wst.sse.core.util.Assert; import org.eclipse.wst.sse.core.util.Debug;
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/rules/StructuredTextPartitioner.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java similarity index 96% rename from bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/rules/StructuredTextPartitioner.java rename to bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java index 9935668..703c04b 100644 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/rules/StructuredTextPartitioner.java +++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/rules/StructuredTextPartitioner.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.core.text.rules; +package org.eclipse.wst.sse.core.internal.text.rules; @@ -27,6 +27,7 @@ import org.eclipse.wst.sse.core.parser.IBlockedStructuredDocumentRegion; import org.eclipse.wst.sse.core.text.IStructuredDocument; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; import org.eclipse.wst.sse.core.text.ITextRegion; import org.eclipse.wst.sse.core.text.ITextRegionContainer; import org.eclipse.wst.sse.core.text.ITextRegionList; @@ -56,11 +57,11 @@ } } - public final static String ST_DEFAULT_PARTITION = "org.eclipse.wst.sse.ST_DEFAULT"; //$NON-NLS-1$ - public final static String ST_UNKNOWN_PARTITION = "org.eclipse.wst.sse.UNKNOWN_PARTITION_TYPE"; //$NON-NLS-1$ + //public final static String ST_DEFAULT_PARTITION = IStructuredPartitions.ST_DEFAULT_PARTITION; //$NON-NLS-1$ + //public final static String ST_UNKNOWN_PARTITION = IStructuredPartitions.ST_UNKNOWN_PARTITION; //$NON-NLS-1$ private CachedComputedPartitions cachedPartitions = new CachedComputedPartitions(-1, -1, null); protected String[] fSupportedTypes = null; - protected StructuredTypedRegion internalReusedTempInstance = new SimpleStructuredTypedRegion(0, 0, ST_DEFAULT_PARTITION); + protected StructuredTypedRegion internalReusedTempInstance = new SimpleStructuredTypedRegion(0, 0, IStructuredPartitions.DEFAULT_PARTITION); protected IStructuredDocument structuredDocument; /** @@ -77,7 +78,7 @@ * Note: this shouldn't be called dirctly by clients, unless they control * the threading that includes modifications to the document. Otherwise * the document could be modified while partitions are being computed. We - * advise that clients use the computePartions API directly from the + * advise that clients use the computePartitions API directly from the * document, so they won't have to worry about that. * * @param offset @@ -269,7 +270,7 @@ */ public String getDefault() { - return ST_DEFAULT_PARTITION; + return IStructuredPartitions.DEFAULT_PARTITION; } /** @@ -479,14 +480,14 @@ * about are attempt to partition */ protected String getUnknown() { - return ST_UNKNOWN_PARTITION; + return IStructuredPartitions.UNKNOWN_PARTITION; } /** * to be abstract eventually */ protected void initLegalContentTypes() { - fSupportedTypes = new String[]{ST_DEFAULT_PARTITION, ST_UNKNOWN_PARTITION}; + fSupportedTypes = new String[]{IStructuredPartitions.DEFAULT_PARTITION, IStructuredPartitions.UNKNOWN_PARTITION}; } /**
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java new file mode 100644 index 0000000..b1e761c --- /dev/null +++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredPartitions.java
@@ -0,0 +1,16 @@ +package org.eclipse.wst.sse.core.text; + +/** + * This interface is not intended to be implemented. + * It defines the partitioning for StructuredDocuments. + * Clients should reference the partition type Strings defined here directly. + * + * @since 1.0 + */ +public interface IStructuredPartitions { + + String STRUCTURED_PARTITIONING = "org.eclipse.wst.sse.PARTITIONING"; //$NON-NLS-1$ + + String DEFAULT_PARTITION = "org.eclipse.wst.sse.ST_DEFAULT"; //$NON-NLS-1$ + String UNKNOWN_PARTITION = "org.eclipse.wst.sse.UNKNOWN_PARTITION_TYPE"; //$NON-NLS-1$ +}
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.properties b/bundles/org.eclipse.wst.sse.ui/plugin.properties index e72f9c3..4cb5819 100644 --- a/bundles/org.eclipse.wst.sse.ui/plugin.properties +++ b/bundles/org.eclipse.wst.sse.ui/plugin.properties
@@ -72,7 +72,7 @@ # Breakpoint_Extension_Point.name=Breakpoint Extension Point SpellCheck_Extension_Point.name=SpellCheck Extension Point -Reconcile_Validator_Extension_Point.name=Reconcile Validator Extension Point +Source_Validation_Extension_Point.name=Reconcile Validator Extension Point Open_On_Extension_Point.name=Open On Extension Point ############################################################################### # The following property keys maybe unused. Commented out on 12/7/2004. Uncomment if needed.
diff --git a/bundles/org.eclipse.wst.sse.ui/plugin.xml b/bundles/org.eclipse.wst.sse.ui/plugin.xml index 1fb3537..09d4191 100644 --- a/bundles/org.eclipse.wst.sse.ui/plugin.xml +++ b/bundles/org.eclipse.wst.sse.ui/plugin.xml
@@ -417,7 +417,7 @@ <editor name="%Standalone_Structured_Source_Editor.name" icon="icons/sourceEditor.gif" - contributorClass="org.eclipse.wst.sse.ui.edit.util.ActionContributor" + contributorClass="org.eclipse.wst.sse.ui.internal.actions.ActionContributor" class="org.eclipse.wst.sse.ui.StructuredTextEditor" symbolicFontName="org.eclipse.wst.sse.ui.textfont" id="org.eclipse.wst.sse.ui.StructuredTextEditor"> @@ -438,7 +438,7 @@ </menu> <action label="%FormatDocument" - class="org.eclipse.wst.sse.ui.edit.util.FormatActionDelegate" + class="org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate" menubarPath="source/sourceGroup" enablesFor="+" id="org.eclipse.wst.sse.ui.actions.ContainerSourceActions.Format"> @@ -457,7 +457,7 @@ </menu> <action label="%FormatDocument" - class="org.eclipse.wst.sse.ui.edit.util.FormatActionDelegate" + class="org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate" menubarPath="source/sourceGroup" enablesFor="+" id="org.eclipse.wst.sse.ui.actions.FileSourceActions.Format"> @@ -508,7 +508,7 @@ <extension-point id="breakpoint" name="%Breakpoint_Extension_Point.name"/> <!-- extension point for spellcheck extension --> <extension-point id="spellcheck" name="%SpellCheck_Extension_Point.name"/> -<!-- extension point for reconcile validation --> +<!-- extension point for source validation --> <!-- interfaces for this extension point can be found in com.ibm.wtp.validation.core --> - <extension-point id="reconcileValidator" name="%Reconcile_Validator_Extension_Point.name" schema="schema/org.eclipse.wst.sse.editor.reconcileValidator.exsd"/> + <extension-point id="sourcevalidation" name="%Source_Validation_Extension_Point.name" schema="schema/org.eclipse.wst.sse.editor.sourcevalidation.exsd"/> </plugin>
diff --git a/bundles/org.eclipse.wst.sse.ui/schema/reconcileValidator.exsd b/bundles/org.eclipse.wst.sse.ui/schema/sourcevalidation.exsd similarity index 82% rename from bundles/org.eclipse.wst.sse.ui/schema/reconcileValidator.exsd rename to bundles/org.eclipse.wst.sse.ui/schema/sourcevalidation.exsd index a22073c..8a976b5 100644 --- a/bundles/org.eclipse.wst.sse.ui/schema/reconcileValidator.exsd +++ b/bundles/org.eclipse.wst.sse.ui/schema/sourcevalidation.exsd
@@ -3,7 +3,7 @@ <schema targetNamespace="org.eclipse.wst.sse.ui"> <annotation> <appInfo> - <meta.schema plugin="org.eclipse.wst.sse.ui" id="reconcileValidator" name="reconcileValidator"/> + <meta.schema plugin="org.eclipse.wst.sse.ui" id="sourcevalidation" name="sourcevalidation"/> </appInfo> <documentation> This extension point is provided to allow clients to contribute a content/partition dependent as-you-type validator for the SSE Editor via extension point. @@ -113,25 +113,24 @@ <meta.section type="examples"/> </appInfo> <documentation> - Example demonstrating how HTMLValidator contributes to as-you-type validation -in the source editor. + Example demonstrating how HTMLValidator contributes to as-you-type validation in the source editor. <extension - point="org.eclipse.wst.sse.ui.extensions.reconcileValidator"> + point="org.eclipse.wst.sse.ui.extensions.sourcevalidation"> <validator scope="total" class="org.eclipse.wst.validation.html.HTMLValidator" - id="org.eclipse.wst.validation.htmlreconcilevalidator"> + id="org.eclipse.wst.validation.htmlsourcevalidator"> <contentTypeIdentifier id="org.eclipse.wst.html.core.htmlsource"> <partitionType - id="org.eclipse.wst.html.DEFAULT_HTML"> + id="org.eclipse.wst.html.HTML_DEFAULT"> </partitionType> </contentTypeIdentifier> <contentTypeIdentifier id="org.eclipse.jst.jsp.core.jspsource"> <partitionType - id="org.eclipse.wst.html.DEFAULT_HTML"> + id="org.eclipse.wst.html.HTML_DEFAULT"> </partitionType> </contentTypeIdentifier> </validator> @@ -144,26 +143,25 @@ <meta.section type="apiInfo"/> </appInfo> <documentation> - Example demonstrating how HTMLValidator contributes to as-you-type validation -in the source editor. + Example demonstrating how HTMLValidator contributes to as-you-type validation in the source editor. <pre> <extension - point="org.eclipse.wst.sse.ui.extensions.reconcileValidator"> + point="org.eclipse.wst.sse.ui.extensions.sourcevalidation"> <validator scope="total" class="org.eclipse.wst.validation.html.HTMLValidator" - id="org.eclipse.wst.validation.htmlreconcilevalidator"> + id="org.eclipse.wst.validation.htmlsourcevalidator"> <contentTypeIdentifier id="org.eclipse.wst.html.core.htmlsource"> <partitionType - id="org.eclipse.wst.html.DEFAULT_HTML"> + id="org.eclipse.wst.html.HTML_DEFAULT"> </partitionType> </contentTypeIdentifier> <contentTypeIdentifier id="org.eclipse.jst.jsp.core.jspsource"> <partitionType - id="org.eclipse.wst.html.DEFAULT_HTML"> + id="org.eclipse.wst.html.HTML_DEFAULT"> </partitionType> </contentTypeIdentifier> </validator> @@ -176,7 +174,7 @@ <ul> <li> <b>point</b> - - org.eclipse.wst.sse.ui.extensions.reconcileValidator + - org.eclipse.wst.sse.ui.extensions.sourcevalidation </li> </ul> </li> @@ -213,6 +211,14 @@ <li><b>id</b> - the id of a PartitionType <code>org.eclipse.jface.text.ITypedRegion#getType()</code> on which this as-you-type IValidator can operate. + These partition type definitions may be found in: + + <code>org.eclipse.wst.sse.core.text.IStructuredPartitions</code> + <code>org.eclipse.wst.xml.core.text.IXMLPartitions</code> + <code>org.eclipse.wst.html.core.text.IHTMLPartitions</code> + <code>org.eclipse.jst.jsp.core.text.IJSPPartitions</code> + <code>org.eclipse.wst.dtd.core.text.IDTDPartitions</code> + <code>org.eclipse.wst.css.core.text.ICSSPartitions</code> </li> </ul> </li>
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java index ab388cb..30375f1 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
@@ -130,8 +130,6 @@ import org.eclipse.wst.sse.core.text.ITextRegion; import org.eclipse.wst.sse.core.undo.IStructuredTextUndoManager; import org.eclipse.wst.sse.core.util.StringUtils; -import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.extension.ExtendedConfigurationBuilder; import org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder; import org.eclipse.wst.sse.ui.extension.ExtendedEditorDropTargetAdapter; @@ -147,6 +145,8 @@ import org.eclipse.wst.sse.ui.internal.ReadOnlyAwareDropTargetAdapter; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; import org.eclipse.wst.sse.ui.internal.StorageModelProvider; +import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.debug.BreakpointRulerAction; import org.eclipse.wst.sse.ui.internal.debug.EditBreakpointAction; import org.eclipse.wst.sse.ui.internal.debug.ManageBreakpointAction;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextReconciler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextReconciler.java deleted file mode 100644 index 99dee64..0000000 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextReconciler.java +++ /dev/null
@@ -1,890 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.ui; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.jface.text.ITextInputListener; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.ITypedRegion; -import org.eclipse.jface.text.TextUtilities; -import org.eclipse.jface.text.reconciler.DirtyRegion; -import org.eclipse.jface.text.reconciler.IReconcilingStrategy; -import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension; -import org.eclipse.jface.text.reconciler.Reconciler; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.wst.sse.core.IModelLifecycleListener; -import org.eclipse.wst.sse.core.IModelManager; -import org.eclipse.wst.sse.core.IStructuredModel; -import org.eclipse.wst.sse.core.ModelLifecycleEvent; -import org.eclipse.wst.sse.core.StructuredModelManager; -import org.eclipse.wst.sse.core.events.IStructuredDocumentListener; -import org.eclipse.wst.sse.core.events.NewDocumentEvent; -import org.eclipse.wst.sse.core.events.NoChangeEvent; -import org.eclipse.wst.sse.core.events.RegionChangedEvent; -import org.eclipse.wst.sse.core.events.RegionsReplacedEvent; -import org.eclipse.wst.sse.core.events.StructuredDocumentRegionsReplacedEvent; -import org.eclipse.wst.sse.core.text.IStructuredDocument; -import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; -import org.eclipse.wst.sse.core.text.IStructuredDocumentRegionList; -import org.eclipse.wst.sse.ui.internal.Logger; -import org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy; -import org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy; -import org.eclipse.wst.sse.ui.util.Assert; - - -/** - * Reconciler that maps different partitions to different strategies. - * Strategies contain one or more Steps Steps contain code that validates - * dirty regions - * - * Is aware of StructuredDocumentEvents which determine if a reconcile should - * be done or not. On partition change events in the document, all strategies - * are called. - * - * @deprecated - * - * @author pavery - */ -public class StructuredTextReconciler extends Reconciler implements IStructuredDocumentListener, IModelLifecycleListener { - - /** - * Reconclies the entire document when the document in the viewer is - * changed. This happens when the document is initially opened, as well as - * after a save-as. - * - * Also see processPostModelEvent(...) for similar behavior when document - * for the model is changed. - */ - private class SourceTextInputListener implements ITextInputListener { - - public void inputDocumentAboutToBeChanged(IDocument oldInput, IDocument newInput) { - // do nothing - } - - public void inputDocumentChanged(IDocument oldInput, IDocument newInput) { - - // don't bother if reconciler not installed - if (isInstalled()) { - setDocument(newInput); - setDocumentOnAllStrategies(newInput); - setEntireDocumentDirty(newInput); - } - } - } - - /** - * Cancels any running reconcile operations via progress monitor. Ensures - * that strategies are released on close of the editor. - */ - private class SourceWidgetDisposeListener implements DisposeListener { - - public void widgetDisposed(DisposeEvent e) { - - getLocalProgressMonitor().setCanceled(true); - - // release all strategies - if (fDefaultStrategy != null && fDefaultStrategy instanceof IReleasable) { - ((IReleasable) fDefaultStrategy).release(); - fDefaultStrategy = null; - } - if (!fStrategyTypes.isEmpty()) { - Iterator it = fStrategyTypes.iterator(); - IReconcilingStrategy strategy = null; - while (it.hasNext()) { - strategy = getReconcilingStrategy((String) it.next()); - if (strategy instanceof IReleasable) { - ((IReleasable) strategy).release(); - strategy = null; - } - } - } - } - } - - public static final String TRACE_FILTER = "reconciler"; //$NON-NLS-1$ - - /** strategy called for unmapped partitions */ - IReconcilingStrategy fDefaultStrategy; - - /** to cancel any long running reconciles if someone closes the editor */ - private SourceWidgetDisposeListener fDisposeListener = null; - - /** - * set true after first install to prevent duplicate work done in the - * install method (since install gets called multiple times) - */ - private boolean fIsInstalled = false; - - /** local queue of dirty regions (created here) to be reconciled */ - private List fLocalDirtyRegionQueue = null; - - /** document that this reconciler works on */ - private IDocument fLocalDocument = null; - - // use our own local for now until we resolve abstract calling it on every - // document change - // resulting in some of our strategies getting cut short and not - // adding/removing annotations correctly - private IProgressMonitor fLocalProgressMonitor = null; - - /** local copy of model manager */ - private IModelManager fModelManager = null; - - /** the list of partition types for which there are strategies */ - List fStrategyTypes = null; - - /** for initital reconcile when document is opened */ - private SourceTextInputListener fTextInputListener = null; - - /** flag set via structured document events */ - private boolean fValidationNeeded = false; - - /** - * the strategy that runs validators contributed via reconcileValidator - * ext point - */ - private ValidatorStrategy fValidatorStrategy; - - /** - * Creates a new StructuredRegionProcessor - */ - public StructuredTextReconciler() { - super(); - configure(); - } - - /** - * This method reduces the dirty region queue to the least common dirty - * region. (the region that overlaps all dirty regions) - * - * @return a condensed DirtyRegion representing all that was in the queue - * at the time this was called, or <code>null</code> if the - * queue is empty - */ - private DirtyRegion compactDirtyRegionQueue() { - - DirtyRegion result = null; - StringBuffer traceInfo = new StringBuffer(); - if (Logger.isTracing(TRACE_FILTER)) - traceInfo.append("[reconciler] COMPACTING STARTING... localDirtyRegionQueue.size():" + fLocalDirtyRegionQueue.size()); //$NON-NLS-1$ - - if (fLocalDirtyRegionQueue.size() == 1) - return (DirtyRegion) fLocalDirtyRegionQueue.remove(0); - - if (!fLocalDirtyRegionQueue.isEmpty()) { - result = formNewDirtyRegion(traceInfo); - } - - return result; - } - - private void configure() { - fStrategyTypes = new ArrayList(); - - // we are always incremental - setIsIncrementalReconciler(true); - setDelay(500); - // setProgressMonitor(new NullProgressMonitor()); - setLocalProgressMonitor(new NullProgressMonitor()); - fDisposeListener = new SourceWidgetDisposeListener(); - fTextInputListener = new SourceTextInputListener(); - fLocalDirtyRegionQueue = new ArrayList(); - } - - private DirtyRegion createDirtyRegion(int offset, int length, String type) { - DirtyRegion durty = null; - IDocument doc = getDocument(); - // safety for BLE - int docLen = doc.getLength(); - if (offset + length > docLen) - length = docLen - offset; - - if (doc != null) { - try { - durty = new DirtyRegion(offset, length, type, doc.get(offset, length)); - } - catch (BadLocationException e) { - e.printStackTrace(); - } - } - return durty; - } - - private DirtyRegion createDirtyRegion(ITypedRegion tr, String type) { - return createDirtyRegion(tr.getOffset(), tr.getLength(), type); - } - - private DirtyRegion formNewDirtyRegion(StringBuffer traceInfo) { - DirtyRegion result; - int min = -1; - int max = -1; - DirtyRegion dr = null; - for (int i = 0; i < fLocalDirtyRegionQueue.size(); i++) { - dr = (DirtyRegion) fLocalDirtyRegionQueue.get(i); - if (dr == null) - continue; - - if (Logger.isTracing(TRACE_FILTER)) - traceInfo.append("\r\n\r\n -> compacting dirty region (" + i + ")" + " start:" + dr.getOffset() + " length:" + dr.getLength()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - - // possibly expand the dirty region start - if (min == -1 || min > dr.getOffset()) - min = dr.getOffset(); - // possibly expand the dirty region end - if (max == -1 || max < dr.getOffset() + dr.getLength()) - max = dr.getOffset() + dr.getLength(); - } - fLocalDirtyRegionQueue.clear(); - result = (min != -1) ? createDirtyRegion(min, max - min, DirtyRegion.INSERT) : null; - - if (Logger.isTracing(TRACE_FILTER)) { - traceInfo.append("\r\n\r\nCOMPACTING DONE... dirtyRangeStart:" + min + " dirtyRangeEnd:" + max + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - Logger.trace(TRACE_FILTER, traceInfo.toString()); - } - return result; - } - - /** - * Gets a strategy that is made to handle the given dirtyRegion. - * - * @param dirtyRegion - * @return a strategy that is made to handle the given dirtyRegion, or the - * default strategy for this reconciler if there isn't one - */ - protected IReconcilingStrategy getAppropriateStrategy(DirtyRegion dirtyRegion) { - String[] partitions = getPartitions(dirtyRegion); - // for now just grab first partition type in dirty region - IReconcilingStrategy rs = null; - if (partitions.length > 0) - rs = getReconcilingStrategy(partitions[0]); - return rs != null ? rs : fDefaultStrategy; - } - - /** - * Gets the default strategy for this reconciler. - * - * @return the default strategy - */ - protected IReconcilingStrategy getDefaultStrategy() { - return fDefaultStrategy; - } - - /** - * We use our own local progress monitor to cancel long running - * strategies/steps. Currently used when widget is disposed (user is - * trying to close the editor), and on uninstall. - * - * @return the local progress monitor - */ - IProgressMonitor getLocalProgressMonitor() { - return fLocalProgressMonitor; - } - - /** - * Avoid excessive calls to Platform.getPlugin(ModelPlugin.ID) - * - * @return sse model manager - */ - protected IModelManager getModelManager() { - if (this.fModelManager == null) - this.fModelManager = StructuredModelManager.getModelManager(); - return this.fModelManager; - } - - /** - * @deprecated - does not use correct partitioning assumes isInstalled() == - * true - * - * @return the document partitioner for the document this reconciler is - * working on. - */ - protected IDocumentPartitioner getPartitioner() { - return getDocument().getDocumentPartitioner(); - } - - /** - * Utility method to get partitions types in a dirty region - * - * @param dirtyRegion - * @return - */ - protected String[] getPartitions(DirtyRegion dirtyRegion) { - ITypedRegion[] partitions = null; - try { - partitions = TextUtilities.computePartitioning(getDocument(), getDocumentPartitioning(), dirtyRegion.getOffset(), dirtyRegion.getLength(), false); - } - catch (BadLocationException e) { - partitions = getPartitioner().computePartitioning(dirtyRegion.getOffset(), dirtyRegion.getLength()); - } - String[] partitionTypes = new String[partitions.length]; - for (int i = 0; i < partitions.length; i++) - partitionTypes[i] = partitions[i].getType(); - return partitionTypes; - } - - /** - * @deprecated - promotes model leakage - * - * Remember to release model after use!! - * - * @return - */ - public IStructuredModel getStructuredModelForRead(IDocument doc) { - IStructuredModel sModel = null; - if (doc != null) - sModel = getModelManager().getExistingModelForRead(doc); - return sModel; - } - - /** - * Get the strategy that runs validators from the reconcileValidator - * extension point. - * - * @param the - * ValidatorStrategy - */ - public ValidatorStrategy getValidatorStrategy() { - return fValidatorStrategy; - } - - - - /** - * @param document - */ - private void hookUpModelLifecycleListener(IDocument document) { - IStructuredModel sModel = getModelManager().getExistingModelForRead(document); - try { - if (sModel != null) { - sModel.addModelLifecycleListener(this); - } - } - finally { - if (sModel != null) - sModel.releaseFromRead(); - } - } - - protected void initialProcess() { - // only happens ONCE on first dirty region in queue (not on doucment - // open) - // not useful to us at the moment - } - - /** - * @see org.eclipse.jface.text.reconciler.IReconciler#install(ITextViewer) - */ - public void install(ITextViewer textViewer) { - // we might be called multiple times with the same viewer, - // maybe after being uninstalled as well, so track separately - if (!isInstalled()) { - - super.install(textViewer); - - textViewer.getTextWidget().addDisposeListener(fDisposeListener); - textViewer.addTextInputListener(fTextInputListener); - - getLocalProgressMonitor().setCanceled(false); - - setInstalled(true); - setValidationNeeded(true); - } - } - - /** - * @param dirtyRegion - * @return - */ - private boolean isEntireDocumentChange(DirtyRegion dirtyRegion) { - return getDocument().getLength() == dirtyRegion.getLength(); - } - - /** - * The viewer has been set on this Reconciler. - * - * @return true if the viewer has been set on this Reconciler, false - * otherwise. - */ - public boolean isInstalled() { - return fIsInstalled; - } - - /** - * @return Returns the needsValidation. - */ - public boolean isValidationNeeded() { - return fValidationNeeded; - } - - public void newModel(NewDocumentEvent structuredDocumentEvent) { - // do nothing - } - - public void noChange(NoChangeEvent structuredDocumentEvent) { - // do nothing - } - - public void nodesReplaced(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) { - Logger.trace(StructuredTextReconciler.TRACE_FILTER, "[trace reconciler] >StructuredRegionProcessor: *NODES REPLACED"); //$NON-NLS-1$ - - // if partition changed, create a full document dirty region - // (causes processAll) - DirtyRegion dr = partitionChanged(structuredDocumentEvent) ? createDirtyRegion(0, getDocument().getLength(), DirtyRegion.INSERT) : createDirtyRegion(structuredDocumentEvent.getOriginalStart(), structuredDocumentEvent.getLength(), DirtyRegion.INSERT); - fLocalDirtyRegionQueue.add(dr); - - setValidationNeeded(true); - } - - /** - * Checks if the StructuredDocumentEvent involved a partition change. If - * there's a partition change, we know we should run all strategies just - * to be sure we cover the new regions and remove obsolete annotations. - * - * A primitive check for now. - * - * @param structuredDocumentEvent - * @return - */ - private boolean partitionChanged(StructuredDocumentRegionsReplacedEvent structuredDocumentEvent) { - boolean changed = false; - - IDocumentPartitioner partitioner = structuredDocumentEvent.getStructuredDocument().getDocumentPartitioner(); - if (partitioner != null) { - IStructuredDocumentRegionList oldNodes = structuredDocumentEvent.getOldStructuredDocumentRegions(); - IStructuredDocumentRegionList newNodes = structuredDocumentEvent.getNewStructuredDocumentRegions(); - - IStructuredDocumentRegion oldNode = (oldNodes.getLength() > 0) ? oldNode = oldNodes.item(0) : null; - IStructuredDocumentRegion newNode = (newNodes.getLength() > 0) ? newNodes.item(0) : null; - - if (oldNode != null && newNode != null) - changed = partitioner.getContentType(oldNode.getStartOffset()).equals(partitioner.getContentType(newNode.getStartOffset())); - } - return changed; - } - - /** - * We keep a local copy of the dirty region queue for compacting. - * - * @see org.eclipse.jface.text.reconciler.AbstractReconciler#process(org.eclipse.jface.text.reconciler.DirtyRegion) - */ - protected void process(DirtyRegion dirtyRegion) { - // this is called from the background thread in AbstractReconciler - // called here so that it only kick off after .5 seconds - // but fNeedsValidation flag is set in structuredDoucmentsEvents below - if (isInstalled()) { - runStrategies(); - } - } - - /** - * Process the entire StructuredDocument. Much more resource intensive - * than simply running a strategy on a dirty region. - */ - protected void processAll() { - if (!isInstalled()) - return; - Logger.trace(StructuredTextReconciler.TRACE_FILTER, "[trace reconciler] >StructuredRegionProcessor: PROCESSING ALL"); //$NON-NLS-1$ - IDocument doc = getDocument(); - DirtyRegion durty = null; - - ITypedRegion tr[] = new ITypedRegion[0]; - try { - tr = TextUtilities.computePartitioning(doc, getDocumentPartitioning(), 0, doc.getLength(), true); - } - catch (BadLocationException e) { - Logger.logException(e); - } - - IReconcilingStrategy s = null; - for (int i = 0; i < tr.length; i++) { - durty = createDirtyRegion(tr[i], DirtyRegion.INSERT); - s = getReconcilingStrategy(tr[i].getType()); - if (s != null) { - if (s instanceof AbstractStructuredTextReconcilingStrategy) - ((AbstractStructuredTextReconcilingStrategy) s).reconcile(durty, durty); - else - s.reconcile(durty, durty); - } - // run validator strategy every time, it figures out if it has - // a - // validator for this partition - // pass in true for "refreshAll" flag = true indicating that - // the - // entire document is being reconciled, only do it once - if (fValidatorStrategy != null) - fValidatorStrategy.reconcile(tr[i], durty); - - } - // we ran the whole doc already now we can reset the strategies - resetStrategies(); - } - - /** - * Process a subsection of the document. - */ - protected void processPartial(DirtyRegion durty) { - if (!isInstalled()) - return; - IDocument doc = getDocument(); - HashSet alreadyRan = new HashSet(); - - ITypedRegion tr[] = new ITypedRegion[0]; - try { - tr = TextUtilities.computePartitioning(doc, getDocumentPartitioning(), 0, doc.getLength(), true); - } - catch (BadLocationException e) { - Logger.logException(e); - } - - IReconcilingStrategy s = null; - for (int i = 0; i < tr.length; i++) { - durty = createDirtyRegion(tr[i], DirtyRegion.INSERT); - // keeping track of already ran might not be the way to do - // it... - if (!alreadyRan.contains(tr[i].getType())) { - alreadyRan.add(tr[i].getType()); - s = getReconcilingStrategy(tr[i].getType()); - if (s != null) - s.reconcile(durty, durty); - } - // run validator strategy every time, it figures out if it has - // a - // validator for this parition - if (fValidatorStrategy != null) - fValidatorStrategy.reconcile(tr[i], durty); - } - - resetStrategies(); - } - - /** - * @see org.eclipse.wst.sse.core.IModelLifecycleListener#processPostModelEvent(org.eclipse.wst.sse.core.ModelLifecycleEvent) - */ - public void processPostModelEvent(ModelLifecycleEvent event) { - - // if underlying StructuredDocument changed, need to reconnect it - // here... - // ex. file is modified outside the workbench - if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) { - - // check that it's this model that changed - IStructuredModel thisModel = getModelManager().getExistingModelForRead(getDocument()); - try { - if (thisModel != null && event.getModel().equals(thisModel)) { - - IStructuredDocument sDoc = event.getModel().getStructuredDocument(); - - if (Logger.isTracing(TRACE_FILTER)) { - System.out.println("======================================================"); //$NON-NLS-1$ - System.out.println("StructuredRegionProcessor: DOCUMENT MODEL CHANGED TO: "); //$NON-NLS-1$ - System.out.println(sDoc.get()); - System.out.println("======================================================"); //$NON-NLS-1$ - } - setDocument(sDoc); - - // propagate document change - setDocumentOnAllStrategies(sDoc); - - // ensure that the document is re-reconciled - setEntireDocumentDirty(sDoc); - } - } - finally { - if (thisModel != null) - thisModel.releaseFromRead(); - } - } - } - - /** - * @see org.eclipse.wst.sse.core.IModelLifecycleListener#processPreModelEvent(org.eclipse.wst.sse.core.ModelLifecycleEvent) - */ - public void processPreModelEvent(ModelLifecycleEvent event) { - - if (event.getType() == ModelLifecycleEvent.MODEL_DOCUMENT_CHANGED) { - - // clear the dirty region queue - fLocalDirtyRegionQueue.clear(); - - // note: old annotations are removed via the strategies on - // AbstractStructuredTextReconcilingStrategy#setDocument(...) - } - } - - /** - * Reinitializes listeners and sets new document onall strategies. - * - * @see org.eclipse.jface.text.reconciler.AbstractReconciler#reconcilerDocumentChanged(IDocument) - */ - protected void reconcilerDocumentChanged(IDocument document) { - - // unhook old lifecycle listner - unhookModelLifecycleListener(fLocalDocument); - - // add new lifecycle listener - hookUpModelLifecycleListener(document); - - if (fLocalDocument != null && fLocalDocument instanceof IStructuredDocument) - ((IStructuredDocument) fLocalDocument).removeDocumentChangedListener(this); - - setDocument(document); - - if (document != null && document instanceof IStructuredDocument) - ((IStructuredDocument) fLocalDocument).addDocumentChangedListener(this); - - setDocumentOnAllStrategies(document); - } - - public void regionChanged(RegionChangedEvent structuredDocumentEvent) { - Logger.trace(StructuredTextReconciler.TRACE_FILTER, "[trace reconciler] >StructuredRegionProcessor: *REGION CHANGED: \r\n\r\n created dirty region from flat model event >> :" + structuredDocumentEvent.getOriginalStart() + ":" + structuredDocumentEvent.getLength() + "\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - - String dirtyRegionType = structuredDocumentEvent.getDeletedText().equals("") ? DirtyRegion.INSERT : DirtyRegion.REMOVE; //$NON-NLS-1$ - DirtyRegion dr = createDirtyRegion(structuredDocumentEvent.getOriginalStart(), structuredDocumentEvent.getLength(), dirtyRegionType); - - fLocalDirtyRegionQueue.add(dr); - - setValidationNeeded(true); - } - - public void regionsReplaced(RegionsReplacedEvent structuredDocumentEvent) { - Logger.trace(StructuredTextReconciler.TRACE_FILTER, "[trace reconciler] >StructuredRegionProcessor: *REGIONS REPLACED: \r\n\r\n created dirty region from flat model event >> :" + structuredDocumentEvent.getOriginalStart() + ":" + structuredDocumentEvent.getLength() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - - DirtyRegion dr = createDirtyRegion(structuredDocumentEvent.getOriginalStart(), structuredDocumentEvent.getLength(), DirtyRegion.INSERT); - fLocalDirtyRegionQueue.add(dr); - - setValidationNeeded(true); - } - - /** - * Resets any flags that were set (eg. flags set during processAll()) - */ - protected void resetStrategies() { -// Iterator it = fStrategyTypes.iterator(); -// String type = null; -// while (it.hasNext()) { -// type = (String) it.next(); -// if (getReconcilingStrategy(type) instanceof AbstractStructuredTextReconcilingStrategy) -// ((AbstractStructuredTextReconcilingStrategy) getReconcilingStrategy(type)).reset(); -// } - } - - /** - * Runs the appropriate strategies on the dirty region queue. The - * reconciler currently handles these reconciling scenarios: - * - * <ul> - * <li>partition change</li> - * <li>routine text edits</li> - * <li>entire document change</li> - * <li>the default strategy</li> - * </ul> - * - */ - private void runStrategies() { - DirtyRegion dirtyRegion = null; - while (fDefaultStrategy != null && isInstalled() && isValidationNeeded()) { - // this flag may be set to true if more dirty regions come in - // while this method is running - setValidationNeeded(false); - Logger.trace(TRACE_FILTER, "start RUNNING STRATEGIES IN RECONCILER"); //$NON-NLS-1$ - dirtyRegion = compactDirtyRegionQueue(); - // will be null if there is nothing in the queue - if (dirtyRegion != null) { - Logger.trace(TRACE_FILTER, "RUNNING with dirty region:" + dirtyRegion.getOffset() + ":" + dirtyRegion.getLength()); //$NON-NLS-1$ //$NON-NLS-2$ - try { - if (isEntireDocumentChange(dirtyRegion)) - processAll(); - else - processPartial(dirtyRegion); - } - catch (Exception e) { - e.printStackTrace(); - } - } - } - } - - /** - * Sets the default reconciling strategy. - * - * @param strategy - */ - public void setDefaultStrategy(IReconcilingStrategy strategy) { - Assert.isNotNull(strategy, "Can't set default strategy to null"); //$NON-NLS-1$ - - fDefaultStrategy = strategy; - fDefaultStrategy.setDocument(getDocument()); - if (fDefaultStrategy instanceof IReconcilingStrategyExtension) - ((IReconcilingStrategyExtension) fDefaultStrategy).setProgressMonitor(getLocalProgressMonitor()); - } - - - public void setDocument(IDocument doc) { - // making sure local document is always up to date - // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3858 - fLocalDocument = doc; - setDocumentOnAllStrategies(doc); - } - - /** - * Propagates a new document to all strategies and steps. - * - * @param document - */ - protected void setDocumentOnAllStrategies(IDocument document) { - if (isInstalled()) { - // default strategies - if (fDefaultStrategy != null) - fDefaultStrategy.setDocument(document); - - // external validator strategy - if (fValidatorStrategy != null) - fValidatorStrategy.setDocument(document); - - // set document on all regular strategies - super.reconcilerDocumentChanged(document); - } - } - - protected void setEntireDocumentDirty(IDocument document) { - - // make the entire document dirty - // this also happens on a "save as" - if (document != null && isInstalled() && fLocalDirtyRegionQueue.size() == 0) { - - // since we're marking the entire doc dirty - fLocalDirtyRegionQueue.clear(); - - DirtyRegion entireDocument = createDirtyRegion(0, document.getLength(), DirtyRegion.INSERT); - fLocalDirtyRegionQueue.add(entireDocument); - - // set this so reconcile won't be "short circuited" - setValidationNeeded(true); - } - } - - /** - * @param isInstalled - * The isInstalled to set. - */ - public void setInstalled(boolean isInstalled) { - fIsInstalled = isInstalled; - } - - private void setLocalProgressMonitor(IProgressMonitor pm) { - fLocalProgressMonitor = pm; - // set on default strategy - if (fDefaultStrategy != null && fDefaultStrategy instanceof IReconcilingStrategyExtension) - ((IReconcilingStrategyExtension) fDefaultStrategy).setProgressMonitor(pm); - // set on all other strategies - if (!fStrategyTypes.isEmpty()) { - Iterator it = fStrategyTypes.iterator(); - String type = null; - while (it.hasNext()) { - type = (String) it.next(); - if (getReconcilingStrategy(type) instanceof IReconcilingStrategyExtension) - ((IReconcilingStrategyExtension) getReconcilingStrategy(type)).setProgressMonitor(pm); - } - } - } - - /** - * Sets the strategy for a given contentType (partitionType) - * - * @see org.eclipse.jface.text.reconciler.Reconciler#setReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy, - * java.lang.String) - */ - public void setReconcilingStrategy(IReconcilingStrategy strategy, String contentType) { - super.setReconcilingStrategy(strategy, contentType); - if (strategy != null) { - strategy.setDocument(fLocalDocument); - if (strategy instanceof IReconcilingStrategyExtension) { - ((IReconcilingStrategyExtension) strategy).setProgressMonitor(getLocalProgressMonitor()); - } - } - fStrategyTypes.add(contentType); - } - - /** - * @param needsValidation - * The needsValidation to set. - */ - public void setValidationNeeded(boolean needsValidation) { - fValidationNeeded = needsValidation; - } - - /** - * Set the strategy that runs validators from the reconcileValidator - * extension point. - * - * @param the - * ValidatorStrategy - */ - public void setValidatorStrategy(ValidatorStrategy strategy) { - fValidatorStrategy = strategy; - if (fValidatorStrategy != null) - fValidatorStrategy.setDocument(getDocument()); - } - - /** - * - * @param document - */ - private void unhookModelLifecycleListener(IDocument document) { - IStructuredModel sModel = getModelManager().getExistingModelForRead(document); - try { - if (sModel != null) { - sModel.removeModelLifecycleListener(this); - } - } - finally { - if (sModel != null) - sModel.releaseFromRead(); - } - } - - /** - * Cleanup listeners. - * - * @see org.eclipse.jface.text.reconciler.IReconciler#uninstall() - */ - public void uninstall() { - setValidationNeeded(false); - if (isInstalled()) { - setInstalled(false); - // getProgressMonitor().setCanceled(true); - getLocalProgressMonitor().setCanceled(true); - - getTextViewer().removeTextInputListener(fTextInputListener); - - super.uninstall(); - } - if (fLocalDocument != null && fLocalDocument instanceof IStructuredDocument) { - // remove structured document listener - ((IStructuredDocument) fLocalDocument).removeDocumentChangedListener(this); - // remove lifecycle listener on the model - unhookModelLifecycleListener(fLocalDocument); - } - setDocument(null); - } -}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java index 080e151..1ed7c2f 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
@@ -38,10 +38,10 @@ import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.sse.core.text.IStructuredDocument; -import org.eclipse.wst.sse.ui.contentassist.IResourceDependentProcessor; import org.eclipse.wst.sse.ui.extension.ExtendedConfigurationBuilder; import org.eclipse.wst.sse.ui.extension.IExtendedConfiguration; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.contentassist.IResourceDependentProcessor; import org.eclipse.wst.sse.ui.internal.editor.HTMLTextPresenter; import org.eclipse.wst.sse.ui.internal.hyperlink.HighlighterHyperlinkPresenter; import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActiveEditorActionHandler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/actions/ActiveEditorActionHandler.java similarity index 99% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActiveEditorActionHandler.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/actions/ActiveEditorActionHandler.java index bcb4062..c2357fe 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActiveEditorActionHandler.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/actions/ActiveEditorActionHandler.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; +package org.eclipse.wst.sse.ui.actions; import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IMenuCreator;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRActionDelegate.java deleted file mode 100644 index ebb2518..0000000 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRActionDelegate.java +++ /dev/null
@@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; - -/** - * @deprecated Eclipse now provides a file conversion action. This will be deleted in M4. - */ -public class ConvertLineDelimitersToCRActionDelegate extends ConvertLineDelimitersToCRLFActionDelegate { - public ConvertLineDelimitersToCRActionDelegate() { - super(); - - setLineDelimiter("\r"); //$NON-NLS-1$ - } -}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRLFActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRLFActionDelegate.java deleted file mode 100644 index daf806c..0000000 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToCRLFActionDelegate.java +++ /dev/null
@@ -1,273 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; - -import java.io.FileOutputStream; -import java.io.IOException; -import java.text.MessageFormat; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.content.IContentDescription; -import org.eclipse.core.runtime.content.IContentType; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.editors.text.TextFileDocumentProvider; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.wst.sse.ui.internal.Logger; -import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; - -/** - * @deprecated Eclipse now provides a file conversion action. This will be deleted in M4. - */ -public class ConvertLineDelimitersToCRLFActionDelegate extends ResourceActionDelegate { - - class ConvertLineDelimitersJob extends Job { - - public ConvertLineDelimitersJob(String name) { - super(name); - } - - /** - * @param container - * @return - */ - private int getResourceCount(IResource[] members) { - int count = 0; - - for (int i = 0; i < members.length; i++) { - if (members[i] instanceof IContainer) { - IContainer container = (IContainer) members[i]; - try { - count += getResourceCount(container.members()); - } catch (CoreException e) { - // skip counting - } - } else - count++; - } - - return count; - } - - /** - * @param elements - * @return - */ - private int getResourceCount(Object[] elements) { - int count = 0; - - for (int i = 0; i < elements.length; i++) { - if (elements[i] instanceof IContainer) { - IContainer container = (IContainer) elements[i]; - try { - count += getResourceCount(container.members()); - } catch (CoreException e) { - // skip counting - } - } else - count++; - } - - return count; - } - - protected IStatus run(IProgressMonitor monitor) { - IStatus status = Status.OK_STATUS; - - Object[] elements = fSelection.toArray(); - int resourceCount = getResourceCount(elements); - monitor.beginTask("", resourceCount); //$NON-NLS-1$ - for (int i = 0; i < elements.length; i++) { - if (elements[i] instanceof IResource) { - process(monitor, (IResource) elements[i]); - monitor.worked(1); - } - } - monitor.done(); - - if (fErrorStatus.getChildren().length > 0) { - status = fErrorStatus; - fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ - } - - return status; - } - - } - - private MultiStatus fErrorStatus = new MultiStatus(SSEUIPlugin.ID, IStatus.ERROR, SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.errorStatusMessage"), null); //$NON-NLS-1$ - protected String fLineDelimiter = "\r\n"; //$NON-NLS-1$ - - protected void convert(IProgressMonitor monitor, IFile file) { - try { - monitor.worked(1); - IContentDescription contentDescription = file.getContentDescription(); - if (contentDescription == null) - return; - - IContentType contentType = contentDescription.getContentType(); - if (contentType.isKindOf(Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.text"))) { //$NON-NLS-1$ - if (monitor == null || !monitor.isCanceled()) { - String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.3"), new String[]{file.getFullPath().toString()}); //$NON-NLS-1$ - monitor.subTask(message); - - IFileEditorInput input = new FileEditorInput(file); - IDocumentProvider documentProvider = new TextFileDocumentProvider(); - documentProvider.connect(new FileEditorInput(file)); - IDocument document = documentProvider.getDocument(new FileEditorInput(file)); - documentProvider.disconnect(input); - - int lineCount = document.getNumberOfLines(); - for (int i = 0; i < lineCount; i++) { - if (!monitor.isCanceled()) { - final String delimiter = document.getLineDelimiter(i); - if (delimiter != null && delimiter.length() > 0 && !delimiter.equals(fLineDelimiter)) { - IRegion region = document.getLineInformation(i); - document.replace(region.getOffset() + region.getLength(), delimiter.length(), fLineDelimiter); - } - } - } - - writeFile(monitor, file, document.get()); - } - } - } catch (CoreException e) { - String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ - fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); - } catch (BadLocationException e) { - String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ - fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); - } - } - - protected void convert(IProgressMonitor monitor, IResource resource) { - if (resource instanceof IFile) { - IFile file = (IFile) resource; - - if (monitor == null || !monitor.isCanceled()) - convert(monitor, file); - } else if (resource instanceof IContainer) { - IContainer container = (IContainer) resource; - - try { - IResource[] members = container.members(); - for (int i = 0; i < members.length; i++) { - if (monitor == null || !monitor.isCanceled()) - convert(monitor, members[i]); - } - } catch (CoreException e) { - String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{resource.getFullPath().toString()}); //$NON-NLS-1$ - fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); - } - } - } - - protected Job getJob() { - return new ConvertLineDelimitersJob(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.jobName")); //$NON-NLS-1$ - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.sse.ui.edit.util.ResourceActionDelegate#process(org.eclipse.core.runtime.IProgressMonitor, - * org.eclipse.core.resources.IResource) - */ - protected void process(IProgressMonitor monitor, IResource resource) { - convert(monitor, resource); - - try { - resource.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - monitor.setTaskName(SSEUIPlugin.getResourceString("%ActionDelegate.0") + resource.getName()); //$NON-NLS-1$ - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.sse.ui.edit.util.ResourceActionDelegate#processorAvailable(org.eclipse.core.resources.IResource) - */ - protected boolean processorAvailable(IResource resource) { - boolean result = false; - try { - if (resource instanceof IFile) { - IFile file = (IFile) resource; - - IContentDescription contentDescription = file.getContentDescription(); - if (contentDescription != null) { - IContentType contentType = contentDescription.getContentType(); - if (contentType.isKindOf(Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.text"))) //$NON-NLS-1$ - return true; - } - } else if (resource instanceof IContainer) { - IContainer container = (IContainer) resource; - - IResource[] members; - members = container.members(); - for (int i = 0; i < members.length; i++) { - boolean available = processorAvailable(members[i]); - - if (available) { - result = true; - break; - } - } - } - } catch (CoreException e) { - Logger.logException(e); - } - - return result; - } - - /** - * @param lineDelimiter - * The fLineDelimiter to set. - */ - public void setLineDelimiter(String lineDelimiter) { - fLineDelimiter = lineDelimiter; - } - - protected void writeFile(IProgressMonitor monitor, IFile file, String outputString) { - FileOutputStream outputStream = null; - try { - outputStream = new FileOutputStream(file.getLocation().toString()); - outputStream.write(outputString.getBytes(file.getCharset())); - } catch (IOException e) { - String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ - fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); - } catch (CoreException e) { - String message = MessageFormat.format(SSEUIPlugin.getResourceString("%ConvertLineDelimitersToCRLFActionDelegate.4"), new String[]{file.getName()}); //$NON-NLS-1$ - fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e)); - } finally { - try { - if (outputStream != null) - outputStream.close(); - } catch (IOException e) { - // do nothing - } - } - } -}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToLFActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToLFActionDelegate.java deleted file mode 100644 index eaaeb75..0000000 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ConvertLineDelimitersToLFActionDelegate.java +++ /dev/null
@@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; - -/** - * @deprecated Eclipse now provides a file conversion action. This will be deleted in M4. - */ -public class ConvertLineDelimitersToLFActionDelegate extends ConvertLineDelimitersToCRLFActionDelegate { - public ConvertLineDelimitersToLFActionDelegate() { - super(); - - setLineDelimiter("\n"); //$NON-NLS-1$ - } -}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionContributor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java similarity index 98% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionContributor.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java index f54e981..43528e1 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionContributor.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionContributor.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; +package org.eclipse.wst.sse.ui.internal.actions; import java.util.ResourceBundle; @@ -42,8 +42,6 @@ import org.eclipse.wst.sse.ui.internal.ui.OffsetStatusLineContributionItem; /** - * XMLEditorActionContributor - * * This class should not be used inside multi page editor's * ActionBarContributor, since cascaded init() call from the * ActionBarContributor will causes exception and it leads to lose whole @@ -52,7 +50,7 @@ * Instead, use SourcePageActionContributor for source page contributor of * multi page editor. * - * Note that this class is still valid for single page editor. + * Note that this class is still valid for single page editor */ public class ActionContributor extends TextEditorActionContributor implements ISourceViewerActionBarContributor, IExtendedContributor {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionDefinitionIds.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java similarity index 97% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionDefinitionIds.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java index 563f27c..b26dae1 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ActionDefinitionIds.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ActionDefinitionIds.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; +package org.eclipse.wst.sse.ui.internal.actions;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/CleanupAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java similarity index 98% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/CleanupAction.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java index 46dc4f1..8e0a4cf 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/CleanupAction.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/CleanupAction.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; +package org.eclipse.wst.sse.ui.internal.actions; import java.util.ResourceBundle;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/FormatActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java similarity index 99% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/FormatActionDelegate.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java index d3831b4..47f8b2a 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/FormatActionDelegate.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/FormatActionDelegate.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; +package org.eclipse.wst.sse.ui.internal.actions; import java.io.IOException;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ResourceActionDelegate.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java similarity index 97% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ResourceActionDelegate.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java index b42a963..3e2686a 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/ResourceActionDelegate.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/ResourceActionDelegate.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; +package org.eclipse.wst.sse.ui.internal.actions; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.jobs.Job;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/StructuredTextEditorActionConstants.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java similarity index 97% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/StructuredTextEditorActionConstants.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java index 3f2bb9f..8d411b1 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/StructuredTextEditorActionConstants.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/actions/StructuredTextEditorActionConstants.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; +package org.eclipse.wst.sse.ui.internal.actions;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/BasicAutoEditStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/autoedit/BasicAutoEditStrategy.java similarity index 95% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/BasicAutoEditStrategy.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/autoedit/BasicAutoEditStrategy.java index 2cd467b..08e9db5 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/edit/util/BasicAutoEditStrategy.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/autoedit/BasicAutoEditStrategy.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.edit.util; +package org.eclipse.wst.sse.ui.internal.autoedit; import org.eclipse.jface.text.IAutoEditStrategy; import org.eclipse.ui.IEditorPart; @@ -25,7 +25,6 @@ * part. * * @return - * @todo Generated comment */ protected Object getActiveTextEditor() { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java index 9e00002..f521084 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CustomCompletionProposal.java
@@ -25,7 +25,6 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.wst.sse.core.util.Debug; -import org.eclipse.wst.sse.ui.contentassist.IRelevanceCompletionProposal; /** * An implementation of ICompletionProposal whose values can be read after
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/IRelevanceCompletionProposal.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java similarity index 94% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/IRelevanceCompletionProposal.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java index 9e18a06..d67b10e 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/IRelevanceCompletionProposal.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IRelevanceCompletionProposal.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.contentassist; +package org.eclipse.wst.sse.ui.internal.contentassist; /**
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/IResourceDependentProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IResourceDependentProcessor.java similarity index 93% rename from bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/IResourceDependentProcessor.java rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IResourceDependentProcessor.java index a1561d0..8e3e212 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/IResourceDependentProcessor.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/IResourceDependentProcessor.java
@@ -10,7 +10,7 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.sse.ui.contentassist; +package org.eclipse.wst.sse.ui.internal.contentassist; import org.eclipse.core.resources.IResource;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java index 44c8768..4fda61f 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/DebugTextEditor.java
@@ -55,7 +55,6 @@ import org.eclipse.ui.texteditor.MarkerRulerAction; import org.eclipse.wst.sse.core.util.StringUtils; import org.eclipse.wst.sse.ui.StructuredResourceMarkerAnnotationModel; -import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds; import org.eclipse.wst.sse.ui.extension.ExtendedConfigurationBuilder; import org.eclipse.wst.sse.ui.extension.ExtendedEditorActionBuilder; import org.eclipse.wst.sse.ui.extension.IExtendedContributor; @@ -64,6 +63,7 @@ import org.eclipse.wst.sse.ui.extensions.breakpoint.IExtendedStorageEditorInput; import org.eclipse.wst.sse.ui.internal.Logger; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds; import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java index d44a44b..31013db 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
@@ -30,7 +30,7 @@ import org.eclipse.jface.text.reconciler.IReconcileStep; import org.eclipse.wst.sse.core.text.IStructuredDocument; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; import org.eclipse.wst.sse.ui.IReleasable; import org.eclipse.wst.sse.ui.internal.Logger; @@ -89,7 +89,7 @@ public ReconcileAnnotationKey createKey(IStructuredDocumentRegion sdRegion, int scope) { ITypedRegion tr = getPartition(sdRegion); - String partitionType = (tr != null) ? tr.getType() : StructuredTextPartitioner.ST_UNKNOWN_PARTITION; + String partitionType = (tr != null) ? tr.getType() : IStructuredPartitions.UNKNOWN_PARTITION; return createKey(partitionType, scope); } @@ -148,7 +148,7 @@ public String getPartitionType(IDocument doc, int offset) { ITypedRegion tr = getPartition(doc, offset); - return (tr != null) ? tr.getType() : StructuredTextPartitioner.ST_UNKNOWN_PARTITION; + return (tr != null) ? tr.getType() : IStructuredPartitions.UNKNOWN_PARTITION; } public String[] getPartitionTypes() {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java index dcf4dc8..8ddb8d8 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredRegionProcessor.java
@@ -50,8 +50,6 @@ * * Adds default and validator strategies. * Adds DirtyRegion processing logic. - * - * @author pavery */ public class StructuredRegionProcessor extends DirtyRegionProcessor implements IStructuredDocumentListener, IModelLifecycleListener{ @@ -95,7 +93,7 @@ private IReconcilingStrategy fDefaultStrategy; /** - * the strategy that runs validators contributed via reconcileValidator + * The strategy that runs validators contributed via <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code> * extension point */ private ValidatorStrategy fValidatorStrategy;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java index 57b192b..2668ff4 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorBuilder.java
@@ -24,9 +24,7 @@ /** * Based off of TransferBuilder. Reads the extension point for - * org.eclipse.wst.sse.ui.extensions.reconcileValidator - * - * @author pavery + * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code> */ public class ValidatorBuilder extends RegistryReader { @@ -37,7 +35,7 @@ public static final ValidatorMetaData[] EMTPY_VMD_ARRAY = new ValidatorMetaData[0]; // extension point ID - public static final String PL_RECONCILE_VALIDATOR = "reconcileValidator"; //$NON-NLS-1$ + public static final String PL_SOURCE_VALIDATION = "sourcevalidation"; //$NON-NLS-1$ public static final String PLUGIN_ID = "org.eclipse.wst.sse.ui"; //$NON-NLS-1$ public static final String TAG_CONTENT_TYPE_IDENTIFIER = "contentTypeIdentifier"; //$NON-NLS-1$ @@ -78,7 +76,7 @@ * @return Transfer[] */ public ValidatorMetaData[] getValidatorMetaData(String editorId) { - readContributions(editorId, TAG_VALIDATOR, PL_RECONCILE_VALIDATOR); + readContributions(editorId, TAG_VALIDATOR, PL_SOURCE_VALIDATION); return (ValidatorMetaData[]) fVmds.toArray(new ValidatorMetaData[fVmds.size()]); }
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java index 068dded..69e83d9 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/validator/ValidatorStrategy.java
@@ -37,8 +37,8 @@ /** - * Special validator strategy. Runs validator steps contributed via - * reconcileValidator extension point + * Special validator strategy. Runs validator steps contributed via the + * <code>org.eclipse.wst.sse.ui.extensions.sourcevalidation</code> extension point * * @author pavery */
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/StructuredTextEditorContentOutlinePage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/StructuredTextEditorContentOutlinePage.java index 2ffa2b7..6ecc52b 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/StructuredTextEditorContentOutlinePage.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/contentoutline/StructuredTextEditorContentOutlinePage.java
@@ -57,7 +57,7 @@ import org.eclipse.wst.sse.core.IModelStateListener; import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.ui.ViewerSelectionManager; -import org.eclipse.wst.sse.ui.edit.util.ActiveEditorActionHandler; +import org.eclipse.wst.sse.ui.actions.ActiveEditorActionHandler; import org.eclipse.wst.sse.ui.view.events.INodeSelectionListener; import org.eclipse.wst.sse.ui.view.events.ITextSelectionListener; import org.eclipse.wst.sse.ui.view.events.NodeSelectionChangedEvent;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/ConfigurablePropertySheetPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/ConfigurablePropertySheetPage.java index 6234a9f..05fd71e 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/ConfigurablePropertySheetPage.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/ConfigurablePropertySheetPage.java
@@ -33,7 +33,7 @@ import org.eclipse.wst.sse.core.FactoryRegistry; import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.ui.ViewerSelectionManager; -import org.eclipse.wst.sse.ui.edit.util.ActiveEditorActionHandler; +import org.eclipse.wst.sse.ui.actions.ActiveEditorActionHandler; import org.eclipse.wst.sse.ui.internal.properties.RemoveAction; import org.eclipse.wst.sse.ui.view.events.INodeSelectionListener; import org.eclipse.wst.sse.ui.view.events.NodeSelectionChangedEvent;
diff --git a/bundles/org.eclipse.wst.xml.core/component.xml b/bundles/org.eclipse.wst.xml.core/component.xml index b2e1513..1b97933 100644 --- a/bundles/org.eclipse.wst.xml.core/component.xml +++ b/bundles/org.eclipse.wst.xml.core/component.xml
@@ -15,6 +15,9 @@ <package name="org.eclipse.wst.xml.core.document" /> <package name="org.eclipse.wst.xml.core.parser" /> + <!-- probably should exclude some classes... --> + <package name="org.eclipse.wst.xml.core.text" /> + <!-- <package name="org.w3c.dom" /> --> <package name="org.eclipse.wst.xml.uriresolver" />
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/encoding/XMLDocumentLoader.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/encoding/XMLDocumentLoader.java index 8659eed..2914390 100644 --- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/encoding/XMLDocumentLoader.java +++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/encoding/XMLDocumentLoader.java
@@ -25,7 +25,7 @@ import org.eclipse.wst.xml.core.contenttype.ContentTypeIdForXML; import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser; import org.eclipse.wst.xml.core.internal.parser.XMLStructuredDocumentReParser; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML; /**
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/rules/StructuredTextPartitionerForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java similarity index 79% rename from bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/rules/StructuredTextPartitionerForXML.java rename to bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java index 4716296..cc6000f 100644 --- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/rules/StructuredTextPartitionerForXML.java +++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/text/rules/StructuredTextPartitionerForXML.java
@@ -10,32 +10,21 @@ * Jens Lukowski/Innoopract - initial renaming/restructuring * *******************************************************************************/ -package org.eclipse.wst.xml.core.text.rules; +package org.eclipse.wst.xml.core.internal.text.rules; import org.eclipse.jface.text.IDocumentPartitioner; import org.eclipse.wst.sse.core.internal.parser.ForeignRegion; +import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.core.text.IStructuredTextPartitioner; import org.eclipse.wst.sse.core.text.ITextRegion; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; import org.eclipse.wst.xml.core.internal.parser.regions.BlockTextRegion; import org.eclipse.wst.xml.core.parser.XMLRegionContext; - +import org.eclipse.wst.xml.core.text.IXMLPartitions; public class StructuredTextPartitionerForXML extends StructuredTextPartitioner implements IStructuredTextPartitioner { - public final static String ST_DEFAULT_XML = "org.eclipse.wst.xml.DEFAULT_XML"; //$NON-NLS-1$ - public final static String ST_XML_CDATA = "org.eclipse.wst.xml.XML_CDATA"; //$NON-NLS-1$ - public final static String ST_XML_PI = "org.eclipse.wst.xml.XML_PI"; //$NON-NLS-1$ - public final static String ST_XML_DECLARATION = "org.eclipse.wst.xml.XML_DECL"; //$NON-NLS-1$ - public final static String ST_XML_COMMENT = "org.eclipse.wst.xml.XML_COMMENT"; //$NON-NLS-1$ - /** - * Should match - * org.eclipse.wst.sse.core.dtd.partitioning.StructuredTextPartitionerForDTD.ST_DTD_SUBSET - */ - public static final String ST_DTD_SUBSET = "org.eclipse.wst.xml.dtd.internal_subset"; //$NON-NLS-1$ - - private final static String[] configuredContentTypes = new String[]{ST_DEFAULT_XML, ST_XML_CDATA, ST_XML_PI, ST_XML_DECLARATION, ST_XML_COMMENT, ST_DTD_SUBSET}; + private final static String[] configuredContentTypes = new String[]{IXMLPartitions.XML_DEFAULT, IXMLPartitions.XML_CDATA, IXMLPartitions.XML_PI, IXMLPartitions.XML_DECLARATION, IXMLPartitions.XML_COMMENT, IXMLPartitions.DTD_SUBSET}; /** * Constructor for JSPDocumentPartioner. @@ -58,15 +47,15 @@ public String getPartitionType(ITextRegion region, int offset) { String result = null; if (region.getType() == XMLRegionContext.XML_COMMENT_TEXT) - result = ST_XML_COMMENT; + result = IXMLPartitions.XML_COMMENT; else if (region.getType() == XMLRegionContext.XML_CDATA_TEXT) - result = ST_XML_CDATA; + result = IXMLPartitions.XML_CDATA; else if (region.getType() == XMLRegionContext.XML_PI_OPEN) - result = ST_XML_PI; + result = IXMLPartitions.XML_PI; else if (region.getType() == XMLRegionContext.XML_DOCTYPE_DECLARATION) - result = ST_XML_DECLARATION; + result = IXMLPartitions.XML_DECLARATION; else if (region.getType() == XMLRegionContext.XML_DOCTYPE_INTERNAL_SUBSET) - result = ST_DTD_SUBSET; + result = IXMLPartitions.DTD_SUBSET; else result = super.getPartitionType(region, offset); return result; @@ -77,16 +66,12 @@ return super.getPartitionType(region, offset); } - /** - * @see com.ibm.sed.structuredDocument.partition.IStructuredTextPartitioner#getPartitionTypeBetween(com.ibm.sed.structuredDocument.ITextRegion, - * com.ibm.sed.structuredDocument.ITextRegion) - */ public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, ITextRegion previousStartTagNameRegion, IStructuredDocumentRegion nextNode, ITextRegion nextEndTagNameRegion) { return super.getPartitionTypeBetween(previousNode, previousStartTagNameRegion, nextNode, nextEndTagNameRegion); } public String getDefault() { - return ST_DEFAULT_XML; + return IXMLPartitions.XML_DEFAULT; } public IDocumentPartitioner newInstance() {
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelhandler/ModelHandlerForXML.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelhandler/ModelHandlerForXML.java index 995e92c..526feea 100644 --- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelhandler/ModelHandlerForXML.java +++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/modelhandler/ModelHandlerForXML.java
@@ -39,7 +39,7 @@ private static String ModelHandlerID = "org.eclipse.wst.xml.core.modelhandler"; //$NON-NLS-1$ public ModelHandlerForXML() { - super(); + super(); setId(ModelHandlerID); setAssociatedContentTypeId(AssociatedContentTypeID); }
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java new file mode 100644 index 0000000..78a5219 --- /dev/null +++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/text/IXMLPartitions.java
@@ -0,0 +1,28 @@ +package org.eclipse.wst.xml.core.text; + +import org.eclipse.wst.sse.core.text.IStructuredPartitions; + + +/** + * This interface is not intended to be implemented. + * It defines the partitioning for XML and all its partitions. + * Clients should reference the partition type Strings defined here directly. + * + * @since 1.0 + */ +public interface IXMLPartitions { + + String XML_PARTITIONING = IStructuredPartitions.STRUCTURED_PARTITIONING; + + String XML_DEFAULT = "org.eclipse.wst.xml.XML_DEFAULT"; //$NON-NLS-1$ + String XML_CDATA = "org.eclipse.wst.xml.XML_CDATA"; //$NON-NLS-1$ + String XML_PI = "org.eclipse.wst.xml.XML_PI"; //$NON-NLS-1$ + String XML_DECLARATION = "org.eclipse.wst.xml.XML_DECL"; //$NON-NLS-1$ + String XML_COMMENT = "org.eclipse.wst.xml.XML_COMMENT"; //$NON-NLS-1$ + + /** + * Should match + * org.eclipse.wst.sse.core.dtd.partitioning.StructuredTextPartitionerForDTD.ST_DTD_SUBSET + */ + String DTD_SUBSET = "org.eclipse.wst.xml.dtd.internal_subset"; //$NON-NLS-1$ +}
diff --git a/bundles/org.eclipse.wst.xml.ui/plugin.xml b/bundles/org.eclipse.wst.xml.ui/plugin.xml index 5915d9c..a16f761 100644 --- a/bundles/org.eclipse.wst.xml.ui/plugin.xml +++ b/bundles/org.eclipse.wst.xml.ui/plugin.xml
@@ -364,15 +364,15 @@ </extension> <extension - point="org.eclipse.wst.sse.ui.reconcileValidator"> + point="org.eclipse.wst.sse.ui.sourcevalidation"> <validator scope="total" - class="org.eclipse.wst.xml.ui.reconcile.DelegatingReconcileValidatorForXML" - id="org.eclipse.wst.xml.ui.reconcile.DelegatingReconcileValidatorForXML"> + class="org.eclipse.wst.xml.ui.reconcile.DelegatingSourceValidatorForXML" + id="org.eclipse.wst.xml.ui.reconcile.DelegatingSourceValidatorForXML"> <contentTypeIdentifier id="org.eclipse.core.runtime.xml"> <partitionType - id="org.eclipse.wst.xml.DEFAULT_XML"> + id="org.eclipse.wst.xml.XML_DEFAULT"> </partitionType> </contentTypeIdentifier> </validator>
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextEditorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextEditorXML.java index 1cf8a60..8e81206 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextEditorXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextEditorXML.java
@@ -16,9 +16,9 @@ import org.eclipse.jface.action.Action; import org.eclipse.wst.sse.ui.StructuredTextEditor; -import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.search.FindOccurrencesActionProvider; import org.eclipse.wst.xml.ui.actions.AddBlockCommentActionXML; import org.eclipse.wst.xml.ui.actions.CleanupActionXML;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java index 8963493..cda3d07 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
@@ -36,7 +36,7 @@ import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.core.StructuredModelManager; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; +import org.eclipse.wst.sse.core.text.IStructuredPartitions; import org.eclipse.wst.sse.ui.StructuredTextEditor; import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration; import org.eclipse.wst.sse.ui.format.StructuredFormattingStrategy; @@ -49,7 +49,8 @@ import org.eclipse.wst.sse.ui.taginfo.TextHoverManager; import org.eclipse.wst.sse.ui.util.EditorUtility; import org.eclipse.wst.xml.core.format.FormatProcessorXML; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.internal.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.text.IXMLPartitions; import org.eclipse.wst.xml.ui.contentassist.NoRegionContentAssistProcessor; import org.eclipse.wst.xml.ui.contentassist.XMLContentAssistProcessor; import org.eclipse.wst.xml.ui.doubleclick.XMLDoubleClickStrategy; @@ -85,7 +86,7 @@ allStrategies.add(superStrategies[i]); } - if (contentType == StructuredTextPartitionerForXML.ST_DEFAULT_XML) { + if (contentType == IXMLPartitions.XML_DEFAULT) { allStrategies.add(new StructuredAutoEditStrategyXML()); } @@ -97,8 +98,8 @@ if (configuredContentTypes == null) { String[] xmlTypes = StructuredTextPartitionerForXML.getConfiguredContentTypes(); configuredContentTypes = new String[xmlTypes.length + 2]; - configuredContentTypes[0] = StructuredTextPartitioner.ST_DEFAULT_PARTITION; - configuredContentTypes[1] = StructuredTextPartitioner.ST_UNKNOWN_PARTITION; + configuredContentTypes[0] = IStructuredPartitions.DEFAULT_PARTITION; + configuredContentTypes[1] = IStructuredPartitions.UNKNOWN_PARTITION; int index = 0; System.arraycopy(xmlTypes, 0, configuredContentTypes, index += 2, xmlTypes.length); } @@ -112,15 +113,15 @@ ContentAssistant contentAssistant = (ContentAssistant) ca; IContentAssistProcessor xmlContentAssistProcessor = new XMLContentAssistProcessor(); IContentAssistProcessor noRegionProcessor = new NoRegionContentAssistProcessor(); - setContentAssistProcessor(contentAssistant, xmlContentAssistProcessor, StructuredTextPartitioner.ST_DEFAULT_PARTITION); - setContentAssistProcessor(contentAssistant, xmlContentAssistProcessor, StructuredTextPartitionerForXML.ST_DEFAULT_XML); - setContentAssistProcessor(contentAssistant, noRegionProcessor, StructuredTextPartitioner.ST_UNKNOWN_PARTITION); + setContentAssistProcessor(contentAssistant, xmlContentAssistProcessor, IStructuredPartitions.DEFAULT_PARTITION); + setContentAssistProcessor(contentAssistant, xmlContentAssistProcessor, IXMLPartitions.XML_DEFAULT); + setContentAssistProcessor(contentAssistant, noRegionProcessor, IStructuredPartitions.UNKNOWN_PARTITION); } return ca; } public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { - final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), StructuredTextPartitionerForXML.ST_DEFAULT_XML); + final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IXMLPartitions.XML_DEFAULT); formatter.setMasterStrategy(new StructuredFormattingStrategy(new FormatProcessorXML())); @@ -135,12 +136,12 @@ ITextEditor editor = getTextEditor(); if (editor != null) { IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(editor); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_DEFAULT_XML); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_CDATA); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_COMMENT); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_DECLARATION); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_XML_PI); - correctionAssistant.setContentAssistProcessor(correctionProcessor, StructuredTextPartitionerForXML.ST_DTD_SUBSET); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DEFAULT); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_CDATA); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_COMMENT); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DECLARATION); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_PI); + correctionAssistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.DTD_SUBSET); } } return ca; @@ -149,7 +150,7 @@ public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) { ITextDoubleClickStrategy doubleClickStrategy = null; - if (contentType.compareTo(StructuredTextPartitionerForXML.ST_DEFAULT_XML) == 0) + if (contentType.compareTo(IXMLPartitions.XML_DEFAULT) == 0) doubleClickStrategy = new XMLDoubleClickStrategy(); else doubleClickStrategy = super.getDoubleClickStrategy(sourceViewer, contentType); @@ -161,11 +162,11 @@ IHighlighter highlighter = super.getHighlighter(sourceViewer); if (highlighter != null) { LineStyleProvider xmlProvider = new LineStyleProviderForXML(); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_DEFAULT_XML, xmlProvider); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_XML_CDATA, xmlProvider); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_XML_COMMENT, xmlProvider); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_XML_DECLARATION, xmlProvider); - highlighter.addProvider(StructuredTextPartitionerForXML.ST_XML_PI, xmlProvider); + highlighter.addProvider(IXMLPartitions.XML_DEFAULT, xmlProvider); + highlighter.addProvider(IXMLPartitions.XML_CDATA, xmlProvider); + highlighter.addProvider(IXMLPartitions.XML_COMMENT, xmlProvider); + highlighter.addProvider(IXMLPartitions.XML_DECLARATION, xmlProvider); + highlighter.addProvider(IXMLPartitions.XML_PI, xmlProvider); } return highlighter; } @@ -175,8 +176,8 @@ if (fInformationPresenter == null) { fInformationPresenter = new InformationPresenter(getInformationPresenterControlCreator(sourceViewer)); IInformationProvider xmlInformationProvider = new XMLInformationProvider(); - fInformationPresenter.setInformationProvider(xmlInformationProvider, StructuredTextPartitioner.ST_DEFAULT_PARTITION); - fInformationPresenter.setInformationProvider(xmlInformationProvider, StructuredTextPartitionerForXML.ST_DEFAULT_XML); + fInformationPresenter.setInformationProvider(xmlInformationProvider, IStructuredPartitions.DEFAULT_PARTITION); + fInformationPresenter.setInformationProvider(xmlInformationProvider, IXMLPartitions.XML_DEFAULT); fInformationPresenter.setSizeConstraints(60, 10, true, true); } return fInformationPresenter; @@ -212,7 +213,7 @@ if (sModel != null) { IReconcilingStrategy markupStrategy = new StructuredTextReconcilingStrategyForMarkup((ITextEditor) editorPart); - fReconciler.setReconcilingStrategy(markupStrategy, StructuredTextPartitionerForXML.ST_DEFAULT_XML); + fReconciler.setReconcilingStrategy(markupStrategy, IXMLPartitions.XML_DEFAULT); fReconciler.setDefaultStrategy(markupStrategy); String contentTypeId = sModel.getContentTypeIdentifier(); @@ -236,7 +237,7 @@ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) { // look for appropriate text hover processor to return based on // content type and state mask - if ((contentType == StructuredTextPartitioner.ST_DEFAULT_PARTITION) || (contentType == StructuredTextPartitionerForXML.ST_DEFAULT_XML)) { + if ((contentType == IStructuredPartitions.DEFAULT_PARTITION) || (contentType == IXMLPartitions.XML_DEFAULT)) { // check which of xml's text hover is handling stateMask TextHoverManager.TextHoverDescriptor[] hoverDescs = getTextHovers(); int i = 0;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ActionContributorXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ActionContributorXML.java index 8d58d08..34c2b2a 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ActionContributorXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ActionContributorXML.java
@@ -23,10 +23,10 @@ import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; import org.eclipse.ui.texteditor.RetargetTextEditorAction; -import org.eclipse.wst.sse.ui.edit.util.ActionContributor; -import org.eclipse.wst.sse.ui.edit.util.ActionDefinitionIds; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.ActionContributor; +import org.eclipse.wst.sse.ui.internal.actions.ActionDefinitionIds; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; /** * XMLEditorActionContributor
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/AddBlockCommentActionXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/AddBlockCommentActionXML.java index d7db263..1122621 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/AddBlockCommentActionXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/AddBlockCommentActionXML.java
@@ -18,8 +18,8 @@ import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.sse.core.IndexedRegion; import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; import org.eclipse.wst.xml.core.internal.document.CommentImpl; public class AddBlockCommentActionXML extends CommentActionXML {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CleanupActionXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CleanupActionXML.java index f79192d..d0ab7e2 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CleanupActionXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CleanupActionXML.java
@@ -18,7 +18,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor; -import org.eclipse.wst.sse.ui.edit.util.CleanupAction; +import org.eclipse.wst.sse.ui.internal.actions.CleanupAction; import org.eclipse.wst.xml.core.internal.cleanup.CleanupProcessorXML;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CommentActionXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CommentActionXML.java index 66888cd..803a1d1 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CommentActionXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CommentActionXML.java
@@ -30,8 +30,8 @@ import org.eclipse.wst.sse.core.IStructuredModel; import org.eclipse.wst.sse.core.StructuredModelManager; import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; public class CommentActionXML extends TextEditorAction { protected static final String CLOSE_COMMENT = "-->"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/RemoveBlockCommentActionXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/RemoveBlockCommentActionXML.java index ee765c3..f310959 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/RemoveBlockCommentActionXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/RemoveBlockCommentActionXML.java
@@ -18,8 +18,8 @@ import org.eclipse.wst.xml.core.internal.document.CommentImpl; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; public class RemoveBlockCommentActionXML extends AddBlockCommentActionXML { public RemoveBlockCommentActionXML(ResourceBundle bundle, String prefix, ITextEditor editor) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ToggleCommentActionXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ToggleCommentActionXML.java index 451d4ed..257fdef 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ToggleCommentActionXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/ToggleCommentActionXML.java
@@ -18,8 +18,8 @@ import org.eclipse.jface.text.IRegion; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; public class ToggleCommentActionXML extends UncommentActionXML { public ToggleCommentActionXML(ResourceBundle bundle, String prefix, ITextEditor editor) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/UncommentActionXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/UncommentActionXML.java index 02e440b..408494e 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/UncommentActionXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/UncommentActionXML.java
@@ -18,8 +18,8 @@ import org.eclipse.jface.text.IRegion; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; public class UncommentActionXML extends CommentActionXML { public UncommentActionXML(ResourceBundle bundle, String prefix, ITextEditor editor) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/CustomTemplateProposal.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/CustomTemplateProposal.java index 043e7b9..83f9f59 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/CustomTemplateProposal.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/CustomTemplateProposal.java
@@ -17,7 +17,7 @@ import org.eclipse.jface.text.templates.TemplateProposal; import org.eclipse.swt.graphics.Image; import org.eclipse.wst.sse.core.util.StringUtils; -import org.eclipse.wst.sse.ui.contentassist.IRelevanceCompletionProposal; +import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal; /** * Purpose of this class is to make the additional proposal info into content
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/NoRegionContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/NoRegionContentAssistProcessor.java index d3ca3e9..83e8e7d 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/NoRegionContentAssistProcessor.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/NoRegionContentAssistProcessor.java
@@ -29,10 +29,10 @@ import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.ui.IReleasable; import org.eclipse.wst.sse.ui.StructuredTextViewer; -import org.eclipse.wst.sse.ui.contentassist.IResourceDependentProcessor; import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils; +import org.eclipse.wst.sse.ui.internal.contentassist.IResourceDependentProcessor; import org.eclipse.wst.xml.core.parser.XMLRegionContext; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.text.IXMLPartitions; /** @@ -210,7 +210,7 @@ */ protected void initPartitionToProcessorMap() { XMLContentAssistProcessor xmlProcessor = new XMLContentAssistProcessor(); - fPartitionToProcessorMap.put(StructuredTextPartitionerForXML.ST_DEFAULT_XML, xmlProcessor); + fPartitionToProcessorMap.put(IXMLPartitions.XML_DEFAULT, xmlProcessor); } public void release() {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ProposalComparator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ProposalComparator.java index 3a4bf4d..11048a2 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ProposalComparator.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ProposalComparator.java
@@ -17,7 +17,7 @@ import java.util.Comparator; import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.wst.sse.ui.contentassist.IRelevanceCompletionProposal; +import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal; public class ProposalComparator implements Comparator {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java index d932829..8ac0817 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
@@ -20,7 +20,7 @@ import org.eclipse.wst.sse.core.StructuredModelManager; import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; import org.eclipse.wst.sse.ui.StructuredDocumentCommand; -import org.eclipse.wst.sse.ui.edit.util.BasicAutoEditStrategy; +import org.eclipse.wst.sse.ui.internal.autoedit.BasicAutoEditStrategy; import org.eclipse.wst.xml.core.document.XMLElement; import org.eclipse.wst.xml.core.document.XMLNode; import org.eclipse.wst.xml.ui.internal.Logger;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesAction.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesAction.java index 55a4407..04a7428 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesAction.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/search/XMLFindOccurrencesAction.java
@@ -17,7 +17,7 @@ import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.wst.sse.ui.internal.search.BasicFindOccurrencesAction; import org.eclipse.wst.xml.core.parser.XMLRegionContext; -import org.eclipse.wst.xml.core.text.rules.StructuredTextPartitionerForXML; +import org.eclipse.wst.xml.core.text.IXMLPartitions; @@ -40,7 +40,7 @@ public String[] getPartitionTypes() { - return new String[]{StructuredTextPartitionerForXML.ST_DEFAULT_XML}; + return new String[]{IXMLPartitions.XML_DEFAULT}; } public String[] getRegionTypes() {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/AbstractReconcileStepAdapter.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/AbstractReconcileStepAdapter.java deleted file mode 100644 index 7d1e510..0000000 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/AbstractReconcileStepAdapter.java +++ /dev/null
@@ -1,157 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.xml.ui.reconcile; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.ITypedRegion; -import org.eclipse.jface.text.reconciler.IReconcileResult; -import org.eclipse.wst.sse.core.INodeNotifier; -import org.eclipse.wst.sse.core.IndexedRegion; -import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; -import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner; -import org.eclipse.wst.sse.ui.StructuredTextReconciler; -import org.eclipse.wst.sse.ui.internal.reconcile.IReconcileStepAdapter; -import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey; -import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep; -import org.eclipse.wst.xml.ui.internal.Logger; - - -/** - * This reconcile step is an adapter on the IStructuredModel. Validation is - * triggered from StructuredDocumentEvents - * - * @deprecated moving toward reconcileValidator extension point - * - * @author pavery - */ -public class AbstractReconcileStepAdapter implements IReconcileStepAdapter { - - protected static final IReconcileResult[] EMPTY_RECONCILE_RESULT_SET = new IReconcileResult[0]; - protected List fDirtyElements = new ArrayList(); - private StructuredReconcileStep fParentStep = null; - private HashSet fPartitionTypes = null; - - public AbstractReconcileStepAdapter() { - super(); - fPartitionTypes = new HashSet(); - } - - public ReconcileAnnotationKey createKey(IStructuredDocumentRegion sdRegion, int scope) { - ITypedRegion tr = null; - if (!sdRegion.isDeleted()) { - try { - tr = sdRegion.getParentDocument().getPartition(sdRegion.getStartOffset()); - } catch (BadLocationException e) { - // do nothing but leave tr as null - // probably due to changes made on another thread - } - } - String partitionType = (tr != null) ? tr.getType() : StructuredTextPartitioner.ST_UNKNOWN_PARTITION; - return createKey(partitionType, scope); - } - - public ReconcileAnnotationKey createKey(String partitionType, int scope) { - fPartitionTypes.add(partitionType); - return new ReconcileAnnotationKey(getParentStep(), partitionType, scope); - } - - public StructuredReconcileStep getParentStep() { - return fParentStep; - } - - public String[] getPartitionTypes() { - String[] results = new String[fPartitionTypes.size()]; - System.arraycopy(fPartitionTypes.toArray(), 0, results, 0, results.length); - return results; - } - - - public boolean isAdapterForType(Object type) { - return type == IReconcileStepAdapter.class; - } - - protected boolean isCanceled(IProgressMonitor monitor) { - return monitor != null && monitor.isCanceled(); - } - - /** - * @param notifier - */ - public void markForReconciling(Object notifier) { - synchronized (fDirtyElements) { - // pa_TODO possible bottleneck - if (!fDirtyElements.contains(notifier)) { - Logger.trace(StructuredTextReconciler.TRACE_FILTER, "marking :" + notifier + ": for reconciling"); //$NON-NLS-1$ //$NON-NLS-2$ - fDirtyElements.add(notifier); - } - } - } - - /* - * (non-Javadoc) - * - * @see com.ibm.sed.model.INodeAdapter#notifyChanged(com.ibm.sed.model.INodeNotifier, - * int, java.lang.Object, java.lang.Object, java.lang.Object, int) - */ - public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) { - // Adapters are notified before the JFace Document events are sent to - // the IReconciler - markForReconciling(notifier); - } - - public IReconcileResult[] reconcile(IProgressMonitor monitor, IndexedRegion xmlNode) { - List workingElements = null; - List results = new ArrayList(); - - IReconcileResult[] temp = EMPTY_RECONCILE_RESULT_SET; - synchronized (fDirtyElements) { - if (fDirtyElements != null && fDirtyElements.size() > 0) { - workingElements = new ArrayList(); - workingElements.addAll(0, fDirtyElements); - fDirtyElements = new ArrayList(); - } - } - if (workingElements != null) { - Iterator elements = workingElements.iterator(); - while (elements.hasNext() && !isCanceled(monitor)) { - temp = reconcile(elements.next(), monitor); - for (int i = 0; i < temp.length; i++) - results.add(temp[i]); - } - } - temp = new IReconcileResult[results.size()]; - System.arraycopy(results.toArray(), 0, temp, 0, results.size()); - return temp; - } - - protected IReconcileResult[] reconcile(Object o, IProgressMonitor monitor) { - return EMPTY_RECONCILE_RESULT_SET; - } - - /** - * @see org.eclipse.wst.sse.ui.IReleasable#release() - */ - public void release() { - // nothing to release - } - - public void setParentStep(StructuredReconcileStep parentStep) { - fParentStep = parentStep; - } -}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingReconcileValidator.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingSourceValidator.java similarity index 99% rename from bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingReconcileValidator.java rename to bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingSourceValidator.java index 5086777..e4750e5 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingReconcileValidator.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingSourceValidator.java
@@ -52,7 +52,7 @@ * @author Mark Hutchinson * */ -public class DelegatingReconcileValidator implements IValidator +public class DelegatingSourceValidator implements IValidator { //these are the selection Strategies: protected static final String ALL_ATTRIBUTES = "ALL_ATTRIBUTES"; protected static final String ATTRIBUTE_NAME ="ATTRIBUTE_NAME"; @@ -67,7 +67,7 @@ protected static final String SQUIGGLE_SELECTION_STRATEGY_ATTRIBUTE = "squiggleSelectionStrategy"; protected static final String SQUIGGLE_NAME_OR_VALUE_ATTRIBUTE = "squiggleNameOrValue"; - public DelegatingReconcileValidator() + public DelegatingSourceValidator() { super(); //constructor }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingReconcileValidatorForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingSourceValidatorForXML.java similarity index 89% rename from bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingReconcileValidatorForXML.java rename to bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingSourceValidatorForXML.java index af0d1ba..5b16dec 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingReconcileValidatorForXML.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/DelegatingSourceValidatorForXML.java
@@ -18,11 +18,11 @@ * @author Mark Hutchinson * */ -public class DelegatingReconcileValidatorForXML extends DelegatingReconcileValidator +public class DelegatingSourceValidatorForXML extends DelegatingSourceValidator { private final static String VALIDATOR_CLASS = "org.eclipse.wst.xml.validation.internal.ui.eclipse.Validator"; - public DelegatingReconcileValidatorForXML() + public DelegatingSourceValidatorForXML() { super(); }
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcileStepAdapterForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcileStepAdapterForXML.java deleted file mode 100644 index 8bd1422..0000000 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcileStepAdapterForXML.java +++ /dev/null
@@ -1,695 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.xml.ui.reconcile; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; -import java.util.Vector; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.reconciler.IReconcileResult; -import org.eclipse.wst.sse.core.INodeNotifier; -import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; -import org.eclipse.wst.sse.core.text.ITextRegion; -import org.eclipse.wst.sse.ui.IReleasable; -import org.eclipse.wst.sse.ui.StructuredTextReconciler; -import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; -import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey; -import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation; -import org.eclipse.wst.xml.core.document.XMLAttr; -import org.eclipse.wst.xml.core.document.XMLElement; -import org.eclipse.wst.xml.core.document.XMLNode; -import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration; -import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument; -import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration; -import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap; -import org.eclipse.wst.xml.core.internal.contentmodel.CMNode; -import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager; -import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery; -import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache; -import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCacheListener; -import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil; -import org.eclipse.wst.xml.core.parser.XMLRegionContext; -import org.eclipse.wst.xml.ui.internal.Logger; -import org.eclipse.wst.xml.ui.internal.correction.ProblemIDsXML; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.DocumentType; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -/** - * @deprecated moving toward reconcileValidator extension point - */ -public class ReconcileStepAdapterForXML extends AbstractReconcileStepAdapter implements CMDocumentCacheListener, IReleasable { - - /** - * Record of notification sent to this adapter. Will be queued up so - * they're not dealt with until reconciling is actually called from the - * reconciler thread. - */ - public class NotificationEvent { - - public Object changedFeature; - - public int eventType; - - public Object newValue; - - public INodeNotifier notifier; - - public Object oldValue; - - public int pos; - - public NotificationEvent(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) { - - this.notifier = notifier; - this.eventType = eventType; - this.changedFeature = changedFeature; - this.oldValue = oldValue; - this.newValue = newValue; - this.pos = pos; - } - - // used (to see if notifications vector "contains()") - // so we don't queue up "duplicate" events, - // (indicates same eventType, notifier, and changedFeature) - public boolean equals(Object o) { - - boolean result = false; - if (o instanceof NotificationEvent) { - NotificationEvent e2 = (NotificationEvent) o; - if (this.notifier == null || e2.notifier == null || this.changedFeature == null || e2.changedFeature == null) { - result = false; - } - result = (this.eventType == e2.eventType && this.notifier == e2.notifier && this.changedFeature == e2.changedFeature); - } - return result; - } - } - - protected boolean fCaseSensitive = true; - protected CMDocumentCache fCMDocumentCache; - protected DocumentType fDocumentTypeForRefresh; - - protected boolean fNeedsRefreshAll = false; - - // required for thread safety - protected List fNotifications = new Vector(); - - // these are used in conjunction w/ cacheUpdated() notification - // in order to refresh the whole document - protected IProgressMonitor fProgressMonitorForRefresh; - - // counter used for repeated reconcile opreations - // to yield the thread control to the next thread - // to improve workbench performance - protected short fReconcileCount = 0; - - // will not attempt to validate attribute names starting with the - // following: - protected String[] ignoreAttributeNamesStartingWith = new String[]{"xmlns", "xsi:", "xml:"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - - // changing these elements may have an impact on the current content model - // (which suggests to mark everything dirty) - protected String[] mayImpactContentModel = new String[]{"DOCTYPE", "xmlns", "xsi", "xmlns:xsi", "xmlns:xsl", "xsi:schemaLocation", "taglib"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ - protected String SEVERITY_MISSING_REQUIRED_ATTR = TemporaryAnnotation.ANNOT_WARNING; - - // severities for the problems discoverable by this reconciler; possibly - // user configurable later - protected String SEVERITY_STRUCTURE = TemporaryAnnotation.ANNOT_ERROR; - protected String SEVERITY_UNKNOWN_ATTR = TemporaryAnnotation.ANNOT_ERROR; - protected String SEVERITY_UNKNOWN_ELEMENT = TemporaryAnnotation.ANNOT_ERROR; - - public ReconcileStepAdapterForXML() { - - super(); - } - - public void cacheCleared(CMDocumentCache arg0) { - // do nothing - } - - public void cacheUpdated(CMDocumentCache arg0, String arg1, int arg2, int arg3, CMDocument arg4) { - - // revalidate all - if (Logger.isTracing(StructuredTextReconciler.TRACE_FILTER)) { - String message = "[trace reconciler] > \r\n====================" + "\n cache updated:" + "\n arg0 :" + arg0 + "\n arg1 :" + arg1 + "\n arg3 :" + arg3 + "\n arg4 :" + arg4; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ - Logger.trace(StructuredTextReconciler.TRACE_FILTER, message); - } - if (arg3 == CMDocumentCache.STATUS_LOADED) { - Logger.trace(StructuredTextReconciler.TRACE_FILTER, "CMDocument finished loading :" + arg1); //$NON-NLS-1$ - doRefreshAll((INodeNotifier) fDocumentTypeForRefresh, fProgressMonitorForRefresh); - } - } - - protected IReconcileResult[] doRefreshAll(INodeNotifier notifier, IProgressMonitor monitor) { - - Logger.trace(StructuredTextReconciler.TRACE_FILTER, "[trace reconciler] > refreshing all"); //$NON-NLS-1$ - - synchronized (fDirtyElements) { - fDirtyElements.clear(); - } - Document doc = (((Node) notifier).getNodeType() != Node.DOCUMENT_NODE) ? ((Node) notifier).getOwnerDocument() : (Document) notifier; - return reconcileSubtree((INodeNotifier) doc, monitor); - } - - protected ModelQuery getModelQuery(Node node) { - - return (node.getNodeType() == Node.DOCUMENT_NODE) ? ModelQueryUtil.getModelQuery((Document) node) : ModelQueryUtil.getModelQuery(node.getOwnerDocument()); - } - - /** - * returns a list of required CMAttributeDeclarations for the given - * element. - * - * @param elementDecl - * - */ - protected List getRequiredAttributes(CMElementDeclaration elementDecl) { - - CMNamedNodeMap attrMap = elementDecl.getAttributes(); - Iterator it = attrMap.iterator(); - CMAttributeDeclaration attr = null; - List result = new ArrayList(); - while (it.hasNext()) { - attr = (CMAttributeDeclaration) it.next(); - if (attr.getUsage() == CMAttributeDeclaration.REQUIRED) { - result.add(attr); - } - } - return result; - } - - /** - * Determine if this Document is an XML/XHTML Document and whether to be - * case sensitive - */ - protected boolean isCaseSensitive(Node node) { - - return true; - } - - // CMVC 254838 - /** - * Indicates if the element is not in the ContentModel (if it's not in the - * ContentModel, but its parent is) - * - * @param element - * @param modelQuery - * @return whether or not the element is unknown according to its - * associated ContentModel. - */ - protected boolean isUnknown(Element element, ModelQuery modelQuery) { - - boolean result = false; - CMElementDeclaration ed = modelQuery.getCMElementDeclaration(element); - if (ed == null) { - // make sure parent declaration exists, and is not inferred - Node parentNode = element.getParentNode(); - if (parentNode != null && parentNode.getNodeType() == Node.ELEMENT_NODE) { - CMElementDeclaration parentEd = modelQuery.getCMElementDeclaration((Element) parentNode); - // 2/19/04 porting iFix for lax schema suppport - result = (parentEd != null) && !Boolean.TRUE.equals(parentEd.getProperty("isInferred")) //$NON-NLS-1$ - && !Boolean.TRUE.equals(parentEd.getProperty("isLax")); //$NON-NLS-1$ - } - // need one error for the root at least - // to indicate the document is wrong... - Document ownerDoc = element.getOwnerDocument(); - if (ownerDoc != null && ownerDoc.getDocumentElement() == element) { - CMDocument cmDoc = modelQuery.getCorrespondingCMDocument(ownerDoc); - result = (cmDoc != null && cmDoc.getElements().getLength() > 0); - } - } else { - if (ed.getProperty("isInferred") != null && Boolean.TRUE.equals(ed.getProperty("isInferred")) //$NON-NLS-1$ //$NON-NLS-2$ - || (ed.getProperty("partialContentModel") != null && Boolean.TRUE.equals(ed.getProperty("partialContentModel")))) { //$NON-NLS-1$ //$NON-NLS-2$ - result = false; - } - } - return result; - } - - /** - * Checks if name matches any mayImpactContentModel[] strings - * - * @param name - * @return if a match is found, return true, else return false - */ - private boolean mayAffectContentModel(String name) { - - // TODO (pa) may need to be smarter if the attribute name is broken... - StringTokenizer st = new StringTokenizer(name, ":", false); //$NON-NLS-1$ - String prefix = ""; //$NON-NLS-1$ - if (st.hasMoreTokens()) - prefix = st.nextToken(); - for (int i = 0; i < mayImpactContentModel.length; i++) { - if (mayImpactContentModel[i].indexOf(name) != -1 || mayImpactContentModel[i].startsWith(prefix)) - return true; - } - return false; - } - - public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) { - - synchronized (fNotifications) { - NotificationEvent newEvent = new NotificationEvent(notifier, eventType, changedFeature, oldValue, newValue, pos); - if (!fNotifications.contains(newEvent)) - fNotifications.add(newEvent); - } - } - - - public void processNotification(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos, IProgressMonitor monitor) { - - if (isCanceled(monitor)) - return; - - // (nsd) pa_TODO: we need to mark more or widen the scope affected by - // the next reconcile() call - // TODO: Handle multi-Node changes from Doctype Declarations, Taglib - // directives, - // and schema and namespace related attributes (DOCTYPE, taglib, - // xmlns, - // xsi...) - // ** we currently don't get a notify on changed taglib... - - // we're going to validate everything again anyways after - // proccessNotifications() has completed (in reconcile(): - // processNotifications() > refreshAll()), - // no sense to do it here if we refreshingAll - if (fNeedsRefreshAll) - return; - if (eventType == INodeNotifier.CHANGE || eventType == INodeNotifier.REMOVE) { - if (changedFeature instanceof Node && ((Node) changedFeature).getNodeType() == Node.ATTRIBUTE_NODE) { - if (mayAffectContentModel(((Node) changedFeature).getNodeName())) { - fNeedsRefreshAll = true; - } - } else if (changedFeature instanceof Node && ((Node) changedFeature).getNodeType() == Node.DOCUMENT_TYPE_NODE) { - fNeedsRefreshAll = true; - } else if (notifier instanceof Node && ((Node) notifier).getNodeType() == Node.DOCUMENT_TYPE_NODE) { - fNeedsRefreshAll = true; - } else { - // pa_TODO need to handle taglib definition changes... - // if(mayAffectContentModel(((Node)changedFeature).getNodeName())) - // { - // System.out.println("dunno what changed > " + - // changedFeature); - // fNeedsRefreshAll = true; - // } - } - if (isCanceled(monitor)) - return; - fNeedsRefreshAll = true; - } - if (eventType == INodeNotifier.CHANGE && changedFeature instanceof Element) { - markForReconciling(changedFeature); - } else if (eventType == INodeNotifier.ADD && newValue instanceof Node) { - Node newNode = (Node) newValue; - if (newNode.getNodeType() == Node.DOCUMENT_TYPE_NODE || newNode.getNodeName().equals("jsp:directive.taglib")) { // $NON-NLS-1$ - // //$NON-NLS-1$ - fNeedsRefreshAll = true; - } else { - markForReconciling(newNode); - } - } - markForReconciling(notifier); - } - - protected void processNotifications(IProgressMonitor monitor) { - - fProgressMonitorForRefresh = monitor; - NotificationEvent[] events = null; - synchronized (fNotifications) { - if (fNotifications.isEmpty()) { - return; - } - events = (NotificationEvent[]) fNotifications.toArray(new NotificationEvent[0]); - fNotifications.clear(); - } - for (int i = 0; i < events.length; i++) { - processNotification(events[i].notifier, events[i].eventType, events[i].changedFeature, events[i].oldValue, events[i].newValue, events[i].pos, monitor); - } - } - - - public IReconcileResult[] reconcile(IProgressMonitor monitor, XMLNode xmlNode) { - - processNotifications(monitor); - IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET; - if (fNeedsRefreshAll) { - results = doRefreshAll(xmlNode, monitor); - fNeedsRefreshAll = false; - } else { - results = super.reconcile(monitor, xmlNode); - } - return results; - } - - /** - * Called by super.reconcile(IAnnotationModel) on each Notifier - * - */ - protected IReconcileResult[] reconcile(Object o, IProgressMonitor monitor) { - - super.reconcile(o, monitor); - ModelQuery mq = null; - if (o instanceof XMLNode) { - XMLNode xmlNode = (XMLNode) o; - mq = getModelQuery(xmlNode); - if (mq != null) { - fCaseSensitive = isCaseSensitive(xmlNode); - return validate(mq, xmlNode); - } - } - - // if we are in a large reconciling loop (like when reconciling the - // entire doc), this ensures - // that other Threads have a chance to run. - yieldIfNeeded(); - return EMPTY_RECONCILE_RESULT_SET; - } - - /** - * Reconcile the Node and all children of the Notifier passed in. - * - * @param notifier - * @param monitor - */ - protected IReconcileResult[] reconcileSubtree(INodeNotifier notifier, IProgressMonitor monitor) { - - IReconcileResult[] temp = EMPTY_RECONCILE_RESULT_SET; - List results = new ArrayList(); - if (!isCanceled(monitor)) { - if (notifier != null && notifier instanceof XMLNode) { - XMLNode current = (XMLNode) notifier; - // loop siblings - while (current != null) { - // mark whatever type nodes we wanna make dirty - if (current.getNodeType() == Node.ELEMENT_NODE || current.getNodeType() == Node.DOCUMENT_TYPE_NODE || current.getNodeType() == Node.DOCUMENT_NODE || current.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) { - temp = reconcile(current, monitor); - for (int i = 0; i < temp.length; i++) - results.add(temp[i]); - } - // drop one level deeper if necessary - if (current.getFirstChild() != null) { - temp = reconcileSubtree((INodeNotifier) current.getFirstChild(), monitor); - for (int i = 0; i < temp.length; i++) - results.add(temp[i]); - } - current = (XMLNode) current.getNextSibling(); - } - } - temp = new IReconcileResult[results.size()]; - System.arraycopy(results.toArray(), 0, temp, 0, results.size()); - } - return temp; - } - - /** - * Called from the ReconcileAdapterFactory - * - */ - public void release() { - - if (fCMDocumentCache != null) { - fCMDocumentCache.removeListener(this); - fCMDocumentCache = null; - } - } - - /** - * Determines whether the given Attr should not be validated according to - * the ignoreAttributeNamesStartingWith array - * - * @param attr - */ - protected boolean shouldIgnore(Attr attr) { - - boolean result = false; - String name = attr.getNodeName(); - for (int i = 0; i < ignoreAttributeNamesStartingWith.length; i++) { - if (fCaseSensitive) { - if (name.startsWith(ignoreAttributeNamesStartingWith[i])) - result = true; - } else { - try { - if (name.length() >= ignoreAttributeNamesStartingWith[i].length() && ignoreAttributeNamesStartingWith[i].equalsIgnoreCase(name.substring(0, ignoreAttributeNamesStartingWith[i].length()))) - result = true; - } catch (StringIndexOutOfBoundsException e) { - result = true; - } - } - } - return result; - } - - private void updateCMDocumentCache(ModelQuery mq, XMLNode xmlNode) { - - if (mq != null) { - CMDocumentManager cmDocManager = mq.getCMDocumentManager(); - if (cmDocManager != null) { - CMDocumentCache newCache = cmDocManager.getCMDocumentCache(); - if (newCache != null) { - if (fCMDocumentCache == null) { - // create fCMDocCache if necessary - fCMDocumentCache = newCache; - fCMDocumentCache.addListener(this); - fDocumentTypeForRefresh = (DocumentType) xmlNode; - } else if (fCMDocumentCache != newCache) { - fCMDocumentCache.removeListener(this); - fCMDocumentCache = newCache; - fCMDocumentCache.addListener(this); - fDocumentTypeForRefresh = (DocumentType) xmlNode; - } - } - } - } - } - - /** - * Called by reconcile(IAnnotationModel, Object) when the Object is a - * Notifier - * - */ - protected IReconcileResult[] validate(ModelQuery mq, XMLNode xmlNode) { - - List results = new ArrayList(); - if (xmlNode == null || !(xmlNode.getNodeType() == Node.ELEMENT_NODE || xmlNode.getNodeType() == Node.DOCUMENT_TYPE_NODE)) - return EMPTY_RECONCILE_RESULT_SET; - // return early if the Node has gone stale - if (xmlNode.getParentNode() == null || xmlNode.getOwnerDocument() == null) { - return EMPTY_RECONCILE_RESULT_SET; - } - if (xmlNode.getNodeType() == Node.DOCUMENT_TYPE_NODE) { - // sets CMDocumentCacheListener (this) - updateCMDocumentCache(mq, xmlNode); - } - CMDocument doc = mq.getCorrespondingCMDocument(xmlNode.getOwnerDocument()); - // looks like this is a bad check to do... I thought we took it out - // before - // if(doc == null) - // return EMPTY_RECONCILE_RESULT_SET; - if (doc != null && doc.getElements().getLength() == 0) { - // an empty document - return EMPTY_RECONCILE_RESULT_SET; - } - // continue on null or FALSE; inferred grammars aren't predefined so - // there's no point in continuing - if (doc != null && doc.getProperty("isInferred") != null && Boolean.TRUE.equals(doc.getProperty("isInferred"))) { //$NON-NLS-1$ //$NON-NLS-2$ - return EMPTY_RECONCILE_RESULT_SET; - } - - // if xmlNode is DOCTYPE, skip to the first element - // if there are no elements, return (don't validate) - XMLNode elementNode = xmlNode; - if (xmlNode.getNodeType() == Node.DOCUMENT_TYPE_NODE) { - boolean elementFound = false; - while ((elementNode = (XMLNode) elementNode.getNextSibling()) != null) { - if (elementNode.getNodeType() == Node.ELEMENT_NODE) { - elementFound = true; - break; - } - } - if (!elementFound) - return EMPTY_RECONCILE_RESULT_SET; - } - XMLElement element = (XMLElement) elementNode; - // boolean needsEndTag = true; - - // test for a known element, if it's known, continue validating it - CMElementDeclaration elementDecl = mq.getCMElementDeclaration(element); - if (elementDecl != null) { - // needsEndTag = needsEndTag(elementNode, elementDecl); - NamedNodeMap attrs = element.getAttributes(); - List reqAttrList = getRequiredAttributes(elementDecl); - for (int i = 0; i < attrs.getLength(); i++) { - XMLAttr attr = (XMLAttr) attrs.item(i); - if (!shouldIgnore(attr)) { - - // iFix V511i - // CMVC 272647, attributes with namespace prefix get - // marked - // as error (even though they aren't) - // CMNode attrDecl = - // elementDecl.getAttributes().getNamedItem(attr.getNodeName()); - CMNode attrDecl = elementDecl.getAttributes().getNamedItem(attr.getLocalName()); - - // test for a known attribute - if (attrDecl != null) { - // test for a known value (if there is an enumerated - // list of them) - String[] values = mq.getPossibleDataTypeValues(element, attrDecl); - String currentValue = attr.getValue(); - boolean found = valueMatch(values, currentValue); - if (!found) { - int start = attr.getValueRegionStartOffset(); - int length = attr.getValueRegion().getTextLength(); - Object[] args = {currentValue.trim()}; - String message = SSEUIPlugin.getResourceString("%Invalid_value_{0}", args); - Position p = new Position(start, length); - ReconcileAnnotationKey key = createKey(elementNode.getFirstStructuredDocumentRegion(), ReconcileAnnotationKey.PARTIAL); - results.add(new TemporaryAnnotation(p, SEVERITY_UNKNOWN_ATTR, message, key)); - } - // remove from known required attribute list - reqAttrList.remove(attrDecl); - } else { - Object[] args = {attr.getName()}; - String message = SSEUIPlugin.getResourceString("%Unknown_attribute_{0}", args); - int start = attr.getNameRegionStartOffset(); - int length = attr.getNameRegion().getTextLength(); - Position p = new Position(start, length); - ReconcileAnnotationKey key = createKey(elementNode.getFirstStructuredDocumentRegion(), ReconcileAnnotationKey.PARTIAL); - results.add(new TemporaryAnnotation(p, SEVERITY_UNKNOWN_ATTR, message, key, ProblemIDsXML.UnknownAttr)); - } - } else { - // remove so we don't flag "ignored" attributes as missing - reqAttrList.remove(elementDecl.getAttributes().getNamedItem(attr.getNodeName())); - } - } - // if there are missing required attributes, create annotations - // for - // them - if (reqAttrList != null && !reqAttrList.isEmpty()) { - Iterator it = reqAttrList.iterator(); - int start = 0; - int length = 1; - CMAttributeDeclaration attr = null; - while (it.hasNext()) { - attr = (CMAttributeDeclaration) it.next(); - // sometimes getFirstStructuredDocumentRegion can return - // null, this is a safety - start = (element.getFirstStructuredDocumentRegion() != null) ? element.getFirstStructuredDocumentRegion().getStartOffset() : element.getStartOffset(); - length = (element.getFirstStructuredDocumentRegion() != null) ? element.getFirstStructuredDocumentRegion().getLength() : 1; - - Object[] args = {attr.getAttrName()}; - String message = SSEUIPlugin.getResourceString("%Missing_required_attribute_{0}", args); - - Position p = new Position(start, length); - ReconcileAnnotationKey key = createKey(elementNode.getFirstStructuredDocumentRegion(), ReconcileAnnotationKey.PARTIAL); - TemporaryAnnotation annotation = new TemporaryAnnotation(p, SEVERITY_MISSING_REQUIRED_ATTR, message, key, ProblemIDsXML.MissingRequiredAttr); - - IStructuredDocumentRegion startStructuredDocumentRegion = element.getStartStructuredDocumentRegion(); - if (startStructuredDocumentRegion != null) { - String requiredAttrName = attr.getAttrName(); - String defaultAttrValue = attr.getDefaultValue(); - String insertString; - if (defaultAttrValue == null) - insertString = requiredAttrName + "=\"" + requiredAttrName + "\""; //$NON-NLS-1$ //$NON-NLS-2$ - else - insertString = requiredAttrName + "=\"" + defaultAttrValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$ - - ITextRegion lastRegion = startStructuredDocumentRegion.getLastRegion(); - int insertOffset = lastRegion.getEnd(); - if (lastRegion.getEnd() == lastRegion.getTextEnd()) - insertString = " " + insertString; //$NON-NLS-1$ - if (lastRegion.getType() == XMLRegionContext.XML_TAG_CLOSE) - insertOffset = lastRegion.getStart(); - Object[] additionalFixInfo = {insertString, new Integer(insertOffset)}; - annotation.setAdditionalFixInfo(additionalFixInfo); - results.add(annotation); - } - } - } - } else if (isUnknown(element, mq)) { // CMVC 254838 - int start = element.getStartOffset(); - int length = element.getEndOffset() - element.getStartOffset(); - if (element.getStartStructuredDocumentRegion() != null && element.getStartStructuredDocumentRegion().getNumberOfRegions() > 1) { - ITextRegion name = element.getStartStructuredDocumentRegion().getRegions().get(1); - start = element.getStartStructuredDocumentRegion().getStartOffset(name); - length = name.getTextLength(); - } - Object[] args = {element.getNodeName()}; - String message = SSEUIPlugin.getResourceString("%Unknown_element_{0}", args); - Position p = new Position(start, length); - ReconcileAnnotationKey key = createKey(elementNode.getFirstStructuredDocumentRegion(), ReconcileAnnotationKey.PARTIAL); - TemporaryAnnotation annotation = new TemporaryAnnotation(p, SEVERITY_UNKNOWN_ELEMENT, message, key, ProblemIDsXML.UnknownElement); - - // quick fix info - int startTagOffset = -1, startTagLength = -1, endTagOffset = -1, endTagLength = -1; - if (element.getStartStructuredDocumentRegion() != null) { - startTagOffset = element.getStartStructuredDocumentRegion().getStartOffset(); - startTagLength = element.getStartStructuredDocumentRegion().getLength(); - } - if (element.getEndStructuredDocumentRegion() != null) { - endTagOffset = element.getEndStructuredDocumentRegion().getStartOffset(); - endTagLength = element.getEndStructuredDocumentRegion().getLength(); - } - Object[] additionalFixInfo = {new Integer(startTagOffset), new Integer(startTagLength), new Integer(endTagOffset), new Integer(endTagLength)}; - - annotation.setAdditionalFixInfo(additionalFixInfo); - results.add(annotation); - } - IReconcileResult[] reconcileResults = new IReconcileResult[results.size()]; - System.arraycopy(results.toArray(), 0, reconcileResults, 0, results.size()); - return reconcileResults; - } - - /** - * Determines if String value is within the values array given the current - * case sensitivity - * - * @param values - * @param value - */ - protected boolean valueMatch(String[] values, String value) { - - boolean found = (values == null || values.length == 0 || value.length() == 0); - for (int j = 0; j < values.length && !found; j++) { - if (fCaseSensitive) { - if (values[j].equals(value)) - found = true; - } else if (values[j].equalsIgnoreCase(value)) - found = true; - } - return found; - } - - // CMVC 255301 - // If we are in a large reconciling loop, this ensures - // that other Threads have a chance to run. - protected void yieldIfNeeded() { - - // 100 is arbitrary, may need a better number - if (fReconcileCount >= 100) { - Thread.yield(); - fReconcileCount = 0; - } else { - fReconcileCount++; - } - } -}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcileStepForContentModel.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcileStepForContentModel.java deleted file mode 100644 index a9c0c9b..0000000 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcileStepForContentModel.java +++ /dev/null
@@ -1,235 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.xml.ui.reconcile; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; - -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.reconciler.DirtyRegion; -import org.eclipse.jface.text.reconciler.IReconcileResult; -import org.eclipse.jface.text.reconciler.IReconcileStep; -import org.eclipse.wst.sse.core.IAdapterFactory; -import org.eclipse.wst.sse.core.INodeNotifier; -import org.eclipse.wst.sse.core.IndexedRegion; -import org.eclipse.wst.sse.core.StructuredModelManager; -import org.eclipse.wst.sse.core.internal.PropagatingAdapter; -import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion; -import org.eclipse.wst.sse.core.text.ITextRegion; -import org.eclipse.wst.sse.ui.StructuredTextReconciler; -import org.eclipse.wst.sse.ui.StructuredTextViewer; -import org.eclipse.wst.sse.ui.internal.reconcile.IReconcileStepAdapter; -import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey; -import org.eclipse.wst.sse.ui.internal.reconcile.StructuredReconcileStep; -import org.eclipse.wst.xml.core.document.XMLDocument; -import org.eclipse.wst.xml.core.document.XMLModel; -import org.eclipse.wst.xml.core.document.XMLNode; -import org.eclipse.wst.xml.core.parser.XMLRegionContext; -import org.eclipse.wst.xml.ui.internal.Logger; - - -/** - * A reconcile step for ContentModel based documents. - * @deprecated using reconcileValidator extension point - */ -public class ReconcileStepForContentModel extends StructuredReconcileStep { - private HashSet fLocalPartitionTypes = null; - - protected boolean fRanInitialValidate = false; - - public ReconcileStepForContentModel() { - super(); - fLocalPartitionTypes = new HashSet(); - } - - public ReconcileStepForContentModel(StructuredTextViewer viewer, IReconcileStep step) { - super(step); - fLocalPartitionTypes = new HashSet(); - } - - private void addPartitionTypes(String[] types) { - for (int i = 0; i < types.length; i++) - fLocalPartitionTypes.add(types[i]); - } - - /** - * Need to add partition types for ReconcileStepAdapterForXML here... - * - */ - public String[] getPartitionTypes() { - String[] superPartitionTypes = super.getPartitionTypes(); - String[] results = new String[superPartitionTypes.length + fLocalPartitionTypes.size()]; - System.arraycopy(superPartitionTypes, 0, results, 0, superPartitionTypes.length); - System.arraycopy(fLocalPartitionTypes.toArray(), 0, results, superPartitionTypes.length, fLocalPartitionTypes.size()); - return results; - } - - public int getScope() { - return ReconcileAnnotationKey.PARTIAL; - } - - public void initialValidate() { - - // (pa) perf: add the adapter for every node here - XMLModel xModel = (XMLModel) StructuredModelManager.getModelManager().getExistingModelForRead(getDocument()); - XMLDocument doc = xModel.getDocument(); - xModel.releaseFromRead(); - PropagatingAdapter propagatingAdapter = (PropagatingAdapter) doc.getAdapterFor(PropagatingAdapter.class); - - List factories = propagatingAdapter.getAdaptOnCreateFactories(); - ReconcilerAdapterFactoryForXML rAdapterFactoryForXML = null; - IAdapterFactory temp = null; - // find the ReconcileStepAdapterFactory - for (int i = 0; i < factories.size(); i++) { - temp = (IAdapterFactory) factories.get(i); - if (temp.isFactoryForType(IReconcileStepAdapter.class)) { - rAdapterFactoryForXML = (ReconcilerAdapterFactoryForXML) temp; - break; - } - } - - if (rAdapterFactoryForXML != null) { - rAdapterFactoryForXML.setShouldMarkForReconciling(false); - initialValidateTree(doc, rAdapterFactoryForXML); - rAdapterFactoryForXML.setShouldMarkForReconciling(true); - } - } - - /** - * Mark the INodeNotifier (Node) and all children of the INodeNotifier - * passed in. - * - * @param notifier - */ - protected void initialValidateTree(INodeNotifier notifier, IAdapterFactory rAdapterFactoryForXML) { - if (isCanceled()) - return; - - if (notifier != null && notifier instanceof XMLNode) { - XMLNode current = (XMLNode) notifier; - IReconcileStepAdapter adapter = null; - // loop siblings - // pa_TODO for large XML files this loop goes for a LONG time - // and the progress monitor never gets canceled - while (current != null && !isCanceled()) { - // adapt this notifier - adapter = (IReconcileStepAdapter) rAdapterFactoryForXML.adapt(current); - if (adapter != null) { -// ((AbstractReconcileStepAdapter) adapter).setParentStep(this); -// adapter.markForReconciling(current); -// current.addAdapter(adapter); -// adapter.reconcile(getProgressMonitor(), current); - } - if (current.getFirstChild() != null) { - initialValidateTree((XMLNode) current.getFirstChild(), rAdapterFactoryForXML); - } - current = (XMLNode) current.getNextSibling(); - } - } - } - - - // Determines whether the IStructuredDocumentRegion is a XML "end tag" - // since they're not allowed to have - // attribute ITextRegions - protected boolean isEndTag(IStructuredDocumentRegion structuredDocumentRegion) { - return structuredDocumentRegion.getFirstRegion().getType() == XMLRegionContext.XML_END_TAG_OPEN; - } - - // Determines whether the IStructuredDocumentRegion is a XML "start tag" - // since they need to be - // checked for proper XML attribute region sequences - protected boolean isStartTag(IStructuredDocumentRegion structuredDocumentRegion) { - return structuredDocumentRegion.getFirstRegion().getType() == XMLRegionContext.XML_TAG_OPEN; - } - - // Because we check the "proper" closing separately from attribute - // sequencing, we need to know what's - // an appropriate close. - protected boolean isTagCloseTextRegion(ITextRegion textRegion) { - return textRegion.getType() == XMLRegionContext.XML_TAG_CLOSE || textRegion.getType() == XMLRegionContext.XML_EMPTY_TAG_CLOSE; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.sse.ui.internal.ui.text.StructuredReconcileStep#reconcileModel(org.eclipse.jface.text.reconciler.DirtyRegion, - * org.eclipse.jface.text.IRegion) - */ - protected IReconcileResult[] reconcileModel(DirtyRegion dirtyRegion, IRegion subRegion) { - if (dirtyRegion == null) - return EMPTY_RECONCILE_RESULT_SET; - - // logging ------------------ - Logger.trace(StructuredTextReconciler.TRACE_FILTER, "[trace reconciler] > reconciling model in CONTENT MODEL step w/ dirty region: [" + dirtyRegion.getOffset() + ":" + dirtyRegion.getLength() + "]" + dirtyRegion.getText()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - // -------------------------- - - int start = dirtyRegion.getOffset(); - int length = dirtyRegion.getLength(); - - IReconcileResult[] results = validate(start, length); - - // logging ------------------ - Logger.trace(StructuredTextReconciler.TRACE_FILTER, "[trace reconciler] > CONTENT MODEL step done"); //$NON-NLS-1$ - // -------------------------- - return results; - } - - /** - * Forces the IReconcilerAdapters for XMLNodes overlapping the given - * region to "validate" their Nodes. - * - * @param startOffset - * @param length - */ - protected IReconcileResult[] validate(int startOffset, int length) { - List results = new ArrayList(); - IReconcileResult[] temp = EMPTY_RECONCILE_RESULT_SET; - - if (!fRanInitialValidate) { - initialValidate(); - fRanInitialValidate = true; - } else { - XMLModel model = (XMLModel) StructuredModelManager.getModelManager().getExistingModelForRead(getDocument()); - int endOffset = startOffset + length; - - IndexedRegion indexedNode = model.getIndexedRegion(startOffset); - IReconcileStepAdapter adapter = null; - - // sometimes for single key type length can be 0 (startOffset == - // endOffset) - for (int i = startOffset; indexedNode != null && i <= endOffset && !isCanceled(); i++) { - - XMLNode xmlNode = (XMLNode) indexedNode; - adapter = (IReconcileStepAdapter) xmlNode.getAdapterFor(IReconcileStepAdapter.class); - if (adapter != null) { - temp = adapter.reconcile(getProgressMonitor(), xmlNode); - for (int j = 0; j < temp.length; j++) - results.add(temp[j]); - // this is for removal purposes later - addPartitionTypes(adapter.getPartitionTypes()); - } - // visited.add(indexedNode); - if (xmlNode.getFirstStructuredDocumentRegion() != null) - i += xmlNode.getFirstStructuredDocumentRegion().getLength(); - else - i++; - - indexedNode = model.getIndexedRegion(i); - } - model.releaseFromRead(); - } - return (IReconcileResult[]) results.toArray(new IReconcileResult[results.size()]); - } -}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcilerAdapterFactoryForXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcilerAdapterFactoryForXML.java deleted file mode 100644 index ecec301..0000000 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/ReconcilerAdapterFactoryForXML.java +++ /dev/null
@@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.xml.ui.reconcile; - -import org.eclipse.wst.sse.core.AbstractAdapterFactory; -import org.eclipse.wst.sse.core.INodeAdapter; -import org.eclipse.wst.sse.core.INodeNotifier; -import org.eclipse.wst.sse.ui.internal.reconcile.IReconcileStepAdapter; -import org.eclipse.wst.xml.core.document.XMLModel; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * @deprecated moving toward reconcileValidator extension point - */ -public class ReconcilerAdapterFactoryForXML extends AbstractAdapterFactory { - - /** - * This flag governs whether or not this ReconcilerFactory is responsible - * for marking nodes "dirty" when an adapter is created for them. This is - * true on startup, then set to false thereafter. - */ - protected boolean fShouldMarkForReconciling = false; - - protected AbstractReconcileStepAdapter singleton = null; - - public ReconcilerAdapterFactoryForXML() { - this(IReconcileStepAdapter.class, true); - } - - /** - * @param adapterKey - * @param registerAdapters - */ - public ReconcilerAdapterFactoryForXML(Object adapterKey, boolean registerAdapters) { - super(adapterKey, registerAdapters); - } - - protected void adaptAll(Node top) { - int length = top.getChildNodes().getLength(); - NodeList children = top.getChildNodes(); - for (int i = 0; i < length; i++) { - adaptAll(children.item(i)); - } - ((INodeNotifier) top).getAdapterFor(adapterKey); - } - - public void adaptAll(XMLModel model) { - if (adapterKey != null) - adaptAll(model.getDocument()); - } - - /* - * (non-Javadoc) - * - * @see com.ibm.sed.model.AbstractAdapterFactory#createAdapter(com.ibm.sed.model.INodeNotifier) - */ - protected INodeAdapter createAdapter(INodeNotifier target) { - if (target instanceof Node) { - Node nodeTarget = (Node) target; - if (nodeTarget.getNodeType() == Node.ELEMENT_NODE || nodeTarget.getNodeType() == Node.DOCUMENT_NODE || nodeTarget.getNodeType() == Node.DOCUMENT_TYPE_NODE) { - if (singleton == null) { - this.singleton = new ReconcileStepAdapterForXML(); - } - // (pa) perf: don't do this on initial startup - if (shouldMarkForReconciling()) - singleton.markForReconciling(target); - return singleton; - } - } - return null; - } - - public void release() { - if (this.singleton != null) - this.singleton.release(); - } - - public void setShouldMarkForReconciling(boolean should) { - fShouldMarkForReconciling = should; - } - - public boolean shouldMarkForReconciling() { - return fShouldMarkForReconciling; - } -}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/StructuredTextReconcilingStrategyForContentModel.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/StructuredTextReconcilingStrategyForContentModel.java deleted file mode 100644 index 4768dbe..0000000 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/reconcile/StructuredTextReconcilingStrategyForContentModel.java +++ /dev/null
@@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.xml.ui.reconcile; - -import org.eclipse.jface.text.reconciler.IReconcileStep; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy; - - -/** - * @deprecated using reconcileValidator extension point - * @author pavery - */ -public class StructuredTextReconcilingStrategyForContentModel extends AbstractStructuredTextReconcilingStrategy { - - public StructuredTextReconcilingStrategyForContentModel(ITextEditor editor) { - super(editor); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.wst.sse.ui.internal.ui.text.AbstractStructuredTextReconcilingStrategy#createReconcileSteps() - */ - public void createReconcileSteps() { - - IReconcileStep cmStep = new ReconcileStepForContentModel(); - fFirstStep = new ReconcileStepForMarkup(cmStep); - } - -}
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.xml b/bundles/org.eclipse.wst.xsd.ui/plugin.xml index e958536..cb77ce4 100644 --- a/bundles/org.eclipse.wst.xsd.ui/plugin.xml +++ b/bundles/org.eclipse.wst.xsd.ui/plugin.xml
@@ -207,15 +207,15 @@ <!-- intialize xsd reconcile validator --> <extension - point="org.eclipse.wst.sse.ui.reconcileValidator"> + point="org.eclipse.wst.sse.ui.sourcevalidation"> <validator scope="total" - class="org.eclipse.wst.xsd.ui.reconcile.DelegatingReconcileValidatorForXSD" - id="org.eclipse.wst.xsd.ui.reconcile.DelegatingReconcileValidatorForXSD"> + class="org.eclipse.wst.xsd.ui.reconcile.DelegatingSourceValidatorForXSD" + id="org.eclipse.wst.xsd.ui.reconcile.DelegatingSourceValidatorForXSD"> <contentTypeIdentifier id="org.eclipse.wst.xsd.contentmodel.xsdsource"> <partitionType - id="org.eclipse.wst.xml.DEFAULT_XML"> + id="org.eclipse.wst.xml.XML_DEFAULT"> </partitionType> </contentTypeIdentifier> </validator>
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java index 57bf372..c9e8790 100644 --- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java +++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDActionBarContributor.java
@@ -32,7 +32,7 @@ import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.ITextEditorActionConstants; import org.eclipse.ui.texteditor.RetargetTextEditorAction; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; import org.eclipse.wst.xsd.ui.internal.actions.ISchemaEditorActionConstants; import org.eclipse.wst.xsd.ui.internal.actions.ReloadDependenciesAction; import org.eclipse.wst.xsd.ui.internal.refactor.actions.RefactorActionGroup;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDTextEditor.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDTextEditor.java index d609bd0..bf18a89 100644 --- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDTextEditor.java +++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/XSDTextEditor.java
@@ -35,7 +35,7 @@ import org.eclipse.ui.views.properties.IPropertySheetPage; import org.eclipse.wst.sse.core.internal.SSECorePlugin; import org.eclipse.wst.sse.ui.StructuredTextViewer; -import org.eclipse.wst.sse.ui.edit.util.StructuredTextEditorActionConstants; +import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants; import org.eclipse.wst.sse.ui.internal.openon.OpenOnAction; import org.eclipse.wst.sse.ui.view.events.INodeSelectionListener; import org.eclipse.wst.sse.ui.view.events.NodeSelectionChangedEvent;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/reconcile/DelegatingReconcileValidatorForXSD.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/reconcile/DelegatingSourceValidatorForXSD.java similarity index 75% rename from bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/reconcile/DelegatingReconcileValidatorForXSD.java rename to bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/reconcile/DelegatingSourceValidatorForXSD.java index 90205e4..49e6dcb 100644 --- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/reconcile/DelegatingReconcileValidatorForXSD.java +++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/reconcile/DelegatingSourceValidatorForXSD.java
@@ -5,18 +5,18 @@ import org.eclipse.wst.validation.core.IValidator; import org.eclipse.wst.validation.plugin.ValidationPlugin; -import org.eclipse.wst.xml.ui.reconcile.DelegatingReconcileValidator; +import org.eclipse.wst.xml.ui.reconcile.DelegatingSourceValidator; /** * @author mhutchin * */ -public class DelegatingReconcileValidatorForXSD extends DelegatingReconcileValidator +public class DelegatingSourceValidatorForXSD extends DelegatingSourceValidator { final private static String VALIDATOR_CLASS = "org.eclipse.wst.xsd.validation.internal.ui.eclipse.Validator"; - public DelegatingReconcileValidatorForXSD() + public DelegatingSourceValidatorForXSD() { super(); }