From 27a9a8b3ddcad3ba04a43769562991587ea2ccf4 Mon Sep 17 00:00:00 2001 From: canderson Date: Thu, 11 Mar 2010 02:33:53 +0000 Subject: [305362] Need to integrate icons for web fragment project --- .../eclipse/jst/jee/util/internal/JavaEEQuickPeek.java | 3 +++ .../icons/full/ovr16/webfragmentoverlayicon.gif | Bin 0 -> 926 bytes .../j2ee/navigator/internal/J2EEProjectDecorator.java | 12 ++++++++++++ .../eclipse/jst/j2ee/project/JavaEEProjectUtilities.java | 2 ++ .../icons/full/ctool16/newWebFragmentProject.gif | Bin 0 -> 1017 bytes plugins/org.eclipse.jst.servlet.ui/plugin.xml | 2 +- 6 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 plugins/org.eclipse.jst.j2ee.navigator.ui/icons/full/ovr16/webfragmentoverlayicon.gif create mode 100644 plugins/org.eclipse.jst.servlet.ui/icons/full/ctool16/newWebFragmentProject.gif (limited to 'plugins') diff --git a/plugins/org.eclipse.jst.j2ee.core/archive/org/eclipse/jst/jee/util/internal/JavaEEQuickPeek.java b/plugins/org.eclipse.jst.j2ee.core/archive/org/eclipse/jst/jee/util/internal/JavaEEQuickPeek.java index ae03fac3d..6a7b59836 100644 --- a/plugins/org.eclipse.jst.j2ee.core/archive/org/eclipse/jst/jee/util/internal/JavaEEQuickPeek.java +++ b/plugins/org.eclipse.jst.j2ee.core/archive/org/eclipse/jst/jee/util/internal/JavaEEQuickPeek.java @@ -363,6 +363,9 @@ public class JavaEEQuickPeek implements J2EEVersionConstants { javaEEVersion = J2EEVersionConstants.JEE_6_0_ID; } break; + + case WEBFRAGMENT_TYPE: + javaEEVersion = J2EEVersionConstants.WEBFRAGMENT_3_0_ID; } if (javaEEVersion == UNSET) { javaEEVersion = UNKNOWN; diff --git a/plugins/org.eclipse.jst.j2ee.navigator.ui/icons/full/ovr16/webfragmentoverlayicon.gif b/plugins/org.eclipse.jst.j2ee.navigator.ui/icons/full/ovr16/webfragmentoverlayicon.gif new file mode 100644 index 000000000..3fb7d1b7d Binary files /dev/null and b/plugins/org.eclipse.jst.j2ee.navigator.ui/icons/full/ovr16/webfragmentoverlayicon.gif differ diff --git a/plugins/org.eclipse.jst.j2ee.navigator.ui/j2ee-navigator/org/eclipse/jst/j2ee/navigator/internal/J2EEProjectDecorator.java b/plugins/org.eclipse.jst.j2ee.navigator.ui/j2ee-navigator/org/eclipse/jst/j2ee/navigator/internal/J2EEProjectDecorator.java index feed0a0c9..fb95f04ca 100644 --- a/plugins/org.eclipse.jst.j2ee.navigator.ui/j2ee-navigator/org/eclipse/jst/j2ee/navigator/internal/J2EEProjectDecorator.java +++ b/plugins/org.eclipse.jst.j2ee.navigator.ui/j2ee-navigator/org/eclipse/jst/j2ee/navigator/internal/J2EEProjectDecorator.java @@ -36,6 +36,7 @@ public class J2EEProjectDecorator extends LabelProvider implements ILightweightL private static ImageDescriptor DYNAMICWEB; private static ImageDescriptor EJB; private static ImageDescriptor CONNECTOR; + private static ImageDescriptor WEBFRAGMENT; /* The constants are duplicated here to avoid plugin loading. */ private static final String EAR_FACET = "jst.ear"; //$NON-NLS-1$ @@ -44,6 +45,7 @@ public class J2EEProjectDecorator extends LabelProvider implements ILightweightL private static final String EJB_FACET = "jst.ejb"; //$NON-NLS-1$ private static final String CONNECTOR_FACET = "jst.connector"; //$NON-NLS-1$ private static final String STATIC_WEB_FACET = "wst.web"; //$NON-NLS-1$ + private static final String WEB_FRAGMENT_FACET = "jst.webfragment"; //$NON-NLS-1$ private static final String ICON_DIR = "icons/full/ovr16"; //$NON-NLS-1$ @@ -73,6 +75,9 @@ public class J2EEProjectDecorator extends LabelProvider implements ILightweightL overlay=getCONNECTOR(); else if (hasFacet(project, STATIC_WEB_FACET)) overlay=getDYNAMICWEB(); + else if (hasFacet(project, WEB_FRAGMENT_FACET)) + overlay=getWEBFRAGMENT(); + // keep it null for if (hasFacet(project, UTILITY_FACET)) if (overlay != null) decoration.addOverlay(overlay); @@ -124,6 +129,13 @@ public class J2EEProjectDecorator extends LabelProvider implements ILightweightL return DYNAMICWEB; } + private static ImageDescriptor getWEBFRAGMENT() { + if (WEBFRAGMENT == null) { + WEBFRAGMENT = getImageDescriptor("webfragmentoverlayicon"); //$NON-NLS-1$ + } + return WEBFRAGMENT; + } + private static ImageDescriptor getEJB() { if (EJB == null) { EJB = getImageDescriptor("ejb_module_ovr"); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/JavaEEProjectUtilities.java b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/JavaEEProjectUtilities.java index bcc406a0b..b5ae90903 100644 --- a/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/JavaEEProjectUtilities.java +++ b/plugins/org.eclipse.jst.j2ee/j2eecreation/org/eclipse/jst/j2ee/project/JavaEEProjectUtilities.java @@ -320,6 +320,8 @@ public class JavaEEProjectUtilities extends ProjectUtilities implements IJ2EEFac ddURI = J2EEConstants.RAR_DD_URI; } else if (isDynamicWebProject(project)) { ddURI = J2EEConstants.WEBAPP_DD_URI; + }else if (isWebFragmentProject(project)) { + ddURI = J2EEConstants.WEBFRAGMENT_DD_URI; } else { throw new IllegalArgumentException("Project:" + project.getName() + " is not a Java EE Project"); //$NON-NLS-1$//$NON-NLS-2$ } diff --git a/plugins/org.eclipse.jst.servlet.ui/icons/full/ctool16/newWebFragmentProject.gif b/plugins/org.eclipse.jst.servlet.ui/icons/full/ctool16/newWebFragmentProject.gif new file mode 100644 index 000000000..9bebd326e Binary files /dev/null and b/plugins/org.eclipse.jst.servlet.ui/icons/full/ctool16/newWebFragmentProject.gif differ diff --git a/plugins/org.eclipse.jst.servlet.ui/plugin.xml b/plugins/org.eclipse.jst.servlet.ui/plugin.xml index c34c9f270..b7c7e8146 100644 --- a/plugins/org.eclipse.jst.servlet.ui/plugin.xml +++ b/plugins/org.eclipse.jst.servlet.ui/plugin.xml @@ -37,7 +37,7 @@