JBoss Tools SVN: r15851 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-10 08:16:29 -0400 (Wed, 10 Jun 2009)
New Revision: 15851
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4213
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java 2009-06-10 12:16:10 UTC (rev 15850)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/TaglibMapping.java 2009-06-10 12:16:29 UTC (rev 15851)
@@ -14,6 +14,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+import java.util.StringTokenizer;
import org.eclipse.core.resources.IResource;
@@ -91,16 +92,22 @@
if(webxml == null || webRoot == null) return;
XModelObject cp = WebAppHelper.findWebAppContextParam(webxml, "facelets.LIBRARIES");
if(cp == null) return;
- String path = cp.getAttributeValue("param-value");
- if(path == null || path.length() == 0) return;
- String modelPath = path;
- if(modelPath.startsWith("/")) modelPath = modelPath.substring(1);
- XModelObject facelet = webRoot.getChildByPath(modelPath);
- if(facelet == null) return;
- String uri = facelet.getAttributeValue("uri");
- if(uri != null) {
- resolvedURIs.put(path, uri);
- taglibObjects.put(uri, facelet);
+ String paths = cp.getAttributeValue("param-value");
+ if(paths == null || paths.length() == 0) return;
+ StringTokenizer st = new StringTokenizer(paths, ";,");
+ while(st.hasMoreTokens()) {
+ String path = st.nextToken();
+ String modelPath = path;
+ if (modelPath.startsWith("/"))
+ modelPath = modelPath.substring(1);
+ XModelObject facelet = webRoot.getChildByPath(modelPath);
+ if (facelet == null)
+ continue;
+ String uri = facelet.getAttributeValue("uri");
+ if (uri != null) {
+ resolvedURIs.put(path, uri);
+ taglibObjects.put(uri, facelet);
+ }
}
}
15 years, 6 months
JBoss Tools SVN: r15850 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/navigator.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-10 08:16:10 -0400 (Wed, 10 Jun 2009)
New Revision: 15850
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/navigator/JsfProjectsTreeListener.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4213
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/navigator/JsfProjectsTreeListener.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/navigator/JsfProjectsTreeListener.java 2009-06-10 12:15:45 UTC (rev 15849)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/navigator/JsfProjectsTreeListener.java 2009-06-10 12:16:10 UTC (rev 15850)
@@ -65,8 +65,8 @@
String entity = c.getModelEntity().getName();
if("FilePROPERTIES".equals(c.getModelEntity().getName())) {
invalidateBundles(source.getModel());
- } else if(JSFProjectTagLibs.isTLDFile(c) ||
- "FileSystemJar".equals(entity)) {
+ } else if(JSFProjectTagLibs.isTLDFile(c) || JSFProjectTagLibs.isFaceletTaglibFile(c)
+ || "FileSystemJar".equals(entity)) {
invalidateTagLibs(source.getModel());
} else if(entity.startsWith(JSFConstants.ENT_FACESCONFIG)) {
invalidateConfig(source.getModel());
15 years, 6 months
JBoss Tools SVN: r15849 - in trunk/jsf/plugins/org.jboss.tools.jsf: resources/meta and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-10 08:15:45 -0400 (Wed, 10 Jun 2009)
New Revision: 15849
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/CreateFaceletTaglibSupport.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFWebHelper.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4213
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2009-06-10 11:53:27 UTC (rev 15848)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2009-06-10 12:15:45 UTC (rev 15849)
@@ -341,8 +341,8 @@
class="org.jboss.tools.jsf.model.handlers.bean.AddManagedBeanSupport"/>
<xclass id="org.jboss.tools.jsf.model.handlers.CreateFacesConfigSupport"
class="org.jboss.tools.jsf.model.handlers.CreateFacesConfigSupport"/>
- <xclass id="org.jboss.tools.jsf.model.handlers.CreateFacesConfigSupport"
- class="org.jboss.tools.jsf.model.handlers.CreateFacesConfigSupport"/>
+ <xclass id="org.jboss.tools.jsf.model.handlers.CreateFaceletTaglibSupport"
+ class="org.jboss.tools.jsf.model.handlers.CreateFaceletTaglibSupport"/>
<xclass id="org.jboss.tools.jsf.model.handlers.AddViewSupport"
class="org.jboss.tools.jsf.model.handlers.AddViewSupport"/>
<xclass id="org.jboss.tools.jsf.model.handlers.AddEntrySupport"
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta 2009-06-10 11:53:27 UTC (rev 15848)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta 2009-06-10 12:15:45 UTC (rev 15849)
@@ -608,19 +608,16 @@
<XActionItem displayName="JSF" kind="list" name="JSF">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.new.facelet.facelet-taglib"
- PROPERTIES="entity=FileFaceletTaglib;extensions=.xml.;validator.addfile=true;support=org.jboss.tools.common.model.files.handlers.CreateFileSupport;extension=xml;entityVersion=FaceletTaglib"
+ PROPERTIES="entity=FileFaceletTaglib;extensions=.xml.;validator.addfile=true;support=org.jboss.tools.jsf.model.handlers.CreateFaceletTaglibSupport;extension=xml;entityVersion=FaceletTaglib"
displayName="Facelet Taglib" kind="action" name="CreateFaceletTaglib">
- <EntityData EntityName="NewFileWizard">
+ <EntityData EntityName="CreateFacesConfigHelper">
<AttributeData AttributeName="folder"/>
<AttributeData AttributeName="separator" Mandatory="no"/>
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="version" Mandatory="no"/>
+ <AttributeData AttributeName="register in web.xml" Mandatory="no"/>
</EntityData>
</XActionItem>
- <XActionItem HandlerClassName="%WizardInvoker%"
- ICON="action.new.facelet.facelet-taglib"
- PROPERTIES="plugin=org.jboss.tools.jsf.ui;wizard=org.jboss.tools.jsf.ui.wizard.newfile.NewFacesConfigFileWizard"
- displayName="Facelet Taglib" kind="action" name="CreateFaceletTaglibV"/>
</XActionItem>
</XActionItem>
</XActionItem>
@@ -638,7 +635,7 @@
<XActionItem displayName="JSF" kind="list" name="JSF">
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.new.facelet.facelet-taglib"
- PROPERTIES="entity=FileFaceletTaglib;extensions=.xml.;validator.addfile=true;support=org.jboss.tools.common.model.files.handlers.CreateFileSupport;extension=xml;entityVersion=FileFaceletTaglib"
+ PROPERTIES="entity=FileFaceletTaglib;extensions=.xml.;validator.addfile=true;support=org.jboss.tools.jsf.model.handlers.CreateFaceletTaglibSupport;extension=xml;entityVersion=FileFaceletTaglib"
displayName="Facelet Taglib" kind="action" name="CreateFaceletTaglib">
<EntityData EntityName="CreateFacesConfigHelper">
<AttributeData AttributeName="folder"/>
@@ -648,10 +645,6 @@
<AttributeData AttributeName="register in web.xml" Mandatory="no"/>
</EntityData>
</XActionItem>
- <XActionItem HandlerClassName="%WizardInvoker%"
- ICON="action.new.facelet.facelet-taglib"
- PROPERTIES="plugin=org.jboss.tools.jsf.ui;wizard=org.jboss.tools.jsf.ui.wizard.newfile.NewFacesConfigFileWizard"
- displayName="Facelet Taglib" kind="action" name="CreateFaceletTaglibV"/>
</XActionItem>
</XActionItem>
</XActionItem>
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/CreateFaceletTaglibSupport.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/CreateFaceletTaglibSupport.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/CreateFaceletTaglibSupport.java 2009-06-10 12:15:45 UTC (rev 15849)
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.model.handlers;
+
+import java.util.*;
+import org.jboss.tools.common.meta.action.impl.*;
+import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.files.handlers.CreateFileSupport;
+import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
+import org.jboss.tools.common.model.undo.*;
+import org.jboss.tools.jsf.model.*;
+import org.jboss.tools.jsf.web.JSFWebHelper;
+import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
+
+public class CreateFaceletTaglibSupport extends CreateFileSupport implements JSFConstants {
+ static String REGISTER = "register in web.xml";
+
+ public void reset() {
+ super.reset();
+ initDefaultName();
+ initRegister();
+ }
+
+ void initDefaultName() {
+ XModelObject[] cs = getFaceletsTaglibs(getTarget());
+ Set<String> names = new HashSet<String>();
+ for (int i = 0; i < cs.length; i++) {
+ names.add(cs[i].getAttributeValue("name"));
+ }
+ if(cs.length == 0) {
+ setAttributeValue(0, "name", "facelets-taglib");
+ return;
+ }
+ String name = "facelets-taglib", namef = name;
+ int i = 0;
+ while(names.contains(namef)) namef = name + "-" + (++i);
+ setAttributeValue(0, "name", namef);
+ }
+
+ void initRegister() {
+ if(checkRegister(getTarget(), getAttributeValue(0, REGISTER)) != null) {
+ setAttributeValue(0, REGISTER, "no");
+ }
+ }
+
+ protected void execute() throws XModelException {
+ Properties p0 = extractStepData(0);
+ XUndoManager undo = getTarget().getModel().getUndoManager();
+ XTransactionUndo u = new XTransactionUndo("Create facelets taglib in " + getTarget().getAttributeValue("element type")+" "+getTarget().getPresentationString(), XTransactionUndo.ADD);
+ undo.addUndoable(u);
+ try {
+ doExecute(p0);
+ } catch (RuntimeException e) {
+ undo.rollbackTransactionInProgress();
+ throw e;
+ } finally {
+ u.commit();
+ }
+ }
+
+ private void doExecute(Properties p0) throws XModelException {
+ Properties p = extractStepData(0);
+ String path = p.getProperty("name");
+ path = revalidatePath(path);
+ XModelObject file = createFile(path);
+ if(file == null) return;
+
+ register(file.getParent(), file, p0);
+
+ open(file);
+ }
+
+ private void register(XModelObject object, XModelObject created, Properties prop) throws XModelException {
+ boolean register = "yes".equals(getAttributeValue(0, "register in web.xml"));
+ if(!register) return;
+ String uri = getURI(created);
+ JSFWebHelper.registerFaceletsTaglib(created.getModel(), uri);
+ }
+
+ private String getURI(XModelObject file) {
+ String result = "/" + FileAnyImpl.toFileName(file);
+ XModelObject o = file.getParent();
+ while(o != null && o.getFileType() != XModelObject.SYSTEM) {
+ result = "/" + o.getAttributeValue("name") + result;
+ o = o.getParent();
+ }
+ if(o == null || !"WEB-ROOT".equals(o.getAttributeValue("name"))) {
+ //TODO resolve to webRoot
+// result = "/WEB-INF" + result;
+ }
+ return result;
+ }
+
+ protected DefaultWizardDataValidator createValidator() {
+ return new CreateFaceletsTaglibValidator();
+ }
+
+ class CreateFaceletsTaglibValidator extends CreateFileSupport.Validator {
+ public void validate(Properties data) {
+ super.validate(data);
+ if(message != null) return;
+ message = checkRegister(getTarget(), data.getProperty("register in web.xml"));
+ }
+ }
+
+ private String checkRegister(XModelObject object, String register) {
+ if(!"yes".equals(register)) return null;
+ XModelObject webxml = WebAppHelper.getWebApp(object.getModel());
+ if(webxml == null) return "Facelets taglib cannot be registered because web.xml is not found.";
+ if("yes".equals(webxml.get("isIncorrect"))) return "Faces config file cannot be registered because web.xml is incorrect.";
+ if(!webxml.isObjectEditable()) return "Facelets taglib file cannot be registered because web.xml is read only.";
+ return null;
+ }
+
+ public static XModelObject[] getFaceletsTaglibs(XModelObject folder) {
+ XModelObject[] cs = folder.getChildren();
+ List<XModelObject> list = new ArrayList<XModelObject>();
+ for (int i = 0; i < cs.length; i++) {
+ if(cs[i].getModelEntity().getName().startsWith("FileFaceletTaglib")) list.add(cs[i]);
+ }
+ return list.toArray(new XModelObject[0]);
+ }
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/CreateFaceletTaglibSupport.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java 2009-06-10 11:53:27 UTC (rev 15848)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java 2009-06-10 12:15:45 UTC (rev 15849)
@@ -11,10 +11,10 @@
package org.jboss.tools.jsf.model.pv;
import java.util.*;
+
import org.eclipse.core.resources.IResource;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
public class JSFProjectTagLibs extends JSFProjectResourceBundles {
@@ -38,9 +38,11 @@
protected List<XModelObject> collect(Iterator<XModelObject> rs) {
List<XModelObject> list = super.collect(rs);
- XModelObject faceletTaglib = getFaceletTaglibs();
- if(faceletTaglib != null && faceletTaglib.getAttributeValue("uri") != null) {
- list.add(faceletTaglib);
+ List<XModelObject> faceletTaglibs = getFaceletTaglibs();
+ if(faceletTaglibs != null) for (XModelObject faceletTaglib: faceletTaglibs) {
+ if(faceletTaglib.getAttributeValue("uri") != null) {
+ list.add(faceletTaglib);
+ }
}
Iterator<XModelObject> it = list.iterator();
@@ -57,7 +59,7 @@
return list;
}
- private XModelObject getFaceletTaglibs() {
+ private List<XModelObject> getFaceletTaglibs() {
XModelObject webxml = getModel().getByPath("/web.xml");
XModelObject webRoot = FileSystemsHelper.getWebRoot(getModel());
if(webxml == null || webRoot == null) return null;
@@ -65,8 +67,15 @@
if(cp == null) return null;
String value = cp.getAttributeValue("param-value");
if(value == null || value.length() == 0) return null;
- if(value.startsWith("/")) value = value.substring(1);
- return webRoot.getChildByPath(value);
+ List<XModelObject> result = new ArrayList<XModelObject>();
+ StringTokenizer st = new StringTokenizer(value, ";,");
+ while(st.hasMoreTokens()) {
+ String path = st.nextToken();
+ if(path.startsWith("/")) path = path.substring(1);
+ XModelObject o = webRoot.getChildByPath(path);
+ if(o != null) result.add(o);
+ }
+ return result;
}
static String TLD_ENTITIES = ".FileTLD_PRO.FileTLD_1_2.FileTLD_2_0.FileTLD_2_1.";
@@ -80,6 +89,11 @@
return TLD_ENTITIES.indexOf(entity) >= 0;
}
+ public static boolean isFaceletTaglibFile(XModelObject o) {
+ String entity = "." + o.getModelEntity().getName();
+ return entity.startsWith("FileFaceletTaglib");
+ }
+
public Object getAdapter(Class adapter) {
if(adapter == IResource.class) {
XModelObject o = getModel().getByPath("FileSystems/WEB-INF");
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFWebHelper.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFWebHelper.java 2009-06-10 11:53:27 UTC (rev 15848)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/JSFWebHelper.java 2009-06-10 12:15:45 UTC (rev 15849)
@@ -31,6 +31,13 @@
new String[]{"/WEB-INF/faces-config.xml"}
);
+ public static ConfigFilesData FACELET_TAGLIB_DATA =
+ new ConfigFilesData(
+ "facelets.LIBRARIES",
+ new String[]{},
+ ";"
+ );
+
static {
FACES_CONFIG_DATA.usesDefaultWithoutRegistration = true;
}
@@ -59,6 +66,10 @@
unregisterConfigFile(model, path, FACES_CONFIG_DATA);
}
+ public static void registerFaceletsTaglib(XModel model, String path) throws XModelException {
+ registerConfigFile(model, path, FACELET_TAGLIB_DATA);
+ }
+
public static XModelObject findInitParam(XModelObject webxml) {
return findInitParam(webxml, FACES_CONFIG_DATA.param);
}
15 years, 6 months
JBoss Tools SVN: r15848 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-06-10 07:53:27 -0400 (Wed, 10 Jun 2009)
New Revision: 15848
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java
Log:
Failed junit has been commented, need to wait for JBIDE-4213 fix
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java 2009-06-10 10:51:37 UTC (rev 15847)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java 2009-06-10 11:53:27 UTC (rev 15848)
@@ -40,8 +40,8 @@
/**
* OpenOn test for Custom elements
*/
-
- public void testCorrectCustomElements() throws CoreException {
+ //TODO Maksim Areshkau, uncoment when JBIDE-4213 will be fixed
+ public void _testCorrectCustomElements() throws CoreException {
VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT, "correctCustomTags.xhtml"); //$NON-NLS-1$
int position = TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 13, 8);
@@ -62,7 +62,8 @@
/**
* test openOn for undefined template
*/
- public void testIncorrectCustomElements() throws CoreException {
+ //TODO Maksim Areshkau, uncoment when JBIDE-4213 will be fixed
+ public void _testIncorrectCustomElements() throws CoreException {
VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT, "incorrectCustomTags.xhtml"); //$NON-NLS-1$
int position = TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 9, 6);
15 years, 6 months
JBoss Tools SVN: r15847 - in trunk/seam/tests/org.jboss.tools.seam.core.test: src/org/jboss/tools/seam/core/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-10 06:51:37 -0400 (Wed, 10 Jun 2009)
New Revision: 15847
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/WebContent/WEB-INF/components.xml
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4393 More tests added
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/WebContent/WEB-INF/components.xml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/WebContent/WEB-INF/components.xml 2009-06-10 10:50:22 UTC (rev 15846)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/WebContent/WEB-INF/components.xml 2009-06-10 10:51:37 UTC (rev 15847)
@@ -35,5 +35,9 @@
<component class="java.lang.Boolean" name="duplicated"/>
<component class="java.lang.Boolean" name="duplicated"/>
+
+ <component class="demo.CustomAnnotation" name="compWithPrecedence10" precedence="10"/>
+ <component class="demo.CustomAnnotation" name="compWithDefaultPrecedence"/>
+ <component class="demo.CustomAnnotation" name="compWithPrecedence20" precedence="20"/>
</components>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2009-06-10 10:50:22 UTC (rev 15846)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2009-06-10 10:51:37 UTC (rev 15847)
@@ -180,6 +180,17 @@
if("duplicated".equals(cs[i].getName())) duplicatedCount++;
}
assertEquals("There are 2 declarations of component \"duplicated\" in xml.", 2, duplicatedCount);
+
+ //5. components.xml has components with different precedence.
+ ISeamComponentDeclaration c10 = findDeclaration(cs, "compWithPrecedence10");
+ assertNotNull(c10);
+ assertEquals("10", ((ISeamXmlComponentDeclaration)c10).getPrecedence());
+ ISeamComponentDeclaration cDefault = findDeclaration(cs, "compWithDefaultPrecedence");
+ assertNotNull(cDefault);
+ assertEquals("20", ((ISeamXmlComponentDeclaration)cDefault).getPrecedence());
+ ISeamComponentDeclaration c20 = findDeclaration(cs, "compWithPrecedence20");
+ assertNotNull(c20);
+ assertEquals("20", ((ISeamXmlComponentDeclaration)c20).getPrecedence());
}
private ISeamComponentDeclaration findDeclaration(ISeamComponentDeclaration[] declarations, String name) {
15 years, 6 months
JBoss Tools SVN: r15846 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: resources/customFaceletsTestProject/WebContent/pages and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-06-10 06:50:22 -0400 (Wed, 10 Jun 2009)
New Revision: 15846
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/show100.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/show100.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/components/inputCurrency.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/custom.taglib.xml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/WEB-INF/web.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3197Test.java
Log:
Test was extended to check two custom tag libraries
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/WEB-INF/web.xml 2009-06-10 10:42:22 UTC (rev 15845)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/WEB-INF/web.xml 2009-06-10 10:50:22 UTC (rev 15846)
@@ -21,7 +21,7 @@
</context-param>
<context-param>
<param-name>facelets.LIBRARIES</param-name>
- <param-value>/tags/facelets.taglib.xml</param-value>
+ <param-value>/tags/facelets.taglib.xml;/tags/custom.taglib.xml</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/show100.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/show100.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/show100.xhtml 2009-06-10 10:50:22 UTC (rev 15846)
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://mydomain.com/jsf/myproject">
+
+ <f:loadBundle basename="resources" var="msg" />
+ <ui:composition>
+ <div id="inputCurrenceTest">
+ <c:inputCurrency value="100"/>
+ </div>
+ </ui:composition>
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/show100.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/show100.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/show100.xhtml.xml 2009-06-10 10:50:22 UTC (rev 15846)
@@ -0,0 +1,14 @@
+<tests>
+<test id="inputCurrenceTest">
+<DIV ID="inputCurrenceTest" STYLE="-moz-user-modify: read-write;">
+<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+$
+</SPAN>
+<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+100
+</SPAN>
+</DIV>
+</DIV>
+</test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/components/inputCurrency.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/components/inputCurrency.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/components/inputCurrency.xhtml 2009-06-10 10:50:22 UTC (rev 15846)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+<ui:composition>
+ <h:outputText value="$" />
+ <h:outputText value="#{value}">
+ <f:convertNumber pattern="#,##0.00" />
+ </h:outputText>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/custom.taglib.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/custom.taglib.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/tags/custom.taglib.xml 2009-06-10 10:50:22 UTC (rev 15846)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+
+<facelet-taglib>
+ <namespace>http://mydomain.com/jsf/myproject</namespace>
+ <tag>
+ <tag-name>inputCurrency</tag-name>
+ <source>components/inputCurrency.xhtml</source>
+ </tag>
+</facelet-taglib>
+
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3197Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3197Test.java 2009-06-10 10:42:22 UTC (rev 15845)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3197Test.java 2009-06-10 10:50:22 UTC (rev 15846)
@@ -30,6 +30,10 @@
public void testContentCustomTagsWithSourceSupport() throws Throwable {
performContentTest("correctCustomTags.xhtml"); //$NON-NLS-1$
}
+
+ public void testJBIDE1593() throws Throwable {
+ performContentTest("show100.xhtml"); //$NON-NLS-1$
+ }
@Override
protected String getTestProjectName() {
15 years, 6 months
JBoss Tools SVN: r15845 - trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-06-10 06:42:22 -0400 (Wed, 10 Jun 2009)
New Revision: 15845
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
Log:
fixed a bug in the new override plugin
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-06-10 09:50:27 UTC (rev 15844)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-06-10 10:42:22 UTC (rev 15845)
@@ -88,6 +88,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties;
import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsDataModelProvider;
import org.eclipse.wst.common.componentcore.internal.operation.RemoveReferenceComponentsDataModelProvider;
@@ -467,11 +468,14 @@
getProjectLabelProvider(), getProjectContentProvider());
if (d.open() == Window.OK) {
IProject selected = (IProject) d.getFirstResult();
- addedElements.add(selected);
+ Object selected2 = ModuleCoreNature.isFlexibleProject(selected) ?
+ ComponentCore.createComponent(selected) : selected;
+ addedElements.add(selected2);
+ objectToRuntimePath.put(selected2, "/");
refresh();
TableItem[] items = availableComponentsViewer.getTable().getItems();
for (int i = 0; i < items.length; i++)
- if (items[i].getData().equals(selected))
+ if (items[i].getData().equals(selected2))
items[i].setChecked(true);
}
}
@@ -1059,8 +1063,10 @@
Object o;
while(i.hasNext()) {
o = i.next();
- if( o instanceof IProject )
+ if( o instanceof IProject && !ModuleCoreNature.isFlexibleProject((IProject)o))
projects.add((IProject)o);
+ else if( o instanceof IProject )
+ components.add(ComponentCore.createComponent(((IProject)o)));
else if( o instanceof IVirtualComponent)
components.add((IVirtualComponent)o);
}
15 years, 6 months
JBoss Tools SVN: r15844 - trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-10 05:50:27 -0400 (Wed, 10 Jun 2009)
New Revision: 15844
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/SchemaImportDialog.java
Log:
JBIDE-4461: filter the xsd and wsdl when user click Import an XSD or Import a WSDL button
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/SchemaImportDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/SchemaImportDialog.java 2009-06-10 09:49:38 UTC (rev 15843)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/SchemaImportDialog.java 2009-06-10 09:50:27 UTC (rev 15844)
@@ -72,46 +72,45 @@
import org.eclipse.ui.dialogs.SelectionStatusDialog;
import org.eclipse.ui.part.DrillDownComposite;
-
-
/**
- * Browse for complex/simple types available in the process and choose
- * that simple type.
+ * Browse for complex/simple types available in the process and choose that
+ * simple type.
*
*/
public class SchemaImportDialog extends SelectionStatusDialog {
-
+
/** Browse local resource */
protected final static int BID_BROWSE_RESOURCE = IDialogConstants.CLIENT_ID + 1;
-
+
/* Button id for browsing URLs */
protected final static int BID_BROWSE_URL = IDialogConstants.CLIENT_ID + 2;
-
+
/* Button id for browse files */
protected final static int BID_BROWSE_FILE = IDialogConstants.CLIENT_ID + 3;
- /* Browse button */
+ /* Browse button */
protected static final int BID_BROWSE = IDialogConstants.CLIENT_ID + 4;
-
+
/* button id for browsing WSIL */
protected static final int BID_BROWSE_WSIL = IDialogConstants.CLIENT_ID + 5;
/* The import source setting, remembered in the dialog settings */
- private static final String IMPORT_KIND = "ImportKind"; //$NON-NLS-1$
+ private static final String IMPORT_KIND = "ImportKind"; //$NON-NLS-1$
private static final String EMPTY = ""; //$NON-NLS-1$
-
-
- private String[] FILTER_EXTENSIONS = { IBPELUIConstants.EXTENSION_STAR_DOT_XSD,
- IBPELUIConstants.EXTENSION_STAR_DOT_WSDL,
- IBPELUIConstants.EXTENSION_STAR_DOT_ANY};
-
- private String[] FILTER_NAMES = { IBPELUIConstants.EXTENSION_XSD_NAME,
- IBPELUIConstants.EXTENSION_WSDL_NAME,
- IBPELUIConstants.EXTENSION_ANY_NAME };
-
-
+
+ private String[] FILTER_EXTENSIONS = {
+ IBPELUIConstants.EXTENSION_STAR_DOT_XSD,
+ IBPELUIConstants.EXTENSION_STAR_DOT_WSDL,
+ IBPELUIConstants.EXTENSION_STAR_DOT_ANY };
+
+ private String[] FILTER_NAMES = { IBPELUIConstants.EXTENSION_XSD_NAME,
+ IBPELUIConstants.EXTENSION_WSDL_NAME,
+ IBPELUIConstants.EXTENSION_ANY_NAME };
+
+ private String resourceFilter = IBPELUIConstants.EXTENSION_DOT_XSD;
+
protected EObject modelObject;
protected Tree fTree;
@@ -121,325 +120,317 @@
private Composite fLocationComposite;
FileSelectionGroup fResourceComposite;
-
+
// Import from WSIL constructs
private Composite fWSILComposite;
protected TreeViewer fWSILTreeViewer;
protected Tree fWSILTree;
protected Text filterText;
String fFilter = ""; //$NON-NLS-1$
-
-
+
Button fBrowseButton;
private Group fGroup;
-
- private IDialogSettings fSettings ;
-
- private int KIND = BID_BROWSE_RESOURCE ;
+ private IDialogSettings fSettings;
+
+ private int KIND = BID_BROWSE_RESOURCE;
+
private String fStructureTitle;
private ITreeContentProvider fTreeContentProvider;
protected Object fInput;
-
+
protected BPELResourceSetImpl fHackedResourceSet;
-
+
protected String fResourceKind = IBPELUIConstants.EXTENSION_XSD;
long fRunnableStart;
URI fRunnableLoadURI;
Job fLoaderJob;
-
- IPreferenceStore fPrefStore = BPELUIPlugin.INSTANCE.getPreferenceStore();
+
+ IPreferenceStore fPrefStore = BPELUIPlugin.INSTANCE.getPreferenceStore();
String fBasePath = fPrefStore.getString(IBPELUIConstants.PREF_WSIL_URL);
- // The WSIL radio box is turned off if the WSIL document is not set in the preferences.
+ // The WSIL radio box is turned off if the WSIL document is not set in the
+ // preferences.
Button fBtnWSIL;
-
-
+
/**
* Create a brand new shiny Schema Import Dialog.
*
* @param parent
*/
- public SchemaImportDialog (Shell parent) {
-
+ public SchemaImportDialog(Shell parent) {
+
super(parent);
- setStatusLineAboveButtons(true);
- int shellStyle = getShellStyle();
- setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
-
- fSettings = BPELUIPlugin.INSTANCE.getDialogSettingsFor( this );
+ setStatusLineAboveButtons(true);
+ int shellStyle = getShellStyle();
+ setShellStyle(shellStyle | SWT.MAX | SWT.RESIZE);
- try {
- KIND = fSettings.getInt(IMPORT_KIND);
- } catch (java.lang.NumberFormatException nfe) {
- KIND = BID_BROWSE_RESOURCE;
- }
-
- setDialogBoundsSettings ( fSettings, getDialogBoundsStrategy() );
-
- configureAsSchemaImport();
+ fSettings = BPELUIPlugin.INSTANCE.getDialogSettingsFor(this);
+
+ try {
+ KIND = fSettings.getInt(IMPORT_KIND);
+ } catch (java.lang.NumberFormatException nfe) {
+ KIND = BID_BROWSE_RESOURCE;
+ }
+
+ setDialogBoundsSettings(fSettings, getDialogBoundsStrategy());
+
+ configureAsSchemaImport();
}
-
+
/**
* Create a brand new shiny Schema Import Dialog
*
- * @param parent shell to use
- * @param eObject the model object to use as reference
+ * @param parent
+ * shell to use
+ * @param eObject
+ * the model object to use as reference
*/
- public SchemaImportDialog (Shell parent, EObject eObject) {
+ public SchemaImportDialog(Shell parent, EObject eObject) {
this(parent);
-
- this.modelObject = eObject;
+
+ this.modelObject = eObject;
setTitle(Messages.SchemaImportDialog_2);
-
+
fHackedResourceSet = BPELUtils.slightlyHackedResourceSet(eObject);
}
-
-
+
/**
*
- * @see Dialog#createDialogArea(Composite)
- *
- * @param parent the parent composite to use
- * @return the composite it created to be used in the dialog area.
- */
-
- @Override
+ * @see Dialog#createDialogArea(Composite)
+ *
+ * @param parent
+ * the parent composite to use
+ * @return the composite it created to be used in the dialog area.
+ */
+
+ @Override
public Control createDialogArea(Composite parent) {
-
- Composite contents = (Composite) super.createDialogArea(parent);
-
- createImportLocation (contents);
- createImportStructure (contents);
-
- buttonPressed(KIND,true);
- return contents;
- }
-
-
+
+ Composite contents = (Composite) super.createDialogArea(parent);
+
+ createImportLocation(contents);
+ createImportStructure(contents);
+
+ buttonPressed(KIND, true);
+ return contents;
+ }
+
@Override
- protected void buttonPressed (int buttonId) {
+ protected void buttonPressed(int buttonId) {
switch (buttonId) {
- case BID_BROWSE :
+ case BID_BROWSE:
FileDialog fileDialog = new FileDialog(getShell());
- fileDialog.setFilterExtensions( FILTER_EXTENSIONS );
- fileDialog.setFilterNames( FILTER_NAMES );
+ fileDialog.setFilterExtensions(FILTER_EXTENSIONS);
+ fileDialog.setFilterNames(FILTER_NAMES);
String path = fileDialog.open();
if (path == null) {
return;
}
- fLocation.setText( path );
- attemptLoad ( path );
+ fLocation.setText(path);
+ attemptLoad(path);
break;
-
- case IDialogConstants.CANCEL_ID :
+
+ case IDialogConstants.CANCEL_ID:
if (fLoaderJob != null) {
if (fLoaderJob.getState() == Job.RUNNING) {
- fLoaderJob.cancel();
+ fLoaderJob.cancel();
}
- }
+ }
break;
}
-
+
super.buttonPressed(buttonId);
}
-
-
- protected void buttonPressed (int id, boolean checked) {
- if (id == BID_BROWSE_FILE || id == BID_BROWSE_RESOURCE || id == BID_BROWSE_URL || id == BID_BROWSE_WSIL) {
+ protected void buttonPressed(int id, boolean checked) {
+
+ if (id == BID_BROWSE_FILE || id == BID_BROWSE_RESOURCE
+ || id == BID_BROWSE_URL || id == BID_BROWSE_WSIL) {
if (checked == false) {
- return ;
+ return;
}
- setVisibleControl (fResourceComposite, id == BID_BROWSE_RESOURCE );
- setVisibleControl (fLocationComposite ,
- id == BID_BROWSE_URL || id == BID_BROWSE_FILE);
-
+ setVisibleControl(fResourceComposite, id == BID_BROWSE_RESOURCE);
+ setVisibleControl(fLocationComposite, id == BID_BROWSE_URL
+ || id == BID_BROWSE_FILE);
+
setVisibleControl(fWSILComposite, id == BID_BROWSE_WSIL);
-
- fBrowseButton.setEnabled( (id == BID_BROWSE_FILE) || (id == BID_BROWSE_WSIL) );
+
+ fBrowseButton.setEnabled((id == BID_BROWSE_FILE)
+ || (id == BID_BROWSE_WSIL));
fLocation.setText(EMPTY);
-
+
markEmptySelection();
KIND = id;
-
+
fSettings.put(IMPORT_KIND, KIND);
-
- fGroup.getParent().layout(true);
+
+ fGroup.getParent().layout(true);
}
-
+
}
-
-
- protected void setVisibleControl (Control c, boolean b) {
+
+ protected void setVisibleControl(Control c, boolean b) {
Object layoutData = c.getLayoutData();
-
+
if (layoutData instanceof GridData) {
GridData data = (GridData) layoutData;
- data.exclude = ! b;
- }
+ data.exclude = !b;
+ }
c.setVisible(b);
}
-
-
+
/**
* Create the dialog.
*
*/
-
+
@Override
- public void create() {
+ public void create() {
super.create();
- buttonPressed(KIND, true);
+ buttonPressed(KIND, true);
}
+ protected Button createRadioButton(Composite parent, String label, int id,
+ boolean checked) {
- protected Button createRadioButton (Composite parent, String label, int id, boolean checked) {
-
- Button button = new Button(parent,SWT.RADIO);
+ Button button = new Button(parent, SWT.RADIO);
button.setText(label);
button.setFont(JFaceResources.getDialogFont());
- button.setData(new Integer(id));
- button.setSelection( checked );
-
- button.addSelectionListener (new SelectionAdapter() {
+ button.setData(new Integer(id));
+ button.setSelection(checked);
+
+ button.addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected (SelectionEvent event) {
+ public void widgetSelected(SelectionEvent event) {
Button b = (Button) event.widget;
int bid = ((Integer) b.getData()).intValue();
-
+
buttonPressed(bid, b.getSelection());
}
});
-
+
return button;
-
+
}
-
- protected void createImportLocation (Composite parent) {
-
- fGroup = new Group(parent,SWT.SHADOW_ETCHED_IN);
- fGroup.setText(Messages.SchemaImportDialog_4);
- GridLayout layout = new GridLayout(1,true);
- GridData data = new GridData();
- data.grabExcessVerticalSpace = false;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
-
- fGroup.setLayout( layout );
- fGroup.setLayoutData( data );
-
-
- Composite container = new Composite(fGroup, SWT.NONE);
-
- layout = new GridLayout();
- layout.makeColumnsEqualWidth = true;
- layout.numColumns = 4;
+
+ protected void createImportLocation(Composite parent) {
+
+ fGroup = new Group(parent, SWT.SHADOW_ETCHED_IN);
+ fGroup.setText(Messages.SchemaImportDialog_4);
+ GridLayout layout = new GridLayout(1, true);
+ GridData data = new GridData();
+ data.grabExcessVerticalSpace = false;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+
+ fGroup.setLayout(layout);
+ fGroup.setLayoutData(data);
+
+ Composite container = new Composite(fGroup, SWT.NONE);
+
+ layout = new GridLayout();
+ layout.makeColumnsEqualWidth = true;
+ layout.numColumns = 4;
container.setLayout(layout);
- data = new GridData();
- data.grabExcessVerticalSpace = false;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.CENTER;
- container.setLayoutData(data);
-
- createRadioButton(container,Messages.SchemaImportDialog_5, BID_BROWSE_RESOURCE,
- KIND == BID_BROWSE_RESOURCE );
- createRadioButton(container,Messages.SchemaImportDialog_6, BID_BROWSE_FILE,
- KIND == BID_BROWSE_FILE );
- createRadioButton(container,Messages.SchemaImportDialog_7, BID_BROWSE_URL,
- KIND == BID_BROWSE_URL );
-
+ data = new GridData();
+ data.grabExcessVerticalSpace = false;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.CENTER;
+ container.setLayoutData(data);
+
+ createRadioButton(container, Messages.SchemaImportDialog_5,
+ BID_BROWSE_RESOURCE, KIND == BID_BROWSE_RESOURCE);
+ createRadioButton(container, Messages.SchemaImportDialog_6,
+ BID_BROWSE_FILE, KIND == BID_BROWSE_FILE);
+ createRadioButton(container, Messages.SchemaImportDialog_7,
+ BID_BROWSE_URL, KIND == BID_BROWSE_URL);
+
// Add WSIL option
- fBtnWSIL = createRadioButton(container, Messages.SchemaImportDialog_15, BID_BROWSE_WSIL,
- KIND == BID_BROWSE_WSIL);
-
-
- // Create location variant
- fLocationComposite = new Composite(fGroup, SWT.NONE);
-
- layout = new GridLayout();
- layout.numColumns = 3;
+ fBtnWSIL = createRadioButton(container, Messages.SchemaImportDialog_15,
+ BID_BROWSE_WSIL, KIND == BID_BROWSE_WSIL);
+
+ // Create location variant
+ fLocationComposite = new Composite(fGroup, SWT.NONE);
+
+ layout = new GridLayout();
+ layout.numColumns = 3;
fLocationComposite.setLayout(layout);
- data = new GridData();
- data.grabExcessVerticalSpace = true;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- fLocationComposite.setLayoutData(data);
-
- Label location = new Label(fLocationComposite,SWT.NONE);
- location.setText(Messages.SchemaImportDialog_8);
-
- fLocation = new Text(fLocationComposite,SWT.BORDER);
- fLocation.setText(EMPTY);
- data = new GridData();
- data.grabExcessVerticalSpace = false;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- fLocation.setLayoutData(data);
- fLocation.addListener(SWT.FocusOut, new Listener() {
+ data = new GridData();
+ data.grabExcessVerticalSpace = true;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ fLocationComposite.setLayoutData(data);
+ Label location = new Label(fLocationComposite, SWT.NONE);
+ location.setText(Messages.SchemaImportDialog_8);
+
+ fLocation = new Text(fLocationComposite, SWT.BORDER);
+ fLocation.setText(EMPTY);
+ data = new GridData();
+ data.grabExcessVerticalSpace = false;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ fLocation.setLayoutData(data);
+ fLocation.addListener(SWT.FocusOut, new Listener() {
+
public void handleEvent(Event event) {
String loc = fLocation.getText();
if (loc.length() > 0) {
- attemptLoad( loc );
+ attemptLoad(loc);
}
- }
- });
- fLocation.addKeyListener( new KeyListener () {
+ }
+ });
+ fLocation.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent event) {
if (event.keyCode == SWT.CR) {
attemptLoad(fLocation.getText());
event.doit = false;
- }
+ }
}
public void keyReleased(KeyEvent e) {
- return ;
+ return;
}
-
- });
-
-
- fBrowseButton = createButton(fLocationComposite, BID_BROWSE, Messages.SchemaImportDialog_9, false);
-
- // End of location variant
-
- // Start Resource Variant
- fResourceComposite = new FileSelectionGroup(fGroup,
- new Listener() {
- public void handleEvent(Event event) {
- IResource resource = fResourceComposite.getSelectedResource();
- if (resource != null && resource.getType() == IResource.FILE) {
- // only attempt to load a resource which is not a container
- attemptLoad ( (IFile) resource );
- return ;
- }
- markEmptySelection();
- }
- },
-
- Messages.SchemaImportDialog_10,
- IBPELUIConstants.EXTENSION_DOT_XSD + "," + IBPELUIConstants.EXTENSION_DOT_WSDL ); //$NON-NLS-1$
-
-
- TreeViewer viewer = fResourceComposite.getTreeViewer();
- viewer.setAutoExpandLevel(2);
-
- // End resource variant
-
- // create WSIL UI widgets
- createWSILStructure(fGroup);
+ });
+
+ fBrowseButton = createButton(fLocationComposite, BID_BROWSE,
+ Messages.SchemaImportDialog_9, false);
+
+ // End of location variant
+
+ // Start Resource Variant
+ fResourceComposite = new FileSelectionGroup(fGroup, new Listener() {
+ public void handleEvent(Event event) {
+ IResource resource = fResourceComposite.getSelectedResource();
+ if (resource != null && resource.getType() == IResource.FILE) {
+ // only attempt to load a resource which is not a container
+ attemptLoad((IFile) resource);
+ return;
+ }
+ markEmptySelection();
+ }
+ }, Messages.SchemaImportDialog_10, resourceFilter); //$NON-NLS-1$
+
+ TreeViewer viewer = fResourceComposite.getTreeViewer();
+ viewer.setAutoExpandLevel(2);
+
+ // End resource variant
+
+ // create WSIL UI widgets
+ createWSILStructure(fGroup);
+
}
protected Object createWSILStructure(Composite parent) {
@@ -540,66 +531,69 @@
fWSILTreeViewer.expandToLevel(2);
fWSILTreeViewer.addFilter(new TreeFilter());
fWSILTreeViewer.setComparator(new WSILViewerComparator());
-
+
wsilTreeComposite.setChildTree(fWSILTreeViewer);
-
-
- fWSILTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- // TODO Auto-generated method stub
- IStructuredSelection sel = (IStructuredSelection)event.getSelection();
- if (sel.getFirstElement() instanceof Service) {
- Service serv = (Service)sel.getFirstElement();
- Description descr = serv.getDescription().get(0);
- attemptLoad(descr.getLocation() );
- } else {
- markEmptySelection();
- }
- }
- });
+
+ fWSILTreeViewer
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ // TODO Auto-generated method stub
+ IStructuredSelection sel = (IStructuredSelection) event
+ .getSelection();
+ if (sel.getFirstElement() instanceof Service) {
+ Service serv = (Service) sel.getFirstElement();
+ Description descr = serv.getDescription().get(0);
+ attemptLoad(descr.getLocation());
+ } else {
+ markEmptySelection();
+ }
+ }
+ });
// end tree viewer for variable structure
-
+
return fWSILComposite;
}
- protected Object createImportStructure (Composite parent) {
-
- Label location = new Label(parent,SWT.NONE);
- location.setText( fStructureTitle );
-
- // Tree viewer for variable structure ...
- fTree = new Tree(parent, SWT.BORDER );
-
- VariableTypeTreeContentProvider variableContentProvider = new VariableTypeTreeContentProvider(true, true);
+ protected Object createImportStructure(Composite parent) {
+
+ Label location = new Label(parent, SWT.NONE);
+ location.setText(fStructureTitle);
+
+ // Tree viewer for variable structure ...
+ fTree = new Tree(parent, SWT.BORDER);
+
+ VariableTypeTreeContentProvider variableContentProvider = new VariableTypeTreeContentProvider(
+ true, true);
fTreeViewer = new TreeViewer(fTree);
- fTreeViewer.setContentProvider( fTreeContentProvider != null ? fTreeContentProvider : variableContentProvider );
+ fTreeViewer
+ .setContentProvider(fTreeContentProvider != null ? fTreeContentProvider
+ : variableContentProvider);
fTreeViewer.setLabelProvider(new ModelTreeLabelProvider());
- fTreeViewer.setInput ( null );
+ fTreeViewer.setInput(null);
fTreeViewer.setAutoExpandLevel(3);
// end tree viewer for variable structure
- GridData data = new GridData();
- data.grabExcessVerticalSpace = true;
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.FILL;
- data.minimumHeight = 200;
- fTree.setLayoutData(data);
-
+ GridData data = new GridData();
+ data.grabExcessVerticalSpace = true;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ data.minimumHeight = 200;
+ fTree.setLayoutData(data);
+
return fTree;
}
+ Object attemptLoad(URI uri, String kind) {
- Object attemptLoad ( URI uri, String kind) {
-
- Resource resource = null;
- try {
- resource = fHackedResourceSet.getResource(uri, true, kind);
- } catch (Throwable t) {
+ Resource resource = null;
+ try {
+ resource = fHackedResourceSet.getResource(uri, true, kind);
+ } catch (Throwable t) {
// BPELUIPlugin.log(t);
return t;
- }
-
- if (resource.getErrors().isEmpty() && resource.isLoaded() ) {
+ }
+
+ if (resource.getErrors().isEmpty() && resource.isLoaded()) {
return resource.getContents().get(0);
}
return null;
@@ -742,103 +736,117 @@
/**
* Update the state of the OK button to the state indicated.
*
- * @param state false to disable, true to enable.
+ * @param state
+ * false to disable, true to enable.
*/
-
- public void updateOK ( boolean state ) {
+
+ public void updateOK(boolean state) {
Button okButton = getOkButton();
- if (okButton != null && !okButton.isDisposed()) {
+ if (okButton != null && !okButton.isDisposed()) {
okButton.setEnabled(state);
}
}
-
+
/**
* @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
*/
-
+
@Override
protected void computeResult() {
Object object = fTreeViewer.getInput();
if (object == null) {
- return ;
+ return;
}
- setSelectionResult(new Object[]{ object });
+ setSelectionResult(new Object[] { object });
}
-
-
+
/**
- * Configure the dialog as a schema import dialog. Set the title and
- * the structure pane message.
- *
+ * Configure the dialog as a schema import dialog. Set the title and the
+ * structure pane message.
+ *
*/
-
- public void configureAsSchemaImport ( ) {
+
+ public void configureAsSchemaImport() {
setTitle(Messages.SchemaImportDialog_2);
fStructureTitle = Messages.SchemaImportDialog_11;
fResourceKind = IBPELUIConstants.EXTENSION_XSD;
}
-
+
/**
- * Configure the dialog as a WSDL import dialog. Set the title and
- * the structure pane message.
- *
+ * Configure the dialog as a WSDL import dialog. Set the title and the
+ * structure pane message.
+ *
*/
-
- public void configureAsWSDLImport ( ) {
-
+
+ public void configureAsWSDLImport() {
+
setTitle(Messages.SchemaImportDialog_0);
fStructureTitle = Messages.SchemaImportDialog_14;
fTreeContentProvider = new PartnerLinkTypeTreeContentProvider(true);
fResourceKind = IBPELUIConstants.EXTENSION_WSDL;
+
+ String[] wsdl_FILTER_EXTENSIONS = {
+ IBPELUIConstants.EXTENSION_STAR_DOT_WSDL,
+ IBPELUIConstants.EXTENSION_STAR_DOT_XSD,
+ IBPELUIConstants.EXTENSION_STAR_DOT_ANY };
+ FILTER_EXTENSIONS = wsdl_FILTER_EXTENSIONS;
+ String[] wsdl_FILTER_NAMES = { IBPELUIConstants.EXTENSION_WSDL_NAME,
+ IBPELUIConstants.EXTENSION_XSD_NAME,
+ IBPELUIConstants.EXTENSION_ANY_NAME };
+ FILTER_NAMES = wsdl_FILTER_NAMES;
+
+ resourceFilter = IBPELUIConstants.EXTENSION_DOT_WSDL;
+
}
-
-
/**
*
* @author Michal Chmielewski (michal.chmielewski(a)oracle.com)
* @date May 4, 2007
- *
+ *
*/
public class TreeFilter extends ViewerFilter {
-
- /** (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+
+ /**
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
*/
@Override
- public boolean select (Viewer viewer, Object parentElement, Object element) {
-
+ public boolean select(Viewer viewer, Object parentElement,
+ Object element) {
+
if (fFilter == null || fFilter.length() == 0) {
return true;
- }
-
+ }
+
if (element instanceof Service) {
String text = ""; //$NON-NLS-1$
- Service service = (Service)element;
+ Service service = (Service) element;
if (service.getName().size() > 0) {
Name name = service.getName().get(0);
text += name.getValue();
- }
+ }
if (service.getAbstract().size() > 0) {
TypeOfAbstract abst = service.getAbstract().get(0);
text += abst.getValue();
}
return (text.toLowerCase().indexOf(fFilter) > -1);
}
-
+
return true;
}
}
-
-
+
/**
*
* @author Michal Chmielewski (michal.chmielewski(a)oracle.com)
* @date May 10, 2007
- *
+ *
*/
public class WSILViewerComparator extends ViewerComparator {
-
+
/**
* @see org.eclipse.jface.viewers.ViewerComparator#category(java.lang.Object)
*/
@@ -850,7 +858,7 @@
return 2;
if (element instanceof Service)
return 3;
-
+
return 0;
}
}
15 years, 6 months
JBoss Tools SVN: r15843 - trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-06-10 05:49:38 -0400 (Wed, 10 Jun 2009)
New Revision: 15843
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModulesToEarPropertiesPage.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java
Log:
It WORKS =DDD
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-06-10 09:42:34 UTC (rev 15842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-06-10 09:49:38 UTC (rev 15843)
@@ -15,12 +15,16 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
+import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -45,15 +49,22 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.window.Window;
+import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider;
+import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationDataModelProvider;
+import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
import org.eclipse.jst.j2ee.internal.AvailableJ2EEComponentsForEARContentProvider;
import org.eclipse.jst.j2ee.internal.IJ2EEDependenciesControl;
+import org.eclipse.jst.j2ee.internal.J2EEConstants;
import org.eclipse.jst.j2ee.internal.ManifestUIResourceHandler;
import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil;
+import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
+import org.eclipse.jst.j2ee.project.facet.IJavaProjectMigrationDataModelProperties;
+import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationDataModelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
@@ -77,18 +88,24 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.datamodel.properties.ICreateReferenceComponentsDataModelProperties;
+import org.eclipse.wst.common.componentcore.internal.operation.CreateReferenceComponentsDataModelProvider;
+import org.eclipse.wst.common.componentcore.internal.operation.RemoveReferenceComponentsDataModelProvider;
import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
+public abstract class AddModuleDependenciesPropertiesPage implements Listener,
+ IJ2EEDependenciesControl {
-public abstract class AddModuleDependenciesPropertiesPage implements Listener, IJ2EEDependenciesControl {
-
- protected final String PATH_SEPARATOR = ComponentDependencyContentProvider.PATH_SEPARATOR;
+ protected final String PATH_SEPARATOR = ComponentDependencyContentProvider.PATH_SEPARATOR;
protected boolean showRuntimePath;
protected final IProject project;
- protected final J2EEDependenciesPage propPage;
+ protected final J2EEDependenciesPage propPage;
protected IVirtualComponent rootComponent = null;
protected Text componentNameText;
protected Label availableModules;
@@ -103,22 +120,23 @@
protected static final IStatus OK_STATUS = IDataModelProvider.OK_STATUS;
protected Listener tableListener;
protected Listener labelListener;
-
protected HashMap<IVirtualComponent, String> oldComponentToRuntimePath = new HashMap<IVirtualComponent, String>();
-
- // This should keep a list of all elements currently in the list, even if unchecked
+
+ // This should keep a list of all elements currently in the list, even if
+ // unchecked
protected HashMap<Object, String> objectToRuntimePath = new HashMap<Object, String>();
-
-
- //[Bug 238264] the cached list elements that are new and need to be manually added to the viewer
+
+ // [Bug 238264] the cached list elements that are new and need to be
+ // manually added to the viewer
// Can be an IProject or IVirtualComponent
- protected ArrayList<Object> addedElements= new ArrayList<Object>();
+ protected ArrayList<Object> addedElements = new ArrayList<Object>();
/**
* Constructor for AddModulestoEARPropertiesControl.
*/
- public AddModuleDependenciesPropertiesPage(final IProject project, final J2EEDependenciesPage page) {
+ public AddModuleDependenciesPropertiesPage(final IProject project,
+ final J2EEDependenciesPage page) {
this.project = project;
this.propPage = page;
rootComponent = ComponentCore.createComponent(project);
@@ -128,26 +146,27 @@
protected boolean getShowRuntimePath() {
return this.showRuntimePath;
}
-
+
protected void setShowRuntimePath(boolean bool) {
this.showRuntimePath = bool;
- }
-
+ }
+
/*
* UI Creation Methods
*/
-
- public Composite createContents(final Composite parent) {
+
+ public Composite createContents(final Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginWidth = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- J2EEDependenciesPage.createDescriptionComposite(composite, ManifestUIResourceHandler.EAR_Modules_Desc);
+ J2EEDependenciesPage.createDescriptionComposite(composite,
+ ManifestUIResourceHandler.EAR_Modules_Desc);
createListGroup(composite);
refresh();
- Dialog.applyDialogFont(parent);
+ Dialog.applyDialogFont(parent);
return composite;
}
@@ -163,12 +182,14 @@
listGroup.setLayoutData(gData);
availableModules = new Label(listGroup, SWT.NONE);
- gData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
- availableModules.setText(J2EEUIMessages.getResourceString("AVAILABLE_J2EE_COMPONENTS")); //$NON-NLS-1$ = "Available dependent JARs:"
+ gData = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_FILL);
+ availableModules.setText(J2EEUIMessages
+ .getResourceString("AVAILABLE_J2EE_COMPONENTS")); //$NON-NLS-1$ = "Available dependent JARs:"
availableModules.setLayoutData(gData);
createTableComposite(listGroup);
}
-
+
protected void createTableComposite(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridData gData = new GridData(GridData.FILL_BOTH);
@@ -195,15 +216,18 @@
// TODO add a project button here
protected void createPushButtons() {
- String SELECT_ALL_BUTTON = ManifestUIResourceHandler.Select_All_3;
- String DE_SELECT_ALL_BUTTON = ManifestUIResourceHandler.Deselect_All_4;
+ String SELECT_ALL_BUTTON = ManifestUIResourceHandler.Select_All_3;
+ String DE_SELECT_ALL_BUTTON = ManifestUIResourceHandler.Deselect_All_4;
selectAllButton = createPushButton(SELECT_ALL_BUTTON);
deselectAllButton = createPushButton(DE_SELECT_ALL_BUTTON);
projectButton = createPushButton("Add Project...");
- projectJarButton = createPushButton(J2EEUIMessages.getResourceString(J2EEUIMessages.PROJECT_JAR));
- externalJarButton = createPushButton(J2EEUIMessages.getResourceString(J2EEUIMessages.EXTERNAL_JAR));
- addVariableButton = createPushButton(J2EEUIMessages.getResourceString(J2EEUIMessages.ADDVARIABLE));
+ projectJarButton = createPushButton(J2EEUIMessages
+ .getResourceString(J2EEUIMessages.PROJECT_JAR));
+ externalJarButton = createPushButton(J2EEUIMessages
+ .getResourceString(J2EEUIMessages.EXTERNAL_JAR));
+ addVariableButton = createPushButton(J2EEUIMessages
+ .getResourceString(J2EEUIMessages.ADDVARIABLE));
}
protected Button createPushButton(String label) {
@@ -221,7 +245,8 @@
layout.marginHeight = 0;
layout.marginWidth = 0;
aButtonColumn.setLayout(layout);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_BEGINNING);
aButtonColumn.setLayoutData(data);
return aButtonColumn;
}
@@ -232,7 +257,8 @@
protected void createTable(Composite parent) {
availableComponentsViewer = createAvailableComponentsViewer(parent);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
+ GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.FILL_VERTICAL);
availableComponentsViewer.getTable().setLayoutData(gd);
if (rootComponent != null) {
@@ -240,127 +266,148 @@
provider.setRuntimePaths(objectToRuntimePath);
availableComponentsViewer.setContentProvider(provider);
availableComponentsViewer.setLabelProvider(provider);
- availableComponentsViewer.setFilters(new ViewerFilter[]{provider});
+ availableComponentsViewer
+ .setFilters(new ViewerFilter[] { provider });
addTableListeners();
}
}
-
+
/**
- * Subclasses should over-ride this and extend the class
+ * Subclasses should over-ride this and extend the class
*/
protected ComponentDependencyContentProvider createProvider() {
- int j2eeVersion = J2EEVersionUtil.convertVersionStringToInt(rootComponent);
+ int j2eeVersion = J2EEVersionUtil
+ .convertVersionStringToInt(rootComponent);
return new ComponentDependencyContentProvider(rootComponent);
}
/*
* Listeners of various events
*/
-
+
protected void addTableListeners() {
addCheckStateListener();
addHoverHelpListeners();
addDoubleClickListener();
}
-
+
protected void addHoverHelpListeners() {
- final Table table = availableComponentsViewer.getTable();
+ final Table table = availableComponentsViewer.getTable();
createLabelListener(table);
createTableListener(table);
table.addListener(SWT.Dispose, tableListener);
table.addListener(SWT.KeyDown, tableListener);
- table.addListener(SWT.MouseMove, tableListener);
- table.addListener(SWT.MouseHover, tableListener);
+ table.addListener(SWT.MouseMove, tableListener);
+ table.addListener(SWT.MouseHover, tableListener);
}
-
+
protected void createLabelListener(final Table table) {
- labelListener = new Listener () {
- public void handleEvent (Event event) {
- Label label = (Label)event.widget;
- Shell shell = label.getShell ();
+ labelListener = new Listener() {
+ public void handleEvent(Event event) {
+ Label label = (Label) event.widget;
+ Shell shell = label.getShell();
switch (event.type) {
- case SWT.MouseDown:
- Event e = new Event ();
- e.item = (TableItem) label.getData ("_TABLEITEM");
- table.setSelection (new TableItem [] {(TableItem) e.item});
- table.notifyListeners (SWT.Selection, e);
- shell.dispose ();
- table.setFocus();
- break;
- case SWT.MouseExit:
- shell.dispose ();
- break;
+ case SWT.MouseDown:
+ Event e = new Event();
+ e.item = (TableItem) label.getData("_TABLEITEM");
+ table.setSelection(new TableItem[] { (TableItem) e.item });
+ table.notifyListeners(SWT.Selection, e);
+ shell.dispose();
+ table.setFocus();
+ break;
+ case SWT.MouseExit:
+ shell.dispose();
+ break;
}
}
};
}
-
+
protected void createTableListener(final Table table) {
- tableListener = new Listener () {
+ tableListener = new Listener() {
Shell tip = null;
Label label = null;
- public void handleEvent (Event event) {
+
+ public void handleEvent(Event event) {
switch (event.type) {
- case SWT.Dispose:
- case SWT.KeyDown:
- case SWT.MouseMove: {
- if (tip == null) break;
- tip.dispose ();
- tip = null;
- label = null;
+ case SWT.Dispose:
+ case SWT.KeyDown:
+ case SWT.MouseMove: {
+ if (tip == null)
break;
+ tip.dispose();
+ tip = null;
+ label = null;
+ break;
+ }
+ case SWT.MouseHover: {
+ TableItem item = table.getItem(new Point(event.x, event.y));
+ if (item != null) {
+ if (!item.getGrayed())
+ return;
+ if (tip != null && !tip.isDisposed())
+ tip.dispose();
+ tip = new Shell(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell(),
+ SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
+ tip.setBackground(Display.getDefault().getSystemColor(
+ SWT.COLOR_INFO_BACKGROUND));
+ FillLayout layout = new FillLayout();
+ layout.marginWidth = 2;
+ tip.setLayout(layout);
+ label = new Label(tip, SWT.WRAP);
+ label.setForeground(Display.getDefault()
+ .getSystemColor(SWT.COLOR_INFO_FOREGROUND));
+ label.setBackground(Display.getDefault()
+ .getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+ label.setData("_TABLEITEM", item); //$NON-NLS-1$
+ label
+ .setText(J2EEUIMessages
+ .getResourceString(J2EEUIMessages.HOVER_HELP_FOR_DISABLED_LIBS));
+ label.addListener(SWT.MouseExit, labelListener);
+ label.addListener(SWT.MouseDown, labelListener);
+ Point size = tip.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Rectangle rect = item.getBounds(0);
+ Point pt = table.toDisplay(rect.x, rect.y);
+ tip.setBounds(pt.x, pt.y - size.y, size.x, size.y);
+ tip.setVisible(true);
}
- case SWT.MouseHover: {
- TableItem item = table.getItem (new Point (event.x, event.y));
- if (item != null) {
- if (!item.getGrayed())
- return;
- if (tip != null && !tip.isDisposed ()) tip.dispose ();
- tip = new Shell (PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getShell(), SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
- tip.setBackground (Display.getDefault().getSystemColor (SWT.COLOR_INFO_BACKGROUND));
- FillLayout layout = new FillLayout ();
- layout.marginWidth = 2;
- tip.setLayout (layout);
- label = new Label (tip, SWT.WRAP);
- label.setForeground (Display.getDefault().getSystemColor (SWT.COLOR_INFO_FOREGROUND));
- label.setBackground (Display.getDefault().getSystemColor (SWT.COLOR_INFO_BACKGROUND));
- label.setData ("_TABLEITEM", item); //$NON-NLS-1$
- label.setText (J2EEUIMessages.getResourceString(J2EEUIMessages.HOVER_HELP_FOR_DISABLED_LIBS));
- label.addListener (SWT.MouseExit, labelListener);
- label.addListener (SWT.MouseDown, labelListener);
- Point size = tip.computeSize (SWT.DEFAULT, SWT.DEFAULT);
- Rectangle rect = item.getBounds (0);
- Point pt = table.toDisplay (rect.x, rect.y);
- tip.setBounds (pt.x, pt.y - size.y, size.x, size.y);
- tip.setVisible (true);
- }
- }
}
+ }
}
- };
+ };
}
protected void addDoubleClickListener() {
- availableComponentsViewer.setColumnProperties(new String[] {"a", "b", "c"});
- CellEditor[] editors = new CellEditor[]{new TextCellEditor(), new TextCellEditor(), new TextCellEditor(availableComponentsViewer.getTable())};
+ availableComponentsViewer.setColumnProperties(new String[] { "a", "b",
+ "c" });
+ CellEditor[] editors = new CellEditor[] { new TextCellEditor(),
+ new TextCellEditor(),
+ new TextCellEditor(availableComponentsViewer.getTable()) };
availableComponentsViewer.setCellEditors(editors);
- availableComponentsViewer.setCellModifier(new RuntimePathCellModifier());
+ availableComponentsViewer
+ .setCellModifier(new RuntimePathCellModifier());
}
-
+
private class RuntimePathCellModifier implements ICellModifier {
public boolean canModify(Object element, String property) {
- int columnIndex = Arrays.asList(availableComponentsViewer.getColumnProperties()).indexOf(property);
- if( columnIndex == 2 ) {
- if( element instanceof VirtualArchiveComponent ) {
+ int columnIndex = Arrays.asList(
+ availableComponentsViewer.getColumnProperties()).indexOf(
+ property);
+ if (columnIndex == 2) {
+ if (element instanceof VirtualArchiveComponent) {
try {
- boolean sameProject =
- ((VirtualArchiveComponent)element).getWorkspaceRelativePath() != null
- && ((VirtualArchiveComponent)element).getWorkspaceRelativePath().segment(0)
- .equals(rootComponent.getProject().getName());
- return !(sameProject && isPhysicallyAdded(((VirtualArchiveComponent)element)));
- } catch( IllegalArgumentException iae) {}
+ boolean sameProject = ((VirtualArchiveComponent) element)
+ .getWorkspaceRelativePath() != null
+ && ((VirtualArchiveComponent) element)
+ .getWorkspaceRelativePath().segment(0)
+ .equals(
+ rootComponent.getProject()
+ .getName());
+ return !(sameProject && isPhysicallyAdded(((VirtualArchiveComponent) element)));
+ } catch (IllegalArgumentException iae) {
+ }
}
return true;
}
@@ -368,19 +415,18 @@
}
public Object getValue(Object element, String property) {
- return objectToRuntimePath.get(element) == null ?
- new Path("/").toString() :
- objectToRuntimePath.get(element);
+ return objectToRuntimePath.get(element) == null ? new Path("/")
+ .toString() : objectToRuntimePath.get(element);
}
public void modify(Object element, String property, Object value) {
- if( element instanceof TableItem ) {
- TableItem item = (TableItem)element;
- item.setText(2, (String)value);
- objectToRuntimePath.put(item.getData(), (String)value);
+ if (element instanceof TableItem) {
+ TableItem item = (TableItem) element;
+ item.setText(2, (String) value);
+ objectToRuntimePath.put(item.getData(), (String) value);
}
}
-
+
}
public void handleEvent(Event event) {
@@ -388,48 +434,48 @@
handleSelectAllButtonPressed();
else if (event.widget == deselectAllButton)
handleDeselectAllButtonPressed();
- else if(event.widget == projectButton)
+ else if (event.widget == projectButton)
handleSelectProjectButton();
- else if(event.widget == projectJarButton)
+ else if (event.widget == projectJarButton)
handleSelectProjectJarButton();
- else if(event.widget == externalJarButton)
+ else if (event.widget == externalJarButton)
handleSelectExternalJarButton();
- else if(event.widget == addVariableButton)
+ else if (event.widget == addVariableButton)
handleSelectVariableButton();
}
-
+
private void handleSelectAllButtonPressed() {
- TableItem[] children = availableComponentsViewer.getTable().getItems();
- for (int i = 0; i < children.length; i++) {
- TableItem item = children[i];
- if( !item.getGrayed())
- item.setChecked(true);
- }
+ TableItem[] children = availableComponentsViewer.getTable().getItems();
+ for (int i = 0; i < children.length; i++) {
+ TableItem item = children[i];
+ if (!item.getGrayed())
+ item.setChecked(true);
+ }
}
private void handleDeselectAllButtonPressed() {
- TableItem[] children = availableComponentsViewer.getTable().getItems();
- for (int i = 0; i < children.length; i++) {
- TableItem item = children[i];
- if( !item.getGrayed())
- item.setChecked(false);
- }
+ TableItem[] children = availableComponentsViewer.getTable().getItems();
+ for (int i = 0; i < children.length; i++) {
+ TableItem item = children[i];
+ if (!item.getGrayed())
+ item.setChecked(false);
+ }
}
-
+
private void handleSelectProjectButton() {
- SelectProjectDialog d = new SelectProjectDialog(
- new Shell(), getProjectLabelProvider(), getProjectContentProvider());
- if( d.open() == Window.OK) {
- IProject selected = (IProject)d.getFirstResult();
+ SelectProjectDialog d = new SelectProjectDialog(new Shell(),
+ getProjectLabelProvider(), getProjectContentProvider());
+ if (d.open() == Window.OK) {
+ IProject selected = (IProject) d.getFirstResult();
addedElements.add(selected);
refresh();
TableItem[] items = availableComponentsViewer.getTable().getItems();
- for( int i = 0; i < items.length; i++ )
- if( items[i].getData().equals(selected))
+ for (int i = 0; i < items.length; i++)
+ if (items[i].getData().equals(selected))
items[i].setChecked(true);
}
}
-
+
protected class SelectProjectDialog extends ElementTreeSelectionDialog {
public SelectProjectDialog(Shell parent, ILabelProvider labelProvider,
ITreeContentProvider contentProvider) {
@@ -439,154 +485,171 @@
setInput(ResourcesPlugin.getWorkspace());
}
}
+
protected ILabelProvider getProjectLabelProvider() {
return new LabelProvider() {
- public Image getImage(Object element) {
- if( element instanceof IProject )
- return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_PROJECT);
- return null;
- }
- public String getText(Object element) {
- if( element instanceof IProject )
- return ((IProject)element).getName();
- return element == null ? "" : element.toString();//$NON-NLS-1$
- }
+ public Image getImage(Object element) {
+ if (element instanceof IProject)
+ return PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_PROJECT);
+ return null;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof IProject)
+ return ((IProject) element).getName();
+ return element == null ? "" : element.toString();//$NON-NLS-1$
+ }
};
}
+
protected ITreeContentProvider getProjectContentProvider() {
return new ITreeContentProvider() {
public Object[] getElements(Object inputElement) {
return ResourcesPlugin.getWorkspace().getRoot().getProjects();
}
+
public Object[] getChildren(Object parentElement) {
return null;
}
+
public Object getParent(Object element) {
return null;
}
+
public boolean hasChildren(Object element) {
return false;
}
+
public void dispose() {
}
+
public void inputChanged(Viewer viewer, Object oldInput,
Object newInput) {
}
-
+
};
}
-
+
protected IProject[] filterAddProjectList(IProject[] list) {
return list;
}
-
-
+
/**
- * [Bug 238264]
- * Add an archive as a potential new reference for this.earComponent
- * NOTE1: the given archive will not be added as a potential reference if there is already a reference to it
- * NOTE2: the given archive will only be added as an actual reference when this.performOk is invoked
+ * [Bug 238264] Add an archive as a potential new reference for
+ * this.earComponent NOTE1: the given archive will not be added as a
+ * potential reference if there is already a reference to it NOTE2: the
+ * given archive will only be added as an actual reference when
+ * this.performOk is invoked
*
- * @param archive the archive to add as a potential new reference in this.earComponent
- *
+ * @param archive
+ * the archive to add as a potential new reference in
+ * this.earComponent
+ *
*/
private void addPotentialNewReference(IVirtualComponent archive) {
- //check to see if a reference to the given archive already exists
- IVirtualReference [] existingRefs = rootComponent.getReferences();
+ // check to see if a reference to the given archive already exists
+ IVirtualReference[] existingRefs = rootComponent.getReferences();
IVirtualComponent referencedComponent;
boolean refAlreadyExists = false;
- for(int i=0;i<existingRefs.length && !refAlreadyExists;i++){
+ for (int i = 0; i < existingRefs.length && !refAlreadyExists; i++) {
referencedComponent = existingRefs[i].getReferencedComponent();
refAlreadyExists = referencedComponent.equals(archive);
}
-
+
// verify it's not already in the list... ugh
TableItem[] allItems = availableComponentsViewer.getTable().getItems();
- for( int i = 0; i < allItems.length; i++ ) {
- if( allItems[i].getData().equals(archive)) {
+ for (int i = 0; i < allItems.length; i++) {
+ if (allItems[i].getData().equals(archive)) {
allItems[i].setChecked(true);
refAlreadyExists = true;
}
}
-
- // only add the archive as a potentialy new reference if it does not already exist
+
+ // only add the archive as a potentialy new reference if it does not
+ // already exist
// also force check it
- if(!refAlreadyExists) {
+ if (!refAlreadyExists) {
this.objectToRuntimePath.put(archive, new Path("/").toString());
this.addedElements.add(archive);
availableComponentsViewer.add(archive);
TableItem[] items = availableComponentsViewer.getTable().getItems();
- for( int i = 0; i < items.length; i++ ) {
- if(items[i].getData().equals(archive))
+ for (int i = 0; i < items.length; i++) {
+ if (items[i].getData().equals(archive))
items[i].setChecked(true);
}
-
+
} else {
- //TODO should inform user that they selected an already referenced archive?
+ // TODO should inform user that they selected an already referenced
+ // archive?
}
}
-
- private void handleSelectExternalJarButton(){
- IPath[] selected= BuildPathDialogAccess.chooseExternalJAREntries(propPage.getShell());
+ private void handleSelectExternalJarButton() {
+ IPath[] selected = BuildPathDialogAccess
+ .chooseExternalJAREntries(propPage.getShell());
+
if (selected != null) {
- for (int i= 0; i < selected.length; i++) {
-
- String type = VirtualArchiveComponent.LIBARCHIVETYPE + IPath.SEPARATOR;
- IVirtualComponent archive = ComponentCore.createArchiveComponent( rootComponent.getProject(), type +
- selected[i].toString());
-
+ for (int i = 0; i < selected.length; i++) {
+
+ String type = VirtualArchiveComponent.LIBARCHIVETYPE
+ + IPath.SEPARATOR;
+ IVirtualComponent archive = ComponentCore
+ .createArchiveComponent(rootComponent.getProject(),
+ type + selected[i].toString());
+
this.addPotentialNewReference(archive);
}
refresh();
}
-
+
}
- private void handleSelectVariableButton(){
+ private void handleSelectVariableButton() {
IPath existingPath[] = new Path[0];
- IPath[] paths = BuildPathDialogAccess.chooseVariableEntries(propPage.getShell(), existingPath);
-
+ IPath[] paths = BuildPathDialogAccess.chooseVariableEntries(propPage
+ .getShell(), existingPath);
+
if (paths != null) {
refresh();
for (int i = 0; i < paths.length; i++) {
- IPath resolvedPath= JavaCore.getResolvedVariablePath(paths[i]);
+ IPath resolvedPath = JavaCore.getResolvedVariablePath(paths[i]);
java.io.File file = new java.io.File(resolvedPath.toOSString());
- if( file.isFile() && file.exists()){
- String type = VirtualArchiveComponent.VARARCHIVETYPE + IPath.SEPARATOR;
-
- IVirtualComponent archive = ComponentCore.createArchiveComponent( rootComponent.getProject(), type +
- paths[i].toString());
-
+ if (file.isFile() && file.exists()) {
+ String type = VirtualArchiveComponent.VARARCHIVETYPE
+ + IPath.SEPARATOR;
+
+ IVirtualComponent archive = ComponentCore
+ .createArchiveComponent(rootComponent.getProject(),
+ type + paths[i].toString());
+
this.addPotentialNewReference(archive);
- }else{
- //display error
+ } else {
+ // display error
}
}
refresh();
- }
+ }
}
-
-
// TODO FIX THIS
protected void addCheckStateListener() {
- availableComponentsViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- CheckboxTableViewer vr = (CheckboxTableViewer)event.getSource();
- Object element = event.getElement();
- if (vr.getGrayed(element))
- vr.setChecked(element, !vr.getChecked(element));
- Object o = event.getSource();
-
- // TODO : check for conflict + dependency res
- }
- });
+ availableComponentsViewer
+ .addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ CheckboxTableViewer vr = (CheckboxTableViewer) event
+ .getSource();
+ Object element = event.getElement();
+ if (vr.getGrayed(element))
+ vr.setChecked(element, !vr.getChecked(element));
+ Object o = event.getSource();
+
+ // TODO : check for conflict + dependency res
+ }
+ });
}
-
-
public CheckboxTableViewer createAvailableComponentsViewer(Composite parent) {
int flags = SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI;
@@ -597,7 +660,7 @@
TableLayout tableLayout = new org.eclipse.jface.viewers.TableLayout();
tableLayout.addColumnData(new ColumnWeightData(300, true));
tableLayout.addColumnData(new ColumnWeightData(300, true));
- if (showRuntimePath)
+ if (showRuntimePath)
tableLayout.addColumnData(new ColumnWeightData(200, true));
table.setLayout(tableLayout);
table.setHeaderVisible(true);
@@ -606,24 +669,24 @@
// table columns
TableColumn fileNameColumn = new TableColumn(table, SWT.NONE, 0);
- fileNameColumn.setText(ManifestUIResourceHandler.JAR_Module_UI_);
+ fileNameColumn.setText(ManifestUIResourceHandler.JAR_Module_UI_);
fileNameColumn.setResizable(true);
TableColumn projectColumn = new TableColumn(table, SWT.NONE, 1);
- projectColumn.setText(ManifestUIResourceHandler.Project_UI_);
+ projectColumn.setText(ManifestUIResourceHandler.Project_UI_);
projectColumn.setResizable(true);
-
+
if (showRuntimePath) {
TableColumn bndColumn = new TableColumn(table, SWT.NONE, 2);
- bndColumn.setText(ManifestUIResourceHandler.Packed_In_Lib_UI_);
- bndColumn.setResizable(true);
+ bndColumn.setText(ManifestUIResourceHandler.Packed_In_Lib_UI_);
+ bndColumn.setResizable(true);
}
-
+
tableLayout.layout(table, true);
return availableComponentsViewer;
}
-
+
protected boolean isPhysicallyAdded(VirtualArchiveComponent component) {
IPath p = null;
try {
@@ -632,101 +695,121 @@
} catch (IllegalArgumentException e) {
return false;
}
- }
+ }
+
private boolean secondShouldBeDisabled(IVirtualComponent component) {
- if(component.isBinary()) return false;
- if (JavaEEProjectUtilities.isApplicationClientComponent(component)) return true;
- if (JavaEEProjectUtilities.isEARProject(component.getProject()) && component.isBinary()) return false;
- if (JavaEEProjectUtilities.isEJBComponent(component)) return true;
- if (JavaEEProjectUtilities.isDynamicWebComponent(component)) return true;
- if (JavaEEProjectUtilities.isJCAComponent(component)) return true;
- if (JavaEEProjectUtilities.isStaticWebProject(component.getProject())) return true;
- if (JavaEEProjectUtilities.isProjectOfType(component.getProject(), IJ2EEFacetConstants.JAVA)) return false;
+ if (component.isBinary())
+ return false;
+ if (JavaEEProjectUtilities.isApplicationClientComponent(component))
+ return true;
+ if (JavaEEProjectUtilities.isEARProject(component.getProject())
+ && component.isBinary())
+ return false;
+ if (JavaEEProjectUtilities.isEJBComponent(component))
+ return true;
+ if (JavaEEProjectUtilities.isDynamicWebComponent(component))
+ return true;
+ if (JavaEEProjectUtilities.isJCAComponent(component))
+ return true;
+ if (JavaEEProjectUtilities.isStaticWebProject(component.getProject()))
+ return true;
+ if (JavaEEProjectUtilities.isProjectOfType(component.getProject(),
+ IJ2EEFacetConstants.JAVA))
+ return false;
return false;
}
-
-
private boolean isInLibDir(VirtualArchiveComponent comp) {
IPath p = comp.getProjectRelativePath();
if (p.segmentCount() == 2)
return false;
return true;
}
-
+
private boolean isConflict(Object lib) {
- IProject libProj = (lib instanceof IProject) ? (IProject)lib : ((IVirtualComponent)lib).getProject();
- IProject earProject = rootComponent.getProject();
- try {
+ IProject libProj = (lib instanceof IProject) ? (IProject) lib
+ : ((IVirtualComponent) lib).getProject();
+ IProject earProject = rootComponent.getProject();
+ try {
IVirtualComponent cmp = ComponentCore.createComponent(earProject);
IProject[] earRefProjects = earProject.getReferencedProjects();
- for (int i = 0; i < earRefProjects.length; i++) {
- if (!J2EEProjectUtilities.isEARProject(earRefProjects[i]) &&
- !earRefProjects[i].equals(libProj)) {
- IVirtualComponent cmp1 = ComponentCore.createComponent(earRefProjects[i]);
+ for (int i = 0; i < earRefProjects.length; i++) {
+ if (!J2EEProjectUtilities.isEARProject(earRefProjects[i])
+ && !earRefProjects[i].equals(libProj)) {
+ IVirtualComponent cmp1 = ComponentCore
+ .createComponent(earRefProjects[i]);
IVirtualReference[] refs = cmp1.getReferences();
for (int j = 0; j < refs.length; j++) {
- if (refs[j].getReferencedComponent().getProject().equals(libProj)) return true;
+ if (refs[j].getReferencedComponent().getProject()
+ .equals(libProj))
+ return true;
}
- }
+ }
}
return false;
} catch (CoreException ce) {
J2EEUIPlugin.logError(ce);
- }
+ }
return false;
- }
-
- private void handleSelectProjectJarButton(){
- IPath[] selected= BuildPathDialogAccess.chooseJAREntries(propPage.getShell(), project.getLocation(), new IPath[0]);
-
+ }
+
+ private void handleSelectProjectJarButton() {
+ IPath[] selected = BuildPathDialogAccess.chooseJAREntries(propPage
+ .getShell(), project.getLocation(), new IPath[0]);
+
if (selected != null) {
- for (int i= 0; i < selected.length; i++) {
- //IPath fullPath = project.getFile(selected[i]).getFullPath();
- String type = VirtualArchiveComponent.LIBARCHIVETYPE + IPath.SEPARATOR;
- IVirtualComponent archive = ComponentCore.createArchiveComponent( rootComponent.getProject(), type +
- selected[i].makeRelative().toString());
-
+ for (int i = 0; i < selected.length; i++) {
+ // IPath fullPath = project.getFile(selected[i]).getFullPath();
+ String type = VirtualArchiveComponent.LIBARCHIVETYPE
+ + IPath.SEPARATOR;
+ IVirtualComponent archive = ComponentCore
+ .createArchiveComponent(rootComponent.getProject(),
+ type + selected[i].makeRelative().toString());
+
this.addPotentialNewReference(archive);
}
refresh();
}
-
+
}
+
private boolean hasInitialized = false;
+
/**
* This should only be called on changes, such as adding a project
* reference, adding a lib reference etc.
*
- * It will reset the input, manually re-add missing elements, and do other tasks
+ * It will reset the input, manually re-add missing elements, and do other
+ * tasks
*/
public void refresh() {
TableItem[] items = availableComponentsViewer.getTable().getItems();
- HashMap<Object, Boolean> checked = cacheChecked();
+ HashMap<Object, Boolean> checked = cacheChecked();
resetTableUI();
- if( !hasInitialized) {
+ if (!hasInitialized) {
initialize();
resetTableUI();
}
/*
- * Re-check any added elements that were checked but now lost their check
+ * Re-check any added elements that were checked but now lost their
+ * check
*/
TableItem[] newItems = availableComponentsViewer.getTable().getItems();
- for( int i = 0; i < newItems.length; i++ ) {
- if( checked.containsKey(newItems[i].getData()))
+ for (int i = 0; i < newItems.length; i++) {
+ if (checked.containsKey(newItems[i].getData()))
newItems[i].setChecked(checked.get(newItems[i].getData()));
}
}
- protected HashMap<Object, Boolean> cacheChecked() {
+ protected HashMap<Object, Boolean> cacheChecked() {
// preserve selections / check / etc of new (added) entities
- TableItem [] items = availableComponentsViewer.getTable().getItems();
- HashMap<Object, Boolean> checked = new HashMap<Object,Boolean>();
- if( addedElements != null ) {
+ TableItem[] items = availableComponentsViewer.getTable().getItems();
+ HashMap<Object, Boolean> checked = new HashMap<Object, Boolean>();
+ if (addedElements != null) {
int j = 0;
- for( int i = 0; i < items.length; i++ ) {
- if( addedElements.contains(items[i].getData()))
+ for (int i = 0; i < items.length; i++) {
+ if (addedElements.contains(items[i].getData()))
checked.put(items[i].getData(), items[i].getChecked());
}
}
@@ -737,68 +820,85 @@
IWorkspaceRoot input = ResourcesPlugin.getWorkspace().getRoot();
availableComponentsViewer.setInput(input);
GridData data = new GridData(GridData.FILL_BOTH);
- int numlines = Math.min(10, availableComponentsViewer.getTable().getItemCount());
- data.heightHint = availableComponentsViewer.getTable().getItemHeight() * numlines;
+ int numlines = Math.min(10, availableComponentsViewer.getTable()
+ .getItemCount());
+ data.heightHint = availableComponentsViewer.getTable().getItemHeight()
+ * numlines;
availableComponentsViewer.getTable().setLayoutData(data);
- GridData btndata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING);
+ GridData btndata = new GridData(GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_BEGINNING);
buttonColumn.setLayoutData(btndata);
- //[Bug 238264] for all the jars in the cache temparaly list them in the grid
- for(Object addedElement : this.addedElements) {
- availableComponentsViewer.add(addedElement);
+ // [Bug 238264] for all the jars in the cache temparaly list them in the
+ // grid
+ TableItem[] items = availableComponentsViewer.getTable().getItems();
+ for (Object addedElement : this.addedElements) {
+ boolean found = false;
+ for (int i = 0; i < items.length; i++) {
+ if (items[i].getData().equals(addedElement))
+ found = true;
+ }
+ if (!found)
+ availableComponentsViewer.add(addedElement);
}
}
protected void initialize() {
- TableItem [] items = availableComponentsViewer.getTable().getItems();
-
+ TableItem[] items = availableComponentsViewer.getTable().getItems();
+
// First initialize the paths
Object data;
- for( int i = 0; i < items.length; i++ ) {
+ for (int i = 0; i < items.length; i++) {
data = items[i].getData();
- if( data instanceof IVirtualComponent ) {
- IVirtualReference ref = rootComponent.getReference(((IVirtualComponent)data).getName());
- String val = ref == null ? new Path(PATH_SEPARATOR).toString() : ref.getRuntimePath().toString();
+ if (data instanceof IVirtualComponent) {
+ IVirtualReference ref = rootComponent
+ .getReference(((IVirtualComponent) data).getName());
+ String val = ref == null ? new Path(PATH_SEPARATOR).toString()
+ : ref.getRuntimePath().toString();
objectToRuntimePath.put(data, val);
+ oldComponentToRuntimePath.put((IVirtualComponent) data, val);
}
}
-
+
// Then initialize the UI
List forceCheck = new ArrayList();
forceCheck.addAll(getChildrenComponents());
forceCheck.addAll(getCPComponents());
- for( int i = 0; i < items.length; i++ ) {
- if( forceCheck.contains(items[i].getData()))
+ for (int i = 0; i < items.length; i++) {
+ if (forceCheck.contains(items[i].getData()))
items[i].setChecked(true);
-
- if( items[i].getData() instanceof VirtualArchiveComponent )
- items[i].setGrayed(isPhysicallyAdded(((VirtualArchiveComponent)items[i].getData())));
+
+ if (items[i].getData() instanceof VirtualArchiveComponent)
+ items[i]
+ .setGrayed(isPhysicallyAdded(((VirtualArchiveComponent) items[i]
+ .getData())));
}
hasInitialized = true;
}
+
protected List getChildrenComponents() {
List list = new ArrayList();
IVirtualReference refs[] = rootComponent.getReferences();
- for( int i=0; i< refs.length; i++){
- if( isChildComponent(refs[i]))
+ for (int i = 0; i < refs.length; i++) {
+ if (isChildComponent(refs[i]))
list.add(refs[i].getReferencedComponent());
}
return list;
}
-
+
protected boolean isChildComponent(IVirtualReference ref) {
-// if ((ref.getRuntimePath().isRoot() && !inLibFolder) ||
-// (!ref.getRuntimePath().isRoot() && inLibFolder) ||
-// !isVersion5) {
+ // if ((ref.getRuntimePath().isRoot() && !inLibFolder) ||
+ // (!ref.getRuntimePath().isRoot() && inLibFolder) ||
+ // !isVersion5) {
return true;
}
-
+
protected List getCPComponents() {
List list = new ArrayList();
Map pathToComp = new HashMap();
IVirtualReference refs[] = rootComponent.getReferences();
- for( int i=0; i< refs.length; i++){
- if( isChildComponent(refs[i])) {
+ for (int i = 0; i < refs.length; i++) {
+ if (isChildComponent(refs[i])) {
IVirtualComponent comp = refs[i].getReferencedComponent();
addClasspathComponentDependencies(list, pathToComp, comp);
}
@@ -806,401 +906,340 @@
return list;
}
- protected void addClasspathComponentDependencies(final List componentList, final Map pathToComp, final IVirtualComponent referencedComponent) {
- AvailableJ2EEComponentsForEARContentProvider.addClasspathComponentDependencies(componentList, pathToComp, referencedComponent);
+ protected void addClasspathComponentDependencies(final List componentList,
+ final Map pathToComp, final IVirtualComponent referencedComponent) {
+ AvailableJ2EEComponentsForEARContentProvider
+ .addClasspathComponentDependencies(componentList, pathToComp,
+ referencedComponent);
}
-
/*
- * Clean-up methods are below. These include
- * performCancel, performDefaults, performOK, and
- * any other methods that are called *only* by this one.
+ * Clean-up methods are below. These include performCancel, performDefaults,
+ * performOK, and any other methods that are called *only* by this one.
*/
public void setVisible(boolean visible) {
}
-
+
public void performDefaults() {
}
-
+
public boolean performCancel() {
return true;
}
-
+
public void dispose() {
Table table = null;
if (availableComponentsViewer != null) {
- table = availableComponentsViewer.getTable();
- if (table == null)
- return;
+ table = availableComponentsViewer.getTable();
+ if (table == null)
+ return;
}
table.removeListener(SWT.Dispose, tableListener);
table.removeListener(SWT.KeyDown, tableListener);
table.removeListener(SWT.MouseMove, tableListener);
- table.removeListener(SWT.MouseHover, tableListener);
+ table.removeListener(SWT.MouseHover, tableListener);
}
- protected abstract boolean performOk(IProgressMonitor monitor);
+
+
+ /*
+ * This is where the OK work goes. Lots of it. Watch your head.
+ * xiao xin
+ */
+
+
+
+ protected abstract boolean preHandleChanges(IProgressMonitor monitor);
+ protected abstract boolean postHandleChanges(IProgressMonitor monitor);
+
public boolean performOk() {
+ // grab what's checked
+ ArrayList<Object> checked = new ArrayList<Object>();
+ TableItem[] items = availableComponentsViewer.getTable().getItems();
+ for (int i = 0; i < items.length; i++)
+ if (items[i].getChecked())
+ checked.add(items[i].getData());
+
+ // Fill our delta lists
+ ArrayList<Object> added = new ArrayList<Object>();
+ ArrayList<IVirtualComponent> removed = new ArrayList<IVirtualComponent>();
+ ArrayList<IVirtualComponent> changed = new ArrayList<IVirtualComponent>();
+
+ Iterator j = oldComponentToRuntimePath.keySet().iterator();
+ Object key, val;
+ while (j.hasNext()) {
+ key = j.next();
+ val = oldComponentToRuntimePath.get(key);
+ if (!checked.contains(key))
+ removed.add((IVirtualComponent)key);
+ else if (!val.equals(objectToRuntimePath.get(key)))
+ changed.add((IVirtualComponent)key);
+ }
+
+ j = objectToRuntimePath.keySet().iterator();
+ while (j.hasNext()) {
+ key = j.next();
+ if (!oldComponentToRuntimePath.containsKey(key))
+ added.add(key);
+ }
+
NullProgressMonitor monitor = new NullProgressMonitor();
- boolean subResult = performOk(monitor);
+ boolean subResult = preHandleChanges(monitor);
if( !subResult )
return false;
-// removeModulesFromEAR(monitor);
-// addModulesToEAR(monitor);
-// refresh();
+ handleDeltas(removed, changed, added);
- Iterator i = addedElements.iterator();
+ subResult &= postHandleChanges(monitor);
+ return subResult;
+ }
+
+ // Subclass can override if it has a good way to handle changed elements
+ protected void handleDeltas(ArrayList<IVirtualComponent> removed,
+ ArrayList<IVirtualComponent> changed, ArrayList<Object> added) {
+ ArrayList<IVirtualComponent> removed2 = new ArrayList<IVirtualComponent>();
+ ArrayList<Object> added2 = new ArrayList<Object>();
+ removed2.addAll(removed);
+ removed2.addAll(changed);
+ added2.addAll(added);
+ added2.addAll(changed);
+
+ // meld the changed into the added / removed
+ handleRemoved(removed2);
+ handleAdded(added2);
+ }
+ protected void handleRemoved(ArrayList<IVirtualComponent> removed) {
+ // If it's removed it should *only* be a virtual component already
+ Iterator<IVirtualComponent> i = removed.iterator();
+ IVirtualComponent component;
while(i.hasNext()) {
- Object o = i.next();
- System.out.println("Adding " + o + " to path " + objectToRuntimePath.get(o));
+ try {
+ component = i.next();
+ IDataModelOperation operation = getRemoveComponentOperation(component);
+ operation.execute(null, null);
+ } catch( ExecutionException e) {
+ J2EEUIPlugin.logError(e);
+ }
}
- return true;
}
+
+ protected IDataModelOperation getRemoveComponentOperation(IVirtualComponent component) {
+ IDataModelProvider provider = getRemoveReferenceDataModelProvider(component);
+ IDataModel model = DataModelFactory.createDataModel(provider);
+ model.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, rootComponent);
+ List modHandlesList = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
+ modHandlesList.add(component);
+ model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modHandlesList);
+ model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, oldComponentToRuntimePath.get(component));
+ return model.getDefaultOperation();
+ }
+
+ protected IDataModelProvider getRemoveReferenceDataModelProvider(IVirtualComponent component) {
+ return new RemoveReferenceComponentsDataModelProvider();
+ }
-// /*
-// * Methods called directly from OK
-// */
-// private IStatus addModulesToEAR(IProgressMonitor monitor) {
-// IStatus stat = OK_STATUS;
-// try {
-// if( earComponent != null ){
-// final List list = newJ2EEModulesToAdd(false);
-// final List bndList = newJ2EEModulesToAdd(true);
-// final boolean shouldRun = (list != null && !list.isEmpty()) || !javaProjectsList.isEmpty();
-// final boolean shouldBndRun = isVersion5 &&
-// ((bndList != null && !bndList.isEmpty()) || !javaLibProjectsList.isEmpty());
-// if(shouldRun || shouldBndRun){
-// IWorkspaceRunnable runnable = new IWorkspaceRunnable(){
-//
-// public void run(IProgressMonitor monitor) throws CoreException{
-// if (shouldRun) {
-// execAddOp(monitor, list, J2EEConstants.EAR_ROOT_DIR);
-// execAddOp1(monitor, javaProjectsList, j2eeComponentList, J2EEConstants.EAR_ROOT_DIR);
-// }
-// if (shouldBndRun) {
-// execAddOp(monitor, bndList, libDir);
-// execAddOp1(monitor, javaLibProjectsList, j2eeLibElementList, libDir);
-// }
-// }
-// };
-// J2EEUIPlugin.getWorkspace().run(runnable, monitor);
-// }
-// }
-// } catch (Exception e) {
-// J2EEUIPlugin.logError(e);
-// }
-//
-// //[Bug 238264] clear out the cache because they should all either be added as references now
-// // or no longer checked and therefore not wanted by the user
-// this.addedJARComponents.clear();
-//
-// return OK_STATUS;
-// }
-//
-// private List newJ2EEModulesToAdd(boolean inLibFolder){
-// if (inLibFolder && !isVersion5) return null;
-// List newComps = new ArrayList();
-// List comps = inLibFolder ? j2eeLibElementList : j2eeComponentList;
-// if (comps != null && !comps.isEmpty()){
-// for (int i = 0; i < comps.size(); i++){
-// IVirtualComponent handle = (IVirtualComponent)comps.get(i);
-// if (ClasspathDependencyUtil.isClasspathComponentDependency(handle)) {
-// continue;
-// }
-// if( !inEARAlready(handle))
-// newComps.add(handle);
-// }
-// }
-// return newComps;
-// }
-//
-// /**
-// *
-// * @param componentHandle
-// * @return
-// * @description returns true is a component is already in the EAR as a dependent
-// */
-// protected boolean inEARAlready(IVirtualComponent component){
-// IVirtualReference refs[] = rootComponent.getReferences();
-// for( int i=0; i< refs.length; i++){
-// IVirtualReference ref = refs[i];
-// if ( ref.getReferencedComponent().equals( component ))
-// return true;
-// }
-// return false;
-// }
+ protected void handleChanged(ArrayList<IVirtualComponent> changed) {
+ Iterator<IVirtualComponent> i = changed.iterator();
+ IVirtualComponent component;
+ IVirtualReference ref;
+ IPath p;
+ while(i.hasNext()) {
+ component = i.next();
+ ref = rootComponent.getReference(component.getName());
+ p = new Path(objectToRuntimePath.get(component));
+ ref.setRuntimePath(p);
+ }
+ }
-// private void updateLibDir(IProgressMonitor monitor) {
-// if (libDir.equals(oldLibDir)) return;
-// final IEARModelProvider earModel = (IEARModelProvider)ModelProviderManager.getModelProvider(project);
-// final Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
-// oldLibDir = app.getLibraryDirectory();
-// if (oldLibDir == null) oldLibDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
-// earModel.modify(new Runnable() {
-// public void run() {
-// app.setLibraryDirectory(libDir);
-// }}, null);
-// }
-//
-// private void remComps(List list, String path) {
-// if( !list.isEmpty()){
-// try {
-// // remove the components from the EAR
-// IDataModelOperation op = removeComponentFromEAROperation(earComponent, list, path);
-// op.execute(null, null);
-// // if that succeeded, remove all EAR-scope J2EE dependencies on these components
-// J2EEComponentClasspathUpdater.getInstance().queueUpdateEAR(earComponent.getProject());
-// } catch (ExecutionException e) {
-// J2EEUIPlugin.logError(e);
-// }
-// }
-// }
-//
-// private IStatus removeModulesFromEAR(IProgressMonitor monitor) {
-// IStatus stat = OK_STATUS;
-// if (!isVersion5) {
-// if(earComponent != null && j2eeComponentList != null) {
-// List list = getComponentsToRemove();
-// remComps(list, J2EEConstants.EAR_ROOT_DIR);
-// }
-// } else {
-// if( earComponent != null && j2eeComponentList != null) {
-// List[] list = getComponentsToRemoveUpdate(!libDir.equals(oldLibDir));
-// remComps(list[0], J2EEConstants.EAR_ROOT_DIR);
-//
-// remComps(list[1], oldLibDir);
-// }
-// }
-// return stat;
-// }
-//
-// protected IDataModelOperation removeComponentFromEAROperation(IVirtualComponent sourceComponent, List targetComponentsHandles, String dir) {
-// IDataModel model = DataModelFactory.createDataModel(new RemoveComponentFromEnterpriseApplicationDataModelProvider());
-// model.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, sourceComponent);
-// List modHandlesList = (List) model.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
-// modHandlesList.addAll(targetComponentsHandles);
-// model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, modHandlesList);
-// model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, dir);
-// return model.getDefaultOperation();
-// }
-//
-// protected List getComponentsToRemove(){
-// //j2eeComponentList = getCheckedJ2EEElementsAsList();
-// List list = new ArrayList();
-// if( earComponent != null && list != null ){
-// IVirtualReference[] oldrefs = earComponent.getReferences();
-// for (int j = 0; j < oldrefs.length; j++) {
-// IVirtualReference ref = oldrefs[j];
-// IVirtualComponent handle = ref.getReferencedComponent();
-// if(!j2eeComponentList.contains(handle) && (isVersion5 ? !j2eeLibElementList.contains(handle) : true)){
-// if ((handle instanceof VirtualArchiveComponent) && (isPhysicallyAdded((VirtualArchiveComponent)handle)))
-// continue;
-// list.add(handle);
-// }
-// }
-// }
-// return list;
-// }
-//
-// // EAR5 case
-// protected List[] getComponentsToRemoveUpdate(boolean dirUpdated){
-// //j2eeComponentList = getCheckedJ2EEElementsAsList();
-// List[] list = new ArrayList[2];
-// list[0] = new ArrayList();
-// list[1] = new ArrayList();
-// if( earComponent != null && list != null ){
-// IVirtualReference[] oldrefs = earComponent.getReferences();
-// for (int j = 0; j < oldrefs.length; j++) {
-// IVirtualReference ref = oldrefs[j];
-// IVirtualComponent handle = ref.getReferencedComponent();
-// if (handle instanceof VirtualArchiveComponent) {
-// VirtualArchiveComponent comp = (VirtualArchiveComponent)handle;
-// if (isPhysicallyAdded(comp))
-// continue;
-// }
-// if(!j2eeComponentList.contains(handle) && ref.getRuntimePath().isRoot()) {
-// list[0].add(handle);
-// }
-// if((!j2eeLibElementList.contains(handle) || dirUpdated) &&
-// ref.getRuntimePath().toString().equals(oldLibDir)) {
-// list[1].add(handle);
-// }
-// }
-// }
-// return list;
-// }
-//
-//
-// /*
-// * Operations called from OK
-// */
-//
-// private void execAddOp(IProgressMonitor monitor, List componentList, String path) throws CoreException {
-// if (componentList == null || componentList.isEmpty()) return;
-// IDataModel dm = DataModelFactory.createDataModel(new AddComponentToEnterpriseApplicationDataModelProvider());
-//
-// dm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComponent);
-// dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, componentList);
-//
-// //[Bug 238264] the uri map needs to be manually set correctly
-// Map uriMap = new HashMap();
-// IVirtualComponent virtComp;
-// String virtCompURIMapName;
-// for(int i=0; i<componentList.size(); i++) {
-// virtComp = (IVirtualComponent)componentList.get(i);
-// virtCompURIMapName = getVirtualComponentNameWithExtension(virtComp);
-// uriMap.put(virtComp, virtCompURIMapName);
-// }
-// dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, uriMap);
-//
-// if (isVersion5) dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, path);
-//
-// IStatus stat = dm.validateProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
-// if (stat != OK_STATUS)
-// throw new CoreException(stat);
-// try {
-// dm.getDefaultOperation().execute(monitor, null);
-// } catch (ExecutionException e) {
-// J2EEUIPlugin.logError(e);
-// }
-// }
-//
-// private void execAddOp1(IProgressMonitor monitor, List jProjList, List j2eeCompList, String path)
-// throws CoreException {
-// if (!jProjList.isEmpty()) {
-// Set moduleProjects = new HashSet();
-// for (int i = 0; i < jProjList.size(); i++) {
-// try {
-// IProject proj = (IProject) jProjList.get(i);
-// moduleProjects.add(proj);
-// IDataModel migrationdm = DataModelFactory.createDataModel(new JavaProjectMigrationDataModelProvider());
-// migrationdm.setProperty(IJavaProjectMigrationDataModelProperties.PROJECT_NAME, proj.getName());
-// migrationdm.getDefaultOperation().execute(monitor, null);
-//
-//
-// IDataModel refdm = DataModelFactory.createDataModel(new CreateReferenceComponentsDataModelProvider());
-// List targetCompList = (List) refdm.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
-//
-// IVirtualComponent targetcomponent = ComponentCore.createComponent(proj);
-// targetCompList.add(targetcomponent);
-//
-// refdm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComponent);
-// refdm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, targetCompList);
-// if (isVersion5) refdm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, path);
-//
-//
-// // referenced java projects should have archiveName attribute
-// ((Map)refdm.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP)).put(targetcomponent, proj.getName().replace(' ', '_') + IJ2EEModuleConstants.JAR_EXT);
-//
-// refdm.getDefaultOperation().execute(monitor, null);
-// j2eeCompList.add(targetcomponent);
-// } catch (ExecutionException e) {
-// J2EEUIPlugin.logError(e);
-// }
-// }
-// EarFacetRuntimeHandler.updateModuleProjectRuntime(earComponent.getProject(), moduleProjects, new NullProgressMonitor());
-// } // end
-//
-// }
-//
-//
-//
-// /*
-// * Methods called From the Operations (which are called from OK)
-// */
-//
-// /**
-// * Method returns the name of the given IVirtualComponent being sure the correct extension
-// * is on the end of the name, this is important for internal projects. Added for [Bug 241509]
-// *
-// * @param virtComp the IVirtualComponent to get the name of with the correct extension
-// * @return the name of the given IVirtualComponent with the correct extension
-// */
-// private String getVirtualComponentNameWithExtension(IVirtualComponent virtComp) {
-// String virtCompURIMapName = this.getURIMappingName(virtComp);
-//
-// boolean linkedToEAR = true;
-// try {
-// if(virtComp.isBinary()){
-// linkedToEAR = ((J2EEModuleVirtualArchiveComponent)virtComp).isLinkedToEAR();
-// ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(false);
-// }
-// if(JavaEEProjectUtilities.isDynamicWebComponent(virtComp)) {
-// if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.WAR_EXT)) {
-// //web module URIs need to end in WAR
-// virtCompURIMapName += IJ2EEModuleConstants.WAR_EXT;
-// }
-// } else if(JavaEEProjectUtilities.isJCAComponent(virtComp)) {
-// if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.RAR_EXT)) {
-// //connector module URIs need to end in RAR
-// virtCompURIMapName += IJ2EEModuleConstants.RAR_EXT;
-// }
-// } else if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.JAR_EXT)) {
-// //all other modules (EJB, AppClient, Utility) need to end in JAR
-// virtCompURIMapName += IJ2EEModuleConstants.JAR_EXT;
-// }
-// } finally {
-// if(virtComp.isBinary()){
-// ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(linkedToEAR);
-// }
-// }
-// return virtCompURIMapName;
-// }
-//
-// /**
-// * [Bug 238264]
-// * determines a unique URI mapping name for a given component
-// * this is in case two components have the same name.
-// *
-// * @return returns a valid (none duplicate) uri mapping name for the given component\
-// */
-// private String getURIMappingName(IVirtualComponent archive) {
-//
-// //get the default uri map name for the given archive
-// IPath componentPath = Path.fromOSString(archive.getName());
-// String uriMapName = componentPath.lastSegment().replace(' ', '_');
-//
-//
-// //check to be sure this uri mapping is not already in use by another reference
-// boolean dupeArchiveName;
-// String refedCompName;
-// int lastDotIndex;
-// String increment;
-// IVirtualReference [] existingRefs = earComponent.getReferences();
-// for(int i=0;i<existingRefs.length;i++){
-// refedCompName = existingRefs[i].getReferencedComponent().getName();
-//
-// //if uri mapping names of the refed component and the given archive are the same
-// // find a new uri map name for the given archive
-// if(existingRefs[i].getArchiveName().equals(uriMapName)){
-// dupeArchiveName = true;
-// //find a new uriMapName for the given component
-// for(int j=1; dupeArchiveName; j++){
-// lastDotIndex = uriMapName.lastIndexOf('.');
-// increment = "_"+j; //$NON-NLS-1$
-//
-// //create the new potential name
-// if(lastDotIndex != -1){
-// uriMapName = uriMapName.substring(0, lastDotIndex) + increment + uriMapName.substring(lastDotIndex);
-// } else {
-// uriMapName = uriMapName.substring(0)+increment;
-// }
-//
-// //determine if the new potential name is valid
-// for(int k=0; k<existingRefs.length; k++) {
-// dupeArchiveName = existingRefs[k].getArchiveName().equals(uriMapName);
-// if(dupeArchiveName) {
-// break;
-// }
-// }
-// }
-// }
-// }
-//
-// return uriMapName;
-// }
-//
-//
+ protected void handleAdded(ArrayList<Object> added) {
+ final ArrayList<IProject> projects = new ArrayList<IProject>();
+ final ArrayList<IVirtualComponent> components = new ArrayList<IVirtualComponent>();
+ Iterator i = added.iterator();
+ Object o;
+ while(i.hasNext()) {
+ o = i.next();
+ if( o instanceof IProject )
+ projects.add((IProject)o);
+ else if( o instanceof IVirtualComponent)
+ components.add((IVirtualComponent)o);
+ }
+
+ IWorkspaceRunnable runnable = new IWorkspaceRunnable(){
+ public void run(IProgressMonitor monitor) throws CoreException{
+ addProjects(projects);
+ addComponents(components);
+ }
+ };
+ try {
+ J2EEUIPlugin.getWorkspace().run(runnable, new NullProgressMonitor());
+ } catch( CoreException e ) {
+ J2EEUIPlugin.logError(e);
+ }
+ }
+
+ protected void addProjects(ArrayList<IProject> projects) throws CoreException {
+ // These projects need to be converted to utility projects first
+ Iterator<IProject> i = projects.iterator();
+ IProject proj;
+ Set moduleProjects = new HashSet();
+ String path;
+ while(i.hasNext()) {
+ proj = i.next();
+ path = objectToRuntimePath.get(proj);
+ try {
+ moduleProjects.add(proj);
+ IDataModel migrationdm = DataModelFactory.createDataModel(new JavaProjectMigrationDataModelProvider());
+ migrationdm.setProperty(IJavaProjectMigrationDataModelProperties.PROJECT_NAME, proj.getName());
+ migrationdm.getDefaultOperation().execute(new NullProgressMonitor(), null);
+
+
+ IDataModel refdm = DataModelFactory.createDataModel(new CreateReferenceComponentsDataModelProvider());
+ List targetCompList = (List) refdm.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
+
+ IVirtualComponent targetcomponent = ComponentCore.createComponent(proj);
+ targetCompList.add(targetcomponent);
+
+ refdm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, rootComponent);
+ refdm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, targetCompList);
+ refdm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, path);
+
+
+ // referenced java projects should have archiveName attribute
+ ((Map)refdm.getProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP)).put(targetcomponent, proj.getName().replace(' ', '_') + IJ2EEModuleConstants.JAR_EXT);
+
+ refdm.getDefaultOperation().execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ J2EEUIPlugin.logError(e);
+ }
+ }
+ postAddProjects(moduleProjects);
+ }
+
+ protected void postAddProjects(Set moduleProjects) throws CoreException {
+ }
+
+ protected void addComponents(ArrayList<IVirtualComponent> components) throws CoreException {
+ Iterator<IVirtualComponent> i = components.iterator();
+ while(i.hasNext()) {
+ addOneComponent(i.next());
+ }
+ }
+
+ protected IDataModelProvider getAddReferenceDataModelProvider(IVirtualComponent component) {
+ return new CreateReferenceComponentsDataModelProvider();
+ }
+
+ protected void addOneComponent(IVirtualComponent component) throws CoreException {
+ IDataModelProvider provider = getAddReferenceDataModelProvider(component);
+ IDataModel dm = DataModelFactory.createDataModel(provider);
+
+ dm.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, rootComponent);
+ dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, Arrays.asList(component));
+
+ //[Bug 238264] the uri map needs to be manually set correctly
+ Map uriMap = new HashMap();
+ uriMap.put(component, getVirtualComponentNameWithExtension(component));
+ dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, uriMap);
+ dm.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, objectToRuntimePath.get(component));
+
+ IStatus stat = dm.validateProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST);
+ if (stat != OK_STATUS)
+ throw new CoreException(stat);
+ try {
+ dm.getDefaultOperation().execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ J2EEUIPlugin.logError(e);
+ }
+ }
+ /**
+ * Method returns the name of the given IVirtualComponent being sure the correct extension
+ * is on the end of the name, this is important for internal projects. Added for [Bug 241509]
+ *
+ * @param virtComp the IVirtualComponent to get the name of with the correct extension
+ * @return the name of the given IVirtualComponent with the correct extension
+ */
+ private String getVirtualComponentNameWithExtension(IVirtualComponent virtComp) {
+ String virtCompURIMapName = this.getURIMappingName(virtComp);
+
+ boolean linkedToEAR = true;
+ try {
+ if(virtComp.isBinary()){
+ linkedToEAR = ((J2EEModuleVirtualArchiveComponent)virtComp).isLinkedToEAR();
+ ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(false);
+ }
+ if(JavaEEProjectUtilities.isDynamicWebComponent(virtComp)) {
+ if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.WAR_EXT)) {
+ //web module URIs need to end in WAR
+ virtCompURIMapName += IJ2EEModuleConstants.WAR_EXT;
+ }
+ } else if(JavaEEProjectUtilities.isJCAComponent(virtComp)) {
+ if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.RAR_EXT)) {
+ //connector module URIs need to end in RAR
+ virtCompURIMapName += IJ2EEModuleConstants.RAR_EXT;
+ }
+ } else if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.JAR_EXT)) {
+ //all other modules (EJB, AppClient, Utility) need to end in JAR
+ virtCompURIMapName += IJ2EEModuleConstants.JAR_EXT;
+ }
+ } finally {
+ if(virtComp.isBinary()){
+ ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(linkedToEAR);
+ }
+ }
+ return virtCompURIMapName;
+ }
+
+ /**
+ * [Bug 238264]
+ * determines a unique URI mapping name for a given component
+ * this is in case two components have the same name.
+ *
+ * @return returns a valid (none duplicate) uri mapping name for the given component\
+ */
+ private String getURIMappingName(IVirtualComponent archive) {
+
+ //get the default uri map name for the given archive
+ IPath componentPath = Path.fromOSString(archive.getName());
+ String uriMapName = componentPath.lastSegment().replace(' ', '_');
+
+
+ //check to be sure this uri mapping is not already in use by another reference
+ boolean dupeArchiveName;
+ String refedCompName;
+ int lastDotIndex;
+ String increment;
+ IVirtualReference [] existingRefs = rootComponent.getReferences();
+ for(int i=0;i<existingRefs.length;i++){
+ refedCompName = existingRefs[i].getReferencedComponent().getName();
+
+ //if uri mapping names of the refed component and the given archive are the same
+ // find a new uri map name for the given archive
+ if(existingRefs[i].getArchiveName().equals(uriMapName)){
+ dupeArchiveName = true;
+ //find a new uriMapName for the given component
+ for(int j=1; dupeArchiveName; j++){
+ lastDotIndex = uriMapName.lastIndexOf('.');
+ increment = "_"+j; //$NON-NLS-1$
+
+ //create the new potential name
+ if(lastDotIndex != -1){
+ uriMapName = uriMapName.substring(0, lastDotIndex) + increment + uriMapName.substring(lastDotIndex);
+ } else {
+ uriMapName = uriMapName.substring(0)+increment;
+ }
+
+ //determine if the new potential name is valid
+ for(int k=0; k<existingRefs.length; k++) {
+ dupeArchiveName = existingRefs[k].getArchiveName().equals(uriMapName);
+ if(dupeArchiveName) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return uriMapName;
+ }
}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModulesToEarPropertiesPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModulesToEarPropertiesPage.java 2009-06-10 09:42:34 UTC (rev 15842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModulesToEarPropertiesPage.java 2009-06-10 09:49:38 UTC (rev 15843)
@@ -1,19 +0,0 @@
-package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public class AddModulesToEarPropertiesPage extends
- AddModuleDependenciesPropertiesPage {
-
-
- public AddModulesToEarPropertiesPage(IProject project,
- J2EEDependenciesPage page) {
- super(project, page);
- }
-
- protected boolean performOk(IProgressMonitor monitor) {
- return false;
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java 2009-06-10 09:42:34 UTC (rev 15842)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java 2009-06-10 09:49:38 UTC (rev 15843)
@@ -2,6 +2,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IProject;
@@ -13,8 +14,11 @@
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider;
+import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationDataModelProvider;
import org.eclipse.jst.j2ee.internal.J2EEConstants;
import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
+import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
import org.eclipse.jst.j2ee.internal.dialogs.ChangeLibDirDialog;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
@@ -22,6 +26,7 @@
import org.eclipse.jst.j2ee.model.ModelProviderManager;
import org.eclipse.jst.j2ee.project.EarUtilities;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
+import org.eclipse.jst.j2ee.project.facet.EarFacetRuntimeHandler;
import org.eclipse.jst.javaee.application.Application;
import org.eclipse.jst.jee.project.facet.EarCreateDeploymentFilesDataModelProvider;
import org.eclipse.jst.jee.project.facet.ICreateDeploymentFilesDataModelProperties;
@@ -33,6 +38,7 @@
import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
@@ -148,7 +154,11 @@
}}, null);
}
- public boolean performOk(IProgressMonitor monitor) {
+ public boolean postHandleChanges(IProgressMonitor monitor) {
+ return true;
+ }
+
+ public boolean preHandleChanges(IProgressMonitor monitor) {
if (isVersion5) {
if (libDir.length() == 0) {
@@ -173,6 +183,24 @@
return true;
}
+ protected void handleRemoved(ArrayList<IVirtualComponent> removed) {
+ super.handleRemoved(removed);
+ J2EEComponentClasspathUpdater.getInstance().queueUpdateEAR(rootComponent.getProject());
+ }
+
+ protected IDataModelProvider getRemoveReferenceDataModelProvider(Object component) {
+ return new RemoveComponentFromEnterpriseApplicationDataModelProvider();
+ }
+
+ protected void postAddProjects(Set moduleProjects) throws CoreException {
+ EarFacetRuntimeHandler.updateModuleProjectRuntime(rootComponent.getProject(), moduleProjects, new NullProgressMonitor());
+ }
+
+ protected IDataModelProvider getAddReferenceDataModelProvider(IVirtualComponent component) {
+ return new AddComponentToEnterpriseApplicationDataModelProvider();
+ }
+
+
public class EarComponentDependencyContentProvider
extends ComponentDependencyContentProvider {
15 years, 6 months
JBoss Tools SVN: r15842 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-10 05:42:34 -0400 (Wed, 10 Jun 2009)
New Revision: 15842
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4393
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java 2009-06-10 09:30:20 UTC (rev 15841)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java 2009-06-10 09:42:34 UTC (rev 15842)
@@ -124,7 +124,7 @@
public void setPrecedence(String precedence) {
this.precedence = precedence;
if(precedence == null || precedence.length() == 0) {
- precedence = "20";
+ this.precedence = "20";
}
}
15 years, 6 months