Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgkessler2008-02-01 20:21:15 +0000
committergkessler2008-02-01 20:21:15 +0000
commit4c8bd02792841baf371c21561b3f86e7006ef9ba (patch)
tree43aa7175f0c6def95e7dd56e393bffa082880f5c /jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter
parent2515676d13e1df367826efeaedcd4db7d05b89cc (diff)
downloadwebtools.jsf-4c8bd02792841baf371c21561b3f86e7006ef9ba.tar.gz
webtools.jsf-4c8bd02792841baf371c21561b3f86e7006ef9ba.tar.xz
webtools.jsf-4c8bd02792841baf371c21561b3f86e7006ef9ba.zip
Big checkin:
- fix to support WPE being removed - all JSF Project MD moved to tagSupport plugin - update to IStructuredDocContextFactory for getContext(Element) - misc
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter')
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/JSPConverterFactory.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/JSPConverterFactory.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/JSPConverterFactory.java
index a9e0b7ce8..2175d91c9 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/JSPConverterFactory.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/converter/jsp/JSPConverterFactory.java
@@ -12,12 +12,16 @@
package org.eclipse.jst.pagedesigner.converter.jsp;
import org.eclipse.jface.viewers.ILabelProvider;
+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.core.internal.tld.ITLDConstants;
-import org.eclipse.jst.pagedesigner.PDPlugin;
import org.eclipse.jst.pagedesigner.converter.HiddenTagConverter;
import org.eclipse.jst.pagedesigner.converter.IConverterFactory;
import org.eclipse.jst.pagedesigner.converter.ITagConverter;
import org.eclipse.jst.pagedesigner.converter.TagConverterToDumBlock;
+import org.eclipse.jst.pagedesigner.editors.palette.TagImageManager;
import org.eclipse.jst.pagedesigner.jsp.core.IJSPCoreConstants;
import org.eclipse.swt.graphics.Image;
import org.w3c.dom.Element;
@@ -84,24 +88,19 @@ public class JSPConverterFactory implements IConverterFactory {
if (element instanceof ITagConverter)
{
final Element hostElement = ((ITagConverter)element).getHostElement();
- final String tagName = hostElement.getLocalName();
- return getJSPSharedImage(tagName);
+ IStructuredDocumentContext context = IStructuredDocumentContextFactory2.INSTANCE.getContext(hostElement);
+ if (context != null){
+ IWorkspaceContextResolver wsResolver = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context);
+ if (wsResolver != null){
+ return TagImageManager.getInstance().getSmallIconImage(wsResolver.getProject(),"JSP11", ITLDConstants.URI_JSP + ":"+hostElement.getLocalName());
+ }
+ }
}
return null;
}
}
- /**
- * @param tagName
- * @return
- */
- private static Image getJSPSharedImage(String tagName) {
- Image image = PDPlugin.getDefault().getImage(
- "palette/JSP/small/JSP_" + tagName.toUpperCase() + ".gif");
- return image;
- }
-
/*
* (non-Javadoc)
*

Back to the top