Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 161064 Details for
Bug 302621
[JSF2.0] Facet presets and JEE6
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Convert to dynamic presets for facets
patch.txt (text/plain), 13.83 KB, created by
Cameron Bateman
on 2010-03-04 22:08:56 EST
(
hide
)
Description:
Convert to dynamic presets for facets
Filename:
MIME Type:
Creator:
Cameron Bateman
Created:
2010-03-04 22:08:56 EST
Size:
13.83 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.jsf.core >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsf/components/jsf/plugins/org.eclipse.jst.jsf.core/plugin.xml,v >retrieving revision 1.39 >diff -u -r1.39 plugin.xml >--- plugin.xml 3 Mar 2010 21:14:47 -0000 1.39 >+++ plugin.xml 5 Mar 2010 03:08:00 -0000 >@@ -112,37 +112,12 @@ > <dynamic-preset id="preset.jst.jsf.v1_1"> > <factory class="org.eclipse.jst.jsf.core.internal.project.facet.JSFConfigurationPresetFactory11"/> > </dynamic-preset> >- <static-preset >- id="preset.jst.jsf.v1_2"> >- <label>%JSFv12Project</label> >- <facet id="jst.java" version="5.0" /> >- <facet id="jst.web" version="2.5"/> >- <facet id="jst.jsf" version="1.2" /> >- <description> >- %JSFv12PresetDesc >- </description> >- </static-preset> >- <static-preset >- id="preset.jst.jsf.v2_0"> >- <label> >- %JSFv20Project >- </label> >- <facet >- id="jst.java" >- version="5.0"> >- </facet> >- <facet >- id="jst.web" >- version="2.5"> >- </facet> >- <facet >- id="jst.jsf" >- version="2.0"> >- </facet> >- <description> >- %JSFv20PresetDesc >- </description> >- </static-preset> >+ <dynamic-preset id="preset.jst.jsf.v1_2"> >+ <factory class="org.eclipse.jst.jsf.core.internal.project.facet.JSFConfigurationPresetFactory12"/> >+ </dynamic-preset> >+ <dynamic-preset id="preset.jst.jsf.v2_0"> >+ <factory class="org.eclipse.jst.jsf.core.internal.project.facet.JSFConfigurationPresetFactory20"/> >+ </dynamic-preset> > </extension> > > <extension point="org.eclipse.wst.common.project.facet.core.runtimes"> >Index: src/org/eclipse/jst/jsf/core/internal/messages.properties >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsf/components/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/messages.properties,v >retrieving revision 1.21 >diff -u -r1.21 messages.properties >--- src/org/eclipse/jst/jsf/core/internal/messages.properties 3 Mar 2010 21:14:48 -0000 1.21 >+++ src/org/eclipse/jst/jsf/core/internal/messages.properties 5 Mar 2010 03:08:00 -0000 >@@ -89,6 +89,6 @@ > RegistryUpgradeCommitHandler_Text=An unrecoverable error occurred while trying to migrate your JSF Library Registry to a newer version. This may cause your library references to be broken in your JSF projects. > RegistryUpgradeCommitHandler_Title=Serious Error Encountered\! > >-JSFFacet11_presetLabel = JavaServer Faces v1.1 Project >-JSFFacet11_presetDescription = Configures a Dynamic Web application to use JSF v1.1 >+JSFFacet11_presetLabel = JavaServer Faces v{0} Project >+JSFFacet11_presetDescription = Configures a Dynamic Web application to use JSF v{0} > >Index: src/org/eclipse/jst/jsf/core/internal/project/facet/AbstractJSFConfigurationPresetFactory.java >=================================================================== >RCS file: src/org/eclipse/jst/jsf/core/internal/project/facet/AbstractJSFConfigurationPresetFactory.java >diff -N src/org/eclipse/jst/jsf/core/internal/project/facet/AbstractJSFConfigurationPresetFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jst/jsf/core/internal/project/facet/AbstractJSFConfigurationPresetFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,78 @@ >+package org.eclipse.jst.jsf.core.internal.project.facet; >+ >+import java.util.HashSet; >+import java.util.Map; >+import java.util.Set; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.jst.common.project.facet.core.JavaFacet; >+import org.eclipse.jst.j2ee.web.project.facet.WebFacetUtils; >+import org.eclipse.jst.jsf.core.internal.Messages; >+import org.eclipse.wst.common.project.facet.core.IDynamicPreset; >+import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase; >+import org.eclipse.wst.common.project.facet.core.IPresetFactory; >+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; >+import org.eclipse.wst.common.project.facet.core.PresetDefinition; >+ >+/** >+ * Super-class of all dynamic preset factories. >+ * >+ * @author cbateman >+ * >+ */ >+public class AbstractJSFConfigurationPresetFactory implements IPresetFactory >+{ >+ private final IProjectFacetVersion _minimumWebVersion; >+ private final IProjectFacetVersion _jsfVersion; >+ >+ /** >+ * @param minimumWebVersion >+ * @param jsfVersion >+ */ >+ protected AbstractJSFConfigurationPresetFactory(final IProjectFacetVersion minimumWebVersion, >+ final IProjectFacetVersion jsfVersion) >+ { >+ _minimumWebVersion = minimumWebVersion; >+ _jsfVersion = jsfVersion; >+ } >+ >+ public PresetDefinition createPreset(final String presetId, >+ final Map<String, Object> context) >+ throws CoreException >+ { >+ final IFacetedProjectBase fproj = (IFacetedProjectBase) context >+ .get(IDynamicPreset.CONTEXT_KEY_FACETED_PROJECT); >+ >+ final IProjectFacetVersion webFacetVersion = fproj >+ .getProjectFacetVersion(WebFacetUtils.WEB_FACET); >+ >+ if (webFacetVersion != null >+ && webFacetVersion.compareTo(_minimumWebVersion) >= 0) >+ { >+ final Set<IProjectFacetVersion> facets = new HashSet<IProjectFacetVersion>(); >+ facets.add(_jsfVersion); >+ facets.add(webFacetVersion); >+ if (webFacetVersion == WebFacetUtils.WEB_23) >+ { >+ facets.add(JavaFacet.VERSION_1_3); >+ } else if (webFacetVersion == WebFacetUtils.WEB_24) >+ { >+ facets.add(JavaFacet.VERSION_1_4); >+ } else if (webFacetVersion == WebFacetUtils.WEB_25) >+ { >+ facets.add(JavaFacet.VERSION_1_5); >+ } else if (webFacetVersion == WebFacetUtils.WEB_30) >+ { >+ facets.add(JavaFacet.VERSION_1_6); >+ } >+ >+ return new PresetDefinition( >+ Messages.bind(Messages.JSFFacet11_presetLabel, _jsfVersion.getVersionString()), >+ Messages.bind(Messages.JSFFacet11_presetDescription, _jsfVersion.getVersionString()) >+ , facets); >+ } >+ >+ return null; >+ } >+ >+} >Index: src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory11.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsf/components/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory11.java,v >retrieving revision 1.2 >diff -u -r1.2 JSFConfigurationPresetFactory11.java >--- src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory11.java 1 Mar 2010 19:54:31 -0000 1.2 >+++ src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory11.java 5 Mar 2010 03:08:04 -0000 >@@ -11,74 +11,26 @@ > > package org.eclipse.jst.jsf.core.internal.project.facet; > >-import java.util.HashSet; >-import java.util.Map; >-import java.util.Set; >- >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.jst.common.project.facet.core.JavaFacet; > import org.eclipse.jst.j2ee.web.project.facet.WebFacetUtils; > import org.eclipse.jst.jsf.core.IJSFCoreConstants; >-import org.eclipse.jst.jsf.core.internal.Messages; >-import org.eclipse.wst.common.project.facet.core.IDynamicPreset; >-import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase; >-import org.eclipse.wst.common.project.facet.core.IPresetFactory; >-import org.eclipse.wst.common.project.facet.core.IProjectFacet; >-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; >-import org.eclipse.wst.common.project.facet.core.PresetDefinition; > import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; > > /** >+ * Preset factory for JSF 1.1. >+ * > * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> > */ > > public final class JSFConfigurationPresetFactory11 >- >- implements IPresetFactory >+ extends AbstractJSFConfigurationPresetFactory > > { >- public PresetDefinition createPreset( final String presetId, >- final Map<String,Object> context ) >- >- throws CoreException >- >+ /** >+ */ >+ public JSFConfigurationPresetFactory11() > { >- final IFacetedProjectBase fproj >- = (IFacetedProjectBase) context.get( IDynamicPreset.CONTEXT_KEY_FACETED_PROJECT ); >- >- final IProjectFacetVersion webFacetVersion >- = fproj.getProjectFacetVersion( WebFacetUtils.WEB_FACET ); >- >- if( webFacetVersion != null && webFacetVersion.compareTo( WebFacetUtils.WEB_23 ) >= 0 ) >- { >- final Set<IProjectFacetVersion> facets = new HashSet<IProjectFacetVersion>(); >- >- final IProjectFacet jsfFacet >- = ProjectFacetsManager.getProjectFacet( IJSFCoreConstants.JSF_CORE_FACET_ID ); >- >- final IProjectFacetVersion jsfFacetVersion11 >- = jsfFacet.getVersion( IJSFCoreConstants.JSF_VERSION_1_1 ); >- >- facets.add( jsfFacetVersion11 ); >- facets.add( webFacetVersion ); >- >- if( webFacetVersion == WebFacetUtils.WEB_23 ) >- { >- facets.add( JavaFacet.VERSION_1_3 ); >- } >- else if( webFacetVersion == WebFacetUtils.WEB_24 ) >- { >- facets.add( JavaFacet.VERSION_1_4 ); >- } >- else >- { >- facets.add( JavaFacet.VERSION_1_5 ); >- } >- >- return new PresetDefinition( Messages.JSFFacet11_presetLabel, Messages.JSFFacet11_presetDescription, facets ); >- } >- >- return null; >+ super(WebFacetUtils.WEB_23, ProjectFacetsManager >+ .getProjectFacet(IJSFCoreConstants.JSF_CORE_FACET_ID) >+ .getVersion(IJSFCoreConstants.JSF_VERSION_1_1)); > } >- > } >Index: src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory12.java >=================================================================== >RCS file: src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory12.java >diff -N src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory12.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory12.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,36 @@ >+/****************************************************************************** >+ * Copyright (c) 2008 BEA Systems, Inc. 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: >+ * Konstantin Komissarchik >+ ******************************************************************************/ >+ >+package org.eclipse.jst.jsf.core.internal.project.facet; >+ >+import org.eclipse.jst.j2ee.web.project.facet.WebFacetUtils; >+import org.eclipse.jst.jsf.core.IJSFCoreConstants; >+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; >+ >+/** >+ * Preset factory for JSF 1.1. >+ * >+ * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> >+ */ >+ >+public final class JSFConfigurationPresetFactory12 >+ extends AbstractJSFConfigurationPresetFactory >+ >+{ >+ /** >+ */ >+ public JSFConfigurationPresetFactory12() >+ { >+ super(WebFacetUtils.WEB_25, ProjectFacetsManager >+ .getProjectFacet(IJSFCoreConstants.JSF_CORE_FACET_ID) >+ .getVersion(IJSFCoreConstants.JSF_VERSION_1_2)); >+ } >+} >Index: src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory20.java >=================================================================== >RCS file: src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory20.java >diff -N src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory20.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jst/jsf/core/internal/project/facet/JSFConfigurationPresetFactory20.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,36 @@ >+/****************************************************************************** >+ * Copyright (c) 2008 BEA Systems, Inc. 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: >+ * Konstantin Komissarchik >+ ******************************************************************************/ >+ >+package org.eclipse.jst.jsf.core.internal.project.facet; >+ >+import org.eclipse.jst.j2ee.web.project.facet.WebFacetUtils; >+import org.eclipse.jst.jsf.core.IJSFCoreConstants; >+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; >+ >+/** >+ * Preset factory for JSF 1.1. >+ * >+ * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a> >+ */ >+ >+public final class JSFConfigurationPresetFactory20 >+ extends AbstractJSFConfigurationPresetFactory >+ >+{ >+ /** >+ */ >+ public JSFConfigurationPresetFactory20() >+ { >+ super(WebFacetUtils.WEB_25, ProjectFacetsManager >+ .getProjectFacet(IJSFCoreConstants.JSF_CORE_FACET_ID) >+ .getVersion(IJSFCoreConstants.JSF_VERSION_2_0)); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 302621
:
161064
|
161134