Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgkessler2010-03-29 17:11:08 +0000
committergkessler2010-03-29 17:11:08 +0000
commit45810f454bb515ff2c7b62eb1c6e4f975bccde26 (patch)
tree7364f30a88247686a1a80ec5b1a8d26884c19633
parent0baa4d98dd8f395f35df9f4c7bc17ff94edc7698 (diff)
downloadwebtools.jsf-45810f454bb515ff2c7b62eb1c6e4f975bccde26.tar.gz
webtools.jsf-45810f454bb515ff2c7b62eb1c6e4f975bccde26.tar.xz
webtools.jsf-45810f454bb515ff2c7b62eb1c6e4f975bccde26.zip
Fix for JSPs in a Facelet context. Now correctly returns JSP view adapters from Facelet Adapter Factory
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTViewHandler.java23
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/DTFaceletViewHandler.java2
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/ViewDefnAdapterFactory.java14
3 files changed, 30 insertions, 9 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTViewHandler.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTViewHandler.java
index 3aae68cf4..b01156037 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTViewHandler.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/designtime/internal/view/DefaultDTViewHandler.java
@@ -89,8 +89,23 @@ public class DefaultDTViewHandler extends AbstractDTViewHandler
@Override
public IViewDefnAdapterFactory getViewMetadataAdapterFactory(
final DTFacesContext context) throws ViewHandlerException
- {
- final IResource res = context.adaptContextObject();
+ {
+ return internalGetViewMetadataAdapterFactory(context);
+ }
+
+ /**
+ * @param context
+ * @return the DefaultViewDefnAdapterFactory
+ *
+ */
+ protected IViewDefnAdapterFactory getDefaultViewMetadataAdapterFactory(
+ final DTFacesContext context)
+ {
+ return internalGetViewMetadataAdapterFactory(context);
+ }
+
+ private IViewDefnAdapterFactory internalGetViewMetadataAdapterFactory (final DTFacesContext context) {
+ final IResource res = context.adaptContextObject();
if (res instanceof IFile)
{
@@ -98,8 +113,8 @@ public class DefaultDTViewHandler extends AbstractDTViewHandler
}
return null;
- }
-
+ }
+
@Override
protected VersionStamp createVersionStamp(
final DTFacesContext facesContext, final String viewId)
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/DTFaceletViewHandler.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/DTFaceletViewHandler.java
index 18dddd41b..e5a4d0314 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/DTFaceletViewHandler.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/DTFaceletViewHandler.java
@@ -73,7 +73,7 @@ public class DTFaceletViewHandler extends DefaultDTViewHandler
if (res instanceof IFile)
{
- return new ViewDefnAdapterFactory(this);
+ return new ViewDefnAdapterFactory(this, getDefaultViewMetadataAdapterFactory(context));
}
return null;
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/ViewDefnAdapterFactory.java b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/ViewDefnAdapterFactory.java
index 55062f34d..c1de79a0f 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/ViewDefnAdapterFactory.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.facelet.core/src/org/eclipse/jst/jsf/facelet/core/internal/view/ViewDefnAdapterFactory.java
@@ -6,16 +6,19 @@ import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
import org.eclipse.jst.jsf.designtime.internal.view.AbstractViewDefnAdapterFactory;
import org.eclipse.jst.jsf.designtime.internal.view.IViewDefnAdapter;
+import org.eclipse.jst.jsf.designtime.internal.view.IViewDefnAdapterFactory;
import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
class ViewDefnAdapterFactory extends AbstractViewDefnAdapterFactory
{
private final DTFaceletViewHandler _myViewHandler;
+ private final IViewDefnAdapterFactory _defaultViewDefnAdapterFactory;
- ViewDefnAdapterFactory(final DTFaceletViewHandler viewHandler)
+ ViewDefnAdapterFactory(final DTFaceletViewHandler viewHandler, final IViewDefnAdapterFactory defaultViewDefnAdapterFactory)
{
_myViewHandler = viewHandler;
+ _defaultViewDefnAdapterFactory = defaultViewDefnAdapterFactory;
}
@Override
@@ -30,11 +33,14 @@ class ViewDefnAdapterFactory extends AbstractViewDefnAdapterFactory
{
final IFile srcFile = (IFile) res;
final ITagRegistry registry = findTagRegistry(srcFile);
- if (_myViewHandler.isHTMLContent(srcFile) && registry != null)
- {
+ if (registry != null) {
+ if (_myViewHandler.isHTMLContent(srcFile))
+ {
+ return new FaceletViewDefnAdapter(registry);
+ }
// if we have a jsp file, then return the default
// adapter
- return new FaceletViewDefnAdapter(registry);
+ return _defaultViewDefnAdapterFactory.createAdapter(context, viewId);
}
}
}

Back to the top