Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2005-04-13 19:12:49 +0000
committernitind2005-04-13 19:12:49 +0000
commit292ded1b4de2f6030e4038b92a37ea5914d3ea7d (patch)
tree44e67d379b97f7e2b353212e4103815636679fec /bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui
parent20cb84d3fe65f82e36498d9946b3b951273a4a4d (diff)
downloadwebtools.sourceediting-292ded1b4de2f6030e4038b92a37ea5914d3ea7d.tar.gz
webtools.sourceediting-292ded1b4de2f6030e4038b92a37ea5914d3ea7d.tar.xz
webtools.sourceediting-292ded1b4de2f6030e4038b92a37ea5914d3ea7d.zip
This commit was manufactured by cvs2svn to create tag 'v20050413_1525'.v20050413_1525
Diffstat (limited to 'bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui')
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java62
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java361
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java100
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java104
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties73
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java160
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/SharedHTMLEditorPluginImageHelper.java58
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java40
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java478
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java130
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java78
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java40
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java83
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java125
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java50
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java114
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java30
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java29
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java172
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java23
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java24
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java56
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java277
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java279
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java31
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTML.java42
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java310
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java154
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java31
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java43
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java146
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java72
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/URIHyperlinkDetector.java89
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java79
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java472
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java77
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java55
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java124
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java190
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java142
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java58
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java97
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java263
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java216
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForEmbeddedHTML.java35
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java138
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java49
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java22
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java75
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLBestMatchHoverProcessor.java34
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java53
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java28
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java38
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java34
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java50
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java28
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/views/contentoutline/HTMLContentOutlineConfiguration.java41
-rw-r--r--bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java84
58 files changed, 0 insertions, 6346 deletions
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
deleted file mode 100644
index 9a3d9c2369..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextEditorHTML.java
+++ /dev/null
@@ -1,62 +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
- *******************************************************************************/
-package org.eclipse.wst.html.ui;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.wst.html.ui.internal.edit.ui.CleanupActionHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.html.ui.internal.search.HTMLFindOccurrencesAction;
-import org.eclipse.wst.sse.ui.internal.StructuredTextEditor;
-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;
-import org.eclipse.wst.xml.ui.actions.ToggleCommentActionXML;
-
-public class StructuredTextEditorHTML extends StructuredTextEditor {
- private final static String UNDERSCORE = "_"; //$NON-NLS-1$
-
- protected void createActions() {
- super.createActions();
-
- ResourceBundle resourceBundle = HTMLUIMessages.getResourceBundle();
-
- Action action = new CleanupActionHTML(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT + UNDERSCORE, this);
- action.setActionDefinitionId(ActionDefinitionIds.CLEANUP_DOCUMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_CLEANUP_DOCUMENT, action);
-
- action = new ToggleCommentActionXML(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_TOGGLE_COMMENT + UNDERSCORE, this);
- action.setActionDefinitionId(ActionDefinitionIds.TOGGLE_COMMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_TOGGLE_COMMENT, action);
-
- action = new AddBlockCommentActionXML(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_ADD_BLOCK_COMMENT + UNDERSCORE, this);
- action.setActionDefinitionId(ActionDefinitionIds.ADD_BLOCK_COMMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_ADD_BLOCK_COMMENT, action);
-
- action = new RemoveBlockCommentActionXML(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_REMOVE_BLOCK_COMMENT + UNDERSCORE, this);
- action.setActionDefinitionId(ActionDefinitionIds.REMOVE_BLOCK_COMMENT);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_REMOVE_BLOCK_COMMENT, action);
-
- FindOccurrencesActionProvider foAction = new FindOccurrencesActionProvider(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FIND_OCCURRENCES + UNDERSCORE, this);
- foAction.addAction(new HTMLFindOccurrencesAction(resourceBundle, "", this)); //$NON-NLS-1$
- foAction.setActionDefinitionId(ActionDefinitionIds.FIND_OCCURRENCES);
- setAction(StructuredTextEditorActionConstants.ACTION_NAME_FIND_OCCURRENCES, foAction);
- markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FIND_OCCURRENCES, true);
- }
- protected void initializeEditor() {
- super.initializeEditor();
- setHelpContextId(IHelpContextIds.HTML_SOURCEVIEW_HELPID);
- }
-} \ No newline at end of file
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
deleted file mode 100644
index a33c52aadb..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jdt.ui.text.JavaSourceViewerConfiguration;
-import org.eclipse.jdt.ui.text.JavaTextTools;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.IAutoEditStrategy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextDoubleClickStrategy;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.formatter.IContentFormatter;
-import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.information.IInformationPresenter;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.InformationPresenter;
-import org.eclipse.jface.text.reconciler.IReconciler;
-import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
-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.text.ICSSPartitionTypes;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.css.ui.internal.style.LineStyleProviderForEmbeddedCSS;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
-import org.eclipse.wst.html.core.text.IHTMLPartitionTypes;
-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;
-import org.eclipse.wst.html.ui.internal.style.LineStyleProviderForHTML;
-import org.eclipse.wst.html.ui.internal.taginfo.HTMLBestMatchHoverProcessor;
-import org.eclipse.wst.html.ui.internal.taginfo.HTMLInformationProvider;
-import org.eclipse.wst.html.ui.internal.taginfo.HTMLTagInfoHoverProcessor;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.javascript.ui.internal.common.style.LineStyleProviderForJavaScript;
-import org.eclipse.wst.javascript.ui.internal.common.taginfo.JavaScriptBestMatchHoverProcessor;
-import org.eclipse.wst.javascript.ui.internal.common.taginfo.JavaScriptInformationProvider;
-import org.eclipse.wst.javascript.ui.internal.common.taginfo.JavaScriptTagInfoHoverProcessor;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.text.IStructuredPartitionTypes;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.eclipse.wst.sse.ui.format.StructuredFormattingStrategy;
-import org.eclipse.wst.sse.ui.internal.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor;
-import org.eclipse.wst.sse.ui.preferences.CommonEditorPreferenceNames;
-import org.eclipse.wst.sse.ui.style.IHighlighter;
-import org.eclipse.wst.sse.ui.style.LineStyleProvider;
-import org.eclipse.wst.sse.ui.taginfo.AnnotationHoverProcessor;
-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.internal.text.rules.StructuredTextPartitionerForXML;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-import org.eclipse.wst.xml.ui.internal.autoedit.StructuredAutoEditStrategyXML;
-import org.eclipse.wst.xml.ui.internal.correction.CorrectionProcessorXML;
-import org.eclipse.wst.xml.ui.internal.doubleclick.XMLDoubleClickStrategy;
-import org.eclipse.wst.xml.ui.reconcile.StructuredTextReconcilingStrategyForMarkup;
-
-public class StructuredTextViewerConfigurationHTML extends StructuredTextViewerConfiguration {
-
- InformationPresenter fInformationPresenter = null;
-
- private JavaSourceViewerConfiguration fJavaSourceViewerConfiguration;
-
- public StructuredTextViewerConfigurationHTML() {
- super();
- }
-
- public StructuredTextViewerConfigurationHTML(IPreferenceStore store) {
- super(store);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
- */
- public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
- List allStrategies = new ArrayList(0);
-
- IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
- for (int i = 0; i < superStrategies.length; i++) {
- allStrategies.add(superStrategies[i]);
- }
-
- if (contentType == IHTMLPartitionTypes.HTML_DEFAULT || contentType == IHTMLPartitionTypes.HTML_DECLARATION) {
- allStrategies.add(new StructuredAutoEditStrategyXML());
- }
-
- return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[0]);
- }
-
- public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
- if (configuredContentTypes == null) {
- String[] xmlTypes = StructuredTextPartitionerForXML.getConfiguredContentTypes();
- String[] htmlTypes = StructuredTextPartitionerForHTML.getConfiguredContentTypes();
- configuredContentTypes = new String[2 + xmlTypes.length + htmlTypes.length];
-
- configuredContentTypes[0] = IStructuredPartitionTypes.DEFAULT_PARTITION;
- configuredContentTypes[1] = IStructuredPartitionTypes.UNKNOWN_PARTITION;
-
- int index = 0;
- System.arraycopy(xmlTypes, 0, configuredContentTypes, index += 2, xmlTypes.length);
- System.arraycopy(htmlTypes, 0, configuredContentTypes, index += xmlTypes.length, htmlTypes.length);
- }
-
- return configuredContentTypes;
- }
-
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- IContentAssistant ca = super.getContentAssistant(sourceViewer);
-
- if (ca != null && ca instanceof ContentAssistant) {
- ContentAssistant contentAssistant = (ContentAssistant) ca;
-
- IContentAssistProcessor htmlContentAssistProcessor = new HTMLContentAssistProcessor();
- IContentAssistProcessor jsContentAssistProcessor = new JavaScriptContentAssistProcessor();
- IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor();
- IContentAssistProcessor noRegionProcessorForHTML = new NoRegionContentAssistProcessorForHTML();
-
- // HTML
- setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, IHTMLPartitionTypes.HTML_DEFAULT);
- setContentAssistProcessor(contentAssistant, htmlContentAssistProcessor, IHTMLPartitionTypes.HTML_COMMENT);
-
- // JavaScript
- setContentAssistProcessor(contentAssistant, jsContentAssistProcessor, IHTMLPartitionTypes.SCRIPT);
-
- // CSS
- setContentAssistProcessor(contentAssistant, cssContentAssistProcessor, ICSSPartitionTypes.STYLE);
-
- // unknown
- setContentAssistProcessor(contentAssistant, noRegionProcessorForHTML, IStructuredPartitionTypes.UNKNOWN_PARTITION);
- }
-
- return ca;
- }
-
- public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
- final MultiPassContentFormatter formatter = new MultiPassContentFormatter(getConfiguredDocumentPartitioning(sourceViewer), IHTMLPartitionTypes.HTML_DEFAULT);
-
- formatter.setMasterStrategy(new StructuredFormattingStrategy(new HTMLFormatProcessorImpl()));
-
- return formatter;
- }
-
- public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer) {
- IContentAssistant ca = super.getCorrectionAssistant(sourceViewer);
-
- if (ca != null && ca instanceof ContentAssistant) {
- ContentAssistant correctionAssistant = (ContentAssistant) ca;
- ITextEditor editor = getTextEditor();
- if (editor != null) {
- IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(editor);
- correctionAssistant.setContentAssistProcessor(correctionProcessor, IHTMLPartitionTypes.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);
- }
- }
-
- return ca;
- }
-
- public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
- if (contentType.compareTo(IHTMLPartitionTypes.HTML_DEFAULT) == 0)
- // HTML
- return new XMLDoubleClickStrategy();
- else if (contentType.compareTo(IHTMLPartitionTypes.SCRIPT) == 0)
- // JavaScript
- return getJavaSourceViewerConfiguration(sourceViewer).getDoubleClickStrategy(sourceViewer, contentType);
- else
- return super.getDoubleClickStrategy(sourceViewer, contentType);
- }
-
- public IHighlighter getHighlighter(ISourceViewer sourceViewer) {
- IHighlighter highlighter = super.getHighlighter(sourceViewer);
-
- if (highlighter != null) {
- // HTML
- LineStyleProvider htmlLineStyleProvider = new LineStyleProviderForHTML();
- highlighter.addProvider(IHTMLPartitionTypes.HTML_DEFAULT, htmlLineStyleProvider);
- highlighter.addProvider(IHTMLPartitionTypes.HTML_COMMENT, htmlLineStyleProvider);
- highlighter.addProvider(IHTMLPartitionTypes.HTML_DECLARATION, htmlLineStyleProvider);
-
- // JavaScript
- LineStyleProvider jsLineStyleProvider = new LineStyleProviderForJavaScript();
- highlighter.addProvider(IHTMLPartitionTypes.SCRIPT, jsLineStyleProvider);
-
- // CSS
- LineStyleProvider cssLineStyleProvider = new LineStyleProviderForEmbeddedCSS();
- highlighter.addProvider(ICSSPartitionTypes.STYLE, cssLineStyleProvider);
- }
-
- return highlighter;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer)
- */
- public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
- if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED))
- return null;
-
- List allDetectors = new ArrayList(0);
- allDetectors.add(new URIHyperlinkDetector());
-
- IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
- for (int m = 0; m < superDetectors.length; m++) {
- IHyperlinkDetector detector = superDetectors[m];
- if (!allDetectors.contains(detector)) {
- allDetectors.add(detector);
- }
- }
- return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]);
- }
-
- public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
- if (fInformationPresenter == null) {
- fInformationPresenter = new InformationPresenter(getInformationPresenterControlCreator(sourceViewer));
-
- // HTML
- IInformationProvider htmlInformationProvider = new HTMLInformationProvider();
- fInformationPresenter.setInformationProvider(htmlInformationProvider, IHTMLPartitionTypes.HTML_DEFAULT);
-
- // JavaScript
- IInformationProvider javascriptInformationProvider = new JavaScriptInformationProvider();
- fInformationPresenter.setInformationProvider(javascriptInformationProvider, IHTMLPartitionTypes.SCRIPT);
-
- fInformationPresenter.setSizeConstraints(60, 10, true, true);
- }
-
- return fInformationPresenter;
- }
-
- private JavaSourceViewerConfiguration getJavaSourceViewerConfiguration(ISourceViewer viewer) {
- if (fJavaSourceViewerConfiguration == null) {
- IPreferenceStore store = PreferenceConstants.getPreferenceStore();
- JavaTextTools javaTextTools = new JavaTextTools(store);
- fJavaSourceViewerConfiguration = new JavaSourceViewerConfiguration(javaTextTools.getColorManager(), store, getTextEditor(), getConfiguredDocumentPartitioning(viewer));
- }
- return fJavaSourceViewerConfiguration;
- }
-
- /**
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconcilerg(org.eclipse.jface.text.source.ISourceViewer)
- */
- public IReconciler getReconciler(ISourceViewer sourceViewer) {
- if (fReconciler != null) {
- // a reconciler should always either be installed or disposed of
- if (!fReconciler.isInstalled()) {
- fReconciler = null;
- }
- }
-
- if (fReconciler == null) {
- // create one
- fReconciler = new StructuredRegionProcessor();
- fReconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
- }
-
- boolean reconcilingEnabled = fPreferenceStore.getBoolean(CommonEditorPreferenceNames.EVALUATE_TEMPORARY_PROBLEMS);
-
- if (!reconcilingEnabled)
- return fReconciler;
-
- if (fReconciler != null) {
- IDocument doc = ((StructuredTextEditor) editorPart).getDocumentProvider().getDocument(editorPart.getEditorInput());
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(doc);
- try {
- if (sModel != null) {
-
- String contentTypeId = sModel.getContentTypeIdentifier();
-
- IReconcilingStrategy markupStrategy = new StructuredTextReconcilingStrategyForMarkup((ITextEditor) editorPart);
-
- fReconciler.setReconcilingStrategy(markupStrategy, IStructuredPartitionTypes.DEFAULT_PARTITION);
- fReconciler.setReconcilingStrategy(markupStrategy, IXMLPartitions.XML_DEFAULT);
-
- fReconciler.setDefaultStrategy(markupStrategy);
-
- if (contentTypeId != null)
- fReconciler.setValidatorStrategy(createValidatorStrategy(contentTypeId));
- }
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- }
- return fReconciler;
- }
-
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- ITextHover hover = null;
- TextHoverManager.TextHoverDescriptor[] hoverDescs = getTextHovers();
- int i = 0;
- while (i < hoverDescs.length && hover == null) {
- if (hoverDescs[i].isEnabled() && EditorUtility.computeStateMask(hoverDescs[i].getModifierString()) == stateMask) {
- String hoverType = hoverDescs[i].getId();
- if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) {
- // treat specially if it's JavaScript, HTML otherwise
- if (contentType.equals(IHTMLPartitionTypes.SCRIPT)) {
- hover = new JavaScriptBestMatchHoverProcessor();
- }
- else {
- hover = new HTMLBestMatchHoverProcessor();
- }
- }
- else if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType)) {
- hover = new ProblemAnnotationHoverProcessor();
- }
- else if (TextHoverManager.ANNOTATION_HOVER.equalsIgnoreCase(hoverType)) {
- hover = new AnnotationHoverProcessor();
- }
- else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType)) {
- // treat specially if it's JavaScript, HTML otherwise
- if (contentType.equals(IHTMLPartitionTypes.SCRIPT)) {
- hover = new JavaScriptTagInfoHoverProcessor();
- }
- else {
- hover = new HTMLTagInfoHoverProcessor();
- }
- }
- }
- i++;
- }
- if (hover == null) {
- hover = super.getTextHover(sourceViewer, contentType, stateMask);
- }
- return hover;
- }
-
- public void unConfigure(ISourceViewer viewer) {
- super.unConfigure(viewer);
-
- // InformationPresenters
- if (fInformationPresenter != null)
- fInformationPresenter.uninstall();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
deleted file mode 100644
index a97543db6e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2005 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.wst.html.ui.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Strings used by HTML UI
- *
- * @since 1.0
- */
-public class HTMLUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.wst.html.ui.internal.HTMLUIPluginResources";//$NON-NLS-1$
- private static ResourceBundle fResourceBundle;
-
- public static String Sample_HTML_doc;
- public static String HTMLFilesPreferencePage_0;
- public static String HTMLFilesPreferencePage_1;
- public static String HTMLFilesPreferencePage_2;
- public static String HTMLFilesPreferencePage_3;
- public static String _UI_WIZARD_NEW_TITLE;
- public static String _UI_WIZARD_NEW_HEADING;
- public static String _UI_WIZARD_NEW_DESCRIPTION;
- public static String _ERROR_FILENAME_MUST_END_HTML;
- public static String Creating_files_encoding;
- public static String MESSAGE_HTML_VALIDATION_MESSAGE_UI_;
- public static String CleanupDocument_label; // resource bundle
- public static String CleanupDocument_tooltip; // resource bundle
- public static String CleanupDocument_description; // resource bundle
- public static String ToggleComment_label; // resource bundle
- public static String ToggleComment_tooltip; // resource bundle
- public static String ToggleComment_description; // resource bundle
- public static String AddBlockComment_label; // resource bundle
- public static String AddBlockComment_tooltip; // resource bundle
- public static String AddBlockComment_description; // resource bundle
- public static String RemoveBlockComment_label; // resource bundle
- public static String RemoveBlockComment_tooltip; // resource bundle
- public static String RemoveBlockComment_description; // resource bundle
- public static String FindOccurrences_label; // resource bundle
- public static String Creating_files;
- public static String Encoding_desc;
- public static String UI_Description_of_role_of_following_DOCTYPE;
- public static String UI_Public_ID;
- public static String UI_System_ID;
- public static String UI_none;
- public static String Preferred_markup_case_UI_;
- public static String Tag_names__UI_;
- public static String Tag_names_Upper_case_UI_;
- public static String Tag_names_Lower_case_UI_;
- public static String Attribute_names__UI_;
- public static String Attribute_names_Upper_case_UI_;
- public static String Attribute_names_Lower_case_UI_;
- public static String Cleanup_UI_;
- public static String Tag_name_case_for_HTML_UI_;
- public static String Tag_name_case_As_is_UI_;
- public static String Tag_name_case_Lower_UI_;
- public static String Tag_name_case_Upper_UI_;
- public static String Attribute_name_case_for_HTML_UI_;
- public static String Attribute_name_case_As_is_UI_;
- public static String Attribute_name_case_Lower_UI_;
- public static String Attribute_name_case_Upper_UI_;
- public static String Insert_required_attributes_UI_;
- public static String Insert_missing_tags_UI_;
- public static String Quote_attribute_values_UI_;
- public static String Format_source_UI_;
- public static String Convert_EOL_codes_UI_;
- public static String EOL_Windows_UI;
- public static String EOL_Unix_UI;
- public static String EOL_Mac_UI;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, HTMLUIMessages.class);
- }
-
- private HTMLUIMessages() {
- // cannot create new instance of this class
- }
-
- public static ResourceBundle getResourceBundle() {
- try {
- if (fResourceBundle == null)
- fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
- }
- catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- return fResourceBundle;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java
deleted file mode 100644
index 54618972e5..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPlugin.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal;
-
-import java.io.IOException;
-
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
-import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
-import org.eclipse.wst.sse.ui.registry.AdapterFactoryRegistry;
-import org.eclipse.wst.sse.ui.registry.AdapterFactoryRegistryImpl;
-import org.eclipse.wst.sse.ui.registry.embedded.EmbeddedAdapterFactoryRegistryImpl;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class HTMLUIPlugin extends AbstractUIPlugin {
- public final static String ID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
-
- protected static HTMLUIPlugin instance = null;
-
- /**
- * The template store for the html editor.
- */
- private TemplateStore fTemplateStore;
-
- /**
- * The template context type registry for the html editor.
- */
- private ContextTypeRegistry fContextTypeRegistry;
-
- public HTMLUIPlugin() {
- super();
- instance = this;
- }
-
- public static HTMLUIPlugin getDefault() {
- return instance;
- }
-
- public synchronized static HTMLUIPlugin getInstance() {
- return instance;
- }
-
- public AdapterFactoryRegistry getAdapterFactoryRegistry() {
- return AdapterFactoryRegistryImpl.getInstance();
-
- }
-
- public AdapterFactoryRegistry getEmbeddedAdapterFactoryRegistry() {
- return EmbeddedAdapterFactoryRegistryImpl.getInstance();
-
- }
-
- /**
- * Returns the template store for the html editor templates.
- *
- * @return the template store for the html editor templates
- */
- public TemplateStore getTemplateStore() {
- if (fTemplateStore == null) {
- fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), HTMLUIPreferenceNames.TEMPLATES_KEY);
-
- try {
- fTemplateStore.load();
- } catch (IOException e) {
- Logger.logException(e);
- }
- }
- return fTemplateStore;
- }
-
- /**
- * Returns the template context type registry for the html plugin.
- *
- * @return the template context type registry for the html plugin
- */
- public ContextTypeRegistry getTemplateContextRegistry() {
- if (fContextTypeRegistry == null) {
- ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
- registry.addContextType(TemplateContextTypeIdsHTML.ALL);
- registry.addContextType(TemplateContextTypeIdsHTML.NEW);
- registry.addContextType(TemplateContextTypeIdsHTML.TAG);
- registry.addContextType(TemplateContextTypeIdsHTML.ATTRIBUTE);
- registry.addContextType(TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE);
-
- fContextTypeRegistry = registry;
- }
-
- return fContextTypeRegistry;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
deleted file mode 100644
index b08c35a63e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
+++ /dev/null
@@ -1,73 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-## The following line is a sample HTML document. Please translate only the following parts:
-## HTML Highlighting Preferences
-## we need a flaming logo
-Sample_HTML_doc=<!DOCTYPE HTML\n\tPUBLIC \"-//W3C/DTD/ HTML 4.01 Transitional//EN\"\n\t\"http://www.w3.org/TR/html4/loose.dtd\">\n<HTML>\n\t<HEAD>\n\t\t<META content=\"text/html\">\n\t\t<TITLE>HTML Highlighting Preferences</TITLE>\n\t</HEAD>\n<BODY>\n\t<!--\n\t\twe need a flaming logo!\n\t-->\n</BODY>\n</HTML>
-
-HTMLFilesPreferencePage_0=Loading files...
-HTMLFilesPreferencePage_1=Add this suffix (if not specified):
-HTMLFilesPreferencePage_2=Insert DOCTYPE declaration
-HTMLFilesPreferencePage_3=Insert GENERATOR with META tag
-#
-_UI_WIZARD_NEW_TITLE = New HTML Page
-_UI_WIZARD_NEW_HEADING = HTML Page
-_UI_WIZARD_NEW_DESCRIPTION = Create a new HTML Page.
-_ERROR_FILENAME_MUST_END_HTML = The file name must end in .html or .xhtml
-#
-Creating_files_encoding=Creating files encoding preference
-MESSAGE_HTML_VALIDATION_MESSAGE_UI_=HTML Syntax : {0}
-# Copied from sse.ui
-CleanupDocument_label=C&leanup Document...
-CleanupDocument_tooltip=Cleanup Document
-CleanupDocument_description=Cleanup Document
-ToggleComment_label=Togg&le Comment
-ToggleComment_tooltip=Toggle Comment
-ToggleComment_description=Toggle Comment
-AddBlockComment_label=Add &Block Comment
-AddBlockComment_tooltip=Add Block Comment
-AddBlockComment_description=Add Block Comment
-RemoveBlockComment_label=Remove Bloc&k Comment
-RemoveBlockComment_tooltip=Remove Block Comment
-RemoveBlockComment_description=Remove Block Comment
-FindOccurrences_label=O&ccurrences in File
-Creating_files=Creating files
-Encoding_desc=The following encoding will apply:
-Preferred_markup_case_UI_=Preferred markup case for content assist, and code generation
-Tag_names__UI_=Tag names:
-Tag_names_Upper_case_UI_=&Uppercase
-Tag_names_Lower_case_UI_=&Lowercase
-Attribute_names__UI_=Attribute names:
-Attribute_names_Upper_case_UI_=U&ppercase
-Attribute_names_Lower_case_UI_=L&owercase
-Cleanup_UI_=Cleanup
-Tag_name_case_for_HTML_UI_=Tag name case for HTML:
-Tag_name_case_As_is_UI_=&As-is
-Tag_name_case_Lower_UI_=&Lower
-Tag_name_case_Upper_UI_=&Upper
-Attribute_name_case_for_HTML_UI_=Attribute name case for HTML:
-Attribute_name_case_As_is_UI_=A&s-is
-Attribute_name_case_Lower_UI_=L&ower
-Attribute_name_case_Upper_UI_=U&pper
-Insert_required_attributes_UI_=Insert &required attributes
-Insert_missing_tags_UI_=&Insert missing tags
-Quote_attribute_values_UI_=&Quote attribute values
-Format_source_UI_=&Format source
-Convert_EOL_codes_UI_=Convert line &delimiters to
-EOL_Windows_UI=&Windows
-EOL_Unix_UI=U&NIX
-EOL_Mac_UI=&Mac
-
-# web content settings
-UI_Description_of_role_of_following_DOCTYPE=Use the following default document type when no DOCTYPE is declared in a file:
-UI_Public_ID=Public ID:
-UI_System_ID=System ID:
-UI_none=none \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
deleted file mode 100644
index 0b872f0c3b..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/Logger.java
+++ /dev/null
@@ -1,160 +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.html.ui.internal;
-
-
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if
- * desired, the console. This class should only be used by classes in this
- * plugin. Other plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
-
- public static final int ERROR = IStatus.ERROR; // 4
- public static final int ERROR_DEBUG = 200 + ERROR;
- public static final int INFO = IStatus.INFO; // 1
- public static final int INFO_DEBUG = 200 + INFO;
-
- public static final int OK = IStatus.OK; // 0
-
- public static final int OK_DEBUG = 200 + OK;
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int WARNING_DEBUG = 200 + WARNING;
-
- /**
- * Adds message to log.
- *
- * @param level
- * severity level of the message (OK, INFO, WARNING, ERROR,
- * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message
- * text to add to the log
- * @param exception
- * exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- *
- * @param message
- * text to print
- * @param category
- * category of the message, to be compared with
- * /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- *
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/SharedHTMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/SharedHTMLEditorPluginImageHelper.java
deleted file mode 100644
index 68dc842246..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/SharedHTMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-
-
-public class SharedHTMLEditorPluginImageHelper {
- public static final String IMG_OBJ_TABLE = HTMLEditorPluginImages.IMG_OBJ_TABLE;
- public static final String IMG_OBJ_TAG_ANCHOR = HTMLEditorPluginImages.IMG_OBJ_TAG_ANCHOR;
- public static final String IMG_OBJ_TAG_BODY = HTMLEditorPluginImages.IMG_OBJ_TAG_BODY;
- public static final String IMG_OBJ_TAG_BUTTON = HTMLEditorPluginImages.IMG_OBJ_TAG_BUTTON;
- public static final String IMG_OBJ_TAG_FONT = HTMLEditorPluginImages.IMG_OBJ_TAG_FONT;
- public static final String IMG_OBJ_TAG_FORM = HTMLEditorPluginImages.IMG_OBJ_TAG_FORM;
- public static final String IMG_OBJ_TAG_HTML = HTMLEditorPluginImages.IMG_OBJ_TAG_HTML;
- public static final String IMG_OBJ_TAG_IMAGE_MAP = HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE_MAP;
- public static final String IMG_OBJ_TAG_IMAGE = HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE;
- public static final String IMG_OBJ_TAG_JSP = HTMLEditorPluginImages.IMG_OBJ_TAG_JSP;
- public static final String IMG_OBJ_TAG_TITLE = HTMLEditorPluginImages.IMG_OBJ_TAG_TITLE;
- public static final String IMG_OBJ_TAG = HTMLEditorPluginImages.IMG_OBJ_TAG;
-
- /**
- * Retrieves the specified image from the html source editor plugin's image registry.
- * Note: The returned <code>Image</code> is managed by the workbench; clients
- * must <b>not</b> dispose of the returned image.
- *
- * @param symbolicName the symbolic name of the image; there are constants
- * declared in this class for build-in images that come with the html source editor
- * @return the image, or <code>null</code> if not found
- */
- public static Image getImage(String symbolicName) {
- return HTMLEditorPluginImageHelper.getInstance().getImage(symbolicName);
- }
-
- /**
- * Retrieves the image descriptor for specified image from the html source editor plugin's
- * image registry. Unlike <code>Image</code>s, image descriptors themselves do
- * not need to be disposed.
- *
- * @param symbolicName the symbolic name of the image; there are constants
- * declared in this interface for build-in images that come with the html source editor
- * @return the image descriptor, or <code>null</code> if not found
- */
- public static ImageDescriptor getImageDescriptor(String symbolicName) {
- return HTMLEditorPluginImageHelper.getInstance().getImageDescriptor(symbolicName);
- }
-}
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
deleted file mode 100644
index 650a4c3f7d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/CustomTemplateProposal.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateProposal;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
-
-/**
- * Purpose of this class is to make the additional proposal info into content
- * fit for an HTML viewer (by escaping characters)
- */
-class CustomTemplateProposal extends TemplateProposal implements IRelevanceCompletionProposal {
- // copies of this class exist in:
- // org.eclipse.jst.jsp.ui.internal.contentassist
- // org.eclipse.wst.html.ui.internal.contentassist
- // org.eclipse.wst.xml.ui.internal.contentassist
-
- public CustomTemplateProposal(Template template, TemplateContext context, IRegion region, Image image, int relevance) {
- super(template, context, region, image, relevance);
- }
-
- public String getAdditionalProposalInfo() {
- String additionalInfo = super.getAdditionalProposalInfo();
- return StringUtils.convertToHTMLContent(additionalInfo);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
deleted file mode 100644
index 02110c8ba9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
+++ /dev/null
@@ -1,478 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.HTML40Namespace;
-import org.eclipse.wst.html.core.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLCMDocument;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.html.ui.internal.preferences.HTMLUIPreferenceNames;
-import org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeIdsHTML;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.sse.core.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.core.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.document.IDOMDocument;
-import org.eclipse.wst.xml.core.document.IDOMModel;
-import org.eclipse.wst.xml.core.document.IDOMNode;
-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.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
-import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class HTMLContentAssistProcessor extends AbstractContentAssistProcessor implements IPropertyChangeListener {
- private INodeAdapterFactory factoryForCSS = null;
- protected IPreferenceStore fPreferenceStore = null;
- protected boolean isXHTML = false;
- protected IResource fResource = null;
- private HTMLTemplateCompletionProcessor fTemplateProcessor = null;
- private List fTemplateContexts = new ArrayList();
-
- public HTMLContentAssistProcessor() {
-
- super();
- }
-
- protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE);
- super.addAttributeNameProposals(contentAssistRequest);
- }
-
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.ATTRIBUTE_VALUE);
- super.addAttributeValueProposals(contentAssistRequest);
- }
-
- /**
- * @see AbstractContentAssistProcessor#addXMLProposal(ContentAssistRequest)
- */
- protected void addXMLProposal(ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- super.addXMLProposal(contentAssistRequest);
- }
-
- /**
- * Add the proposals for a completely empty document
- */
- protected void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.NEW);
- }
-
- protected void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- super.addPCDATAProposal(nodeName, contentAssistRequest);
- }
-
- protected void addStartDocumentProposals(ContentAssistRequest contentAssistRequest) {
- if (isXHTML)
- addEmptyDocumentProposals(contentAssistRequest);
- }
-
- protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
- addTemplates(contentAssistRequest, TemplateContextTypeIdsHTML.TAG);
- super.addTagInsertionProposals(contentAssistRequest, childPosition);
- }
-
- /**
- * Adds templates to the list of proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
- if (contentAssistRequest == null)
- return;
-
- // if already adding template proposals for a certain context type, do
- // not add again
- if (!fTemplateContexts.contains(context)) {
- fTemplateContexts.add(context);
- boolean useProposalList = !contentAssistRequest.shouldSeparate();
-
- if (getTemplateCompletionProcessor() != null) {
- getTemplateCompletionProcessor().setContextType(context);
- ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, contentAssistRequest.getReplacementBeginPosition());
- for (int i = 0; i < proposals.length; ++i) {
- if (useProposalList)
- contentAssistRequest.addProposal(proposals[i]);
- else
- contentAssistRequest.addMacro(proposals[i]);
- }
- }
- }
- }
-
- protected boolean beginsWith(String aString, String prefix) {
- if (aString == null || prefix == null || prefix.length() == 0)
- return true;
- int minimumLength = Math.min(prefix.length(), aString.length());
- String beginning = aString.substring(0, minimumLength);
- return beginning.equalsIgnoreCase(prefix);
- }
-
- protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
- ContentAssistRequest request = super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
- addTemplates(request, TemplateContextTypeIdsHTML.ALL);
- return request;
- }
-
- /**
- * Return a list of proposed code completions based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text-editor control.
- *
- * @param documentPosition
- * a location within the document
- * @return an array of code-assist items
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int documentPosition) {
- fTemplateContexts.clear();
-
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) textViewer, documentPosition);
- IDOMNode node = (IDOMNode) treeNode;
- setErrorMessage(null);
-
- // check if it's in a comment node
- IStructuredDocument structuredDocument = (IStructuredDocument) textViewer.getDocument();
- IStructuredDocumentRegion fn = structuredDocument.getRegionAtCharacterOffset(documentPosition);
- if (fn != null && fn.getType() == DOMRegionContext.XML_COMMENT_TEXT && documentPosition != fn.getStartOffset()) {
- return new ICompletionProposal[0];
- }
-
- // CMVC 242695
- // if it's a </script> tag, bounce back to JS ca processor...
- if (fn != null && fn.getType() == DOMRegionContext.XML_TAG_NAME && documentPosition == fn.getStartOffset()) {
- ITextRegionList v = fn.getRegions();
- if (v.size() > 1) {
- // determine that it's a close tag
- if ((v.get(0)).getType() == DOMRegionContext.XML_END_TAG_OPEN) {
- Iterator it = v.iterator();
- ITextRegion region = null;
- // search for script tag name
- while (it.hasNext()) {
- region = (ITextRegion) it.next();
- if (fn.getText(region).equalsIgnoreCase("script")) { //$NON-NLS-1$
- // return JS content assist...
- JavaScriptContentAssistProcessor jsProcessor = new JavaScriptContentAssistProcessor();
- return jsProcessor.computeCompletionProposals(textViewer, documentPosition);
- }
- }
- }
- }
- }
-
- isXHTML = getXHTML(node);
-
- fGenerator = null; // force reload of content generator
-
- // handle blank HTML document case
- if (treeNode == null || isViewerEmpty(textViewer)) {
- // cursor is at the EOF
- ICompletionProposal htmlTagProposal = getHTMLTagPropsosal((StructuredTextViewer) textViewer, documentPosition);
- ICompletionProposal[] superResults = super.computeCompletionProposals(textViewer, documentPosition);
- if (superResults != null && superResults.length > 0 && htmlTagProposal != null) {
- ICompletionProposal[] blankHTMLDocResults = new ICompletionProposal[superResults.length + 1];
- blankHTMLDocResults[0] = htmlTagProposal;
- System.arraycopy(superResults, 0, blankHTMLDocResults, 1, superResults.length);
- return blankHTMLDocResults;
- }
- }
-
- if (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
-
- // check embedded CSS proposals at the beginning of the STYLE end
- // tag
- Element element = (Element) node;
- String tagName = element.getTagName();
- if (tagName != null && tagName.equalsIgnoreCase(HTML40Namespace.ATTR_NAME_STYLE)) {//$NON-NLS-1$
- IStructuredDocumentRegion endStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
- if (endStructuredDocumentRegion != null && endStructuredDocumentRegion.getStartOffset() == documentPosition) {
- IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
- if (startStructuredDocumentRegion != null) {
- int offset = startStructuredDocumentRegion.getEndOffset();
- int pos = documentPosition - offset;
- ICompletionProposal[] proposals = getCSSProposals(textViewer, pos, node, offset, (char) 0);
- if (proposals != null)
- return proposals;
- }
- }
- }
-
- // check inline CSS proposals
- // need to find attr region from sd region
- IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion((StructuredTextViewer) textViewer, documentPosition);
- Iterator regions = sdRegion.getRegions().iterator();
- ITextRegion styleNameRegion = null;
- ITextRegion styleValueRegion = null;
- while (regions.hasNext()) {
- styleNameRegion = (ITextRegion) regions.next();
- if (styleNameRegion.getType().equals(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) && sdRegion.getText(styleNameRegion).equalsIgnoreCase(HTML40Namespace.ATTR_NAME_STYLE)) { //$NON-NLS-1$
- // the next region should be "="
- if (regions.hasNext()) {
- regions.next(); // skip the "="
- // next region should be attr value region
- if (regions.hasNext()) {
- styleValueRegion = (ITextRegion) regions.next();
- break;
- }
- }
- }
- }
-
- if (styleValueRegion != null) {
- int offset = sdRegion.getStartOffset(styleValueRegion);
- int end = sdRegion.getTextEndOffset(styleValueRegion);
- if (documentPosition >= offset && documentPosition <= end) {
- boolean askCSS = true;
- char quote = (char) 0;
- String text = sdRegion.getText(styleValueRegion);
- int length = (text != null ? text.length() : 0);
- if (length > 0) {
- char firstChar = text.charAt(0);
- if (firstChar == '"' || firstChar == '\'') {
- if (documentPosition == offset) {
- // before quote
- askCSS = false;
- } else {
- offset++;
- quote = firstChar;
- }
- }
- if (documentPosition == end) {
- if (length > 1 && text.charAt(length - 1) == quote) {
- // after quote
- askCSS = false;
- }
- }
- }
- if (askCSS) {
- int pos = documentPosition - offset;
- ICompletionProposal[] proposals = getCSSProposals(textViewer, pos, node, offset, quote);
- if (proposals != null)
- return proposals;
- }
- }
- }
- }
-
- return super.computeCompletionProposals(textViewer, documentPosition);
- }
-
- /**
- * Returns true if there is no text or it's all white space, otherwise
- * returns false
- *
- * @param treeNode
- * @param textViewer
- * @return boolean
- */
- private boolean isViewerEmpty(ITextViewer textViewer) {
- boolean isEmpty = false;
- String text = textViewer.getTextWidget().getText();
- if (text == null || (text != null && text.trim().equals(""))) //$NON-NLS-1$
- isEmpty = true;
- return isEmpty;
- }
-
- /**
- * @return ICompletionProposal
- */
- private ICompletionProposal getHTMLTagPropsosal(StructuredTextViewer viewer, int documentPosition) {
- IModelManager mm = StructuredModelManager.getModelManager();
- IStructuredModel model = null;
- try {
- if (mm != null)
- model = mm.getExistingModelForRead(viewer.getDocument());
-
- IDOMDocument doc = ((IDOMModel) model).getDocument();
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(doc);
- // XHTML requires lowercase tagname for lookup
- CMElementDeclaration htmlDecl = (CMElementDeclaration) mq.getCorrespondingCMDocument(doc).getElements().getNamedItem(HTML40Namespace.ElementName.HTML.toLowerCase());
- if (htmlDecl != null) {
- StringBuffer proposedTextBuffer = new StringBuffer();
- getContentGenerator().generateTag(doc, htmlDecl, proposedTextBuffer);
-
- String proposedText = proposedTextBuffer.toString();
- String requiredName = getContentGenerator().getRequiredName(doc, htmlDecl);
-
- CustomCompletionProposal proposal = new CustomCompletionProposal(proposedText, documentPosition, // start
- // pos
- 0, // replace length
- requiredName.length() + 2, // cursor position
- // after (relavtive to
- // start)
- HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_GENERIC), requiredName, null, null, XMLRelevanceConstants.R_TAG_NAME);
- return proposal;
- }
- } finally {
- if (model != null)
- model.releaseFromRead();
- }
- return null;
- }
-
- /**
- * @see AbstractContentAssistProcessor#getContentGenerator()
- */
- public XMLContentModelGenerator getContentGenerator() {
- if (fGenerator == null) {
- if (isXHTML)
- fGenerator = XHTMLMinimalContentModelGenerator.getInstance();
- else
- fGenerator = HTMLMinimalContentModelGenerator.getInstance();
- }
- return fGenerator;
- }
-
- protected ICompletionProposal[] getCSSProposals(ITextViewer viewer, int pos, IDOMNode element, int offset, char quote) {
-
- CSSContentAssistProcessor cssProcessor = new CSSContentAssistProcessor();
- cssProcessor.setDocumentOffset(offset);
- cssProcessor.setQuoteCharOfStyleAttribute(quote);
-
- return cssProcessor.computeCompletionProposals(viewer, pos);
- }
-
- protected String getEmptyTagCloseString() {
- if (isXHTML)
- return " />"; //$NON-NLS-1$
- return ">"; //$NON-NLS-1$
- }
-
- private HTMLTemplateCompletionProcessor getTemplateCompletionProcessor() {
- if (fTemplateProcessor == null) {
- fTemplateProcessor = new HTMLTemplateCompletionProcessor();
- }
- return fTemplateProcessor;
- }
-
- /**
- * Determine if this Document is an XHTML Document. Oprates solely off of
- * the Document Type declaration
- */
- protected boolean getXHTML(Node node) {
- if (node == null)
- return false;
-
- Document doc = null;
- if (node.getNodeType() != Node.DOCUMENT_NODE)
- doc = node.getOwnerDocument();
- else
- doc = ((Document) node);
-
- if (doc instanceof IDOMDocument)
- return ((IDOMDocument) doc).isXMLType();
-
-
- if (doc instanceof INodeNotifier) {
- ModelQueryAdapter adapter = (ModelQueryAdapter) ((INodeNotifier) doc).getAdapterFor(ModelQueryAdapter.class);
- CMDocument cmdoc = null;
- if (adapter != null && adapter.getModelQuery() != null)
- cmdoc = adapter.getModelQuery().getCorrespondingCMDocument(doc);
- if (cmdoc != null) {
- // treat as XHTML unless we've got the in-code HTML content
- // model
- if (cmdoc instanceof HTMLCMDocument)
- return false;
- if (cmdoc.supports(HTMLCMProperties.IS_XHTML))
- return Boolean.TRUE.equals(cmdoc.getProperty(HTMLCMProperties.IS_XHTML));
- }
- }
- // this should never be reached
- DocumentType docType = doc.getDoctype();
- return docType != null && docType.getPublicId() != null && docType.getPublicId().indexOf("-//W3C//DTD XHTML ") == 0; //$NON-NLS-1$
- }
-
- protected void init() {
- getPreferenceStore().addPropertyChangeListener(this);
- reinit();
- }
-
- protected void reinit() {
- String key = HTMLUIPreferenceNames.AUTO_PROPOSE;
- boolean doAuto = getPreferenceStore().getBoolean(key);
- if (doAuto) {
- key = HTMLUIPreferenceNames.AUTO_PROPOSE_CODE;
- completionProposalAutoActivationCharacters = getPreferenceStore().getString(key).toCharArray();
- } else {
- completionProposalAutoActivationCharacters = null;
- }
- }
-
- public void release() {
- if (factoryForCSS != null) {
- factoryForCSS.release();
- }
- getPreferenceStore().removePropertyChangeListener(this);
- super.release();
- }
-
- protected boolean stringsEqual(String a, String b) {
- return a.equalsIgnoreCase(b);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
-
- if (property.compareTo(HTMLUIPreferenceNames.AUTO_PROPOSE) == 0 || property.compareTo(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE) == 0) {
- reinit();
- }
- }
-
- protected IPreferenceStore getPreferenceStore() {
- if (fPreferenceStore == null)
- fPreferenceStore = HTMLUIPlugin.getDefault().getPreferenceStore();
-
- return fPreferenceStore;
- }
-
- /**
- * @see com.ibm.sed.edit.adapters.ExtendedContentAssistAdapter#computeCompletionProposals(ITextViewer,
- * int, IndexedRegion, ITextRegion)
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition, IndexedRegion indexedNode, ITextRegion region) {
- return computeCompletionProposals(viewer, documentPosition);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
deleted file mode 100644
index 8f2a83f928..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLMinimalContentModelGenerator.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.wst.html.core.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.sse.core.internal.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.w3c.dom.Node;
-
-public class HTMLMinimalContentModelGenerator extends XMLContentModelGenerator {
-
- private static HTMLMinimalContentModelGenerator instance = null;
- protected int fTagCase;
- protected int fAttrCase;
-
- /**
- * HTMLMinimalContentModelGenerator constructor comment.
- */
- private HTMLMinimalContentModelGenerator() {
- super();
- }
-
- private void init() {
- //IPreferenceStore prefs = CommonPreferencesPlugin.getDefault().getPreferenceStore(ContentType.ContentTypeID_HTML);
- Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences();
- fTagCase = prefs.getInt(CommonModelPreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getInt(CommonModelPreferenceNames.ATTR_NAME_CASE);
- }
-
- protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if (elementDecl == null)
- return;
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return;
- }
- }
- }
-
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- buffer.append("</" + tagName + ">"); //$NON-NLS-2$//$NON-NLS-1$
- return;
- }
-
- private boolean shouldIgnoreCase(CMNode cmnode) {
- if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return false;
- return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-
- public String getRequiredName(Node ownerNode, CMNode cmnode) {
- String name = super.getRequiredName(ownerNode, cmnode);
- // don't change the case unless we're certain it is meaningless
- if (shouldIgnoreCase(cmnode)) {
- int caseVal = -1;
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION)
- caseVal = fTagCase;
- else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION)
- caseVal = fAttrCase;
- switch (caseVal) {
- case CommonModelPreferenceNames.LOWER :
- {
- name = name.toLowerCase();
- }
- break;
- case CommonModelPreferenceNames.UPPER :
- {
- name = name.toUpperCase();
- }
- break;
- }
- }
- return name;
- }
-
- public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
- String other = getOtherClose(parentNode);
- if (other != null)
- return other;
- if (elementDecl == null)
- return ">"; //$NON-NLS-1$
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return "/>"; //$NON-NLS-1$
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return ">"; //$NON-NLS-1$
- }
- }
- }
-
- return ">"; //$NON-NLS-1$
- }
-
- /**
- * Gets the instance.
- * @return Returns a HTMLMinimalContentModelGenerator
- */
- public synchronized static HTMLMinimalContentModelGenerator getInstance() {
- if (instance == null)
- instance = new HTMLMinimalContentModelGenerator();
- instance.init();
- return instance;
- }
-
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
deleted file mode 100644
index cc01530a81..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLTemplateCompletionProcessor.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-
-
-/**
- * Completion processor for HTML Templates. Most of the work is already done
- * by the HTML Content Assist processor, so by the time the
- * HTMLTemplateCompletionProcessor is asked for content assist proposals, the
- * HTML content assist processor has already set the context type for
- * templates.
- */
-class HTMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
- private String fContextTypeId = null;
-
- protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
- return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
- }
-
- protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
- TemplateContextType type = null;
-
- ContextTypeRegistry registry = getTemplateContextRegistry();
- if (registry != null)
- type = registry.getContextType(fContextTypeId);
-
- return type;
- }
-
- protected Image getImage(Template template) {
- // just return the same image for now
- return HTMLEditorPluginImageHelper.getInstance().getImage(HTMLEditorPluginImages.IMG_OBJ_TAG_TEMPLATE);
- }
-
- private ContextTypeRegistry getTemplateContextRegistry() {
- return HTMLUIPlugin.getDefault().getTemplateContextRegistry();
- }
-
- protected Template[] getTemplates(String contextTypeId) {
- Template templates[] = null;
-
- TemplateStore store = getTemplateStore();
- if (store != null)
- templates = store.getTemplates(contextTypeId);
-
- return templates;
- }
-
- private TemplateStore getTemplateStore() {
- return HTMLUIPlugin.getDefault().getTemplateStore();
- }
-
- void setContextType(String contextTypeId) {
- fContextTypeId = contextTypeId;
- }
-}
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
deleted file mode 100644
index dde1edd7a8..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/NoRegionContentAssistProcessorForHTML.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.wst.css.core.text.ICSSPartitionTypes;
-import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.text.IHTMLPartitionTypes;
-import org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
-import org.eclipse.wst.xml.ui.internal.contentassist.NoRegionContentAssistProcessor;
-
-/**
- *
- * @author pavery
- */
-public class NoRegionContentAssistProcessorForHTML extends NoRegionContentAssistProcessor {
- /*
- * @see com.ibm.sse.editor.xml.contentassist.NoRegionContentAssistProcessor#initPartitionToProcessorMap()
- */
- protected void initPartitionToProcessorMap() {
- super.initPartitionToProcessorMap();
- IContentAssistProcessor htmlProcessor = new HTMLContentAssistProcessor();
- fPartitionToProcessorMap.put(IHTMLPartitionTypes.HTML_DEFAULT, htmlProcessor);
- fPartitionToProcessorMap.put(IHTMLPartitionTypes.HTML_COMMENT, htmlProcessor);
-
- IContentAssistProcessor jsContentAssistProcessor = new JavaScriptContentAssistProcessor();
- fPartitionToProcessorMap.put(IHTMLPartitionTypes.SCRIPT, jsContentAssistProcessor);
-
- IContentAssistProcessor cssContentAssistProcessor = new CSSContentAssistProcessor();
- fPartitionToProcessorMap.put(ICSSPartitionTypes.STYLE, cssContentAssistProcessor);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java
deleted file mode 100644
index 0e881cd472..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/XHTMLMinimalContentModelGenerator.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentassist;
-
-
-
-import org.eclipse.wst.html.core.HTMLCMProperties;
-import org.eclipse.wst.html.core.internal.contentmodel.HTMLElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
-import org.w3c.dom.Node;
-
-public class XHTMLMinimalContentModelGenerator extends XMLContentModelGenerator {
-
- private static XHTMLMinimalContentModelGenerator instance = null;
-
- private XHTMLMinimalContentModelGenerator() {
- super();
- }
-
- protected void generateEndTag(String tagName, Node parentNode, CMElementDeclaration elementDecl, StringBuffer buffer) {
- if (elementDecl == null)
- return;
- if (elementDecl instanceof HTMLElementDeclaration) {
- if (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()) {
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- }
- else {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return;
- }
- }
- }
-
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY)
- return;
- buffer.append("</" + tagName + ">"); //$NON-NLS-2$//$NON-NLS-1$
- return;
- }
-
-
- public String getStartTagClose(Node parentNode, CMElementDeclaration elementDecl) {
- String other = getOtherClose(parentNode);
- if (other != null)
- return other;
- if (elementDecl == null)
- return ">"; //$NON-NLS-1$
- // EMPTY tag, do a self-close
- if (elementDecl.getContentType() == CMElementDeclaration.EMPTY) {
- // if it's a JSP element, don't add the space since the JSP container doesn't/shouldn't care
- if (elementDecl instanceof HTMLElementDeclaration && (((Boolean) elementDecl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue()))
- // if it's not JSP, conform to XHTML guidelines and add the space
- return "/>"; //$NON-NLS-1$
- else
- return " />"; //$NON-NLS-1$
- }
- // not defined as EMPTY, but should be treated as such anyway
- else if (elementDecl instanceof HTMLElementDeclaration) {
- String ommission = (String) elementDecl.getProperty(HTMLCMProperties.OMIT_TYPE);
- if (ommission.equals(HTMLCMProperties.Values.OMIT_END) || ommission.equals(HTMLCMProperties.Values.OMIT_END_DEFAULT) || ommission.equals(HTMLCMProperties.Values.OMIT_END_MUST)) {
- return " />"; //$NON-NLS-1$
- }
- }
-
- return ">"; //$NON-NLS-1$
- }
-
- public synchronized static XHTMLMinimalContentModelGenerator getInstance() {
- if (instance == null)
- instance = new XHTMLMinimalContentModelGenerator();
- return instance;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java
deleted file mode 100644
index 9fdd487246..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/HTMLNodeActionManager.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentoutline;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.wst.html.core.HTMLCMProperties;
-import org.eclipse.wst.html.core.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.core.internal.HTMLContentBuilder;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor;
-import org.eclipse.wst.sse.core.internal.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMContentBuilder;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- *
- */
-public class HTMLNodeActionManager extends XMLNodeActionManager {
- protected int fTagCase;
- protected int fAttrCase;
-
- public HTMLNodeActionManager(IStructuredModel model, Viewer viewer) {
- super(model, viewer);
- updateCase();
- }
-
- /**
- * If neccessary, employ a DOMContentBuilder that understands how to
- * change the case of HTML tags (but NOT taglib derived tags).
- */
- public DOMContentBuilder createDOMContentBuilder(Document document) {
- DOMContentBuilder builder = null;
- if (model.getModelHandler().getAssociatedContentTypeId().equals(ContentTypeIdForHTML.ContentTypeID_HTML))
- builder = new HTMLContentBuilder(document);
- else
- builder = super.createDOMContentBuilder(document);
-
- return builder;
- }
-
- private boolean shouldIgnoreCase(CMNode cmnode) {
- if (!cmnode.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))
- return false;
- return ((Boolean) cmnode.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue();
- }
-
- /**
- * Modify the displayed menuitem label to change the case of HTML children
- * but neither XML nor taglib-derived children.
- */
- public String getLabel(Node parent, CMNode cmnode) {
- String result = null;
- //CMNode cmnode = action.getCMNode();
- // don't change the case unless we're certain it is meaningless
- if (shouldIgnoreCase(cmnode)) {
- String name = cmnode.getNodeName();
- if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
- if (fTagCase == CommonModelPreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fTagCase == CommonModelPreferenceNames.UPPER)
- name = name.toUpperCase();
- // else do nothing
- }
- else if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
- if (fAttrCase == CommonModelPreferenceNames.LOWER)
- name = name.toLowerCase();
- else if (fAttrCase == CommonModelPreferenceNames.UPPER)
- name = name.toUpperCase();
- // else do nothing
- }
- result = name;
- }
- else {
- result = super.getLabel(parent, cmnode);
- }
-
- return result;
- }
-
- /**
- * Another HTML specific detail.
- */
- protected void updateCase() {
- if (model.getModelHandler().getAssociatedContentTypeId().equals(ContentTypeIdForHTML.ContentTypeID_HTML)) {
- Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences(); //$NON-NLS-1$
- fTagCase = prefs.getInt(CommonModelPreferenceNames.TAG_NAME_CASE);
- fAttrCase = prefs.getInt(CommonModelPreferenceNames.ATTR_NAME_CASE);
- // Element caseSettings = HTMLPreferenceManager.getHTMLInstance().getElement(PreferenceNames.PREFERRED_CASE);
- // fTagCase = caseSettings.getAttribute(PreferenceNames.TAGNAME);
- // fAttrCase = caseSettings.getAttribute(PreferenceNames.ATTRIBUTENAME);
- }
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.ui.actions.AbstractNodeActionManager#reformat(org.w3c.dom.Node, boolean)
- */
- public void reformat(Node newElement, boolean deep) {
- try {
- // tell the model that we are about to make a big model change
- model.aboutToChangeModel();
-
- // format selected node
- IStructuredFormatProcessor formatProcessor = new HTMLFormatProcessorImpl();
- formatProcessor.formatNode(newElement);
- }
- finally {
- // tell the model that we are done with the big model change
- model.changedModel();
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java
deleted file mode 100644
index 9c749dd173..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterFactoryForHTML.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentoutline;
-
-
-
-import org.eclipse.wst.sse.core.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
-
-/**
- * An adapter factory to create JFaceNodeAdapters. Use this
- * adapter factory with a JFaceAdapterContentProvider to display
- * DOM nodes in a tree.
- */
-public class JFaceNodeAdapterFactoryForHTML extends JFaceNodeAdapterFactory {
-
-
- public JFaceNodeAdapterFactoryForHTML() {
- this(IJFaceNodeAdapter.class, true);
- }
-
- public JFaceNodeAdapterFactoryForHTML(Object adapterKey, boolean registerAdapters) {
- super(adapterKey, registerAdapters);
- }
-
- protected INodeAdapter createAdapter(INodeNotifier node) {
- if (singletonAdapter == null) {
- // create the JFaceNodeAdapter
- singletonAdapter = new JFaceNodeAdapterForHTML(this);
- initAdapter(singletonAdapter, node);
- }
- return singletonAdapter;
- }
-
- public INodeAdapterFactory copy() {
- return new JFaceNodeAdapterFactoryForHTML(this.adapterKey, this.shouldRegisterAdapter);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
deleted file mode 100644
index 9cfa9bac2a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentoutline/JFaceNodeAdapterForHTML.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentoutline;
-
-
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.html.core.HTML40Namespace;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImageHelper;
-import org.eclipse.wst.html.ui.internal.editor.HTMLEditorPluginImages;
-import org.eclipse.wst.sse.core.INodeAdapterFactory;
-import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapter;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Adapts a DOM node to a JFace viewer.
- */
-public class JFaceNodeAdapterForHTML extends JFaceNodeAdapter {
-
- private Image createHTMLImage(String imageResourceName) {
- ImageDescriptor imageDescriptor = HTMLEditorPluginImageHelper.getInstance().getImageDescriptor(imageResourceName);
- if (imageDescriptor != null)
- return imageDescriptor.createImage();
- return null;
- }
-
- /**
- * Constructor for JFaceNodeAdapterForHTML.
- * @param adapterFactory
- */
- public JFaceNodeAdapterForHTML(INodeAdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- protected Image createImage(Node node) {
- Image image = null;
-
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- if (node.getNodeName().equalsIgnoreCase("table")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TABLE);
- else if (node.getNodeName().equalsIgnoreCase("a")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_ANCHOR);
- else if (node.getNodeName().equalsIgnoreCase("body")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BODY);
- else if (node.getNodeName().equalsIgnoreCase("button")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_BUTTON);
- else if (node.getNodeName().equalsIgnoreCase("font")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FONT);
- else if (node.getNodeName().equalsIgnoreCase("form")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_FORM);
- else if (node.getNodeName().equalsIgnoreCase("html")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_HTML);
- else if (node.getNodeName().equalsIgnoreCase("img")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE);
- else if (node.getNodeName().equalsIgnoreCase("map")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_IMAGE_MAP);
- else if (node.getNodeName().equalsIgnoreCase("title")) //$NON-NLS-1$
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG_TITLE);
- else
- image = createHTMLImage(HTMLEditorPluginImages.IMG_OBJ_TAG);
- }
- if (image == null) {
- image = super.createImage(node);
- }
- return image;
- }
-
- /*
- * @see IJFaceNodeAdapter#getLabelText(Node)
- */
- public String getLabelText(Node node) {
- // TODO (pa) eventually showing ID, NAME, etc..might be a preference
- // - like in the package explorer for java.. (along w/ being able to customize delimiters)
- // - possibly for all (or filtered list of) elements
- String text = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- if (node.getNodeName().equalsIgnoreCase("table")) { //$NON-NLS-1$
- // won't update properly as-is
- // it will only update if you change the attr name,
- // delete a ", or add a new element to the tree
- text = node.getNodeName();
-
- // get attr values
- String tableID = null;
- tableID = ((Element) node).getAttribute(HTML40Namespace.ATTR_NAME_ID);
- String tableName = null;
- tableName = ((Element) node).getAttribute(HTML40Namespace.ATTR_NAME_NAME);
-
- // if there's ID or NAME, add a ">"
- if ((tableID != null && tableID.length() > 0) || (tableName != null && tableName.length() > 0)) {
- text += " > "; //$NON-NLS-1$
- }
-
- if (tableID != null && tableID.length() > 0)
- text += " ID:[" + tableID + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- if (tableName != null && tableName.length() > 0)
- text += " NAME:[" + tableName + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- if (text == null)
- text = super.getLabelText(node);
- return text;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
deleted file mode 100644
index d72abeb07e..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntry.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-public class AbstractDeviceProfileEntry implements DeviceProfileEntry {
-
- public AbstractDeviceProfileEntry() {
- super();
- }
-
- public String getEntryId() {
- return null;
- }
-
- public String getEntryName() {
- return null;
- }
-
- public void release() {
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
deleted file mode 100644
index 173e80cd22..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/AbstractDeviceProfileEntryProvider.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Iterator;
-
-public class AbstractDeviceProfileEntryProvider implements
- DeviceProfileEntryProvider {
-
- public AbstractDeviceProfileEntryProvider() {
- super();
- }
-
- public Iterator getDeviceProfileEntries() {
- return null;
- }
-
- public void release() {
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
deleted file mode 100644
index 1579af23d5..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ContentSettingsRegistry.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfile;
-import org.eclipse.wst.css.core.internal.metamodel.CSSProfileRegistry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeEntry;
-import org.eclipse.wst.html.core.internal.document.HTMLDocumentTypeRegistry;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonCharsetNames;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ComboList;
-
-public final class ContentSettingsRegistry {
-
- private static final String NONE = HTMLUIMessages.UI_none;
-
- public static String maxLengthStringInHTMLDocumentTypeRegistry = ""; //$NON-NLS-1$
- public static String maxLengthStringInCharacterCodeRegistry = ""; //$NON-NLS-1$
-
- private ContentSettingsRegistry() {
- }
-
- public static void setHTMLDocumentTypeRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
- Enumeration e = reg.getEntries();
- while (e.hasMoreElements()) {
- HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
- String publicId = entry.getPublicId();
- String displayName = entry.getDisplayName();
- if (displayName != null) {
- combo.add(displayName, publicId);
- if (displayName.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = displayName;
- }
- else
- combo.add(publicId, publicId);
- if (publicId.length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = publicId;
- if (entry.getSystemId() == null)
- continue; // if HTML entry
- if (entry.getSystemId().length() > maxLengthStringInHTMLDocumentTypeRegistry.length())
- maxLengthStringInHTMLDocumentTypeRegistry = entry.getSystemId();
- }
-
- combo.sortByKey(1);
- }
-
- public static void setCSSMetaModelRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- CSSProfileRegistry reg = CSSProfileRegistry.getInstance();
- Iterator i = reg.getProfiles();
- while (i.hasNext()) {
- CSSProfile profile = (CSSProfile) i.next();
- String id = profile.getProfileID();
- String name = profile.getProfileName();
- combo.add(name, id);
- }
- combo.sortByKey(1);
- }
-
- public static void setDeviceProfileRegistryInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- DeviceProfileEntryProvider reg = DeviceProfileEntryProviderBuilder.getEntryProvider();
- if (reg == null) {
- return;
- }
- Iterator profiles = reg.getDeviceProfileEntries();
- if (profiles == null) {
- reg.release();
- return;
- }
- DeviceProfileEntry entry;
- while (profiles.hasNext()) {
- entry = (DeviceProfileEntry) profiles.next();
- combo.add(entry.getEntryName(), entry.getEntryId());
- entry.release();
- }
- reg.release();
- combo.sortByKey(1);
- }
-
- public static String getSystemIdFrom(String publicId) {
- if (publicId == null || publicId.length() == 0)
- return null;
- HTMLDocumentTypeRegistry reg = HTMLDocumentTypeRegistry.getInstance();
- Enumeration e = reg.getEntries();
- while (e.hasMoreElements()) {
- HTMLDocumentTypeEntry entry = (HTMLDocumentTypeEntry) e.nextElement();
- if (entry.getPublicId().equals(publicId))
- return entry.getSystemId();
- }
- return null;
- }
-
- public static void setContentTypeInto(ComboList combo) {
- String[] type = {"", //$NON-NLS-1$
- "application/xhtml+xml", //$NON-NLS-1$
- "application/xml", //$NON-NLS-1$
- "text/html", //$NON-NLS-1$
- "text/xml",}; //$NON-NLS-1$
- String[] displayName = {NONE, "application/xhtml+xml", //$NON-NLS-1$
- //$NON-NLS-1$
- "application/xml", //$NON-NLS-1$
- "text/html", //$NON-NLS-1$
- "text/xml",}; //$NON-NLS-1$
- for (int i = 0; i < type.length; i++) {
- if (displayName[i] != null && displayName[i].length() != 0)
- combo.add(displayName[i], type[i]);
- else
- combo.add(type[i], type[i]);
- }
-
- }
-
- public static void setCharacterCodeInto(ComboList combo) {
- combo.add(NONE, ""); //$NON-NLS-1$
- String max = ""; //$NON-NLS-1$
- //CommonCharsetNames encoding = new CommonCharsetNames();
- String[] charCode = CommonCharsetNames.getCommonCharsetNames();
- for (int i = 0; i < charCode.length; i++) {
- String displayName = CommonCharsetNames.getDisplayString(charCode[i]);
- if (displayName != null && displayName.length() != 0) {
- combo.add(displayName, charCode[i]);
- int n_byte = displayName.getBytes().length;
- if (max.getBytes().length < n_byte)
- max = displayName;
- }
- else
- combo.add(charCode[i], charCode[i]);
- }
- /*
- charCode = encoding.getSupportedJavaEncodings();
- for(int i=0;i<charCode.length;i++){
- String displayName = encoding.getDisplayString(charCode[i]);
- if (displayName!=null && displayName.length()!=0)
- combo.add(displayName,charCode[i]);
- else
- combo.add(charCode[i],charCode[i]);
- }
- */
- // combo.sortByKey(1);
- maxLengthStringInCharacterCodeRegistry = max;
- }
-
- public static void setLanguageInto(ComboList combo) {
- String[] lang = {"", //$NON-NLS-1$
- "java", //$NON-NLS-1$
- "javascript",}; //$NON-NLS-1$
- String[] displayName = {NONE, "java", //$NON-NLS-1$
- //$NON-NLS-1$
- "javascript",}; //$NON-NLS-1$
- for (int i = 0; i < lang.length; i++) {
- if (displayName[i] != null && displayName[i].length() != 0)
- combo.add(displayName[i], lang[i]);
- else
- combo.add(lang[i], lang[i]);
- }
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
deleted file mode 100644
index 94f24e4374..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntry.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-/**
- * <p>
- * This interface is not intended to be implemented by clients
- * directly. Instead, please use abstract class(AbstractDeviceProfileEntry) instead.
- * </p>
- */
-public interface DeviceProfileEntry {
- public String getEntryId();
- public String getEntryName();
- public void release();
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
deleted file mode 100644
index 552c1db220..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProvider.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Iterator;
-
-/**
- * <p>
- * This interface is not intended to be implemented by clients
- * directly. Instead, please use abstract class(AbstractDeviceProfileEntryProvider) instead.
- * </p>
- */
-public interface DeviceProfileEntryProvider {
- public Iterator getDeviceProfileEntries();
- public void release();
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
deleted file mode 100644
index 6367d10b6f..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/DeviceProfileEntryProviderBuilder.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-
-public class DeviceProfileEntryProviderBuilder {
- private static final String EXTENSION_POINT_PLUGINID = "org.eclipse.wst.html.ui"; //$NON-NLS-1$
- private static final String EXTENSION_POINT_NAME = "deviceProfileEntryProvider"; //$NON-NLS-1$
- private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
-
- public DeviceProfileEntryProviderBuilder() {
- super();
- }
- static public DeviceProfileEntryProvider getEntryProvider() {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_PLUGINID, EXTENSION_POINT_NAME);
- if (point != null) {
- IExtension extensions[] = point.getExtensions();
- if ((extensions != null) && (extensions.length > 0)) {
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement elements[] = extensions[i].getConfigurationElements();
- if ((elements != null) && (elements.length > 0)) {
- for (int j = 0; j < elements.length; j++) {
- IConfigurationElement config = elements[j];
- if ((config != null) && (config.getName().equals(EXTENSION_POINT_NAME) == true)) {
- String className = config.getAttribute(ATTR_CLASS);
- if (className != null) {
- try {
- DeviceProfileEntryProvider provider = (DeviceProfileEntryProvider)config.createExecutableExtension(ATTR_CLASS);
- if (provider != null) {
- return provider;
- }
- } catch (CoreException ignored) {
- }
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
deleted file mode 100644
index 848d98e096..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/HTMLContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ContentSettingsPropertyPage;
-
-public final class HTMLContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
-
-
- private final int N_DOCUMENT_TYPE = 0;
- private final int N_CSS_PROFILE = 1;
- private final int N_TARGET_DEVICE = 2;
-
- private Text publicIdText;
- private Text systemIdText;
-
- public HTMLContentSettingsPropertyPage() {
- super();
- numberOfCombo = 3;
- numCols = 2;
- numRows = 8;
- combo = new ComboListOnPropertyPage[super.numberOfCombo];
-
- }
-
-
-
- protected void createDocumentTypeComboBox() {
-
- // create description of implecit DOCTYPE
- Label label = new Label(propertyPage, SWT.LEFT);
- label.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- label.setLayoutData(data);
-
- // create combobox
- super.combo[N_DOCUMENT_TYPE] = super.createComboBoxOf(DOCUMENT_LABEL);
- super.combo[this.N_DOCUMENT_TYPE].addSelectionListener(this);
- // set entry list into Combo
- ContentSettingsRegistry.setHTMLDocumentTypeRegistryInto(combo[N_DOCUMENT_TYPE]);
- // create TextField
- createIDTextField();
- if (combo[N_DOCUMENT_TYPE].getItemCount() <= 0)
- return;
-
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_DOCUMENT_TYPE], initValue);
- this.publicIdText.setText(initValue);
- if (!initValue.equals("")) {//$NON-NLS-1$
- // toro D210260
- if (ContentSettingsRegistry.getSystemIdFrom(initValue) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(initValue));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else
- this.systemIdText.setText("");//$NON-NLS-1$
-
- // create separator
- label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- data.verticalSpan = 8;
- label.setLayoutData(data);
-
- }
-
-
-
- protected void createCSSComboBox() {
- super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
-
- ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
- if (combo[N_CSS_PROFILE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
- }
-
-
-
- protected void createDeviceComboBox() {
- super.combo[N_TARGET_DEVICE] = super.createComboBoxOf(DEVICE_LABEL);
-
- ContentSettingsRegistry.setDeviceProfileRegistryInto(combo[N_TARGET_DEVICE]);
- if (combo[N_TARGET_DEVICE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_TARGET_DEVICE], initValue);
- }
-
-
- protected void createSettingsPageGUI() {
- int type = ((IResource) getElement()).getType();
- switch (type) {
- case IResource.FILE :
- // composite = createComposite(propertyPage,numCols,numRows);
- createDocumentTypeComboBox();
- createCSSComboBox();
- createDeviceComboBox();
- computeMaxWidthHint();
- WorkbenchHelp.setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
- break;
-
- default :
- Logger.log(Logger.WARNING, "HTMLContentSettingsPropertyPage is instantiated by resource except FILE");//$NON-NLS-1$
- break;
- }
-
- }
-
-
-
- protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
-
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- properties.put(IContentSettings.HTML_DOCUMENT_TYPE, valueInCombo);
- break;
- case N_CSS_PROFILE :
- // css
- properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
- break;
- case N_TARGET_DEVICE :
- // device
- properties.put(IContentSettings.DEVICE_PROFILE, valueInCombo);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class HTMLContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
-
- }
-
- protected void deleteNoneProperty(int index) {
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- break;
- case N_CSS_PROFILE :
- // css
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- break;
- case N_TARGET_DEVICE :
- // device
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class HTMLContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
- }
-
- private void createIDTextField() {
- // public ID & System ID
- Label publicLabel = new Label(super.propertyPage, SWT.NONE);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- publicLabel.setLayoutData(data);
- publicLabel.setText(HTMLUIMessages.UI_Public_ID);
- publicIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- publicIdText.setLayoutData(data);
-
- Label systemLabel = new Label(super.propertyPage, SWT.NONE);
- data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- systemLabel.setLayoutData(data);
- systemLabel.setText(HTMLUIMessages.UI_System_ID);
- systemIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- systemIdText.setLayoutData(data);
- }
-
-
-
- private void computeMaxWidthHint() {
- // maxLengthString was set when HTMLDocumentTypeEntry was set in class ContentSettingsRegistry.
- String maxLengthString = ContentSettingsRegistry.maxLengthStringInHTMLDocumentTypeRegistry;
- String backup = this.systemIdText.getText();
- this.systemIdText.setText(maxLengthString);
- int maxWidthHint = this.systemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
- this.systemIdText.setText(backup);
-
- if (this.combo[this.N_DOCUMENT_TYPE].getLayoutData() != null)
- ((GridData) this.combo[this.N_DOCUMENT_TYPE].getLayoutData()).widthHint = maxWidthHint;
- if (this.publicIdText.getLayoutData() != null)
- ((GridData) this.publicIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.systemIdText.getLayoutData() != null)
- ((GridData) this.systemIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_CSS_PROFILE].getLayoutData() != null)
- ((GridData) this.combo[this.N_CSS_PROFILE].getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_TARGET_DEVICE].getLayoutData() != null)
- ((GridData) this.combo[this.N_TARGET_DEVICE].getLayoutData()).widthHint = maxWidthHint;
-
- }
-
-
- public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
- }
-
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent event) {
- Widget source = event.widget;
-
- if (this.combo[this.N_DOCUMENT_TYPE].equals(source)) {
- ComboListOnPropertyPage combo = this.combo[this.N_DOCUMENT_TYPE];
- if (combo.getSelectionIndex() < 0)
- return;
- if (!combo.getSelectedValue().equals("")) {//$NON-NLS-1$
- this.publicIdText.setText(combo.getSelectedValue());
- if (ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else {
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
- }
-
- }
- }
-
- protected void performDefaults() {
- super.performDefaults();
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
-
- }
-
-
-}
-
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
deleted file mode 100644
index ee400a00f9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentproperties/ui/ProjectContentSettingsPropertyPage.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.contentproperties.ui;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.ui.contentproperties.IContentSettings;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ComboListOnPropertyPage;
-import org.eclipse.wst.sse.ui.contentproperties.ui.ContentSettingsPropertyPage;
-
-public final class ProjectContentSettingsPropertyPage extends ContentSettingsPropertyPage implements org.eclipse.swt.events.SelectionListener {
-
-
- private final int N_DOCUMENT_TYPE = 0;
- private final int N_CSS_PROFILE = 1;
- private final int N_TARGET_DEVICE = 2;
-
- private Text publicIdText;
- private Text systemIdText;
-
- public ProjectContentSettingsPropertyPage() {
- super();
- numberOfCombo = 3;
- numCols = 2;
- numRows = 8;
- combo = new ComboListOnPropertyPage[super.numberOfCombo];
-
- }
-
-
-
- protected void createDocumentTypeComboBox() {
-
- // create description of implecit DOCTYPE
- Label label = new Label(propertyPage, SWT.LEFT);
- label.setText(HTMLUIMessages.UI_Description_of_role_of_following_DOCTYPE);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- label.setLayoutData(data);
-
- // create combobox
- super.combo[N_DOCUMENT_TYPE] = super.createComboBoxOf(DOCUMENT_LABEL);
- super.combo[this.N_DOCUMENT_TYPE].addSelectionListener(this);
- // set entry list into Combo
- ContentSettingsRegistry.setHTMLDocumentTypeRegistryInto(combo[N_DOCUMENT_TYPE]);
- // create TextField
- createIDTextField();
- if (combo[N_DOCUMENT_TYPE].getItemCount() <= 0)
- return;
-
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_DOCUMENT_TYPE], initValue);
- this.publicIdText.setText(initValue);
- if (!initValue.equals("")) {//$NON-NLS-1$
- // toro D210260
- if (ContentSettingsRegistry.getSystemIdFrom(initValue) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(initValue));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else
- this.systemIdText.setText("");//$NON-NLS-1$
-
- // create separator
- label = new Label(propertyPage, SWT.SEPARATOR | SWT.HORIZONTAL);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = numCols;
- data.verticalSpan = 8;
- label.setLayoutData(data);
-
- }
-
-
-
- protected void createCSSComboBox() {
- super.combo[N_CSS_PROFILE] = super.createComboBoxOf(CSS_LABEL);
-
- ContentSettingsRegistry.setCSSMetaModelRegistryInto(combo[N_CSS_PROFILE]);
- if (combo[N_CSS_PROFILE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_CSS_PROFILE], initValue);
- }
-
-
-
- protected void createDeviceComboBox() {
- super.combo[N_TARGET_DEVICE] = super.createComboBoxOf(DEVICE_LABEL);
-
- ContentSettingsRegistry.setDeviceProfileRegistryInto(combo[N_TARGET_DEVICE]);
- if (combo[N_TARGET_DEVICE].getItemCount() <= 0)
- return;
- String initValue = contentSettings.getProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- // when either .contentsettings or element doesn't exist
- // when attribute doesn't exists,getProperty returns empty string.
- if (initValue == null)
- initValue = ""; //$NON-NLS-1$
- // set init selectionItem in Combo
- super.setSelectionItem(combo[N_TARGET_DEVICE], initValue);
- }
-
-
- protected void createSettingsPageGUI() {
- int type = ((IResource) getElement()).getType();
- switch (type) {
- case IResource.PROJECT :
- // composite = createComposite(propertyPage,numCols,numRows);
- createDocumentTypeComboBox();
- createCSSComboBox();
- createDeviceComboBox();
- computeMaxWidthHint();
- WorkbenchHelp.setHelp(propertyPage, IHelpContextIds.WEB_CONTENT_SETTINGS_HELPID);
- break;
-
- default :
- Logger.log(Logger.WARNING, "ProjectContentSettingsPropertyPage is instantiated by resource except PROJECT");//$NON-NLS-1$
- break;
- }
-
- }
-
-
-
- protected void putSelectedPropertyInto(Map properties, String valueInCombo, int index) {
-
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- properties.put(IContentSettings.HTML_DOCUMENT_TYPE, valueInCombo);
- break;
- case N_CSS_PROFILE :
- // css
- properties.put(IContentSettings.CSS_PROFILE, valueInCombo);
- break;
- case N_TARGET_DEVICE :
- // device
- properties.put(IContentSettings.DEVICE_PROFILE, valueInCombo);
- break;
- default :
- Logger.log(Logger.ERROR, "Index is out of range in putSelectedPropertyInto() in class ProjectContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
-
- }
-
- protected void deleteNoneProperty(int index) {
- switch (index) {
- case N_DOCUMENT_TYPE :
- // doc type
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.HTML_DOCUMENT_TYPE);
- break;
-
- case N_CSS_PROFILE :
- // css
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.CSS_PROFILE);
- break;
-
- case N_TARGET_DEVICE :
- // device
- contentSettings.deleteProperty((IResource) super.getElement(), IContentSettings.DEVICE_PROFILE);
- break;
-
- default :
- Logger.log(Logger.ERROR, "Index is out of range in deleteNoneProperty() in class ProjectContentSettingsPropertyPage");//$NON-NLS-1$
- break;
- }
- }
-
- private void createIDTextField() {
- // public ID & System ID
- Label publicLabel = new Label(super.propertyPage, SWT.NONE);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- publicLabel.setLayoutData(data);
- publicLabel.setText(HTMLUIMessages.UI_Public_ID);
- publicIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- publicIdText.setLayoutData(data);
-
- Label systemLabel = new Label(super.propertyPage, SWT.NONE);
- data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
- data.horizontalIndent = 10;
- systemLabel.setLayoutData(data);
- systemLabel.setText(HTMLUIMessages.UI_System_ID);
- systemIdText = new Text(super.propertyPage, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData();
-
- systemIdText.setLayoutData(data);
- }
-
-
-
- private void computeMaxWidthHint() {
- // maxLengthString was set when HTMLDocumentTypeEntry was set in class ContentSettingsRegistry.
- String maxLengthString = ContentSettingsRegistry.maxLengthStringInHTMLDocumentTypeRegistry;
- String backup = this.systemIdText.getText();
- this.systemIdText.setText(maxLengthString);
- int maxWidthHint = this.systemIdText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
- this.systemIdText.setText(backup);
-
- if (this.combo[this.N_DOCUMENT_TYPE].getLayoutData() != null)
- ((GridData) this.combo[this.N_DOCUMENT_TYPE].getLayoutData()).widthHint = maxWidthHint;
- if (this.publicIdText.getLayoutData() != null)
- ((GridData) this.publicIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.systemIdText.getLayoutData() != null)
- ((GridData) this.systemIdText.getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_CSS_PROFILE].getLayoutData() != null)
- ((GridData) this.combo[this.N_CSS_PROFILE].getLayoutData()).widthHint = maxWidthHint;
- if (this.combo[this.N_TARGET_DEVICE].getLayoutData() != null)
- ((GridData) this.combo[this.N_TARGET_DEVICE].getLayoutData()).widthHint = maxWidthHint;
-
- }
-
-
- public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
- }
-
- public void widgetSelected(org.eclipse.swt.events.SelectionEvent event) {
- Widget source = event.widget;
-
- if (this.combo[this.N_DOCUMENT_TYPE].equals(source)) {
- ComboListOnPropertyPage combo = this.combo[this.N_DOCUMENT_TYPE];
- if (combo.getSelectionIndex() < 0)
- return;
- if (!combo.getSelectedValue().equals("")) {//$NON-NLS-1$
- this.publicIdText.setText(combo.getSelectedValue());
- if (ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()) != null)
- this.systemIdText.setText(ContentSettingsRegistry.getSystemIdFrom(combo.getSelectedValue()));
- else
- this.systemIdText.setText("");//$NON-NLS-1$
- }
- else {
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
- }
-
- }
- }
-
- protected void performDefaults() {
- super.performDefaults();
- this.publicIdText.setText("");//$NON-NLS-1$
- this.systemIdText.setText(""); //$NON-NLS-1$
-
- }
-
-}
-
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java
deleted file mode 100644
index 0c711b296a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/ActionContributorHTML.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.edit.ui;
-
-import org.eclipse.wst.xml.ui.actions.ActionContributorXML;
-
-/**
- *
- * Instead, use SourcePageActionContributor for source page contributor
- * of multi page editor.
- *
- * Note that this class is still valid for single page editor.
- */
-public class ActionContributorHTML extends ActionContributorXML {
- private static final String[] EDITOR_IDS = {"org.eclipse.wst.html.core.htmlsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor"}; //$NON-NLS-1$ //$NON-NLS-2$
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.ui.actions.ActionContributor#getExtensionIDs()
- */
- protected String[] getExtensionIDs() {
- return EDITOR_IDS;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTML.java
deleted file mode 100644
index 0eedfb667d..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupActionHTML.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.edit.ui;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.widgets.Shell;
-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.internal.actions.CleanupAction;
-
-public class CleanupActionHTML extends CleanupAction {
- protected IStructuredCleanupProcessor fCleanupProcessor;
-
- public CleanupActionHTML(ResourceBundle bundle, String prefix, ITextEditor editor) {
- super(bundle, prefix, editor);
- }
-
- protected Dialog getCleanupDialog(Shell shell) {
- if (fCleanupDialog == null)
- fCleanupDialog = new CleanupDialogHTML(shell);
-
- return fCleanupDialog;
- }
-
- protected IStructuredCleanupProcessor getCleanupProcessor() {
- if (fCleanupProcessor == null)
- fCleanupProcessor = new HTMLCleanupProcessorImpl();
-
- return fCleanupProcessor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
deleted file mode 100644
index b9170e466f..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/edit/ui/CleanupDialogHTML.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.edit.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.html.core.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IModelHandler;
-import org.eclipse.wst.sse.core.internal.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.xml.core.contenttype.ContentTypeIdForXML;
-import org.eclipse.wst.xml.core.internal.cleanup.XMLCleanupPreferencesImpl;
-
-public class CleanupDialogHTML extends Dialog implements SelectionListener {
-
- protected Button fRadioButtonTagNameCaseAsis;
- protected Button fRadioButtonTagNameCaseLower;
- protected Button fRadioButtonTagNameCaseUpper;
- protected Button fRadioButtonAttrNameCaseAsis;
- protected Button fRadioButtonAttrNameCaseLower;
- protected Button fRadioButtonAttrNameCaseUpper;
- protected Button fCheckBoxInsertRequiredAttrs;
- protected Button fCheckBoxInsertMissingTags;
- protected Button fCheckBoxQuoteAttrValues;
- protected Button fCheckBoxFormatSource;
- protected Button fCheckBoxConvertEOLCodes;
- protected Button fRadioButtonConvertEOLWindows;
- protected Button fRadioButtonConvertEOLUnix;
- protected Button fRadioButtonConvertEOLMac;
- protected IStructuredModel fModel = null;
- protected Preferences fPreferences = null;
-
- public CleanupDialogHTML(Shell shell) {
- super(shell);
- }
-
- public Control createDialogArea(Composite parent) {
- getShell().setText(HTMLUIMessages.Cleanup_UI_);
- Composite composite = new Composite(parent, SWT.NULL);
-
- createDialogAreaInComposite(composite);
- initializeOptions();
-
- return composite;
- }
-
- protected void createDialogAreaInCompositeForHTML(Composite composite) {
- // Convert tag name case
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group tagNameCase = new Group(composite, SWT.NONE);
- tagNameCase.setText(HTMLUIMessages.Tag_name_case_for_HTML_UI_);
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- tagNameCase.setLayout(hLayout);
- fRadioButtonTagNameCaseAsis = new Button(tagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseAsis.setText(HTMLUIMessages.Tag_name_case_As_is_UI_);
- fRadioButtonTagNameCaseAsis.addSelectionListener(this);
- fRadioButtonTagNameCaseLower = new Button(tagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseLower.setText(HTMLUIMessages.Tag_name_case_Lower_UI_);
- fRadioButtonTagNameCaseLower.addSelectionListener(this);
- fRadioButtonTagNameCaseUpper = new Button(tagNameCase, SWT.RADIO);
- fRadioButtonTagNameCaseUpper.setText(HTMLUIMessages.Tag_name_case_Upper_UI_);
- fRadioButtonTagNameCaseUpper.addSelectionListener(this);
-
- // Convert attr name case
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group attrNameCase = new Group(composite, SWT.NONE);
- attrNameCase.setText(HTMLUIMessages.Attribute_name_case_for_HTML_UI_);
- attrNameCase.setLayout(hLayout);
- fRadioButtonAttrNameCaseAsis = new Button(attrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseAsis.setText(HTMLUIMessages.Attribute_name_case_As_is_UI_);
- fRadioButtonAttrNameCaseAsis.addSelectionListener(this);
- fRadioButtonAttrNameCaseLower = new Button(attrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseLower.setText(HTMLUIMessages.Attribute_name_case_Lower_UI_);
- fRadioButtonAttrNameCaseLower.addSelectionListener(this);
- fRadioButtonAttrNameCaseUpper = new Button(attrNameCase, SWT.RADIO);
- fRadioButtonAttrNameCaseUpper.setText(HTMLUIMessages.Attribute_name_case_Upper_UI_);
- fRadioButtonAttrNameCaseUpper.addSelectionListener(this);
- }
-
- protected void createDialogAreaInComposite(Composite composite) {
- if (isHTMLType()) {
- createDialogAreaInCompositeForHTML(composite);
- WorkbenchHelp.setHelp(composite, IHelpContextIds.CLEANUP_HTML_HELPID); // use HTML specific help
- }
- else
- WorkbenchHelp.setHelp(composite, org.eclipse.wst.xml.ui.internal.editor.IHelpContextIds.CLEANUP_XML_HELPID); // use XML specific help
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.makeColumnsEqualWidth = true;
- composite.setLayout(layout);
-
- // Insert missing required attrs
- fCheckBoxInsertRequiredAttrs = new Button(composite, SWT.CHECK);
- fCheckBoxInsertRequiredAttrs.setText(HTMLUIMessages.Insert_required_attributes_UI_);
- fCheckBoxInsertRequiredAttrs.addSelectionListener(this);
-
- // Insert missing begin/end tags
- fCheckBoxInsertMissingTags = new Button(composite, SWT.CHECK);
- fCheckBoxInsertMissingTags.setText(HTMLUIMessages.Insert_missing_tags_UI_);
- fCheckBoxInsertMissingTags.addSelectionListener(this);
-
- // Quote attribute values
- fCheckBoxQuoteAttrValues = new Button(composite, SWT.CHECK);
- fCheckBoxQuoteAttrValues.setText(HTMLUIMessages.Quote_attribute_values_UI_);
- fCheckBoxQuoteAttrValues.addSelectionListener(this);
-
- // Format source
- fCheckBoxFormatSource = new Button(composite, SWT.CHECK);
- fCheckBoxFormatSource.setText(HTMLUIMessages.Format_source_UI_);
- fCheckBoxFormatSource.addSelectionListener(this);
-
- // Convert EOL code
- fCheckBoxConvertEOLCodes = new Button(composite, SWT.CHECK);
- fCheckBoxConvertEOLCodes.setText(HTMLUIMessages.Convert_EOL_codes_UI_);
- fCheckBoxConvertEOLCodes.addSelectionListener(this);
- Composite EOLCodes = new Composite(composite, SWT.NULL);
- GridLayout hLayout = new GridLayout();
- hLayout.numColumns = 3;
- EOLCodes.setLayout(hLayout);
- fRadioButtonConvertEOLWindows = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLWindows.setText(HTMLUIMessages.EOL_Windows_UI);
- fRadioButtonConvertEOLWindows.addSelectionListener(this);
- fRadioButtonConvertEOLUnix = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLUnix.setText(HTMLUIMessages.EOL_Unix_UI);
- fRadioButtonConvertEOLUnix.addSelectionListener(this);
- fRadioButtonConvertEOLMac = new Button(EOLCodes, SWT.RADIO);
- fRadioButtonConvertEOLMac.setText(HTMLUIMessages.EOL_Mac_UI);
- fRadioButtonConvertEOLMac.addSelectionListener(this);
- }
-
- protected void okPressed() {
- storeOptions();
-
- super.okPressed();
- }
-
- protected void initializeOptionsForHTML() {
- int tagNameCase = getModelPreferences().getInt(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE);
- if (tagNameCase == CommonModelPreferenceNames.UPPER)
- fRadioButtonTagNameCaseUpper.setSelection(true);
- else if (tagNameCase == CommonModelPreferenceNames.LOWER)
- fRadioButtonTagNameCaseLower.setSelection(true);
- else
- fRadioButtonTagNameCaseAsis.setSelection(true);
-
- int attrNameCase = getModelPreferences().getInt(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE);
- if (attrNameCase == CommonModelPreferenceNames.UPPER)
- fRadioButtonAttrNameCaseUpper.setSelection(true);
- else if (attrNameCase == CommonModelPreferenceNames.LOWER)
- fRadioButtonAttrNameCaseLower.setSelection(true);
- else
- fRadioButtonAttrNameCaseAsis.setSelection(true);
- }
-
- protected void initializeOptions() {
- if (isHTMLType())
- initializeOptionsForHTML();
-
- fCheckBoxInsertRequiredAttrs.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.INSERT_REQUIRED_ATTRS));
- fCheckBoxInsertMissingTags.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.INSERT_MISSING_TAGS));
- fCheckBoxQuoteAttrValues.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.QUOTE_ATTR_VALUES));
- fCheckBoxFormatSource.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.FORMAT_SOURCE));
- fCheckBoxConvertEOLCodes.setSelection(getModelPreferences().getBoolean(CommonModelPreferenceNames.CONVERT_EOL_CODES));
- if (fCheckBoxConvertEOLCodes.getSelection()) {
- String EOLCode = getModelPreferences().getString(CommonModelPreferenceNames.CLEANUP_EOL_CODE);
- if (EOLCode == CommonEncodingPreferenceNames.LF)
- fRadioButtonConvertEOLUnix.setSelection(true);
- else if (EOLCode == CommonEncodingPreferenceNames.CR)
- fRadioButtonConvertEOLMac.setSelection(true);
- else
- fRadioButtonConvertEOLWindows.setSelection(true);
- }
- enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
- }
-
- protected void storeOptionsForHTML() {
- if (fRadioButtonTagNameCaseUpper.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE, CommonModelPreferenceNames.UPPER);
- else if (fRadioButtonTagNameCaseLower.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE, CommonModelPreferenceNames.LOWER);
- else
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE, CommonModelPreferenceNames.ASIS);
-
- if (fRadioButtonAttrNameCaseUpper.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE, CommonModelPreferenceNames.UPPER);
- else if (fRadioButtonAttrNameCaseLower.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE, CommonModelPreferenceNames.LOWER);
- else
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE, CommonModelPreferenceNames.ASIS);
-
- // explicitly save plugin preferences so values are stored
- HTMLCorePlugin.getDefault().savePluginPreferences();
- }
-
- protected void storeOptions() {
- if (isHTMLType()) {
- storeOptionsForHTML();
- XMLCleanupPreferencesImpl.getInstance().setTagNameCase(getModelPreferences().getInt(CommonModelPreferenceNames.CLEANUP_TAG_NAME_CASE));
- XMLCleanupPreferencesImpl.getInstance().setAttrNameCase(getModelPreferences().getInt(CommonModelPreferenceNames.CLEANUP_ATTR_NAME_CASE));
- }
- else {
- XMLCleanupPreferencesImpl.getInstance().setTagNameCase(CommonModelPreferenceNames.ASIS);
- XMLCleanupPreferencesImpl.getInstance().setAttrNameCase(CommonModelPreferenceNames.ASIS);
- }
-
- getModelPreferences().setValue(CommonModelPreferenceNames.INSERT_REQUIRED_ATTRS, fCheckBoxInsertRequiredAttrs.getSelection());
- getModelPreferences().setValue(CommonModelPreferenceNames.INSERT_MISSING_TAGS, fCheckBoxInsertMissingTags.getSelection());
- getModelPreferences().setValue(CommonModelPreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection());
- getModelPreferences().setValue(CommonModelPreferenceNames.FORMAT_SOURCE, fCheckBoxFormatSource.getSelection());
- getModelPreferences().setValue(CommonModelPreferenceNames.CONVERT_EOL_CODES, fCheckBoxConvertEOLCodes.getSelection());
- XMLCleanupPreferencesImpl.getInstance().setInsertMissingTags(fCheckBoxInsertMissingTags.getSelection());
- XMLCleanupPreferencesImpl.getInstance().setQuoteAttrValues(fCheckBoxQuoteAttrValues.getSelection());
- XMLCleanupPreferencesImpl.getInstance().setFormatSource(fCheckBoxFormatSource.getSelection());
- XMLCleanupPreferencesImpl.getInstance().setConvertEOLCodes(fCheckBoxConvertEOLCodes.getSelection());
- if (fCheckBoxConvertEOLCodes.getSelection()) {
- if (fRadioButtonConvertEOLUnix.getSelection()) {
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.LF);
- XMLCleanupPreferencesImpl.getInstance().setEOLCode(CommonEncodingPreferenceNames.LF);
- }
- else if (fRadioButtonConvertEOLMac.getSelection()) {
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CR);
- XMLCleanupPreferencesImpl.getInstance().setEOLCode(CommonEncodingPreferenceNames.CR);
- }
- else {
- getModelPreferences().setValue(CommonModelPreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CRLF);
- XMLCleanupPreferencesImpl.getInstance().setEOLCode(CommonEncodingPreferenceNames.CRLF);
- }
- }
-
- // explicitly save plugin preferences so values are stored
- HTMLCorePlugin.getDefault().savePluginPreferences();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- public void widgetSelected(SelectionEvent e) {
- getButton(OK).setEnabled((fRadioButtonTagNameCaseLower != null && (fRadioButtonTagNameCaseLower.getSelection() || fRadioButtonTagNameCaseUpper.getSelection())) || (fRadioButtonAttrNameCaseLower != null && (fRadioButtonAttrNameCaseLower.getSelection() || fRadioButtonAttrNameCaseUpper.getSelection())) || fCheckBoxInsertMissingTags.getSelection() || fCheckBoxQuoteAttrValues.getSelection() || fCheckBoxFormatSource.getSelection() || fCheckBoxConvertEOLCodes.getSelection() || (fRadioButtonConvertEOLUnix != null && (fRadioButtonConvertEOLUnix.getSelection() || fRadioButtonConvertEOLMac.getSelection() || fRadioButtonConvertEOLWindows.getSelection())));
- if (e.widget == fCheckBoxConvertEOLCodes)
- enableEOLCodeRadios(fCheckBoxConvertEOLCodes.getSelection());
- }
-
- public void setModel(IStructuredModel model) {
- fModel = model;
- }
-
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected boolean isXMLType() {
- boolean result = false;
-
- if (fModel != null) {
- IModelHandler modelHandler = fModel.getModelHandler();
- if (modelHandler.getAssociatedContentTypeId().equals(ContentTypeIdForXML.ContentTypeID_XML))
- result = true;
- }
-
- return result;
- }
-
- protected boolean isHTMLType() {
- boolean result = true;
-
- if (fModel != null) {
- IModelHandler modelHandler = fModel.getModelHandler();
- if (modelHandler.getAssociatedContentTypeId().equals(ContentTypeIdForHTML.ContentTypeID_HTML))
- result = true;
- }
-
- return result;
- }
-
- protected void enableEOLCodeRadios(boolean enable) {
- if ((fRadioButtonConvertEOLWindows != null) && (fRadioButtonConvertEOLUnix != null) && (fRadioButtonConvertEOLMac != null)) {
- fRadioButtonConvertEOLWindows.setEnabled(enable);
- fRadioButtonConvertEOLUnix.setEnabled(enable);
- fRadioButtonConvertEOLMac.setEnabled(enable);
-
- if (!fRadioButtonConvertEOLWindows.getSelection() && !fRadioButtonConvertEOLUnix.getSelection() && !fRadioButtonConvertEOLMac.getSelection())
- fRadioButtonConvertEOLWindows.setSelection(true);
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
deleted file mode 100644
index e8d0887a82..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImageHelper.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.editor;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-
-
-/**
- * Helper class to handle images provided by this plug-in.
- *
- * NOTE: For internal use only. For images used externally, please use the
- * Shared***ImageHelper class instead.
- *
- * @author amywu
- */
-public class HTMLEditorPluginImageHelper {
- private final String PLUGINID = HTMLUIPlugin.ID;
- private static HTMLEditorPluginImageHelper instance = null;
-
- // save a descriptor for each image
- private HashMap fImageDescRegistry = null;
-
- /**
- * Gets the instance.
- *
- * @return Returns a HTMLEditorPluginImageHelper
- */
- public synchronized static HTMLEditorPluginImageHelper getInstance() {
- if (instance == null)
- instance = new HTMLEditorPluginImageHelper();
- return instance;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptor(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- //create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null)
- fImageDescRegistry = new HashMap();
- return fImageDescRegistry;
- }
-
- /**
- * Returns the image registry for this plugin.
- *
- * @return ImageRegistry - image registry for this plugin
- */
- private ImageRegistry getImageRegistry() {
- return JFaceResources.getImageRegistry();
- }
-
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptor(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor()))
- getImageRegistry().put(resource, image);
- }
- return image;
- }
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- }
- else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java
deleted file mode 100644
index 22c65fda61..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/HTMLEditorPluginImages.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.editor;
-
-/**
- * Bundle of most images used by the HTML Editor plug-in.
- */
-public class HTMLEditorPluginImages {
- public static final String IMG_OBJ_TABLE = "icons/full/obj16/table.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_ANCHOR = "icons/full/obj16/tag-anchor.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_BODY = "icons/full/obj16/tag-body.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_BUTTON = "icons/full/obj16/tag-button.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_FONT = "icons/full/obj16/tag-font.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_FORM = "icons/full/obj16/tag-form.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_GENERIC = "icons/full/obj16/tag-generic.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_HTML = "icons/full/obj16/tag-html.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_IMAGE_MAP = "icons/full/obj16/tag-image-map.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_IMAGE = "icons/full/obj16/tag-image.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_JSP = "icons/full/obj16/tag-jsp.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_TEMPLATE = "icons/full/obj16/tag-template.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG_TITLE = "icons/full/obj16/tag-title.gif"; //$NON-NLS-1$
- public static final String IMG_OBJ_TAG = "icons/full/obj16/tag.gif"; //$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java
deleted file mode 100644
index 77746a379c..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/editor/IHelpContextIds.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.editor;
-
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-
-/**
- * Help context ids for the HTML Source Editor.
- * <p>
- * This interface contains constants only; it is not intended to be implemented.
- * </p>
- *
- */
-public interface IHelpContextIds {
- // org.eclipse.wst.html.ui.
- public static final String PREFIX = HTMLUIPlugin.ID + "."; //$NON-NLS-1$
-
- // HTML Source page editor
- public static final String HTML_SOURCEVIEW_HELPID = PREFIX + "ehtm0000"; //$NON-NLS-1$
-
- // HTML Files Preference page
- public static final String HTML_PREFWEBX_FILES_HELPID = PREFIX + "webx0030"; //$NON-NLS-1$
- // HTML Source Preference page
- public static final String HTML_PREFWEBX_SOURCE_HELPID = PREFIX + "webx0031"; //$NON-NLS-1$
- // HTML Styles Preference page
- public static final String HTML_PREFWEBX_STYLES_HELPID = PREFIX + "webx0032"; //$NON-NLS-1$
- // HTML Templates Preference page
- public static final String HTML_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0033"; //$NON-NLS-1$
-
- // HTML Cleanup dialog
- public static final String CLEANUP_HTML_HELPID = PREFIX + "xmlm1100"; //$NON-NLS-1$
-
- // HTML Content Settings
- public static final String WEB_CONTENT_SETTINGS_HELPID = PREFIX + "misc0170"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java
deleted file mode 100644
index 016d2dcf71..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileEditorInput.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.editors.text.ILocationProvider;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * EditorInput for external files. Copied from
- * org.eclipse.ui.internal.editors.text.JavaFileEditorInput
- */
-class ExternalFileEditorInput implements IEditorInput, ILocationProvider {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- /**
- * The workbench adapter which simply provides the label.
- *
- * @since 3.1
- */
- private class WorkbenchAdapter implements IWorkbenchAdapter {
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- return ((ExternalFileEditorInput) o).getName();
- }
-
- /*
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
- }
-
- private File fFile;
- private WorkbenchAdapter fWorkbenchAdapter = new WorkbenchAdapter();
-
- public ExternalFileEditorInput(File file) {
- super();
- fFile = file;
- fWorkbenchAdapter = new WorkbenchAdapter();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return fFile.exists();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- public String getName() {
- return fFile.getName();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return fFile.getAbsolutePath();
- }
-
- /*
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- if (ILocationProvider.class.equals(adapter))
- return this;
- if (IWorkbenchAdapter.class.equals(adapter))
- return fWorkbenchAdapter;
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /*
- * @see org.eclipse.ui.editors.text.ILocationProvider#getPath(java.lang.Object)
- */
- public IPath getPath(Object element) {
- if (element instanceof ExternalFileEditorInput) {
- ExternalFileEditorInput input = (ExternalFileEditorInput) element;
- return Path.fromOSString(input.fFile.getAbsolutePath());
- }
- return null;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o) {
- if (o == this)
- return true;
-
- if (o instanceof ExternalFileEditorInput) {
- ExternalFileEditorInput input = (ExternalFileEditorInput) o;
- return fFile.equals(input.fFile);
- }
-
- return false;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fFile.hashCode();
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java
deleted file mode 100644
index a37e44f61f..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import java.io.File;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-/**
- * Hyperlink for external files.
- */
-class ExternalFileHyperlink implements IHyperlink {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private IRegion fHyperlinkRegion;
- private File fHyperlinkFile;
-
- public ExternalFileHyperlink(IRegion region, File file) {
- fHyperlinkFile = file;
- fHyperlinkRegion = region;
- }
-
- public IRegion getHyperlinkRegion() {
- return fHyperlinkRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void open() {
- if (fHyperlinkFile != null) {
- IEditorInput input = new ExternalFileEditorInput(fHyperlinkFile);
- IEditorDescriptor descriptor;
- try {
- descriptor = IDE.getEditorDescriptor(input.getName());
- if (descriptor != null) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, input, descriptor.getId(), true);
- }
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/URIHyperlinkDetector.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/URIHyperlinkDetector.java
deleted file mode 100644
index ee2dee83ad..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/URIHyperlinkDetector.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.sse.core.internal.util.URIResolver;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-/**
- * Detects hyperlinks in tags. Includes detection in DOCTYPE and attribute
- * values. Resolves references to schemas, dtds, href, file, src, etc using the
- * Web Project Resolver.
- *
- */
-public class URIHyperlinkDetector extends XMLHyperlinkDetector {
- // copies of this class exist in:
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private final String SCHEMA_LOCATION = "schemaLocation"; //$NON-NLS-1$
- private final String XMLNS = "xmlns"; //$NON-NLS-1$
- private final String XSI_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
-
- protected String getURIString(Node node, IDocument document) {
- if (isXMLHandled(node))
- return super.getURIString(node, document);
-
- String resolvedURI = null;
- if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
- // handle attribute node
- Attr attrNode = (Attr) node;
- String attrValue = attrNode.getValue();
- attrValue = StringUtils.strip(attrValue);
-
- if (attrValue != null && attrValue.length() > 0) {
- // currently using model's URI resolver until a better resolver is
- // extended to common extensible URI resolver
- // future_TODO: should use the new common extensible URI resolver
- // when
- // clients start implementing it
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (sModel != null) {
- URIResolver resolver = sModel.getResolver();
- resolvedURI = resolver != null ? resolver.getLocationByURI(attrValue, true) : attrValue;
- }
- }
- catch (Exception e) {
- Logger.logException(e);
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
- }
- }
- return resolvedURI;
- }
-
- /**
- * Check if this is an xml-related node (schema location, doctype).
- * @param node
- * @return
- */
- private boolean isXMLHandled(Node node) {
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- return true;
- } else if (nodeType == Node.ATTRIBUTE_NODE) {
- Attr attrNode = (Attr) node;
- String attrName = attrNode.getName();
-
- // handle schemaLocation attribute
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
- return true;
- } else if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attrNode))) && (SCHEMA_LOCATION.equals(unprefixedName))) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java
deleted file mode 100644
index 8ee3ac1db0..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-/**
- * Hyperlink for files within the workspace. (As long as there is an IFile,
- * this can be used) Opens the default editor for the file.
- */
-class WorkspaceFileHyperlink implements IHyperlink {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private IRegion fRegion;
- private IFile fFile;
- private IRegion fHighlightRange;
-
- public WorkspaceFileHyperlink(IRegion region, IFile file) {
- fRegion = region;
- fFile = file;
- }
-
- public WorkspaceFileHyperlink(IRegion region, IFile file, IRegion range) {
- fRegion = region;
- fFile = file;
- fHighlightRange = range;
- }
-
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void open() {
- if (fFile != null && fFile.exists()) {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editor = IDE.openEditor(page, fFile, true);
- // highlight range in editor if possible
- if (fHighlightRange != null && editor instanceof ITextEditor) {
- ((ITextEditor) editor).setHighlightRange(fHighlightRange.getOffset(), fHighlightRange.getLength(), true);
- }
- }
- catch (PartInitException pie) {
- Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java
deleted file mode 100644
index e6e9bcebfc..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/XMLHyperlinkDetector.java
+++ /dev/null
@@ -1,472 +0,0 @@
-package org.eclipse.wst.html.ui.internal.hyperlink;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
-import org.eclipse.wst.common.uriresolver.URIResolverPlugin;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.util.StringUtils;
-import org.eclipse.wst.xml.core.document.IDOMAttr;
-import org.eclipse.wst.xml.core.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Detects hyperlinks in XML tags. Includes detection in DOCTYPE and attribute
- * values. Resolves references to schemas, dtds, etc using the Common URI
- * Resolver.
- *
- */
-class XMLHyperlinkDetector implements IHyperlinkDetector {
- // copies of this class exist in:
- // org.eclipse.wst.xml.ui.internal.hyperlink
- // org.eclipse.wst.html.ui.internal.hyperlink
- // org.eclipse.jst.jsp.ui.internal.hyperlink
-
- private final String NO_NAMESPACE_SCHEMA_LOCATION = "noNamespaceSchemaLocation"; //$NON-NLS-1$
- private final String SCHEMA_LOCATION = "schemaLocation"; //$NON-NLS-1$
- private final String XMLNS = "xmlns"; //$NON-NLS-1$
- private final String XSI_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
- private final String HTTP_PROTOCOL = "http://";//$NON-NLS-1$
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- // for now, only capable of creating 1 hyperlink
- List hyperlinks = new ArrayList(0);
-
- if (region != null && textViewer != null) {
- IDocument document = textViewer.getDocument();
- Node currentNode = getCurrentNode(document, region.getOffset());
- if (currentNode != null) {
- String uriString = null;
- if (currentNode.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- // doctype nodes
- uriString = getURIString(currentNode, document);
- }
- else if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
- // element nodes
- Attr currentAttr = getCurrentAttrNode(currentNode, region.getOffset());
- if (currentAttr != null) {
- // try to find link for current attribute
- // resolve attribute value
- uriString = getURIString(currentAttr, document);
- // verify validity of uri string
- if (!isValidURI(uriString))
- // reset current attribute
- currentAttr = null;
- }
- if (currentAttr == null) {
- // try to find a linkable attribute within element
- currentAttr = getLinkableAttr((Element) currentNode);
- if (currentAttr != null) {
- uriString = getURIString(currentAttr, document);
- }
- }
- currentNode = currentAttr;
- }
- // try to create hyperlink from information gathered
- if (uriString != null && currentNode != null && isValidURI(uriString)) {
- IRegion hyperlinkRegion = getHyperlinkRegion(currentNode);
- IHyperlink hyperlink = createHyperlink(uriString, hyperlinkRegion, document, currentNode);
- if (hyperlink != null) {
- hyperlinks.add(hyperlink);
- }
- }
- }
- }
- if (hyperlinks.size() == 0)
- return null;
- return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]);
- }
-
- /**
- * Create the appropriate hyperlink
- *
- * @param uriString
- * @param hyperlinkRegion
- * @return IHyperlink
- */
- private IHyperlink createHyperlink(String uriString, IRegion hyperlinkRegion, IDocument document, Node node) {
- IHyperlink link = null;
-
- if (uriString != null) {
- String temp = uriString.toLowerCase();
- if (temp.startsWith(HTTP_PROTOCOL)) {
- // this is a URLHyperlink since this is a web address
- link = new URLHyperlink(hyperlinkRegion, uriString);
- }
- else {
- // try to locate the file in the workspace
- IFile file = getFile(uriString);
- if (file != null && file.exists()) {
- // this is a WorkspaceFileHyperlink since file exists in
- // workspace
- link = new WorkspaceFileHyperlink(hyperlinkRegion, file);
- }
- else {
- // this is an ExternalFileHyperlink since file does not
- // exist
- // in workspace
- File externalFile = new File(uriString);
- link = new ExternalFileHyperlink(hyperlinkRegion, externalFile);
- }
- }
- }
-
- return link;
- }
-
- private IRegion getHyperlinkRegion(Node node) {
- IRegion hyperRegion = null;
-
- if (node != null) {
- short nodeType = node.getNodeType();
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- // handle doc type node
- IDOMNode docNode = (IDOMNode) node;
- hyperRegion = new Region(docNode.getStartOffset(), docNode.getEndOffset() - docNode.getStartOffset());
- }
- else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute nodes
- IDOMAttr att = (IDOMAttr) node;
- // do not include quotes in attribute value region
- int regOffset = att.getValueRegionStartOffset();
- int regLength = att.getValueRegion().getTextLength();
- String attValue = att.getValueRegionText();
- if (StringUtils.isQuoted(attValue)) {
- regOffset = ++regOffset;
- regLength = regLength - 2;
- }
- hyperRegion = new Region(regOffset, regLength);
- }
- }
- return hyperRegion;
- }
-
- /**
- * Returns the URI string
- *
- * @param node -
- * assumes not null
- */
- protected String getURIString(Node node, IDocument document) {
- String resolvedURI = null;
- // need the base location, publicId, and systemId for URIResolver
- String baseLoc = null;
- String publicId = null;
- String systemId = null;
-
- short nodeType = node.getNodeType();
- // handle doc type node
- if (nodeType == Node.DOCUMENT_TYPE_NODE) {
- baseLoc = getBaseLocation(document);
- publicId = ((DocumentType) node).getPublicId();
- systemId = ((DocumentType) node).getSystemId();
- }
- else if (nodeType == Node.ATTRIBUTE_NODE) {
- // handle attribute node
- Attr attrNode = (Attr) node;
- baseLoc = getBaseLocation(document);
- String attrName = attrNode.getName();
- String attrValue = attrNode.getValue();
- attrValue = StringUtils.strip(attrValue);
-
- // handle schemaLocation attribute
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName))) {
- publicId = attrValue;
- systemId = getLocationHint(attrNode.getOwnerElement(), publicId);
- }
- else if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attrNode))) && (SCHEMA_LOCATION.equals(unprefixedName))) {
- // for now just use the first pair
- // need to look into being more precise
- StringTokenizer st = new StringTokenizer(attrValue);
- publicId = st.hasMoreTokens() ? st.nextToken() : null;
- systemId = st.hasMoreTokens() ? st.nextToken() : null;
- // else check if xmlns publicId = value
- }
- else {
- systemId = attrValue;
- }
- }
-
- resolvedURI = resolveURI(baseLoc, publicId, systemId);
- return resolvedURI;
- }
-
- /**
- * Returns an IFile from the given uri if possible, null if cannot find
- * file from uri.
- *
- * @param fileString
- * file system path
- * @return returns IFile if fileString exists in the workspace
- */
- private IFile getFile(String fileString) {
- IFile file = null;
-
- if (fileString != null) {
- IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(fileString));
- for (int i = 0; i < files.length && file == null; i++)
- if (files[i].exists())
- file = files[i];
- }
-
- return file;
- }
-
- /**
- * Checks to see if the given attribute is openable. Attribute is openable
- * if it is a namespace declaration attribute or if the attribute value is
- * of type URI.
- *
- * @param attr
- * cannot be null
- * @param cmElement
- * CMElementDeclaration associated with the attribute (can be
- * null)
- * @return true if this attribute is "openOn-able" false otherwise
- */
- private boolean isLinkableAttr(Attr attr, CMElementDeclaration cmElement) {
- String attrName = attr.getName();
- String prefix = DOMNamespaceHelper.getPrefix(attrName);
- String unprefixedName = DOMNamespaceHelper.getUnprefixedName(attrName);
- // determine if attribute is namespace declaration
- if ((XMLNS.equals(prefix)) || (XMLNS.equals(unprefixedName)))
- return true;
-
- // determine if attribute contains schema location
- if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attr))) && ((SCHEMA_LOCATION.equals(unprefixedName)) || (NO_NAMESPACE_SCHEMA_LOCATION.equals(unprefixedName))))
- return true;
-
- // determine if attribute value is of type URI
- if (cmElement != null) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) cmElement.getAttributes().getNamedItem(attrName);
- if ((attrDecl != null) && (attrDecl.getAttrType() != null) && (CMDataType.URI.equals(attrDecl.getAttrType().getDataTypeName()))) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Attempts to find an attribute within element that is openable.
- *
- * @param element -
- * cannot be null
- * @return Attr attribute that can be used for open on, null if no
- * attribute could be found
- */
- private Attr getLinkableAttr(Element element) {
- CMElementDeclaration ed = getCMElementDeclaration(element);
- // get the list of attributes for this node
- NamedNodeMap attrs = element.getAttributes();
- for (int i = 0; i < attrs.getLength(); ++i) {
- // check if this attribute is "openOn-able"
- Attr att = (Attr) attrs.item(i);
- if (isLinkableAttr(att, ed)) {
- return att;
- }
- }
- return null;
- }
-
- /**
- * Get the CMElementDeclaration for an element
- *
- * @param element
- * @return CMElementDeclaration
- */
- private CMElementDeclaration getCMElementDeclaration(Element element) {
- CMElementDeclaration ed = null;
-
- ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (mq != null) {
- ed = mq.getCMElementDeclaration(element);
- }
- return ed;
- }
-
- /**
- * Returns the attribute node within node at offset
- *
- * @param node
- * @param offset
- * @return Attr
- */
- private Attr getCurrentAttrNode(Node node, int offset) {
- if ((node instanceof IndexedRegion) && ((IndexedRegion) node).contains(offset) && (node.hasAttributes())) {
- NamedNodeMap attrs = node.getAttributes();
- // go through each attribute in node and if attribute contains
- // offset, return that attribute
- for (int i = 0; i < attrs.getLength(); ++i) {
- // assumption that if parent node is of type IndexedRegion,
- // then its attributes will also be of type IndexedRegion
- IndexedRegion attRegion = (IndexedRegion) attrs.item(i);
- if (attRegion.contains(offset)) {
- return (Attr) attrs.item(i);
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the node the cursor is currently on in the document. null if no
- * node is selected
- *
- * @param offset
- * @return Node either element, doctype, text, or null
- */
- private Node getCurrentNode(IDocument document, int offset) {
- // get the current node at the offset (returns either: element,
- // doctype, text)
- IndexedRegion inode = null;
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- inode = sModel.getIndexedRegion(offset);
- if (inode == null)
- inode = sModel.getIndexedRegion(offset - 1);
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
-
- if (inode instanceof Node) {
- return (Node) inode;
- }
- return null;
- }
-
- /**
- * Get the base location from the current model (local file system)
- */
- private String getBaseLocation(IDocument document) {
- String baseLoc = null;
-
- // get the base location from the current model
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if (sModel != null) {
- IPath location = new Path(sModel.getBaseLocation());
- if (location.toFile().exists()) {
- baseLoc = location.toString();
- }
- else {
- IPath basePath = new Path(sModel.getBaseLocation());
- if(basePath.segmentCount() > 1)
- baseLoc = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath).getLocation().toString();
- else
- baseLoc = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(basePath).toString();
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- return baseLoc;
- }
-
- /**
- * Checks whether the given uriString is really pointing to a file
- *
- * @param uriString
- * @return boolean
- */
- private boolean isValidURI(String uriString) {
- boolean isValid = false;
-
- if (uriString != null) {
- // first do a quick check to see if this is some sort of http://
- String tempString = uriString.toLowerCase();
- if (tempString.startsWith(HTTP_PROTOCOL))
- isValid = true;
- else {
- File file = new File(uriString);
- try {
- URI uri = new URI(uriString);
- file = new File(uri);
- }
- catch (URISyntaxException e) {
- // it is okay that a uri could not be created out of
- // uriString
- }
- catch (IllegalArgumentException e) {
- // it is okay that file could not be created out of uri
- }
- isValid = file.exists();
- }
- }
- return isValid;
- }
-
- /**
- * Resolves the given URI information
- *
- * @param baseLocation
- * @param publicId
- * @param systemId
- * @return String resolved uri.
- */
- private String resolveURI(String baseLocation, String publicId, String systemId) {
- // dont resolve if there's nothing to resolve
- if ((baseLocation == null) && (publicId == null) && (systemId == null))
- return null;
- return URIResolverPlugin.createResolver().resolve(baseLocation, publicId, systemId);
- }
-
- /**
- * Find the location hint for the given namespaceURI if it exists
- *
- * @param elementNode -
- * cannot be null
- * @param namespaceURI -
- * cannot be null
- * @return location hint (systemId) if it was found, null otherwise
- */
- private String getLocationHint(Element elementNode, String namespaceURI) {
- Attr schemaLocNode = elementNode.getAttributeNodeNS(XSI_NAMESPACE_URI, SCHEMA_LOCATION);
- if (schemaLocNode != null) {
- StringTokenizer st = new StringTokenizer(schemaLocNode.getValue());
- while (st.hasMoreTokens()) {
- String publicId = st.hasMoreTokens() ? st.nextToken() : null;
- String systemId = st.hasMoreTokens() ? st.nextToken() : null;
- // found location hint
- if (namespaceURI.equalsIgnoreCase(publicId))
- return systemId;
- }
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
deleted file mode 100644
index e2969c3fcc..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceInitializer.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.wst.html.ui.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.style.IStyleConstantsHTML;
-import org.eclipse.wst.sse.ui.preferences.ui.ColorHelper;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * Sets default values for HTML UI preferences
- */
-public class HTMLUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = HTMLUIPlugin.getDefault().getPreferenceStore();
-
- store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE, true);
- store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, "<");//$NON-NLS-1$
-
- // HTML Style Preferences
- String NOBACKGROUNDBOLD = " | null | false"; //$NON-NLS-1$
- String styleValue = ColorHelper.getColorString(127, 0, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_NAME, styleValue);
-
- styleValue = ColorHelper.getColorString(42, 0, 255) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_VALUE, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.TAG_ATTRIBUTE_EQUALS, styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.getColorString(63, 95, 191) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.COMMENT_BORDER, styleValue);
- store.setDefault(IStyleConstantsXML.COMMENT_TEXT, styleValue);
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DECL_BORDER, styleValue);
-
- styleValue = ColorHelper.getColorString(0, 0, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_NAME, styleValue);
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_PUBREF, styleValue);
-
- styleValue = ColorHelper.getColorString(128, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID, styleValue);
-
- styleValue = ColorHelper.getColorString(63, 127, 95) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.DOCTYPE_EXTERNAL_ID_SYSREF, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.XML_CONTENT, styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_BORDER, styleValue);
-
- styleValue = ColorHelper.getColorString(63, 127, 127) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.TAG_NAME, styleValue);
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.PI_BORDER, styleValue);
-
- styleValue = "null" + NOBACKGROUNDBOLD; //$NON-NLS-1$
- store.setDefault(IStyleConstantsXML.PI_CONTENT, styleValue); // specified value is black; leaving as widget default
-
- styleValue = ColorHelper.getColorString(0, 128, 128) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.CDATA_BORDER, styleValue);
-
- styleValue = ColorHelper.getColorString(0, 0, 0) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsXML.CDATA_TEXT, styleValue);
-
- styleValue = ColorHelper.getColorString(191, 95, 63) + NOBACKGROUNDBOLD;
- store.setDefault(IStyleConstantsHTML.SCRIPT_AREA_BORDER, styleValue);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
deleted file mode 100644
index f02070f1b8..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/HTMLUIPreferenceNames.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences;
-
-/**
- * Preference keys for HTML UI
- */
-public class HTMLUIPreferenceNames {
- /**
- * A named preference that controls if code assist gets auto activated.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- */
- public static final String AUTO_PROPOSE = getAutoProposeKey();
-
- private static String getAutoProposeKey() {
- return "autoPropose";//$NON-NLS-1$
- }
-
- /**
- * A named preference that holds the characters that auto activate code
- * assist.
- * <p>
- * Value is of type <code>String</code>. All characters that trigger
- * auto code assist.
- * </p>
- */
- public static final String AUTO_PROPOSE_CODE = getAutoProposeCodeKey();
-
- private static String getAutoProposeCodeKey() {
- return "autoProposeCode";//$NON-NLS-1$
- }
-
- /**
- * The key to store customized templates.
- * <p>
- * Value is of type <code>String</code>.
- * </p>
- */
- public static final String TEMPLATES_KEY = getTemplatesKey();
-
- private static String getTemplatesKey() {
- return "org.eclipse.wst.sse.ui.custom_templates"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
deleted file mode 100644
index 26079187f7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLColorPage.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.html.core.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
-import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
-import org.eclipse.wst.sse.ui.preferences.ui.StyledTextColorPicker;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLColorPage;
-
-public class HTMLColorPage extends XMLColorPage {
-
- /**
- * Set up all the style preference keys in the overlay store
- */
- protected OverlayKey[] createOverlayStoreKeys() {
- ArrayList overlayKeys = new ArrayList();
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
- Iterator i = styleList.iterator();
- while (i.hasNext()) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String)i.next()));
- }
-
- OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- public String getSampleText() {
- return HTMLUIMessages.Sample_HTML_doc;
-
- }
-
- protected void initContextStyleMap(Dictionary contextStyleMap) {
-
- initCommonContextStyleMap(contextStyleMap);
- initDocTypeContextStyleMap(contextStyleMap);
- // FIXME: these were "brute forced" commented out when moving XMLJSPRegionContexts
- // effect is unknown, but thought just to effect preference page
- //contextStyleMap.put(XMLJSPRegionContexts.JSP_DIRECTIVE_NAME, IStyleConstantsXML.TAG_NAME);
- //contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_OPEN, IStyleConstantsXML.COMMENT_BORDER);
- //contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_TEXT, IStyleConstantsXML.COMMENT_TEXT);
- //contextStyleMap.put(XMLJSPRegionContexts.JSP_COMMENT_CLOSE, IStyleConstantsXML.COMMENT_BORDER);
- }
-
- protected void initDescriptions(Dictionary descriptions) {
-
- initCommonDescriptions(descriptions);
- initDocTypeDescriptions(descriptions);
- }
-
- protected void initStyleList(ArrayList list) {
- initCommonStyleList(list);
- initDocTypeStyleList(list);
- // list.add(HTMLColorManager.SCRIPT_AREA_BORDER);
-
- }
-
- protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(ContentTypeIdForHTML.ContentTypeID_HTML).getParser());
-
- // create descriptions for hilighting types
- Dictionary descriptions = new Hashtable();
- initDescriptions(descriptions);
-
- // map region types to hilighting types
- Dictionary contextStyleMap = new Hashtable();
- initContextStyleMap(contextStyleMap);
-
- ArrayList styleList = new ArrayList();
- initStyleList(styleList);
-
- picker.setContextStyleMap(contextStyleMap);
- picker.setDescriptions(descriptions);
- picker.setStyleList(styleList);
-
- // updatePickerFont(picker);
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
- WorkbenchHelp.setHelp(c, IHelpContextIds.HTML_PREFWEBX_STYLES_HELPID);
- return c;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.preferences.ui.AbstractColorPage#savePreferences()
- */
- protected void savePreferences() {
- HTMLUIPlugin.getDefault().savePluginPreferences();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
deleted file mode 100644
index 19b12fa57a..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLFilesPreferencePage.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.html.core.HTMLFilesPreferenceNames;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.preferences.EncodingSettings;
-import org.eclipse.wst.xml.ui.internal.preferences.WorkbenchDefaultEncodingSettings;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLFilesPreferencePage;
-
-public class HTMLFilesPreferencePage extends XMLFilesPreferencePage {
- private WorkbenchDefaultEncodingSettings fInputEncodingSettings = null;
- private Text fHtmlext_Field;
- private Button fDoctype_Button;
- private Button fGenerator_Button;
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.preferences.ui.AbstractPreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
- */
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#doSavePreferenceStore()
- */
- protected void doSavePreferenceStore() {
- HTMLCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite scrolledComposite = createScrolledComposite(parent);
- createContentsForCreatingOrSavingGroup(scrolledComposite);
- createContentsForCreatingGroup(scrolledComposite);
- createContentsForLoadingGroup(scrolledComposite);
-
- WorkbenchHelp.setHelp(scrolledComposite, IHelpContextIds.HTML_PREFWEBX_FILES_HELPID);
-
- setSize(scrolledComposite);
- loadPreferences();
-
- return scrolledComposite;
- }
-
- protected void createContentsForLoadingGroup(Composite parent) {
- Group group = createGroup(parent, 1);
- group.setText(HTMLUIMessages.HTMLFilesPreferencePage_0);
-
- fInputEncodingSettings = new WorkbenchDefaultEncodingSettings(group);
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.preferences.ui.AbstractPreferencePage#initializeValues()
- */
- protected void initializeValues() {
- super.initializeValues();
- initializeValuesForLoadingGroup();
- }
-
- protected void initializeValuesForLoadingGroup() {
- String encoding = getModelPreferences().getString(CommonEncodingPreferenceNames.INPUT_CODESET);
-
- fInputEncodingSettings.setIANATag(encoding);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- super.performDefaults();
- performDefaultsForLoadingGroup();
- }
-
- protected void performDefaultsForLoadingGroup() {
- String encoding = getModelPreferences().getDefaultString(CommonEncodingPreferenceNames.INPUT_CODESET);
-
- fInputEncodingSettings.setIANATag(encoding);
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.preferences.ui.AbstractPreferencePage#storeValues()
- */
- protected void storeValues() {
- super.storeValues();
- storeValuesForLoadingGroup();
- }
-
- protected void storeValuesForLoadingGroup() {
- getModelPreferences().setValue(CommonEncodingPreferenceNames.INPUT_CODESET, fInputEncodingSettings.getIANATag());
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#createContentsForCreatingGroup(org.eclipse.swt.widgets.Composite)
- */
- protected void createContentsForCreatingGroup(Composite parent) {
- Group creatingGroup = createGroup(parent, 2);
- creatingGroup.setText(HTMLUIMessages.Creating_files);
-
- // Add this suffix..
- createLabel(creatingGroup, HTMLUIMessages.HTMLFilesPreferencePage_1);
- fHtmlext_Field = createTextField(creatingGroup);
-
- // Encoding..
- Label label = createLabel(creatingGroup, HTMLUIMessages.Encoding_desc);
- ((GridData)label.getLayoutData()).horizontalSpan = 2;
- fEncodingSettings = new EncodingSettings(creatingGroup);
- ((GridData)fEncodingSettings.getLayoutData()).horizontalSpan = 2;
-
- // Insert DOCTYPE declaration
- fDoctype_Button = createCheckBox(creatingGroup, HTMLUIMessages.HTMLFilesPreferencePage_2);
- ((GridData)fDoctype_Button.getLayoutData()).horizontalSpan = 2;
-
- // Insert GENERATOR with META tag
- fGenerator_Button = createCheckBox(creatingGroup, HTMLUIMessages.HTMLFilesPreferencePage_3);
- ((GridData)fGenerator_Button.getLayoutData()).horizontalSpan = 2;
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#initializeValuesForCreatingGroup()
- */
- protected void initializeValuesForCreatingGroup() {
- super.initializeValuesForCreatingGroup();
-
- String defaultSuffix = getModelPreferences().getString(HTMLFilesPreferenceNames.DEFAULT_SUFFIX);
- if (defaultSuffix.length() > 0) {
- fHtmlext_Field.setText(defaultSuffix);
- }
-
- boolean bCheck;
- bCheck = getModelPreferences().getBoolean(HTMLFilesPreferenceNames.GENERATE_DOCUMENT_TYPE);
- fDoctype_Button.setSelection(bCheck);
-
- bCheck = getModelPreferences().getBoolean(HTMLFilesPreferenceNames.GENERATE_GENERATOR);
- fGenerator_Button.setSelection(bCheck);
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#performDefaultsForCreatingGroup()
- */
- protected void performDefaultsForCreatingGroup() {
- super.performDefaultsForCreatingGroup();
-
- fHtmlext_Field.setText(getModelPreferences().getDefaultString(HTMLFilesPreferenceNames.DEFAULT_SUFFIX));
-
- fDoctype_Button.setSelection(getModelPreferences().getDefaultBoolean(HTMLFilesPreferenceNames.GENERATE_DOCUMENT_TYPE));
- fGenerator_Button.setSelection(getModelPreferences().getDefaultBoolean(HTMLFilesPreferenceNames.GENERATE_GENERATOR));
- }
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.xml.preferences.ui.XMLFilesPreferencePage#storeValuesForCreatingGroup()
- */
- protected void storeValuesForCreatingGroup() {
- super.storeValuesForCreatingGroup();
-
- String str_ext = fHtmlext_Field.getText();
- getModelPreferences().setValue(HTMLFilesPreferenceNames.DEFAULT_SUFFIX, str_ext);
-
- getModelPreferences().setValue(HTMLFilesPreferenceNames.GENERATE_DOCUMENT_TYPE, fDoctype_Button.getSelection());
-
- getModelPreferences().setValue(HTMLFilesPreferenceNames.GENERATE_GENERATOR, fGenerator_Button.getSelection());
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
deleted file mode 100644
index d6d37f9147..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLSourcePreferencePage.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-import org.eclipse.wst.sse.core.internal.preferences.CommonModelPreferenceNames;
-import org.eclipse.wst.xml.ui.internal.preferences.XMLSourcePreferencePage;
-
-public class HTMLSourcePreferencePage extends XMLSourcePreferencePage {
-
- protected Button fTagNameAsIs = null;
- protected Button fTagNameUpper = null;
- protected Button fTagNameLower = null;
- protected Button fAttrNameAsIs = null;
- protected Button fAttrNameUpper = null;
- protected Button fAttrNameLower = null;
-
- protected void createContentsForGrammarConstraintsGroup(Composite parent) {
- // do nothing
- }
-
- protected void performDefaultsForGrammarConstraintsGroup() {
- // do nothing
- }
-
- protected void initializeValuesForGrammarConstraintsGroup() {
- // do nothing
- }
-
- protected void storeValuesForGrammarConstraintsGroup() {
- // do nothing
- }
-
- protected void createContentsForContentAssistGroup(Composite parent) {
- super.createContentsForContentAssistGroup(parent);
-
- // add one more group of preferences
- createContentsForPreferredCaseGroup(parent, 2);
- }
-
- protected Composite createContentsForPreferredCaseGroup(Composite parent, int columnSpan) {
- Group caseGroup = createGroup(parent, columnSpan);
- caseGroup.setText(HTMLUIMessages.Preferred_markup_case_UI_);
-
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group tagNameGroup = createGroup(caseGroup, 1);
- tagNameGroup.setText(HTMLUIMessages.Tag_names__UI_);
- fTagNameUpper = createRadioButton(tagNameGroup, HTMLUIMessages.Tag_names_Upper_case_UI_);
- fTagNameLower = createRadioButton(tagNameGroup, HTMLUIMessages.Tag_names_Lower_case_UI_);
-
- // d257064 need to associate group w/ radio buttons so radio buttons header can be read
- Group attrNameGroup = createGroup(caseGroup, 1);
- attrNameGroup.setText(HTMLUIMessages.Attribute_names__UI_);
- fAttrNameUpper = createRadioButton(attrNameGroup, HTMLUIMessages.Attribute_names_Upper_case_UI_);
- fAttrNameLower = createRadioButton(attrNameGroup, HTMLUIMessages.Attribute_names_Lower_case_UI_);
-
- return parent;
-
- }
-
- protected void performDefaults() {
- fTagNameUpper.setSelection(getModelPreferences().getDefaultInt(CommonModelPreferenceNames.TAG_NAME_CASE) == CommonModelPreferenceNames.UPPER);
- fTagNameLower.setSelection(getModelPreferences().getDefaultInt(CommonModelPreferenceNames.TAG_NAME_CASE) == CommonModelPreferenceNames.LOWER);
- fAttrNameUpper.setSelection(getModelPreferences().getDefaultInt(CommonModelPreferenceNames.ATTR_NAME_CASE) == CommonModelPreferenceNames.UPPER);
- fAttrNameLower.setSelection(getModelPreferences().getDefaultInt(CommonModelPreferenceNames.ATTR_NAME_CASE) == CommonModelPreferenceNames.LOWER);
-
- super.performDefaults();
- }
-
- protected void initializeValues() {
- fTagNameUpper.setSelection(getModelPreferences().getInt(CommonModelPreferenceNames.TAG_NAME_CASE) == CommonModelPreferenceNames.UPPER);
- fTagNameLower.setSelection(getModelPreferences().getInt(CommonModelPreferenceNames.TAG_NAME_CASE) == CommonModelPreferenceNames.LOWER);
- fAttrNameUpper.setSelection(getModelPreferences().getInt(CommonModelPreferenceNames.ATTR_NAME_CASE) == CommonModelPreferenceNames.UPPER);
- fAttrNameLower.setSelection(getModelPreferences().getInt(CommonModelPreferenceNames.ATTR_NAME_CASE) == CommonModelPreferenceNames.LOWER);
-
- super.initializeValues();
- }
-
- protected void storeValues() {
- if (fTagNameUpper.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.TAG_NAME_CASE, CommonModelPreferenceNames.UPPER);
- else
- getModelPreferences().setValue(CommonModelPreferenceNames.TAG_NAME_CASE, CommonModelPreferenceNames.LOWER);
- if (fAttrNameUpper.getSelection())
- getModelPreferences().setValue(CommonModelPreferenceNames.ATTR_NAME_CASE, CommonModelPreferenceNames.UPPER);
- else
- getModelPreferences().setValue(CommonModelPreferenceNames.ATTR_NAME_CASE, CommonModelPreferenceNames.LOWER);
-
- super.storeValues();
- }
-
- public boolean performOk() {
- boolean result = super.performOk();
-
- doSavePreferenceStore();
-
- return result;
- }
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.preferences.ui.xml.XMLSourcePreferencePage#getModelPreferences()
- */
- protected Preferences getModelPreferences() {
- return HTMLCorePlugin.getDefault().getPluginPreferences();
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-
- protected void doSavePreferenceStore() {
- HTMLUIPlugin.getDefault().savePluginPreferences(); // UI
- HTMLCorePlugin.getDefault().savePluginPreferences(); // model
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
- WorkbenchHelp.setHelp(c, IHelpContextIds.HTML_PREFWEBX_SOURCE_HELPID);
- return c;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
deleted file mode 100644
index f495fe9768..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/preferences/ui/HTMLTemplatePreferencePage.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.preferences.ui;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.editor.IHelpContextIds;
-
-
-/**
- * Preference page for HTML templates
- */
-public class HTMLTemplatePreferencePage extends TemplatePreferencePage {
-
- public HTMLTemplatePreferencePage() {
- HTMLUIPlugin htmlEditorPlugin = HTMLUIPlugin.getDefault();
-
- setPreferenceStore(htmlEditorPlugin.getPreferenceStore());
- setTemplateStore(htmlEditorPlugin.getTemplateStore());
- setContextTypeRegistry(htmlEditorPlugin.getTemplateContextRegistry());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- boolean ok = super.performOk();
- HTMLUIPlugin.getDefault().savePluginPreferences();
- return ok;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#isShowFormatterSetting()
- */
- protected boolean isShowFormatterSetting() {
- // template formatting has not been implemented
- return false;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite ancestor) {
- Control c = super.createContents(ancestor);
- WorkbenchHelp.setHelp(c, IHelpContextIds.HTML_PREFWEBX_TEMPLATES_HELPID);
- return c;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
deleted file mode 100644
index 06d9384092..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterFactoryHTML.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.projection;
-
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.html.core.HTML40Namespace;
-import org.eclipse.wst.sse.core.AbstractAdapterFactory;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.w3c.dom.Node;
-
-public class ProjectionModelNodeAdapterFactoryHTML extends AbstractAdapterFactory {
- // copies of this class located in:
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
-
- private ProjectionViewer fProjectionViewer;
-
- public ProjectionModelNodeAdapterFactoryHTML() {
- adapterKey = ProjectionModelNodeAdapterHTML.class;
- }
-
- /**
- * Actually creates an adapter for the parent of target if target is the
- * "adapt-able" node
- */
- protected INodeAdapter createAdapter(INodeNotifier target) {
- if ((fProjectionViewer != null) && (target instanceof Node) && ((Node) target).getNodeType() == Node.ELEMENT_NODE) {
- Node node = (Node) target;
- if (isNodeProjectable(node)) {
-
- // actually work with the parent node to listen for add,
- // delete events
- Node parent = node.getParentNode();
- if (parent instanceof INodeNotifier) {
- INodeNotifier parentNotifier = (INodeNotifier) parent;
- ProjectionModelNodeAdapterHTML parentAdapter = (ProjectionModelNodeAdapterHTML) parentNotifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
- if (parentAdapter == null) {
- // create a new adapter for parent
- parentAdapter = new ProjectionModelNodeAdapterHTML(this);
- parentNotifier.addAdapter(parentAdapter);
- }
- // call update on parent because a new node has just been
- // added
- parentAdapter.updateAdapter(parent);
- }
- }
- }
-
- return null;
- }
-
- ProjectionViewer getProjectionViewer() {
- return fProjectionViewer;
- }
-
- /**
- * Returns true if node is a node type able to fold
- *
- * @param node
- * @return boolean true if node is projectable, false otherwise
- */
- boolean isNodeProjectable(Node node) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String tagName = node.getNodeName();
- // node is only projectable if it is head, body, script, style,
- // table tags
- if (HTML40Namespace.ElementName.HEAD.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.BODY.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.SCRIPT.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.STYLE.equalsIgnoreCase(tagName) || HTML40Namespace.ElementName.TABLE.equalsIgnoreCase((tagName)))
- return true;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.core.AbstractAdapterFactory#release()
- */
- public void release() {
- fProjectionViewer = null;
-
- super.release();
- }
-
- void setProjectionViewer(ProjectionViewer viewer) {
- fProjectionViewer = viewer;
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
deleted file mode 100644
index 1da7249f93..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/ProjectionModelNodeAdapterHTML.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.projection;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
-import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.wst.sse.core.INodeAdapter;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IndexedRegion;
-import org.eclipse.wst.html.ui.internal.Logger;
-import org.w3c.dom.Node;
-
-/**
- * Updates projection annotation model with projection annotations for this
- * adapter node's children
- */
-public class ProjectionModelNodeAdapterHTML implements INodeAdapter {
-
- private class TagProjectionAnnotation extends ProjectionAnnotation {
- private boolean fIsVisible = false; /* workaround for BUG85874 */
- private Node fNode;
-
- public TagProjectionAnnotation(Node node, boolean isCollapsed) {
- super(isCollapsed);
- fNode = node;
- }
-
- public Node getNode() {
- return fNode;
- }
-
- public void setNode(Node node) {
- fNode = node;
- }
-
- /**
- * Does not paint hidden annotations. Annotations are hidden when they
- * only span one line.
- *
- * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC,
- * org.eclipse.swt.widgets.Canvas,
- * org.eclipse.swt.graphics.Rectangle)
- */
- public void paint(GC gc, Canvas canvas, Rectangle rectangle) {
- /* workaround for BUG85874 */
- /*
- * only need to check annotations that are expanded because hidden
- * annotations should never have been given the chance to
- * collapse.
- */
- if (!isCollapsed()) {
- // working with rectangle, so need the styledtext line height
- int lineHeight = fAdapterFactory.getProjectionViewer().getTextWidget().getLineHeight();
-
- // do not draw annotations that only span one line and mark
- // them as not visible
- if ((rectangle.height / lineHeight) <= 1) {
- fIsVisible = false;
- return;
- }
- }
- fIsVisible = true;
- super.paint(gc, canvas, rectangle);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.projection.ProjectionAnnotation#markCollapsed()
- */
- public void markCollapsed() {
- /* workaround for BUG85874 */
- // do not mark collapsed if annotation is not visible
- if (fIsVisible)
- super.markCollapsed();
- }
- }
-
- // copies of this class located in:
- // org.eclipse.wst.html.ui.internal.projection
- // org.eclipse.jst.jsp.ui.internal.projection
- private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
- ProjectionModelNodeAdapterFactoryHTML fAdapterFactory;
- private Map fTagAnnotations = new HashMap();
-
- public ProjectionModelNodeAdapterHTML(ProjectionModelNodeAdapterFactoryHTML factory) {
- fAdapterFactory = factory;
- }
-
- /**
- * Create a projection position from the given node. Able to get
- * projection position if node isNodeProjectable.
- *
- * @param node
- * @return null if no projection position possible, a Position otherwise
- */
- private Position createProjectionPosition(Node node) {
- Position pos = null;
- if (fAdapterFactory.isNodeProjectable(node) && node instanceof IndexedRegion) {
- IDocument document = fAdapterFactory.getProjectionViewer().getDocument();
- if (document != null) {
- IndexedRegion inode = (IndexedRegion) node;
- int start = inode.getStartOffset();
- int end = inode.getEndOffset();
- if (start >= 0 && start < end) {
- try {
-// // region-based
-// // extra line when collapsed, but no region increase when add newline
-// pos = new Position(start, end - start);
-
-// // line-based
-// // extra line when collapsed, but no region increase when add newline
-// IRegion startLineRegion = document.getLineInformationOfOffset(start);
-// IRegion endLineRegion = document.getLineInformationOfOffset(end);
-// int startOffset = startLineRegion.getOffset();
-// int endOffset = endLineRegion.getOffset() + endLineRegion.getLength();
-// if (endOffset > startOffset) {
-// pos = new Position(startOffset, endOffset - startOffset);
-// }
-
- // line-based
- // no extra line when collapsed, but region increase when add newline
- int startLine = document.getLineOfOffset(start);
- int endLine = document.getLineOfOffset(end);
- if (endLine + 1 < document.getNumberOfLines()) {
- int offset = document.getLineOffset(startLine);
- int endOffset = document.getLineOffset(endLine + 1);
- pos = new Position(offset, endOffset - offset);
- }
- } catch (BadLocationException x) {
- Logger.log(Logger.WARNING_DEBUG, null, x);
- }
- }
- }
- }
- return pos;
- }
-
- /**
- * Find TagProjectionAnnotation for node in the current list of projection
- * annotations for this adapter
- *
- * @param node
- * @return TagProjectionAnnotation
- */
- private TagProjectionAnnotation getExistingAnnotation(Node node) {
- TagProjectionAnnotation anno = null;
-
- if ((node != null) && (!fTagAnnotations.isEmpty())) {
- Iterator it = fTagAnnotations.keySet().iterator();
- while (it.hasNext() && anno == null) {
- TagProjectionAnnotation a = (TagProjectionAnnotation) it.next();
- Node n = a.getNode();
- if (node.equals(n)) {
- anno = a;
- }
- }
- }
- return anno;
- }
-
- public boolean isAdapterForType(Object type) {
- return type == ProjectionModelNodeAdapterHTML.class;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- // check if folding is even enabled, if not, just ignore notifyChanged
- // events
- if (fAdapterFactory.getProjectionViewer() == null) {
- return;
- }
-
- if ((eventType == INodeNotifier.STRUCTURE_CHANGED) && (notifier instanceof Node)) {
- updateAdapter((Node) notifier);
- }
- }
-
- /**
- * Update the projection annotation of all the nodes that are children of
- * node
- *
- * @param node
- */
- void updateAdapter(Node node) {
- long start = System.currentTimeMillis();
-
- Map additions = new HashMap();
- Map projectionAnnotations = new HashMap();
-
- // go through immediate child nodes and figure out projection
- // model annotations
- if (node != null) {
- Node childNode = node.getFirstChild();
- while (childNode != null) {
- Position newPos = createProjectionPosition(childNode);
- if (newPos != null) {
- TagProjectionAnnotation newAnnotation = new TagProjectionAnnotation(childNode, false);
- TagProjectionAnnotation existing = getExistingAnnotation(childNode);
- if (existing == null) {
- // add to map containing all annotations for this
- // adapter
- projectionAnnotations.put(newAnnotation, newPos);
- // add to map containing annotations to add
- additions.put(newAnnotation, newPos);
- } else {
- // add to map containing all annotations for this
- // adapter
- projectionAnnotations.put(existing, newPos);
- // remove from map containing annotations to delete
- fTagAnnotations.remove(existing);
- }
- }
- childNode = childNode.getNextSibling();
- }
-
- // in the end, want to delete anything leftover in old list, add
- // everything in additions, and update everything in
- // projectionAnnotations
- ProjectionAnnotation[] oldList = null;
- if (!fTagAnnotations.isEmpty()) {
- oldList = (ProjectionAnnotation[]) fTagAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
- }
- ProjectionAnnotation[] modifyList = null;
- if (!projectionAnnotations.isEmpty()) {
- modifyList = (ProjectionAnnotation[]) projectionAnnotations.keySet().toArray(new ProjectionAnnotation[0]);
- }
- ProjectionViewer viewer = fAdapterFactory.getProjectionViewer();
- ProjectionAnnotationModel annotationModel = viewer.getProjectionAnnotationModel();
- annotationModel.modifyAnnotations(oldList, additions, modifyList);
- }
-
- // save new list of annotations
- fTagAnnotations = additions;
-
- long end = System.currentTimeMillis();
- if (debugProjectionPerf) {
- String nodeName = node != null ? node.getNodeName() : "null"; //$NON-NLS-1$
- System.out.println("ProjectionModelNodeAdapterHTML.updateAdapter (" + nodeName + "):" + (end - start)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
deleted file mode 100644
index effbba8b5f..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/projection/StructuredTextFoldingProviderHTML.java
+++ /dev/null
@@ -1,216 +0,0 @@
-package org.eclipse.wst.html.ui.internal.projection;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.projection.IProjectionListener;
-import org.eclipse.jface.text.source.projection.ProjectionViewer;
-import org.eclipse.wst.sse.core.INodeNotifier;
-import org.eclipse.wst.sse.core.IStructuredModel;
-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.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.projection.IStructuredTextFoldingProvider;
-import org.eclipse.wst.xml.core.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Updates the projection model of a structured model for HTML.
- */
-public class StructuredTextFoldingProviderHTML implements IStructuredTextFoldingProvider, IProjectionListener {
- private final static boolean debugProjectionPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.html.ui/projectionperf")); //$NON-NLS-1$ //$NON-NLS-2$
-
- private IDocument fDocument;
- private ProjectionViewer fViewer;
-
- /**
- * Adds an adapter to node and its children
- *
- * @param node
- * @param level
- */
- private void addAdapterToNodeAndChildren(Node node, int level) {
- if (node instanceof INodeNotifier) {
- INodeNotifier notifier = (INodeNotifier) node;
-
- // try and get the adapter for the current node and update the
- // adapter with projection information
- ProjectionModelNodeAdapterHTML adapter = (ProjectionModelNodeAdapterHTML) notifier.getExistingAdapter(ProjectionModelNodeAdapterHTML.class);
- if (adapter != null) {
- adapter.updateAdapter(node);
- }
- else {
- // just call getadapter so the adapter is created and
- // automatically initialized
- notifier.getAdapterFor(ProjectionModelNodeAdapterHTML.class);
- }
-
- Node nextChild = node.getFirstChild();
- while (nextChild != null) {
- Node childNode = nextChild;
- nextChild = childNode.getNextSibling();
-
- addAdapterToNodeAndChildren(childNode, level + 1);
- }
- }
- }
-
- /**
- * Goes through every node and adds an adapter onto each for tracking
- * purposes
- */
- private void addAllAdapters() {
- long start = System.currentTimeMillis();
-
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (sModel != null) {
- int startOffset = 0;
- IndexedRegion startNode = sModel.getIndexedRegion(startOffset);
- if (startNode instanceof Node) {
- int level = 0;
- Node nextSibling = (Node) startNode;
- while (nextSibling != null) {
- Node currentNode = nextSibling;
- nextSibling = currentNode.getNextSibling();
-
- addAdapterToNodeAndChildren(currentNode, level);
- }
- }
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
-
- long end = System.currentTimeMillis();
- if (debugProjectionPerf)
- System.out.println("StructuredTextFoldingProviderHTML.addAllAdapters: " + (end - start)); //$NON-NLS-1$
- }
-
- /**
- * Get the ProjectionModelNodeAdapterFactoryHTML to use with this
- * provider.
- *
- * @return ProjectionModelNodeAdapterFactoryHTML
- */
- private ProjectionModelNodeAdapterFactoryHTML getAdapterFactory(boolean createIfNeeded) {
- long start = System.currentTimeMillis();
-
- ProjectionModelNodeAdapterFactoryHTML factory = null;
- IStructuredModel sModel = null;
- try {
- sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
- if (sModel != null) {
- FactoryRegistry factoryRegistry = sModel.getFactoryRegistry();
-
- // getting the projectionmodelnodeadapter for the first time
- // so do some initializing
- if (!factoryRegistry.contains(ProjectionModelNodeAdapterHTML.class) && createIfNeeded) {
- ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();
-
- // add factory to factory registry
- factoryRegistry.addFactory(newFactory);
-
- // add factory to propogating adapter
- IDOMModel domModel = (IDOMModel) sModel;
- Document document = domModel.getDocument();
- PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
- if (propagatingAdapter != null) {
- propagatingAdapter.addAdaptOnCreateFactory(newFactory);
- }
- }
-
- // try and get the factory
- factory = (ProjectionModelNodeAdapterFactoryHTML) factoryRegistry.getFactoryFor(ProjectionModelNodeAdapterHTML.class);
- }
- }
- finally {
- if (sModel != null)
- sModel.releaseFromRead();
- }
-
- long end = System.currentTimeMillis();
- if (debugProjectionPerf)
- System.out.println("StructuredTextFoldingProviderHTML.getAdapterFactory: " + (end - start)); //$NON-NLS-1$
- return factory;
- }
-
- /**
- * Initialize this provider with the correct document. Assumes projection
- * is enabled. (otherwise, only install would have been called)
- */
- public void initialize() {
- if (!isInstalled())
- return;
-
- // set projection viewer to null on old document's adapter factory
- ProjectionModelNodeAdapterFactoryHTML factory = getAdapterFactory(false);
- if (factory != null) {
- factory.setProjectionViewer(null);
- }
-
- // clear out all annotations
- if (fViewer.getProjectionAnnotationModel() != null)
- fViewer.getProjectionAnnotationModel().removeAllAnnotations();
-
- fDocument = fViewer.getDocument();
-
- if (fDocument != null) {
- // set projection viewer on new document's adapter factory
- factory = getAdapterFactory(true);
- if (factory != null) {
- factory.setProjectionViewer(fViewer);
- }
-
- addAllAdapters();
- }
- }
-
- /**
- * Associate a ProjectionViewer with this IStructuredTextFoldingProvider
- *
- * @param viewer
- */
- public void install(ProjectionViewer viewer) {
- // uninstall before trying to install new viewer
- if (isInstalled()) {
- uninstall();
- }
- fViewer = viewer;
- fViewer.addProjectionListener(this);
- }
-
- private boolean isInstalled() {
- return fViewer != null;
- }
-
- public void projectionDisabled() {
- ProjectionModelNodeAdapterFactoryHTML factory = getAdapterFactory(false);
- if (factory != null) {
- factory.setProjectionViewer(null);
- }
-
- fDocument = null;
- }
-
- public void projectionEnabled() {
- initialize();
- }
-
- /**
- * Disconnect this IStructuredTextFoldingProvider from projection viewer
- */
- public void uninstall() {
- if (isInstalled()) {
- projectionDisabled();
-
- fViewer.removeProjectionListener(this);
- fViewer = null;
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForEmbeddedHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForEmbeddedHTML.java
deleted file mode 100644
index 56926a3e70..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForEmbeddedHTML.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.registry;
-
-import org.eclipse.wst.html.core.internal.modelhandler.EmbeddedHTML;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.ui.registry.embedded.EmbeddedAdapterFactoryProvider;
-
-public class AdapterFactoryProviderForEmbeddedHTML implements EmbeddedAdapterFactoryProvider {
-
- /*
- * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
- */
- public void addAdapterFactories(IStructuredModel structuredModel) {
- // if (structuredModel instanceof XMLModel) {
- // XMLDocument doc = ((XMLModel) structuredModel).getDocument();
- // }
- }
-
- /*
- * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
- */
- public boolean isFor(EmbeddedTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof EmbeddedHTML);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java
deleted file mode 100644
index 97c7bb69e6..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/registry/AdapterFactoryProviderForHTML.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.registry;
-
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.wst.html.core.internal.modelhandler.ModelHandlerForHTML;
-import org.eclipse.wst.html.ui.internal.contentoutline.JFaceNodeAdapterFactoryForHTML;
-import org.eclipse.wst.sse.core.INodeAdapterFactory;
-import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
-import org.eclipse.wst.sse.core.internal.model.FactoryRegistry;
-import org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter;
-import org.eclipse.wst.sse.ui.registry.AdapterFactoryProvider;
-import org.eclipse.wst.sse.ui.util.Assert;
-import org.eclipse.wst.xml.core.document.IDOMModel;
-import org.eclipse.wst.xml.ui.internal.properties.XMLPropertySourceAdapterFactory;
-
-/**
- *
- */
-public class AdapterFactoryProviderForHTML implements AdapterFactoryProvider {
-
- /*
- * @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
- */
- public void addAdapterFactories(IStructuredModel structuredModel) {
-
- // these are the normal edit side content based factories
- addContentBasedFactories(structuredModel);
- // ===
- // Must update/add to propagating adapter here too
- if (structuredModel instanceof IDOMModel) {
- addPropagatingAdapters(structuredModel);
- }
- // ===
- }
-
- protected void addContentBasedFactories(IStructuredModel structuredModel) {
-
- FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
- Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
- INodeAdapterFactory factory = null;
- // == this list came from the previous "HTML only" list
- // factory = factoryRegistry.getFactoryFor(ContentAssistAdapter.class);
-
- // Doc Partion change: no more adapter factories for edit side functions
-
- // if (factory == null) {
- // factory = new HTMLContentAssistAdapterFactory();
- // factoryRegistry.addFactory(factory);
- // }
-
- // factory = factoryRegistry.getFactoryFor(DoubleClickAdapter.class);
- // if (factory == null) {
- // factory = new DoubleClickAdapterFactory(DoubleClickAdapter.class, true);
- // factoryRegistry.addFactory(factory);
- // }
- // // == New adapter factories for tagInfo
- // factory = factoryRegistry.getFactoryFor(HoverHelpAdapter.class);
- // if (factory == null) {
- // factory = new HTMLHoverHelpAdapterFactory(HoverHelpAdapter.class, true);
- // factoryRegistry.addFactory(factory);
- // }
- // factory = factoryRegistry.getFactoryFor(TagInfoProviderAdapter.class);
- // if (factory == null) {
- // factory = new JSTagInfoProviderAdapterFactory(TagInfoProviderAdapter.class, true);
- // factoryRegistry.addFactory(factory);
- // }
- // ==
- // == this list came from the previous 'for both XML and HTML' list
- factory = factoryRegistry.getFactoryFor(IPropertySource.class);
- if (factory == null) {
- factory = new XMLPropertySourceAdapterFactory();
- factoryRegistry.addFactory(factory);
- }
- factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
- if (factory == null) {
- factory = new JFaceNodeAdapterFactoryForHTML();
- factoryRegistry.addFactory(factory);
- }
- // factory = factoryRegistry.getFactoryFor(com.ibm.sed.edit.adapters.LineStyleProvider.class);
- // if (factory == null) {
- // factory = new LineStyleProviderFactoryForHTML();
- // factoryRegistry.addFactory(factory);
- // }
-
- // factory = factoryRegistry.getFactoryFor(ReconcilerAdapter.class);
- // if (factory == null) {
- // // can't use Propagating system since the Node tree is already built by now
- // ReconcilerAdapterFactoryForXML reconcilerFactory = new ReconcilerAdapterFactoryForXML();
- // factoryRegistry.addFactory(reconcilerFactory);
- // reconcilerFactory.adaptAll((XMLModel) structuredModel);
- // }
- }
-
- protected void addPropagatingAdapters(IStructuredModel structuredModel) {
-// XMLModel xmlModel = (XMLModel) structuredModel;
-// XMLDocument document = xmlModel.getDocument();
-// PropagatingAdapter propagatingAdapter = (PropagatingAdapter) document.getAdapterFor(PropagatingAdapter.class);
-// if (propagatingAdapter != null) {
- // no longer needs?
- // factory = new HTMLLineStyeUpdaterFactory();
- // propagatingAdapter.addAdaptOnCreateFactory(factory);
- // propagatingAdapter.initializeForFactory(factory, document);
-
- // checking if we should bother adding this factory
- // if the preference says not to check validity, we don't bother creating this factory
- // to improve performance...
- //if(structuredModel.getStructuredPreferenceStore().getPreferenceString(CommonPreferenceNames.EDITOR_VALIDATION_METHOD).equals(CommonPreferenceNames.EDITOR_VALIDATION_CONTENT_MODEL)) {
- //factory = new ReconcilerAdapterFactoryForXML();
- //propagatingAdapter.addAdaptOnCreateFactory(factory);
- // (pa) perf:
- //propagatingAdapter.initializeForFactory(factory, xmlModel.getDocument());
- //}
-
-// }
- }
-
- /*
- * @see AdapterFactoryProvider#isFor(ContentTypeDescription)
- */
- public boolean isFor(IDocumentTypeHandler contentTypeDescription) {
- return (contentTypeDescription instanceof ModelHandlerForHTML);
- }
-
- public void reinitializeFactories(IStructuredModel structuredModel) {
- // nothing to do, since no embedded type
- }
-
-} \ 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
deleted file mode 100644
index 079359a679..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/search/HTMLFindOccurrencesAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.search;
-
-import java.util.ResourceBundle;
-
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.wst.html.core.text.IHTMLPartitionTypes;
-import org.eclipse.wst.sse.ui.internal.search.BasicFindOccurrencesAction;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-
-/**
- * Configures a BasicFindOccurrencesAction with HTML partitions and regions
- *
- * @author pavery
- */
-public class HTMLFindOccurrencesAction extends BasicFindOccurrencesAction {
-
- public HTMLFindOccurrencesAction(ResourceBundle bundle, String prefix, ITextEditor editor) {
- super(bundle, prefix, editor);
- }
-
- /**
- * @see com.ibm.sse.editor.internal.search.BasicFindOccurrencesAction#getPartitionTypes()
- */
- public String[] getPartitionTypes() {
-
- return new String[]{IHTMLPartitionTypes.HTML_DEFAULT, IXMLPartitions.XML_DEFAULT};
- }
-
- /**
- * @see com.ibm.sse.editor.internal.search.BasicFindOccurrencesAction#getRegionTypes()
- */
- public String[] getRegionTypes() {
-
- return new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_NAME, DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE};
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java
deleted file mode 100644
index 5c7c88decc..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/IStyleConstantsHTML.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.style;
-
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-
-/**
- * Contains the symbolic name of styles used by LineStyleProvider, ColorManager, and
- * any others who may be interested
- */
-public interface IStyleConstantsHTML extends IStyleConstantsXML {
- public static final String SCRIPT_AREA_BORDER = "SCRIPT_AREA_BORDER";//$NON-NLS-1$
- public static final String SCRIPT_AREA = "SCRIPT_AREA";//$NON-NLS-1$
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
deleted file mode 100644
index 56f71f96d5..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/style/LineStyleProviderForHTML.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.style;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.ui.style.LineStyleProvider;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.style.IStyleConstantsXML;
-import org.eclipse.wst.xml.ui.internal.style.LineStyleProviderForXML;
-
-public class LineStyleProviderForHTML extends LineStyleProviderForXML implements LineStyleProvider {
-
- public LineStyleProviderForHTML() {
- super();
- }
-
- /**
- * a method to centralize all the "format rules" for regions
- * specifically associated for how to "open" the region.
- */
- // NOTE: this method was just copied down form LineStyleProviderForXML
- public TextAttribute getAttributeFor(ITextRegion region) {
- // not sure why this is coming through null, but just to catch it
- if (region == null) {
- return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- }
- if (region.getType() == DOMRegionContext.BLOCK_TEXT) {
- return (TextAttribute)getTextAttributes().get(IStyleConstantsXML.XML_CONTENT);
- }
- // first try "standard" tag attributes from super class
- return super.getAttributeFor(region);
- }
-
- protected void loadColors() {
- super.loadColors();
-
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
- }
-
-
- protected void handlePropertyChange(PropertyChangeEvent event) {
- if (event != null) {
- String prefKey = event.getProperty();
- // check if preference changed is a style preference
- if (IStyleConstantsHTML.SCRIPT_AREA_BORDER.equals(prefKey)) {
- addTextAttribute(IStyleConstantsHTML.SCRIPT_AREA_BORDER);
-
- // this is what AbstractLineStyleProvider.propertyChange() does
- getHighlighter().refreshDisplay();
- } else {
- super.handlePropertyChange(event);
- }
- } else {
- super.handlePropertyChange(event);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.style.AbstractLineStyleProvider#getColorPreferences()
- */
- protected IPreferenceStore getColorPreferences() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLBestMatchHoverProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLBestMatchHoverProcessor.java
deleted file mode 100644
index 644966b1b9..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLBestMatchHoverProcessor.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.taginfo;
-
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.wst.sse.ui.taginfo.AbstractBestMatchHoverProcessor;
-
-/**
- * Provides the best html hover help documentation (by using other hover help processors)
- * Priority of hover help processors is:
- * ProblemHoverProcessor, HTMLTagInfoHoverProcessor, AnnotationHoverProcessor
- */
-public class HTMLBestMatchHoverProcessor extends AbstractBestMatchHoverProcessor {
- HTMLTagInfoHoverProcessor fTagInfoHover;
-
- /* (non-Javadoc)
- * @see com.ibm.sse.editor.structured.taginfo.AbstractBestMatchHoverProcessor#getTagInfoHover()
- */
- protected ITextHover getTagInfoHover() {
- if (fTagInfoHover == null) {
- fTagInfoHover = new HTMLTagInfoHoverProcessor();
- }
- return fTagInfoHover;
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
deleted file mode 100644
index 26ecebfed4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLInformationProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.taginfo;
-
-
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.information.IInformationProvider;
-import org.eclipse.jface.text.information.IInformationProviderExtension;
-
-/**
- * Provides context information for HTML tags (Shows tooltip description)
- *
- * @author amywu
- */
-public class HTMLInformationProvider implements IInformationProvider, IInformationProviderExtension {
-
- private HTMLBestMatchHoverProcessor fTextHover = null;
-
- public HTMLInformationProvider() {
- fTextHover = new HTMLBestMatchHoverProcessor();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer, int)
- */
- public IRegion getSubject(ITextViewer textViewer, int offset) {
- return fTextHover.getHoverRegion(textViewer, offset);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
- */
- public String getInformation(ITextViewer textViewer, IRegion subject) {
- return (String)getInformation2(textViewer, subject);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
- */
- public Object getInformation2(ITextViewer textViewer, IRegion subject) {
- return fTextHover.getHoverInfo(textViewer, subject);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java
deleted file mode 100644
index b8f7103d94..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/taginfo/HTMLTagInfoHoverProcessor.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.taginfo;
-
-
-
-import org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor;
-
-/**
- * Provides hover help documentation for HTML tags
- *
- * @author amywu
- */
-public class HTMLTagInfoHoverProcessor extends XMLTagInfoHoverProcessor {
- // currently empty because XMLTagInfoHoverProcessor handles all cases relevant to HTML
- public HTMLTagInfoHoverProcessor() {
- super();
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java
deleted file mode 100644
index aca7d175e7..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/EncodingTemplateVariableResolverHTML.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.SimpleTemplateVariableResolver;
-import org.eclipse.jface.text.templates.TemplateContext;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-
-
-public class EncodingTemplateVariableResolverHTML extends SimpleTemplateVariableResolver {
- private static final String ENCODING_TYPE = getEncodingType();
-
- private static String getEncodingType() {
- return "encoding"; //$NON-NLS-1$
- }
-
- /**
- * Creates a new encoding variable
- */
- public EncodingTemplateVariableResolverHTML() {
- super(ENCODING_TYPE, HTMLUIMessages.Creating_files_encoding);
- }
-
- protected String resolve(TemplateContext context) {
- return HTMLCorePlugin.getDefault().getPluginPreferences().getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java
deleted file mode 100644
index bf775f4ce4..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeHTML.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.templates;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * Base class for HTML template context types. Templates of this context type
- * apply to any place within HTML content type.
- */
-public class TemplateContextTypeHTML extends TemplateContextType {
-
- public TemplateContextTypeHTML() {
- super();
- addResolver(new GlobalTemplateVariables.Cursor());
- addResolver(new GlobalTemplateVariables.Date());
- addResolver(new GlobalTemplateVariables.Dollar());
- addResolver(new GlobalTemplateVariables.LineSelection());
- addResolver(new GlobalTemplateVariables.Time());
- addResolver(new GlobalTemplateVariables.User());
- addResolver(new GlobalTemplateVariables.WordSelection());
- addResolver(new GlobalTemplateVariables.Year());
- addResolver(new EncodingTemplateVariableResolverHTML());
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java
deleted file mode 100644
index 794b13db36..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/templates/TemplateContextTypeIdsHTML.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.templates;
-
-
-public class TemplateContextTypeIdsHTML {
-
- public static final String ALL = getAll();
-
- public static final String ATTRIBUTE = getAttribute();
-
- public static final String ATTRIBUTE_VALUE = getAttributeValue();
-
- public static final String NEW = getNew();
-
- public static final String TAG = getTag();
-
- private static String getAll() {
- return getPrefix() + "_all"; //$NON-NLS-1$
- }
-
- private static String getAttribute() {
- return getPrefix() + "_attribute"; //$NON-NLS-1$
- }
-
- private static String getAttributeValue() {
- return getPrefix() + "_attribute_value"; //$NON-NLS-1$
- }
-
- private static String getNew() {
- return getPrefix() + "_new"; //$NON-NLS-1$
- }
-
- private static String getTag() {
- return getPrefix() + "_tag"; //$NON-NLS-1$
- }
-
- private static String getPrefix() {
- return "html"; //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java
deleted file mode 100644
index c58a457adb..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/text/HTMLDocumentRegionEdgeMatcher.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.text;
-
-import org.eclipse.jdt.internal.ui.text.JavaPairMatcher;
-import org.eclipse.wst.sse.ui.text.DocumentRegionEdgeMatcher;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-public class HTMLDocumentRegionEdgeMatcher extends DocumentRegionEdgeMatcher {
-
- protected final static char[] BRACKETS = {'{', '}', '(', ')', '[', ']'};
-
- /**
- * @param validContexts
- * @param nextMatcher
- */
- public HTMLDocumentRegionEdgeMatcher() {
- super(new String[]{DOMRegionContext.XML_TAG_NAME, DOMRegionContext.XML_COMMENT_TEXT, DOMRegionContext.XML_CDATA_TEXT, DOMRegionContext.XML_PI_OPEN, DOMRegionContext.XML_PI_CONTENT}, new JavaPairMatcher(BRACKETS));
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/views/contentoutline/HTMLContentOutlineConfiguration.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/views/contentoutline/HTMLContentOutlineConfiguration.java
deleted file mode 100644
index d46aa98aee..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/views/contentoutline/HTMLContentOutlineConfiguration.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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
- *******************************************************************************/
-package org.eclipse.wst.html.ui.internal.views.contentoutline;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.contentoutline.HTMLNodeActionManager;
-import org.eclipse.wst.xml.ui.internal.contentoutline.XMLNodeActionManager;
-import org.eclipse.wst.xml.ui.internal.views.contentoutline.XMLContentOutlineConfiguration;
-
-public class HTMLContentOutlineConfiguration extends XMLContentOutlineConfiguration {
-
- /**
- * @param editor
- */
- public HTMLContentOutlineConfiguration() {
- super();
- }
-
- /**
- * @see com.ibm.sse.editor.xml.views.contentoutline.XMLContentOutlineConfiguration#createNodeActionManager(org.eclipse.jface.viewers.TreeViewer)
- */
- protected XMLNodeActionManager createNodeActionManager(TreeViewer treeViewer) {
- return new HTMLNodeActionManager(getEditor().getModel(), treeViewer);
- }
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.views.contentoutline.StructuredContentOutlineConfiguration#getPreferenceStore()
- */
- protected IPreferenceStore getPreferenceStore() {
- return HTMLUIPlugin.getDefault().getPreferenceStore();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
deleted file mode 100644
index 1cbfc3dae3..0000000000
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/wizard/NewHTMLWizard.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.eclipse.wst.html.ui.internal.wizard;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
-import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
-import org.eclipse.wst.html.ui.internal.Logger;
-
-public class NewHTMLWizard extends Wizard implements INewWizard {
- static String PAGE_IMAGE = "/icons/full/wizban/newhfile_wiz.gif"; //$NON-NLS-1$
- private WizardNewFileCreationPage fNewFilePage;
- private IStructuredSelection fSelection;
- List fValidExtensions = new ArrayList(Arrays.asList(new String[]{"html", "xhtml"})); //$NON-NLS-1$ //$NON-NLS-2$
-
- public void addPages() {
- fNewFilePage = new WizardNewFileCreationPage("HTMLWizardNewFileCreationPage", new StructuredSelection(IDE.computeSelectedResources(fSelection))) { //$NON-NLS-1$
- protected boolean validatePage() {
- IPath handlePath = new Path(getFileName());
- String extension = handlePath.getFileExtension();
- if (extension == null || !fValidExtensions.contains(extension)) {
- setErrorMessage(HTMLUIMessages._ERROR_FILENAME_MUST_END_HTML);
- return false;
- }
- setErrorMessage(null);
- return super.validatePage();
- }
- };
- fNewFilePage.setTitle(HTMLUIMessages._UI_WIZARD_NEW_HEADING);
- fNewFilePage.setDescription(HTMLUIMessages._UI_WIZARD_NEW_DESCRIPTION);
-
- addPage(fNewFilePage);
- }
-
- public void init(IWorkbench aWorkbench, IStructuredSelection aSelection) {
- fSelection = aSelection;
- setWindowTitle(HTMLUIMessages._UI_WIZARD_NEW_TITLE);
- if (PAGE_IMAGE != null) {
- ImageDescriptor descriptor = HTMLUIPlugin.getDefault().getImageRegistry().getDescriptor(PAGE_IMAGE);
- if (descriptor == null) {
- descriptor = ImageDescriptor.createFromURL(HTMLUIPlugin.getDefault().getBundle().getEntry(PAGE_IMAGE));
- HTMLUIPlugin.getDefault().getImageRegistry().put(PAGE_IMAGE, descriptor);
- }
- setDefaultPageImageDescriptor(descriptor);
- }
- }
-
- private void openEditor(final IFile file) {
- if (file != null) {
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
- }
- }
- });
- }
- }
-
- public boolean performFinish() {
- IFile file = fNewFilePage.createNewFile();
- openEditor(file);
- return true;
- }
-} \ No newline at end of file

Back to the top