Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.facelet.ui')
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.classpath7
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.project28
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.settings/org.eclipse.jdt.core.prefs79
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.settings/org.eclipse.pde.prefs24
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/META-INF/MANIFEST.MF40
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/about.html22
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/build.properties8
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/plugin.properties5
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/plugin.xml147
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/FaceletUiPlugin.java69
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/CompositeAttributeAssistProcessor.java123
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/MyModelQueryExtension.java84
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor.java277
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor2.java335
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletChangePage.java163
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletInstallPage.java18
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletUninstallPage.java28
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/hover/FaceletHover.java143
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/htmleditor/FaceletELHyperlinkDetector.java50
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/validation/HTMLValidator.java280
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/validation/ValidationReporter.java69
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/templates/templates.properties15
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.ui/templates/templates.xml7
23 files changed, 0 insertions, 2021 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.classpath b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.classpath
deleted file mode 100644
index 304e86186..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.project b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.project
deleted file mode 100644
index c7247f3b8..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.facelet.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.settings/org.eclipse.jdt.core.prefs b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 42536ddc8..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,79 +0,0 @@
-#Tue Oct 23 12:04:38 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=error
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.settings/org.eclipse.pde.prefs b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index cde25849d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,24 +0,0 @@
-#Fri May 30 12:03:18 PDT 2008
-compilers.f.unresolved-features=1
-compilers.f.unresolved-plugins=1
-compilers.incompatible-environment=1
-compilers.p.build=1
-compilers.p.deprecated=1
-compilers.p.discouraged-class=2
-compilers.p.internal=1
-compilers.p.missing-bundle-classpath-entries=1
-compilers.p.missing-packages=0
-compilers.p.no-required-att=0
-compilers.p.not-externalized-att=0
-compilers.p.unknown-attribute=1
-compilers.p.unknown-class=1
-compilers.p.unknown-element=1
-compilers.p.unknown-identifier=1
-compilers.p.unknown-resource=1
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.s.create-docs=false
-compilers.s.doc-folder=doc
-compilers.s.open-tags=1
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/META-INF/MANIFEST.MF b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 8c082cd5e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,40 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.jst.jsf.facelet.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.facelet.ui.internal.FaceletUiPlugin
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.wst.html.core;bundle-version="1.1.200",
- org.eclipse.wst.html.ui;bundle-version="1.0.300",
- org.eclipse.wst.xml.ui;bundle-version="1.0.400",
- org.eclipse.jface.text;bundle-version="3.4.0",
- org.eclipse.wst.sse.ui;bundle-version="1.1.0",
- org.eclipse.wst.sse.core;bundle-version="1.1.300",
- org.eclipse.wst.xml.core;bundle-version="1.1.300",
- org.eclipse.jst.jsf.common;bundle-version="1.0.1",
- org.eclipse.core.resources;bundle-version="3.4.0",
- org.eclipse.jst.jsf.core;bundle-version="1.0.1",
- org.eclipse.jst.jsf.common.runtime;bundle-version="1.0.0",
- org.eclipse.wst.validation;bundle-version="1.1.103",
- org.eclipse.emf.common;bundle-version="2.4.0",
- org.eclipse.wst.common.project.facet.ui,
- org.eclipse.wst.common.frameworks;bundle-version="1.1.102",
- org.eclipse.core.databinding;bundle-version="1.1.0",
- org.eclipse.jface.databinding;bundle-version="1.2.0",
- org.eclipse.wst.common.modulecore;bundle-version="1.1.103",
- org.eclipse.core.databinding.beans;bundle-version="1.0.100",
- org.eclipse.wst.common.frameworks.ui;bundle-version="1.1.101",
- org.eclipse.jst.jsf.ui;bundle-version="1.0.1",
- org.eclipse.jst.jsf.facelet.core;bundle-version="1.0.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jst.jsf.facelet.ui.internal;x-internal:=true,
- org.eclipse.jst.jsf.facelet.ui.internal.contentassist;x-internal:=true,
- org.eclipse.jst.jsf.facelet.ui.internal.facet;x-internal:=true,
- org.eclipse.jst.jsf.facelet.ui.internal.hover;x-internal:=true,
- org.eclipse.jst.jsf.facelet.ui.internal.htmleditor;x-internal:=true,
- org.eclipse.jst.jsf.facelet.ui.internal.validation;x-internal:=true
-Bundle-Vendor: %Bundle-Vendor.0
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/about.html b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/about.html
deleted file mode 100644
index 90bd74d4d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/build.properties b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/build.properties
deleted file mode 100644
index 28e0ea218..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- plugin.properties,\
- templates/,\
- about.html
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/plugin.properties b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/plugin.properties
deleted file mode 100644
index 21fb12e00..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/plugin.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-FaceletHTMLValidator_name=Facelet HTML Validator
-EL_Hyperlinkdetector_name=Facelet EL Hyperlink Detector
-FaceletValidatorMarker=Facelet Validator
-Bundle-Name.0 = UI Plug-in
-Bundle-Vendor.0 = Eclipse.org \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/plugin.xml b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/plugin.xml
deleted file mode 100644
index d2dab59b7..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/plugin.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML"
- target="org.eclipse.wst.html.core.htmlsource">
- </sourceViewerConfiguration>
- <provisionalConfiguration
- class="org.eclipse.jst.jsf.facelet.ui.internal.contentassist.XHTMLContentAssistProcessor"
- target="org.eclipse.wst.html.HTML_DEFAULT"
- type="contentassistprocessor">
- </provisionalConfiguration>
- <provisionalConfiguration
- type="contentassistprocessor"
- class="org.eclipse.jst.jsf.facelet.ui.internal.contentassist.CompositeAttributeAssistProcessor"
- target="org.eclipse.wst.html.HTML_DEFAULT" />
- <documentationTextHover
- class="org.eclipse.jst.jsf.facelet.ui.internal.hover.FaceletHover"
- target="org.eclipse.wst.html.HTML_DEFAULT">
- </documentationTextHover>
- </extension>
-
- <extension point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
- <hyperlinkDetector
- class="org.eclipse.jst.jsf.facelet.ui.internal.htmleditor.FaceletELHyperlinkDetector"
- id="org.eclipse.jst.jsf.ui.elhyperlinkdetector"
- name="%EL_Hyperlinkdetector_name"
- targetId="org.eclipse.wst.html.core.htmlsource">
- </hyperlinkDetector>
- </extension>
-
- <extension
- id="FaceletValidationMarker"
- name="%FaceletValidatorMarker"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.wst.validation.problemmarker">
- </super>
- </extension>
-
- <extension
- point="org.eclipse.wst.validation.validatorV2"
- id="FaceletHTMLValidator"
- name="%FaceletHTMLValidator_name">
- <validator
- build="true"
- class="org.eclipse.jst.jsf.facelet.ui.internal.validation.HTMLValidator"
- manual="true"
- markerId="org.eclipse.jst.jsf.facelet.ui.FaceletValidationMarker"
- version="1">
-
- <include>
- <rules>
- <projectNature
- id="org.eclipse.wst.common.modulecore.ModuleCoreNature">
- </projectNature>
- </rules>
- </include>
- <include>
- <rules>
- <projectNature
- id="org.eclipse.jdt.core.javanature">
- </projectNature>
- </rules>
- </include>
-
- <include>
- <rules>
- <facet
- id="jst.java">
- </facet>
- </rules>
- </include>
- <include>
- <rules>
- <facet
- id="jst.web">
- </facet>
- </rules>
- </include>
- <include>
- <rules>
- <facet
- id="jst.jsf" version="2.0">
- </facet>
- </rules>
- </include>
- <include>
- <rules>
- <contentType
- exactMatch="false"
- id="jsf.facelet">
- </contentType>
- <contentType
- exactMatch="false"
- id="jsf.facelet.composite">
- </contentType>
- </rules>
- </include>
- <group
- id="org.eclipse.wst.sse.core.structuredModelGroup">
- </group>
-
- </validator>
- </extension>
-
- <!--<extension
- point="org.eclipse.wst.validation.validator"
- id="FaceletTaglibValidator"
- name="%FaceletTaglibValidator">
- <validator>
- <projectNature id="org.eclipse.wst.common.modulecore.ModuleCoreNature" />
- <projectNature id="org.eclipse.jdt.core.javanature" />
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="faces-config.xml">
- </filter>
- <markerId
- markerIdValue="JSPSemanticsValidatorMarker">
- </markerId>
- <helper
- class="org.eclipse.wst.validation.internal.operations.WorkbenchContext">
- </helper>
- <run
- class="org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator"
- incremental="true"
- fullBuild="true"
- />
- </validator>
- </extension>-->
- <extension
- point="org.eclipse.ui.editors.templates">
- <include
- file="templates/templates.xml"
- translations="$nl$/templates/templates.properties">
- </include>
- </extension>
- <!--<extension
- point="org.eclipse.wst.xml.core.modelQueryExtensions">
- <modelQueryExtension
- class="org.eclipse.jst.jsf.facelet.ui.internal.contentassist.MyModelQueryExtension"
- contentType="org.eclipse.wst.html.core.htmlsource">
- </modelQueryExtension>
- </extension>-->
-</plugin>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/FaceletUiPlugin.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/FaceletUiPlugin.java
deleted file mode 100644
index 15ed6719a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/FaceletUiPlugin.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.eclipse.jst.jsf.facelet.ui.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory.TagRegistryFactoryException;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class FaceletUiPlugin extends AbstractUIPlugin
-{
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.jsf.facelet.ui";
-
- // The shared instance
- private static FaceletUiPlugin plugin;
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
- * )
- */
- @Override
- public void start(final BundleContext context) throws Exception
- {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
- * )
- */
- @Override
- public void stop(final BundleContext context) throws Exception
- {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static FaceletUiPlugin getDefault()
- {
- return plugin;
- }
-
- /**
- * @param e
- */
- public static void log(final TagRegistryFactoryException e)
- {
- getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "", e));
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/CompositeAttributeAssistProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/CompositeAttributeAssistProcessor.java
deleted file mode 100644
index 13312faec..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/CompositeAttributeAssistProcessor.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.eclipse.jst.jsf.facelet.ui.internal.contentassist;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.designtime.DTAppManagerUtil;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter.DTELExpression;
-import org.eclipse.jst.jsf.ui.internal.contentassist.JSFContentAssistProcessor;
-import org.eclipse.jst.jsf.ui.internal.contentassist.el.JSFELContentAssistProcessor;
-
-/**
- * Composes the EL and non-EL attribute value assist processor for JSF. This
- * is necessary mainly because, without the EL partitioning in HTML, both
- * processors would otherwise activate on every attribute.
- *
- * @author cbateman
- *
- */
-public class CompositeAttributeAssistProcessor implements
- IContentAssistProcessor
-{
- private JSFContentAssistProcessor _nonELProcessor;
- private JSFELContentAssistProcessor _elProcessor;
- private char[] _activationChars;
-
- /**
- * Default constructor
- */
- public CompositeAttributeAssistProcessor()
- {
- _nonELProcessor = new JSFContentAssistProcessor();
- _elProcessor = new JSFELContentAssistProcessor();
-
- char[] nonELChars =
- _nonELProcessor.getCompletionProposalAutoActivationCharacters();
- char[] elChars =
- _elProcessor.getCompletionProposalAutoActivationCharacters();
- _activationChars = new char[nonELChars.length+elChars.length];
- System.arraycopy(nonELChars, 0, _activationChars, 0, nonELChars.length);
- System.arraycopy(elChars, 0, _activationChars, nonELChars.length, elChars.length);
-
-
- }
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
- int offset)
- {
- if (isEL(viewer, offset))
- {
- return _elProcessor.computeCompletionProposals(viewer, offset);
- }
- return _nonELProcessor.computeCompletionProposals(viewer, offset);
- }
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer,
- int offset)
- {
- if (isEL(viewer, offset))
- {
- return _elProcessor.computeContextInformation(viewer, offset);
- }
- return _nonELProcessor.computeContextInformation(viewer, offset);
- }
-
- public char[] getCompletionProposalAutoActivationCharacters()
- {
- return _activationChars;
- }
-
- public char[] getContextInformationAutoActivationCharacters()
- {
- // disable this functionality
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator()
- {
- // disable this functionality
- return null;
- }
-
- public String getErrorMessage()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- private boolean isEL(final ITextViewer viewer, int offset)
- {
- IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE.getContext(viewer, offset);
-
- if (context != null)
- {
- XMLViewDefnAdapter adapter =
- DTAppManagerUtil.getXMLViewDefnAdapter(context);
- if (adapter != null)
- {
- try
- {
- DTELExpression elExpression = adapter.getELExpression(context);
-
- // only return true if we definitively find EL
- if(elExpression != null)
- {
- return true;
- }
- }
- catch (ViewHandlerException e)
- {
- // fall through to false, no el
- }
- }
- }
- // all other cases, return false
- return false;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/MyModelQueryExtension.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/MyModelQueryExtension.java
deleted file mode 100644
index f2b80aad6..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/MyModelQueryExtension.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.eclipse.jst.jsf.facelet.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory2;
-import org.eclipse.jst.jsf.facelet.core.internal.cm.FaceletDocumentFactory;
-import org.eclipse.jst.jsf.facelet.core.internal.util.ViewUtil;
-import org.eclipse.jst.jsf.facelet.core.internal.util.ViewUtil.PrefixEntry;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
-import org.w3c.dom.Element;
-
-/**
- * A model query extension used to help support content assist in html files.
- *
- * @author cbateman
- *
- */
-public class MyModelQueryExtension extends ModelQueryExtension
-{
-
- @Override
- public String[] getAttributeValues(Element ownerElement, String namespace,
- String name)
- {
- // TODO Auto-generated method stub
- return super.getAttributeValues(ownerElement, namespace, name);
- }
-
- @Override
- public CMNode[] getAvailableElementContent(Element parentElement,
- String namespace, int includeOptions)
- {
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory2.INSTANCE
- .getContext(parentElement);
- if (context != null)
- {
- final IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(context);
-
- if (resolver != null)
- {
- final IProject project = resolver.getProject();
- final FaceletDocumentFactory factory =
- new FaceletDocumentFactory(project);
- final Map<String, PrefixEntry> map =
- ViewUtil.getDocumentNamespaces(parentElement.getOwnerDocument());
- String prefix = null;
- for (final Map.Entry<String, PrefixEntry> entry : map.entrySet())
- {
- if (entry.getValue().getUri().equals(namespace))
- {
- prefix = entry.getValue().getPrefix();
- break;
- }
- }
-
- if (prefix != null)
- {
- CMDocument document =
- factory.createCMDocumentForContext(namespace, prefix);
- if (document != null)
- {
- List<CMNode> nodes = new ArrayList<CMNode>();
- for (final Iterator<?> it = document.getElements().iterator(); it.hasNext();)
- {
- nodes.add((CMNode)it.next());
- }
- return nodes.toArray(new CMNode[0]);
- }
- }
- }
- }
- return new CMNode[0];
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor.java
deleted file mode 100644
index 0b2afd49f..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor.java
+++ /dev/null
@@ -1,277 +0,0 @@
-package org.eclipse.jst.jsf.facelet.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.eclipse.jst.jsf.facelet.core.internal.cm.FaceletDocumentFactory;
-import org.eclipse.jst.jsf.facelet.core.internal.util.ViewUtil;
-import org.eclipse.jst.jsf.facelet.core.internal.util.ViewUtil.PrefixEntry;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-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.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-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.XMLRelevanceConstants;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * The main entry point for Facelet content assist in html files.
- * @author cbateman
- *
- */
-public class XHTMLContentAssistProcessor extends AbstractContentAssistProcessor
-{
- private IFile _file;
- private FaceletDocumentFactory _factory;
-
- private final static ICompletionProposal[] NO_PROPOSALS = new ICompletionProposal[0];
-
- @Override
- public ICompletionProposal[] computeCompletionProposals(
- final ITextViewer textViewer, final int documentPosition)
- {
- ICompletionProposal[] proposals = null;
- _file = getFile(textViewer, documentPosition);
-
- if (_file != null && shouldContribute(_file))
- {
- _factory = new FaceletDocumentFactory(_file.getProject());
- proposals = super.computeCompletionProposals(textViewer,
- documentPosition);
- }
- return proposals != null ? proposals : NO_PROPOSALS;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected List getAvailableChildElementDeclarations(final Element parent,
- final int childPosition, final int kindOfAction)
- {
- final Map<String, PrefixEntry> namespaces = getDocumentNamespaces(
- _factory, childPosition);
- final List availableChildElements = new ArrayList();
-
- for (final Map.Entry<String, PrefixEntry> entry : namespaces.entrySet())
- {
- final String prefix = entry.getValue().getPrefix();
- final CMDocument cmDocument = _factory.createCMDocumentForContext(
- entry.getValue().getUri(), prefix);
-
- if (cmDocument != null)
- {
- final Iterator it = cmDocument.getElements().iterator();
- while (it.hasNext())
- {
- availableChildElements.add(it.next());
- }
- }
- }
-
- return availableChildElements;
- }
-
- @Override
- protected void addAttributeValueProposals(
- final ContentAssistRequest contentAssistRequest)
- {
- final ITextRegion textRegion = findNameRegionIfIsHTMLRoot(contentAssistRequest);
-
- if (textRegion != null)
- {
- final IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
- final NamedNodeMap attributes = node.getAttributes();
- final String attrName = node.getFirstStructuredDocumentRegion()
- .getText(textRegion);
- if (attrName != null)
- {
- final int colonPos = attrName.indexOf(':');
- // must have a colon && it must not be the last char, otherwise
- // there is no localName
- if (colonPos > -1 && colonPos < attrName.length() - 1)
- {
- final String prefix = attrName.substring(0, colonPos);
-
- if ("xmlns".equals(prefix))
- {
- final ITagRegistry tagRegistry = ViewUtil.getHtmlTagRegistry(_file.getProject());
- if (tagRegistry != null)
- {
- final Set<Attr> alreadyUsed = ViewUtil.getDeclaredNamespaces(attributes);
- final Collection<? extends Namespace> namespaces = tagRegistry
- .getAllTagLibraries();
- NAMESPACE_LOOP: for (final Namespace ns : namespaces)
- {
- final String possibleValue = ns.getNSUri();
-
- if (ViewUtil.hasAttributeValue(alreadyUsed, possibleValue))
- {
- continue NAMESPACE_LOOP;
- }
- // we have an attribute of the form xmlns:X in
- // the
- // html root node. Here we can provide value
- // proposals
- // for all of the known namespaces.
- final String rString = "\"" + possibleValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
- final int rOffset = contentAssistRequest
- .getReplacementBeginPosition();
- final int rLength = contentAssistRequest
- .getReplacementLength();
- final int cursorAfter = possibleValue.length() + 1;
- final String displayString = "\"" + possibleValue + "\""; //$NON-NLS-2$//$NON-NLS-1$
-
- final CustomCompletionProposal proposal = new CustomCompletionProposal(
- rString,
- rOffset,
- rLength,
- cursorAfter,
- null,
- displayString,
- null,
- null,
- XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE);
- contentAssistRequest.addProposal(proposal);
- }
- }
- // now bail, since super only adds annoying identity completions
- // for this case
- return;
- }
- }
- }
- }
- super.addAttributeValueProposals(contentAssistRequest);
- }
-
- private ITextRegion findNameRegionIfIsHTMLRoot(
- final ContentAssistRequest contentAssistRequest)
- {
- final IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
- if (node.getNodeType() == Node.ELEMENT_NODE
- && "html".equals(node.getNodeName())
- && node.getOwnerDocument().getDocumentElement() == node)
- {
- // Find the attribute region and name for which this position should
- // have a value proposed
- final IStructuredDocumentRegion open = node
- .getFirstStructuredDocumentRegion();
- final ITextRegionList openRegions = open.getRegions();
- int i = openRegions.indexOf(contentAssistRequest.getRegion());
- if (i < 0)
- {
- return null;
- }
- ITextRegion nameRegion = null;
- while (i >= 0)
- {
- nameRegion = openRegions.get(i--);
- if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)
- {
- break;
- }
- }
- return nameRegion;
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- private Map<String, PrefixEntry> getDocumentNamespaces(
- final FaceletDocumentFactory factory, final int offset)
- {
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(fTextViewer, offset);
-
- Document doc = null;
- if (context != null)
- {
- final IDOMContextResolver domContextResolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(context);
-
- doc = domContextResolver.getDOMDocument();
-
- if (doc == null)
- {
- return Collections.EMPTY_MAP;
- }
- }
- return ViewUtil.getDocumentNamespaces(doc);
- }
-
- @Override
- protected CMElementDeclaration getCMElementDeclaration(final Node node)
- {
- if (node.getNodeType() == Node.ELEMENT_NODE)
- {
- if (node.getPrefix() != null)
- {
- final Element element = (Element) node;
-
- final CMElementDeclaration elementDecl = _factory
- .createCMElementDeclaration(element);
-
- if (elementDecl != null)
- {
- return elementDecl;
- }
- }
- }
-
- return null;
- // return super.getCMElementDeclaration(node);
- }
-
- private boolean shouldContribute(final IFile file)
- {
- return ViewUtil.isFaceletVDLFile(file);
- }
-
- private IFile getFile(final ITextViewer textViewer,
- final int documentPosition)
- {
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(textViewer, documentPosition);
-
- if (context != null)
- {
- final IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(context);
-
- if (resolver != null)
- {
- final IResource resource = resolver.getResource();
- if (resource != null &&
- resource.getType() == IResource.FILE)
- {
- return (IFile) resource;
- }
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor2.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor2.java
deleted file mode 100644
index 47ac5910e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/contentassist/XHTMLContentAssistProcessor2.java
+++ /dev/null
@@ -1,335 +0,0 @@
-package org.eclipse.jst.jsf.facelet.ui.internal.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ITextRegionContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.eclipse.jst.jsf.designtime.internal.view.model.TagRegistryFactory.TagRegistryFactoryException;
-import org.eclipse.jst.jsf.facelet.core.internal.registry.FaceletRegistryManager.MyRegistryFactory;
-import org.eclipse.jst.jsf.facelet.ui.internal.FaceletUiPlugin;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * Temporary.
- *
- * @author cbateman
- *
- */
-public class XHTMLContentAssistProcessor2 implements IContentAssistProcessor
-{
- private final static ICompletionProposal[] NO_PROPOSALS = new ICompletionProposal[0];
-
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
- int offset)
- {
- List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(viewer, offset);
-
- if (context != null)
- {
- final IDOMContextResolver domContextResolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(context);
-
- final Document doc = domContextResolver.getDOMDocument();
-
- if (doc == null)
- {
- return NO_PROPOSALS;
- }
-
- // get the namespaces that are already declared
- final Map<String, PrefixEntry> documentNamespaces = getDocumentNamespaces(doc);
-
- final ITextRegionContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getTextRegionResolver(context);
-
- if (resolver != null)
- {
- final String regionType = resolver.getRegionType();
-
- if (DOMRegionContext.XML_CONTENT.equals(regionType))
- {
- // TODO: this may be in the open it may occur on the inside
- // of a
- // "<" that doesn't have any further tag name yet
- proposals = getTagCompletionsForDocument(context,
- documentNamespaces, TagPrefix.NO_PREFIX);
- }
- else if (DOMRegionContext.XML_TAG_NAME.equals(regionType))
- {
- final TagPrefix tagPrefix = new TagPrefix(resolver
- .getRegionText());
- proposals = getTagCompletionsForDocument(context,
- documentNamespaces, tagPrefix);
- }
- else
- {
- System.out.println(regionType);
- }
- }
- }
-
- return proposals.toArray(NO_PROPOSALS);
- }
-
- private List<ICompletionProposal> getTagCompletionsForDocument(
- final IStructuredDocumentContext context,
- final Map<String, PrefixEntry> namespaces, final TagPrefix tagPrefix)
- {
- final List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
-
- final IWorkspaceContextResolver wkspaceResolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(context);
- final IProject project = wkspaceResolver.getProject();
-
- MyRegistryFactory factory = new MyRegistryFactory();
- ITagRegistry registry;
- try
- {
- registry = factory.createTagRegistry(project);
- if (registry == null)
- {
- return proposals;
- }
-
- final Collection<? extends Namespace> tagLibs = registry
- .getAllTagLibraries();
-
- for (final Namespace tagLib : tagLibs)
- {
- final PrefixEntry ns = namespaces.get(tagLib.getNSUri());
-
- // if the tag library is not initialized, don't trigger
- // a potentially expensive operation during the content assist
- if (ns != null && tagLib.isInitialized())
- {
- // only add if this namespace's prefix starts with
- // the prefix that the user provided
- if (ns._prefix.startsWith(tagPrefix.getPrefix()))
- {
- final Collection<?> tags = tagLib.getViewElements();
-
- for (final Iterator<?> it = tags.iterator(); it
- .hasNext();)
- {
- final ITagElement tagElement = (ITagElement) it
- .next();
-
- // only add an element it starts with the prefix
- // provided
- if (tagElement.getName().startsWith(
- tagPrefix.getLocalName()))
- {
- final String userPrefix = tagPrefix
- .getUserPrefix();
-
- final String tagName = ns._prefix + ":"
- + tagElement.getName();
- String replacementText = "";
- if ("".equals(userPrefix))
- {
- replacementText = "<" + tagName + "></"
- + tagName + ">";
- }
- else
- {
- replacementText = tagName
- .substring(userPrefix.length());
- }
- proposals.add(new CompletionProposal(
- replacementText, context
- .getDocumentPosition(), 0, 0,
- null, tagName, null, null));
- }
- }
- }
- }
- }
- }
- catch (TagRegistryFactoryException e)
- {
- FaceletUiPlugin.log(e);
- }
-
- return proposals;
- }
-
- private Map<String, PrefixEntry> getDocumentNamespaces(Document doc)
- {
- final Map<String, PrefixEntry> namespaces = new HashMap<String, PrefixEntry>();
-
- Element rootElement = doc.getDocumentElement();
-
- if (rootElement != null)
- {
- NamedNodeMap attrs = rootElement.getAttributes();
- for (int i = 0; i < attrs.getLength(); i++)
- {
- Attr a = (Attr) attrs.item(i);
- PrefixEntry ns = PrefixEntry.parseNamespace(a);
- if (ns != null)
- {
- namespaces.put(ns.getUri(), ns);
- }
- }
- }
-
- return namespaces;
- }
-
- private static class TagPrefix
- {
- public final static TagPrefix NO_PREFIX = new TagPrefix("");
-
- private final String _prefix;
- private final String _localName;
- private final boolean _hasColon;
-
- public TagPrefix(final String tagName)
- {
- int prefixIdx = tagName.indexOf(':');
-
- if (prefixIdx != -1)
- {
- _prefix = tagName.substring(0, prefixIdx);
- _hasColon = true;
- if (tagName.length() > prefixIdx)
- {
- _localName = tagName.substring(prefixIdx + 1);
- }
- else
- {
- _localName = "";
- }
- }
- else
- {
- _hasColon = false;
- _prefix = tagName;
- _localName = "";
- }
- }
-
- public String getUserPrefix()
- {
- String userPrefix = _prefix;
-
- if (_hasColon)
- {
- userPrefix += ":";
- userPrefix += _localName;
- }
-
- return userPrefix;
- }
-
- public String getPrefix()
- {
- return _prefix;
- }
-
- public String getLocalName()
- {
- return _localName;
- }
- }
-
- private static class PrefixEntry
- {
- private final String _uri;
- private final String _prefix;
-
- public static PrefixEntry parseNamespace(Attr attr)
- {
- final String prefix = attr.getPrefix();
-
- if ("xmlns".equals(prefix))
- {
- final String prefixName = attr.getLocalName();
- if (prefixName != null)
- {
- final String uri = attr.getNodeValue();
-
- if (uri != null)
- {
- return new PrefixEntry(uri, prefixName);
- }
- }
- }
-
- return null;
- }
-
- public PrefixEntry(final String uri, final String prefix)
- {
- _uri = uri;
- _prefix = prefix;
- }
-
- public final String getUri()
- {
- return _uri;
- }
-
- public int hashCode()
- {
- return _uri.hashCode();
- }
-
- public boolean equals(Object obj)
- {
- return _uri.equals(obj);
- }
- }
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer,
- int offset)
- {
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters()
- {
- return null;
- }
-
- public char[] getContextInformationAutoActivationCharacters()
- {
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator()
- {
- return null;
- }
-
- public String getErrorMessage()
- {
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletChangePage.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletChangePage.java
deleted file mode 100644
index 24996aad4..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletChangePage.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facelet.ui.internal.facet;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeansObservables;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jst.jsf.facelet.core.internal.facet.ChangeActionType;
-import org.eclipse.jst.jsf.facelet.core.internal.facet.FacetChangeModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.RowData;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
-
-/**
- * A common facet change UI page, mainly used for facet install/uninstall.
- *
- * @author cbateman
- *
- */
-public abstract class FaceletChangePage extends AbstractFacetWizardPage
-{
- private Button _chgDefaultSuffix;
- private Button _chgViewHandler;
- private Button _chgConfigureListener;
- private Button _chgWebappLifecycleListener;
-
- private DataBindingContext _bindingContext;
- private FacetChangeModel _dataModel;
-
- /**
- * @param name
- */
- public FaceletChangePage(String name)
- {
- super(name);
- }
-
- public void setConfig(final Object config)
- {
- _dataModel = (FacetChangeModel) config;
- }
-
- /**
- * @return the name of the change based on the actionType enumeration.
- */
- protected String getTextForChangeType()
- {
- final ChangeActionType actionType = _dataModel.getChangeActionType();
-
- switch (actionType)
- {
- case ADD:
- return "Add";
-
- case REMOVE:
- return "Remove";
- }
-
- return "*ERROR*";
- }
-
- private void initDefaultSuffixButton(final Composite parent)
- {
- _chgDefaultSuffix = new Button(parent, SWT.CHECK);
- _chgDefaultSuffix.setText(getTextForChangeType() + " '.xhtml' DEFAULT_SUFFIX parameter");
- _chgDefaultSuffix.setSelection(_dataModel.isChgDefaultSuffix());
- _chgDefaultSuffix.setLayoutData(new RowData());
- IObservableValue modelObservable = BeansObservables.observeValue(
- _dataModel, "chgDefaultSuffix");
-
- _bindingContext.bindValue(SWTObservables
- .observeSelection(_chgDefaultSuffix), modelObservable, null,
- null);
- }
-
- private void initViewHandlerButton(final Composite parent)
- {
- _chgViewHandler = new Button(parent, SWT.CHECK);
- _chgViewHandler.setText(getTextForChangeType() + " Facelet view handler");
- _chgViewHandler.setSelection(_dataModel.isChgViewHandler());
- _chgViewHandler.setLayoutData(new RowData());
- IObservableValue modelObservable = BeansObservables.observeValue(
- _dataModel, "chgViewHandler");
-
- _bindingContext
- .bindValue(SWTObservables.observeSelection(_chgViewHandler),
- modelObservable, null, null);
- }
-
- private void initConfigureListener(final Composite parent)
- {
- _chgConfigureListener = new Button(parent, SWT.CHECK);
- _chgConfigureListener
- .setText(getTextForChangeType() + " configure listener (needed by some Tomcat containers)");
- _chgConfigureListener.setSelection(_dataModel.isChgConfigureListener());
- _chgConfigureListener.setLayoutData(new RowData());
- IObservableValue modelObservable = BeansObservables.observeValue(
- _dataModel, "chgConfigureListener");
-
- _bindingContext.bindValue(SWTObservables
- .observeSelection(_chgConfigureListener), modelObservable,
- null, null);
- }
-
- private void initWebappLifecycleListener(final Composite parent)
- {
- _chgWebappLifecycleListener = new Button(parent, SWT.CHECK);
- _chgWebappLifecycleListener
- .setText(getTextForChangeType() + " web application lifecycle listener (needed by some Tomcat containers)");
- _chgWebappLifecycleListener.setSelection(_dataModel
- .isChgConfigureListener());
- _chgWebappLifecycleListener.setLayoutData(new RowData());
- IObservableValue modelObservable = BeansObservables.observeValue(
- _dataModel, "chgWebAppLifecycleListener");
-
- _bindingContext.bindValue(SWTObservables
- .observeSelection(_chgWebappLifecycleListener),
- modelObservable, null, null);
- }
-
- public void createControl(final Composite parent)
- {
- setTitle("Facelet");
- setMessage("Configure Facelet settings");
-
- _bindingContext = new DataBindingContext();
-
- // WizardPageSupport.create(this, _bindingContext);
-
- final Composite control = new Composite(parent, SWT.NONE);
- final RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
- rowLayout.fill = true;
- control.setLayout(rowLayout);
-
- final Group webXMLGroup = new Group(control, SWT.NONE);
- webXMLGroup.setLayout(rowLayout);
- webXMLGroup.setText("Deployment Descriptor (web.xml) Configuration");
- initDefaultSuffixButton(webXMLGroup);
- initConfigureListener(webXMLGroup);
- initWebappLifecycleListener(webXMLGroup);
-
- final Group facesConfigGroup = new Group(control, SWT.NONE);
- facesConfigGroup.setLayout(rowLayout);
- facesConfigGroup
- .setText("Application (faces-config.xml) Configuration");
- initViewHandlerButton(facesConfigGroup);
-
- setControl(control);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletInstallPage.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletInstallPage.java
deleted file mode 100644
index 2ef2c5c9a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletInstallPage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.eclipse.jst.jsf.facelet.ui.internal.facet;
-
-
-/**
- * The UI page for installing the Facelet facet.
- * @author cbateman
- *
- */
-public class FaceletInstallPage extends FaceletChangePage
-{
- /**
- *
- */
- public FaceletInstallPage()
- {
- super("Facelet Install Page");
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletUninstallPage.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletUninstallPage.java
deleted file mode 100644
index f0e0c2fce..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/facet/FaceletUninstallPage.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle Corporation.
- * 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:
- * Cameron Bateman - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facelet.ui.internal.facet;
-
-/**
- * The uninstall page for the Facelet facet.
- *
- * @author cbateman
- *
- */
-public class FaceletUninstallPage extends FaceletChangePage
-{
- /**
- *
- */
- public FaceletUninstallPage()
- {
- super("Facelet Uninstall Page");
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/hover/FaceletHover.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/hover/FaceletHover.java
deleted file mode 100644
index 9fe582118..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/hover/FaceletHover.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package org.eclipse.jst.jsf.facelet.ui.internal.hover;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ITextRegionContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.facelet.core.internal.cm.FaceletDocumentFactory;
-import org.eclipse.jst.jsf.ui.internal.jspeditor.JSFELHover;
-import org.eclipse.wst.html.ui.internal.taginfo.HTMLTagInfoHoverProcessor;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * The text hover for Facelets in html documents.
- *
- * @author cbateman
- *
- */
-public class FaceletHover implements ITextHover
-{
- private IProject _project;
- private JSFELHover _elHover;
- private HTMLTagInfoHoverProcessor _htmlHoverProcessor;
-
- /**
- *
- */
- public FaceletHover()
- {
- _elHover = new JSFELHover();
- _htmlHoverProcessor = new MyHTMLTagInfoHoverProcessor();
- }
-
- public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion)
- {
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(textViewer, hoverRegion.getOffset());
- String info = null;
- if (isInAttributeValue(context))
- {
- info = _elHover.getHoverInfo(textViewer, hoverRegion);
- }
-
- if (info == null)
- {
- if (context != null)
- {
- _project = getProject(context);
- }
-
- info = _htmlHoverProcessor.getHoverInfo(textViewer, hoverRegion);
- }
-
- return info;
- }
-
- public IRegion getHoverRegion(ITextViewer textViewer, int offset)
- {
- IRegion region = null;
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(textViewer, offset);
-
- // if we are in an attribute value, try to get a region from the
- // el hover first
- if (context != null)
- {
- if (isInAttributeValue(context))
- {
- region = _elHover.getHoverRegion(textViewer, offset);
- }
- }
-
- if (region == null)
- {
- if (context != null)
- {
- _project = getProject(context);
- }
- region = _htmlHoverProcessor.getHoverRegion(textViewer, offset);
- }
-
- return region;
- }
-
- private boolean isInAttributeValue(final IStructuredDocumentContext context)
- {
- final ITextRegionContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getTextRegionResolver(context);
- final String regionType = resolver.getRegionType();
- if (regionType != null
- && (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE || resolver
- .matchesRelative(new String[]
- { DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE })))
- {
- return true;
- }
-
- return false;
- }
-
- private IProject getProject(final IStructuredDocumentContext context)
- {
- final IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getWorkspaceContextResolver(context);
-
- if (resolver != null)
- {
- return resolver.getProject();
- }
- return null;
- }
-
- private class MyHTMLTagInfoHoverProcessor extends HTMLTagInfoHoverProcessor
- {
- @Override
- protected CMElementDeclaration getCMElementDeclaration(Node node)
- {
- if (_project != null && node.getNodeType() == Node.ELEMENT_NODE
- && node.getPrefix() != null)
- {
- final Element element = (Element) node;
- final FaceletDocumentFactory factory = new FaceletDocumentFactory(_project);
-
- final CMElementDeclaration elementDecl = factory
- .createCMElementDeclaration(element);
-
- if (elementDecl != null)
- {
- return elementDecl;
- }
- }
-
- return super.getCMElementDeclaration(node);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/htmleditor/FaceletELHyperlinkDetector.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/htmleditor/FaceletELHyperlinkDetector.java
deleted file mode 100644
index 703eeeed7..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/htmleditor/FaceletELHyperlinkDetector.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.facelet.ui.internal.htmleditor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.ui.internal.jspeditor.AbstractELHyperlinkDetector;
-
-/**
- * This HyperlinkDetector creates hyperlinks for symbols in JSF EL expressions
- * inside facelet files.
- */
-public class FaceletELHyperlinkDetector extends AbstractELHyperlinkDetector {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jst.jsf.ui.internal.jspeditor.AbstractELHyperlinkDetector#isEnabled(org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext)
- */
- @Override
- protected boolean isEnabled(IStructuredDocumentContext context) {
- boolean enabled = false;
- if (context != null) {
- IWorkspaceContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context);
- if (resolver != null) {
- IResource resource = resolver.getResource();
- if (resource instanceof IFile) {
- IFile file = (IFile)resource;
- String filename = file.getFullPath().toString();
- enabled =
- hasContentType(filename, "jsf.facelet") || //$NON-NLS-1$
- hasContentType(filename, "jsf.facelet.composite"); //$NON-NLS-1$
- }
- }
- }
- return enabled;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/validation/HTMLValidator.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/validation/HTMLValidator.java
deleted file mode 100644
index b3df14855..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/validation/HTMLValidator.java
+++ /dev/null
@@ -1,280 +0,0 @@
-package org.eclipse.jst.jsf.facelet.ui.internal.validation;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.eclipse.jst.jsf.facelet.core.internal.util.ViewUtil;
-import org.eclipse.jst.jsf.facelet.ui.internal.FaceletUiPlugin;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator;
-import org.eclipse.jst.jsf.validation.internal.JSFValidatorFactory;
-import org.eclipse.jst.jsf.validation.internal.ValidationPreferences;
-import org.eclipse.jst.jsf.validation.internal.facelet.FaceletDiagnosticFactory;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.LocalizedMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * The Facelet HTML file validator.
- *
- * @author cbateman
- *
- */
-public class HTMLValidator extends AbstractValidator implements IValidator
-{
- private FaceletDiagnosticFactory _diagnosticFactory = new FaceletDiagnosticFactory();
- /**
- * @param helper
- * @return no rule, null
- */
- public ISchedulingRule getSchedulingRule(final IValidationContext helper)
- {
- // no rule...
- return null;
- }
-
- /**
- * @param helper
- * @param reporter
- * @return status of this validation
- * @throws ValidationException
- */
- public IStatus validateInJob(final IValidationContext helper,
- final IReporter reporter) throws ValidationException
- {
- IStatus status = Status.OK_STATUS;
- try
- {
- validate(helper, reporter);
- }
- catch (final ValidationException e)
- {
- status = new Status(IStatus.ERROR, FaceletUiPlugin.PLUGIN_ID,
- IStatus.ERROR, e.getLocalizedMessage(), e);
- }
- return status;
-
- }
-
- public void cleanup(final IReporter reporter)
- {
- // do nothing
- }
-
- @Override
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor){
- ValidationResult vr = new ValidationResult();
- if (resource == null || !(resource instanceof IFile)) {
- return vr;
- }
- IFile currentFile = (IFile) resource;
- if (shouldValidate(currentFile)) {
- validateFile(currentFile, vr.getReporter(monitor));
- }
- return vr;
- }
-
- public void validate(final IValidationContext helper,
- final IReporter reporter) throws ValidationException
- {
- final String[] uris = helper.getURIs();
- final IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
- if (uris.length > 0)
- {
- IFile currentFile = null;
-
- for (int i = 0; i < uris.length && !reporter.isCancelled(); i++)
- {
- currentFile = wsRoot.getFile(new Path(uris[i]));
- if (currentFile != null && currentFile.exists())
- {
- if (shouldValidate(currentFile))
- {
- final int percent = (i * 100) / uris.length + 1;
- final IMessage message = new LocalizedMessage(
- IMessage.LOW_SEVERITY, percent + "% " + uris[i]);
- reporter.displaySubtask(this, message);
-
- validateFile(currentFile, reporter);
- }
- }
- }
- }
-
- }
-
- private void validateFile(final IFile file, final IReporter reporter)
- {
- final IJSFViewValidator validator = JSFValidatorFactory
- .createDefaultXMLValidator();
- final ValidationPreferences prefs = new ValidationPreferences(
- JSFCorePlugin.getDefault().getPreferenceStore());
- prefs.load();
-
- IStructuredModel model = null;
- try
- {
- model = StructuredModelManager.getModelManager().getModelForRead(
- file);
-
- final ValidationReporter jsfReporter = new ValidationReporter(this,
- reporter, file, prefs, model);
- validator.validateView(file, jsfReporter);
- // TODO: break off into composite strategies
- validateFaceletHtml(file, jsfReporter);
- }
- catch (final CoreException e)
- {
- JSFCorePlugin.log("Error validating JSF", e);
- }
- catch (final IOException e)
- {
- JSFCorePlugin.log("Error validating JSF", e);
- }
- finally
- {
- if (null != model)
- {
- model.releaseFromRead();
- }
- }
- }
-
- private void validateFaceletHtml(final IFile file,
- final ValidationReporter reporter)
- {
- IStructuredModel model = null;
- try
- {
- model = StructuredModelManager.getModelManager().getModelForRead(
- file);
-
- final IStructuredDocument structuredDoc = model
- .getStructuredDocument();
-
- validateDocument(structuredDoc, reporter, file.getProject());
- }
- catch (final CoreException e)
- {
- JSFCorePlugin.log("Error validating JSF", e);
- }
- catch (final IOException e)
- {
- JSFCorePlugin.log("Error validating JSF", e);
- }
- finally
- {
- if (null != model)
- {
- model.releaseFromRead();
- }
- }
- }
-
- private void validateDocument(IStructuredDocument structuredDoc,
- final ValidationReporter reporter, IProject project)
- {
- validateRoot(structuredDoc, reporter, project);
- }
-
- private void validateRoot(IStructuredDocument structuredDoc,
- ValidationReporter reporter, IProject project)
- {
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(structuredDoc, -1);
- final IDOMContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(context);
- final Document document = resolver.getDOMDocument();
- Element rootElement = document.getDocumentElement();
-
- if ("html".equals(rootElement.getNodeName()))
- {
- final Set<Attr> declaredNamespaces = ViewUtil
- .getDeclaredNamespaces(rootElement.getAttributes());
- final ITagRegistry tagRegistry = ViewUtil
- .getHtmlTagRegistry(project);
- final Collection<? extends Namespace> namespaces;
- if (tagRegistry != null)
- {
- namespaces = tagRegistry.getAllTagLibraries();
- }
- else
- {
- // unexpected
- namespaces = Collections.EMPTY_SET;
- JSFCorePlugin.log(IStatus.ERROR, "Program Error: HTML tag registry not found"); //$NON-NLS-1$
- }
-
- for (final Attr attr : declaredNamespaces)
- {
- // only validate prefix declarations
- if (attr.getPrefix() != null && attr instanceof IDOMAttr)
- {
- final String declaredUri = attr.getValue();
- String findUri = null;
- SEARCH_NAMESPACES: for (final Namespace ns : namespaces)
- {
- if (ns.getNSUri().equals(declaredUri))
- {
- findUri = ns.getNSUri();
- break SEARCH_NAMESPACES;
- }
- }
-
- if (findUri == null)
- {
- final Diagnostic diag = _diagnosticFactory.create_CANNOT_FIND_FACELET_TAGLIB(declaredUri);
- final IDOMAttr domAttr = (IDOMAttr) attr;
- reporter.report(diag, domAttr.getValueRegionStartOffset(), domAttr
- .getValue().length());
- }
- }
- }
- }
- }
-
- private boolean shouldValidate(final IFile model)
- {
- final IContentTypeManager manager = Platform.getContentTypeManager();
- final IContentType contentType = manager
- .getContentType("org.eclipse.wst.html.core.htmlsource");
- return (contentType.isAssociatedWith(model.getName()))
- && ViewUtil.isFaceletVDLFile(model);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/validation/ValidationReporter.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/validation/ValidationReporter.java
deleted file mode 100644
index 2e87e8233..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/src/org/eclipse/jst/jsf/facelet/ui/internal/validation/ValidationReporter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.eclipse.jst.jsf.facelet.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.ui.internal.validation.ValidationMessageFactory;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator;
-import org.eclipse.jst.jsf.validation.internal.ValidationPreferences;
-import org.eclipse.jst.jsf.validation.internal.strategy.DiagnosticFactory;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-/*package*/class ValidationReporter implements
- IJSFViewValidator.IValidationReporter
-{
- private final IValidator _validator;
- private final IReporter _reporter;
- private final IFile _file;
- private final ValidationMessageFactory _factory;
-
- public ValidationReporter(final IValidator validator,
- final IReporter reporter, final IFile file,
- final ValidationPreferences prefs, final IStructuredModel model)
- {
- _validator = validator;
- _reporter = reporter;
- _file = file;
- _factory = new ValidationMessageFactory(prefs, model);
- }
-
- public void report(final Diagnostic problem, final int start,
- final int length)
- {
- if (shouldReportProblem(problem.getCode()))
- {
- final IMessage message = _factory.createFromDiagnostic(problem,
- start, length, _file);
- if ((message.getSeverity() & IMessage.ALL_MESSAGES) != 0)
- {
- _reporter.addMessage(_validator, message);
- }
- }
- }
-
- /**
- * @param problemCode
- * @return filters out problems to be reported by code
- */
- private boolean shouldReportProblem(final int problemCode)
- {
- switch (problemCode)
- {
- case DiagnosticFactory.CONTAINMENT_ERROR_MISSING_VIEW:
- return false;
- default:
- return true;
- }
- }
-
- public void report(IMessage message)
- {
- // not capable of filtering problems by code... should not be used
- if ((message.getSeverity() & IMessage.ALL_MESSAGES) != 0)
- {
- _reporter.addMessage(_validator, message);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/templates/templates.properties b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/templates/templates.properties
deleted file mode 100644
index 1b2b72bda..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/templates/templates.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-New_Facelet_Footer=New Facelet Footer
-New_Footer_Description=Creates a footer for use with the Facelet template.
-
-New_Facelet_Header=New Facelet Header
-New_Facelet_Header_Description=Creates a header for use with the Facelet template
-
-New_Facelet_Template=New Facelet Template
-New_Facelet_Template_Description=Creates a basic header/content/footer Facelet template
-
-New_Simple_Facelet_Composition_Page=New Facelet Composition Page
-New_Simple_Facelet_Composition_Page_Description=Creates a new Facelet page for use with a template.
-New_Facelet_Header.header=<?xml version="1.0" encoding="ISO-8859-1" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<body>\n<div style="width:100%;font-size:36px;line-height:48px;background-color:navy;color:white">My Facelet Application</div>\n</body>\n</html>\n
-New_Facelet_Footer.footer=<?xml version="1.0" encoding="ISO-8859-1" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />\n<title>Insert title here</title>\n</head>\n<body>\n<div style="background-color:navy;width:100%;color:white"></div>\n</body>\n</html>\n
-New_Facelet_Template.template=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" \n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml"\n xmlns:ui="http://java.sun.com/jsf/facelets">\n<head>\n <title><ui:insert name="title">Default title</ui:insert></title>\n</head>\n\n<body>\n\n<div id="header">\n <ui:insert name="header">\n Header area. See comments below this line in the source.\n <!-- include your header file or uncomment the include below and create header.xhtml in this directory -->\n <!-- <ui:include src="header.xhtml"/> -->\n </ui:insert>\n</div>\n\n\n<div id="content">\n <ui:insert name="content">\n Content area. See comments below this line in the source.\n <!-- include your content file or uncomment the include below and create content.xhtml in this directory -->\n <!-- <div> -->\n <!-- <ui:include src="content.xhtml"/> --> \n <!-- </div> -->\n </ui:insert>\n</div>\n\n<div id="footer">\n <ui:insert name="footer">\n Footer area. See comments below this line in the source.\n <!-- include your header file or uncomment the include below and create footer.xhtml in this directory -->\n <!--<ui:include src="footer.xhtml"/> -->\n </ui:insert>\n</div>\n\n</body>\n\n</html>\n
-New_Simple_Facelet_Composition_Page.composition=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" \n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n\n<html xmlns="http://www.w3.org/1999/xhtml"\n xmlns:ui="http://java.sun.com/jsf/facelets"\n xmlns:h="http://java.sun.com/jsf/html"\n xmlns:f="http://java.sun.com/jsf/core">\n\n<ui:composition template="">\n <ui:define name="header">\n Add your header here or delete to use the default\n </ui:define>\n <ui:define name="content">\n Add your content here or delete to use the default\n </ui:define>\n <ui:define name="footer">\n Add your footer here or delete to use the default\n </ui:define>\n</ui:composition>\n</html>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/templates/templates.xml b/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/templates/templates.xml
deleted file mode 100644
index c5f4eb18e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.ui/templates/templates.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<templates>
-<template id="org.eclipse.jst.jsf.facelet.ui.new_simple_footer_xhtml" autoinsert="false" context="html_new" deleted="false" description="%New_Footer_Description" enabled="true" name="%New_Facelet_Footer">%New_Facelet_Footer.footer</template>
-<template id="org.eclipse.jst.jsf.facelet.ui.new_header_xhtml" autoinsert="false" context="html_new" deleted="false" description="%New_Facelet_Header_Description" enabled="true" name="%New_Facelet_Header">%New_Facelet_Header.header</template>
-<template id="org.eclipse.jst.jsf.facelet.ui.new_basic_template_xhtml" autoinsert="false" context="html_new" deleted="false" description="%New_Facelet_Template_Description" enabled="true" name="%New_Facelet_Template">%New_Facelet_Template.template</template>
-<template id="org.eclipse.jst.jsf.facelet.ui.new_basic_composition_xhtml" autoinsert="false" context="html_new" deleted="false" description="%New_Simple_Facelet_Composition_Page_Description" enabled="true" name="%New_Simple_Facelet_Composition_Page">%New_Simple_Facelet_Composition_Page.composition</template>
-</templates> \ No newline at end of file

Back to the top