Author: dsakovich
Date: 2008-03-03 08:42:48 -0500 (Mon, 03 Mar 2008)
New Revision: 6669
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1713/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1713/JBIDE-1713.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pictures/pic1.jpg
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1713Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
Log:
Add JUnit test for
http://jira.jboss.com/jira/browse/JBIDE-1713
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1713/JBIDE-1713.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1713/JBIDE-1713.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1713/JBIDE-1713.xhtml 2008-03-03
13:42:48 UTC (rev 6669)
@@ -0,0 +1,73 @@
+<!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:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+<head>
+<style type="text/css">
+.myContentStyle {
+ background-color: aqua;
+}
+
+.myContentStyle1 {
+ background-color: lime;
+}
+
+.myHeaderStyle {
+ color: red;
+}
+
+.myHeaderStyle1 {
+ background: purple;
+}
+
+.myHeaderStyleActive {
+ background: aqua;
+}
+
+.myHeaderStyleActive1 {
+ background: olive;
+}
+
+.rich-panelbar {
+ background-color: silver;
+}
+
+.myClass {
+ font-style: italic;
+ font-stretch: narrower;
+}
+</style>
+</head>
+<body>
+ <rich:panelBar width="453" height="207"
contentClass="myContentStyle1"
+ contentStyle="color: brown;" headerClass="myHeaderStyle1"
+ headerStyle="color: green"
headerClassActive="myHeaderStyleActive1"
+ headerStyleActive="color: white;" style="font-weight: bold;"
+ styleClass="myClass">
+ <rich:panelBarItem label="nice" contentClass="myContentStyle"
+ contentStyle="color: green;" headerClass="myHeaderStyle"
+ headerStyle="background: yellow;"
+ headerClassActive="myHeaderStyleActive"
+ headerStyleActive="color: blue; background: red;">
+ An automated testing facility is in our roadmap for the near future. This facility
will generate test cases for your component as soon as you develop it. The testing
framework will not just test the components, but also any other server-side or client-side
functionality including JavaScript code. What is more, it will do all of this without
deploying the test application into the Servlet container.
+ <h:graphicImage value="/pictures/pic1.jpg" />
+ </rich:panelBarItem>
+ <rich:panelBarItem label="good">
+ <f:facet name="label">
+ <h:graphicImage value="/pictures/pic1.jpg" />
+ </f:facet>
+ <f:verbatim>Ajax4jsf is fully integrated into the JSF lifecycle. While other
frameworks only give you access to the managed bean facility, Ajax4jsf advantages the
action and value change listeners as well as invokes server-side validators and converters
during the AJAX request-response cycle.</f:verbatim>
+ </rich:panelBarItem>
+ <rich:panelBarItem label="good"
+ headerClassActive="myHeaderStyleActive"
+ headerStyleActive="color: blue;">
+ <f:facet name="label">
+ <h:outputText value="Guess who?" />
+ </f:facet>
+ <f:verbatim>Ajax4jsf is fully integrated into the JSF lifecycle. While other
frameworks only give you access to the managed bean facility, Ajax4jsf advantages the
action and value change listeners as well as invokes server-side validators and converters
during the AJAX request-response cycle.</f:verbatim>
+ </rich:panelBarItem>
+ </rich:panelBar>
+</body>
+</html>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pictures/pic1.jpg
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pictures/pic1.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java 2008-03-03
13:05:49 UTC (rev 6668)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java 2008-03-03
13:42:48 UTC (rev 6669)
@@ -18,6 +18,7 @@
import org.jboss.tools.jsf.vpe.richfaces.test.jbide.JBIDE1579Test;
import org.jboss.tools.jsf.vpe.richfaces.test.jbide.JBIDE1613Test;
+import org.jboss.tools.jsf.vpe.richfaces.test.jbide.JBIDE1713Test;
import org.jboss.tools.jsf.vpe.richfaces.test.jbide.Jbide1548Test;
import org.jboss.tools.jsf.vpe.richfaces.test.jbide.Jbide1580Test;
import org.jboss.tools.jsf.vpe.richfaces.test.jbide.Jbide1614Test;
@@ -47,7 +48,7 @@
suite.addTestSuite(Jbide1639Test.class);
suite.addTestSuite(Jbide1682Test.class);
suite.addTestSuite(Jbide1548Test.class);
-
+ suite.addTestSuite(JBIDE1713Test.class);
// $JUnit-END$
List<ImportBean> projectToImport = new ArrayList<ImportBean>();
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1713Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1713Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1713Test.java 2008-03-03
13:42:48 UTC (rev 6669)
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.test.jbide;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+
+/**
+ * Test JBIDE-1713
+ *
+ * @author Dzmitry Sakovich (dsakovich(a)exadel.com)
+ *
+ */
+public class JBIDE1713Test extends VpeTest {
+
+ public static final String IMPORT_PROJECT_NAME = "richFacesTest";
+
+ private static final String TEST_PAGE_NAME = "JBIDE/1713/JBIDE-1713.xhtml";
+
+ public JBIDE1713Test(String name) {
+ super(name);
+ }
+
+ // test method for JBIDE 1713 component
+ public void testJBIDE_1713() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
+ IMPORT_PROJECT_NAME);
+
+ assertNotNull("Could not open specified file " + file.getFullPath(),
+ file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ nsIDOMElement element = document.getDocumentElement();
+
+ // check that element is not null
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "table" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE);
+
+ assertEquals(1, elements.size());
+
+ nsIDOMElement table = (nsIDOMElement) elements.get(0).queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertNotNull(table);
+
+ // Check applying styleClass
+ String styleClass = table.getAttribute(HTML.ATTR_CLASS);
+ assertNotNull("styleClass attribute not apply", styleClass);
+ assertEquals("dr-pnlbar rich-panelbar dr-pnlbar-b myClass", styleClass);
+
+ // Check applying style
+ String stylePanel = table.getAttribute(HTML.ATTR_STYLE);
+ assertNotNull("style attribute not apply", stylePanel);
+ assertEquals(
+ "padding: 0px; height: 207px; width: 453px; font-weight: bold;",
+ stylePanel);
+
+ elements.clear();
+
+ TestUtil.findAllElementsByName(node, elements, HTML.TAG_DIV);
+
+ assertEquals(9, elements.size());
+
+ nsIDOMElement activeToggle = (nsIDOMElement) elements.get(4)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertNotNull(activeToggle);
+ String activeToggleClass = activeToggle.getAttribute(HTML.ATTR_CLASS);
+ assertNotNull(activeToggleClass);
+ assertEquals(
+ "dr-pnlbar-h rich-panelbar-header myHeaderStyleActive
myHeaderStyleActive",
+ activeToggleClass);
+
+ String activeToggleStyle = activeToggle.getAttribute(HTML.ATTR_STYLE);
+ assertNotNull(activeToggleStyle);
+ assertEquals(
+ "background: red none repeat scroll 0%; color: blue; -moz-background-clip:
-moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy:
-moz-initial;",
+ activeToggleStyle);
+
+ // check active content
+ List<nsIDOMNode> contentElements = new ArrayList<nsIDOMNode>();
+ TestUtil.findAllElementsByName(node, contentElements, HTML.TAG_TD);
+
+ assertEquals(2, contentElements.size());
+
+ nsIDOMElement contentElement = (nsIDOMElement) contentElements.get(1)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertNotNull(contentElement);
+
+ String activeContentStyle = contentElement
+ .getAttribute(HTML.ATTR_STYLE);
+ assertNotNull(activeContentStyle);
+ assertEquals("color: green;", activeContentStyle);
+
+ String activeContentClass = contentElement
+ .getAttribute(HTML.ATTR_CLASS);
+ assertNotNull(activeContentClass);
+ assertEquals(
+ "dr-pnlbar-c rich-panelbar-content myContentStyle myContentStyle",
+ activeContentClass);
+
+ // check facet
+ nsIDOMElement disabledToggle = (nsIDOMElement) elements.get(6)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertNotNull(contentElement);
+
+ String disabledContentStyle = disabledToggle
+ .getAttribute(HTML.ATTR_STYLE);
+ assertNotNull(disabledContentStyle);
+ assertEquals("color: green;", disabledContentStyle);
+
+ String disabledContentClass = disabledToggle
+ .getAttribute(HTML.ATTR_CLASS);
+ assertNotNull(disabledContentClass);
+ assertEquals("dr-pnlbar-h rich-panelbar-header myHeaderStyle1",
+ disabledContentClass);
+
+ contentElements.clear();
+ TestUtil.findElementsByName((nsIDOMNode) disabledToggle,
+ contentElements, HTML.TAG_IMG);
+ assertEquals(1, contentElements.size());
+
+ disabledToggle = (nsIDOMElement) elements.get(8).queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertNotNull(contentElement);
+
+ disabledContentStyle = disabledToggle.getAttribute(HTML.ATTR_STYLE);
+ assertNotNull(disabledContentStyle);
+ assertEquals("color: green;", disabledContentStyle);
+
+ disabledContentClass = disabledToggle.getAttribute(HTML.ATTR_CLASS);
+ assertNotNull(disabledContentClass);
+ assertEquals("dr-pnlbar-h rich-panelbar-header myHeaderStyle1",
+ disabledContentClass);
+
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+
+}
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-03-03
13:05:49 UTC (rev 6668)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-03-03
13:42:48 UTC (rev 6669)
@@ -28,6 +28,7 @@
import org.jboss.tools.vpe.ui.test.beans.ImportBean;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.xpcom.XPCOMException;
/**
* Class for importing project from jar file
@@ -37,176 +38,203 @@
*/
public class TestUtil {
- private static final String COMPONENTS_PATH = "WebContent/pages";
//$NON-NLS-1$
+ private static final String COMPONENTS_PATH = "WebContent/pages";
//$NON-NLS-1$
- private static final String WEBCONTENT_PATH = "WebContent"; //$NON-NLS-1$
+ private static final String WEBCONTENT_PATH = "WebContent"; //$NON-NLS-1$
- @SuppressWarnings("restriction")
- static void importProjectIntoWorkspace(String path, String projectName) {
+ @SuppressWarnings("restriction")
+ static void importProjectIntoWorkspace(String path, String projectName) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- projectName);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ projectName);
- try {
+ try {
- IOverwriteQuery overwrite = new IOverwriteQuery() {
- public String queryOverwrite(String pathString) {
- return ALL;
- }
- };
+ IOverwriteQuery overwrite = new IOverwriteQuery() {
+ public String queryOverwrite(String pathString) {
+ return ALL;
+ }
+ };
- ImportProvider importProvider = new ImportProvider();
+ ImportProvider importProvider = new ImportProvider();
- // need to remove from imported project "svn" files
- List<String> unimportedFiles = new ArrayList<String>();
- unimportedFiles.add(".svn"); //$NON-NLS-1$
+ // need to remove from imported project "svn" files
+ List<String> unimportedFiles = new ArrayList<String>();
+ unimportedFiles.add(".svn"); //$NON-NLS-1$
- importProvider.setUnimportedFiles(unimportedFiles);
+ importProvider.setUnimportedFiles(unimportedFiles);
- // create import operation
- ImportOperation importOp = new ImportOperation(project
- .getFullPath(), new File(path), importProvider, overwrite);
+ // create import operation
+ ImportOperation importOp = new ImportOperation(project
+ .getFullPath(), new File(path), importProvider, overwrite);
- // import files just to project folder ( without old structure )
- importOp.setCreateContainerStructure(false);
+ // import files just to project folder ( without old structure )
+ importOp.setCreateContainerStructure(false);
- importOp.setContext(PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getShell());
+ importOp.setContext(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell());
- // run import
- importOp.run(new NullProgressMonitor());
+ // run import
+ importOp.run(new NullProgressMonitor());
- } catch (InvocationTargetException ite) {
- VPETestPlugin.getDefault().logError(ite.getCause());
- } catch (InterruptedException ie) {
- VPETestPlugin.getDefault().logError(ie);
+ } catch (InvocationTargetException ite) {
+ VPETestPlugin.getDefault().logError(ite.getCause());
+ } catch (InterruptedException ie) {
+ VPETestPlugin.getDefault().logError(ie);
+ }
}
- }
- /**
- *
- * @return
- * @throws CoreException
- */
- public static IResource getComponentPath(String componentPage,
- String projectName) throws CoreException {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- projectName);
- if (project != null) {
- return project.getFolder(COMPONENTS_PATH).findMember(componentPage);
+ /**
+ *
+ * @return
+ * @throws CoreException
+ */
+ public static IResource getComponentPath(String componentPage,
+ String projectName) throws CoreException {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ projectName);
+ if (project != null) {
+ return project.getFolder(COMPONENTS_PATH).findMember(componentPage);
+ }
+
+ return null;
}
- return null;
- }
+ /**
+ *
+ * @return
+ * @throws CoreException
+ */
+ public static IResource getWebContentPath(String componentPage,
+ String projectName) throws CoreException {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ projectName);
+ if (project != null) {
+ return project.getFolder(WEBCONTENT_PATH).findMember(componentPage);
+ }
- /**
- *
- * @return
- * @throws CoreException
- */
- public static IResource getWebContentPath(String componentPage,
- String projectName) throws CoreException {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- projectName);
- if (project != null) {
- return project.getFolder(WEBCONTENT_PATH).findMember(componentPage);
+ return null;
}
- return null;
- }
+ /**
+ *
+ * @throws CoreException
+ */
+ static void removeProject(String projectName) throws CoreException {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ projectName);
+ if (project != null) {
+ project.delete(IResource.ALWAYS_DELETE_PROJECT_CONTENT,
+ new NullProgressMonitor());
+ }
+ }
- /**
- *
- * @throws CoreException
- */
- static void removeProject(String projectName) throws CoreException {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- projectName);
- if (project != null) {
- project.delete(IResource.ALWAYS_DELETE_PROJECT_CONTENT,
- new NullProgressMonitor());
+ /**
+ * Process UI input but do not return for the specified time interval.
+ *
+ * @param waitTimeMillis
+ * the number of milliseconds
+ */
+ public static void delay(long waitTimeMillis) {
+ Display display = Display.getCurrent();
+ if (display != null) {
+ long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
+ while (System.currentTimeMillis() < endTimeMillis) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.update();
+ }
+ // Otherwise, perform a simple sleep.
+ else {
+ try {
+ Thread.sleep(waitTimeMillis);
+ } catch (InterruptedException e) {
+ // Ignored.
+ }
+ }
}
- }
- /**
- * Process UI input but do not return for the specified time interval.
- *
- * @param waitTimeMillis
- * the number of milliseconds
- */
- public static void delay(long waitTimeMillis) {
- Display display = Display.getCurrent();
- if (display != null) {
- long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
- while (System.currentTimeMillis() < endTimeMillis) {
- if (!display.readAndDispatch())
- display.sleep();
- }
- display.update();
+ /**
+ * Wait until all background tasks are complete.
+ */
+ public static void waitForJobs() {
+ while (Job.getJobManager().currentJob() != null)
+ delay(100);
}
- // Otherwise, perform a simple sleep.
- else {
- try {
- Thread.sleep(waitTimeMillis);
- } catch (InterruptedException e) {
- // Ignored.
- }
- }
- }
- /**
- * Wait until all background tasks are complete.
- */
- public static void waitForJobs() {
- while (Job.getJobManager().currentJob() != null)
- delay(100);
- }
+ /**
+ * find elements by name
+ *
+ * @param node -
+ * current node
+ * @param elements -
+ * list of found elements
+ * @param name -
+ * name element
+ */
+ static public void findElementsByName(nsIDOMNode node,
+ List<nsIDOMNode> elements, String name) {
- /**
- * find elements by name
- *
- * @param node -
- * current node
- * @param elements -
- * list of found elements
- * @param name -
- * name element
- */
- static public void findElementsByName(nsIDOMNode node,
- List<nsIDOMNode> elements, String name) {
+ // get children
+ nsIDOMNodeList children = node.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ nsIDOMNode child = children.item(i);
- // get children
- nsIDOMNodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- nsIDOMNode child = children.item(i);
+ // if current child is required then add his to list
+ if (name.equalsIgnoreCase((child.getNodeName()))) {
- // if current child is required then add his to list
- if (name.equalsIgnoreCase((child.getNodeName()))) {
+ elements.add(child);
- elements.add(child);
+ } else {
- } else {
+ findElementsByName(child, elements, name);
- findElementsByName(child, elements, name);
+ }
+ }
- }
}
- }
+ /**
+ * find all elements by name
+ *
+ * @param node -
+ * current node
+ * @param elements -
+ * list of found elements
+ * @param name -
+ * name element
+ */
+ static public void findAllElementsByName(nsIDOMNode node,
+ List<nsIDOMNode> elements, String name) {
- static public List<ImportBean> createImportBeanList(String projectName,
- String resourcePath) {
- List<ImportBean> projectToImport = new ArrayList<ImportBean>();
- projectToImport.add(createImportBean(projectName, resourcePath));
- return projectToImport;
- }
+ try {
+ nsIDOMNodeList list = node.getChildNodes();
+ if (node.getNodeName().equalsIgnoreCase(name)) {
+ elements.add(node);
+ }
+ for (int i = 0; i < list.getLength(); i++) {
+ findAllElementsByName(list.item(i), elements, name);
+ }
+ } catch (XPCOMException e) {
+ // Ignore
+ return;
+ }
+ }
- static public ImportBean createImportBean(String projectName,
- String resourcePath) {
- ImportBean importBean = new ImportBean();
- importBean.setImportProjectName(projectName);
- importBean.setImportProjectPath(resourcePath);
- return importBean;
- }
+ static public List<ImportBean> createImportBeanList(String projectName,
+ String resourcePath) {
+ List<ImportBean> projectToImport = new ArrayList<ImportBean>();
+ projectToImport.add(createImportBean(projectName, resourcePath));
+ return projectToImport;
+ }
+
+ static public ImportBean createImportBean(String projectName,
+ String resourcePath) {
+ ImportBean importBean = new ImportBean();
+ importBean.setImportProjectName(projectName);
+ importBean.setImportProjectPath(resourcePath);
+ return importBean;
+ }
}