JBoss Tools SVN: r9166 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-07-17 11:04:51 -0400 (Thu, 17 Jul 2008)
New Revision: 9166
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/META-INF/MANIFEST.MF
Log:
ADD JUNIT https://jira.jboss.com:8443/jira/browse/JBIDE-2010
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/META-INF/MANIFEST.MF 2008-07-17 15:04:47 UTC (rev 9165)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/META-INF/MANIFEST.MF 2008-07-17 15:04:51 UTC (rev 9166)
@@ -21,3 +21,4 @@
org.jboss.tools.vpe.ui.test
Eclipse-LazyStart: true
Bundle-ClassPath: vpe-rf-test.jar
+Export-Package: org.jboss.tools.jsf.vpe.richfaces.test
16 years, 3 months
JBoss Tools SVN: r9165 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: template and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-07-17 11:04:47 -0400 (Thu, 17 Jul 2008)
New Revision: 9165
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHref.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
Log:
ADD JUNIT https://jira.jboss.com:8443/jira/browse/JBIDE-2010
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-07-17 15:04:41 UTC (rev 9164)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-07-17 15:04:47 UTC (rev 9165)
@@ -436,11 +436,14 @@
//
// }
- if (template.getClass().getName().contains("Rich") || template.getClass().getName().contains("Jsf")) {
+ if (template.getClass().getName().contains("Rich") || template.getClass().getName().contains("Jsf")
+ || template.getClass().getName().toLowerCase().contains("vpehtmltemplate")
+ /*|| template.getClass().getName().toLowerCase().contains("vpecomposition")*/) {
final Element sourceNodeClone = (Element) ((Element) sourceNode).cloneNode(true);
+
template.beforeTemplateCreated(getPageContext(), sourceNodeClone, getVisualDocument());
creationData = template.create(getPageContext(), sourceNodeClone, getVisualDocument());
- }else{
+ } else {
creationData = template.create(getPageContext(), sourceNode, getVisualDocument());
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2008-07-17 15:04:41 UTC (rev 9164)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2008-07-17 15:04:47 UTC (rev 9165)
@@ -21,6 +21,7 @@
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.eclipse.wst.xml.core.internal.document.TextImpl;
import org.jboss.tools.jst.jsp.editor.ITextFormatter;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeSourceInnerDragInfo;
@@ -1473,22 +1474,34 @@
// }
// }
// }
-// }
+// }
//
// System.err.println("Hello world4");
}
+ @SuppressWarnings("restriction")
public void beforeTemplateCreated(VpePageContext pageContext, Node sourceNode, nsIDOMDocument domDocument) {
final IFile file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
if ((file != null) && (sourceNode.getNodeType() == Node.ELEMENT_NODE) && ElService.getInstance().isAvailable(file)) {
+ // Node first((Element
+ Node text = sourceNode.getFirstChild();
+ if(text instanceof TextImpl){
+ ((TextImpl)text).setData(ElService.getInstance().replaceEl(file, ((TextImpl)text).getData()));
+ }
final NamedNodeMap nodeMap = sourceNode.getAttributes();
for (int i = 0; i < nodeMap.getLength(); i++) {
final Attr n = (Attr)nodeMap.item(i);
- n.setValue(ElService.getInstance().replaceEl(file, n.getValue()));
+ n.setValue(ElService.getInstance().replaceEl(file, n.getValue()));
}
+ if ((sourceNode.getChildNodes() != null) && (sourceNode.getChildNodes().getLength() > 0)) {
+ for (int j = 0; j < sourceNode.getChildNodes().getLength(); j++) {
+ beforeTemplateCreated(pageContext, sourceNode.getChildNodes().item(j), domDocument);
+ }
+ }
+
}
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHref.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHref.java 2008-07-17 15:04:41 UTC (rev 9164)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionHref.java 2008-07-17 15:04:47 UTC (rev 9165)
@@ -32,7 +32,7 @@
public VpeValue exec(VpePageContext pageContext, Node sourceNode) {
String tagValue = getParameter(0).exec(pageContext, sourceNode).stringValue();
- tagValue = resolveEL(tagValue);
+ tagValue = resolveEL(pageContext,tagValue);
IPath tagPath = new Path(tagValue);
if (tagPath.isEmpty()) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-07-17 15:04:41 UTC (rev 9164)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-07-17 15:04:47 UTC (rev 9165)
@@ -35,6 +35,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.css.ResourceReference;
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
+import org.jboss.tools.vpe.editor.util.ElService;
import org.w3c.dom.Node;
public class VpeFunctionSrc extends VpeFunction {
@@ -44,10 +45,9 @@
public VpeValue exec(VpePageContext pageContext, Node sourceNode) {
String tagValue = getParameter(0).exec(pageContext, sourceNode)
.stringValue();
-
- tagValue = resolveEL(tagValue);
-
+ tagValue = resolveEL(pageContext,tagValue);
IFile iFile = VpeCreatorUtil.getFile(tagValue, pageContext);
+
if (iFile != null) {
return new VpeValue(getPrefix()+iFile.getLocation().toString());
}
@@ -235,9 +235,11 @@
* temporary solution to solve #{facesContext.externalContext.requestContextPath}
* JBIDE-1410
*/
- protected String resolveEL(String value) {
- String resolvedValue = value.replaceFirst("^\\s*(\\#|\\$)\\{facesContext.externalContext.requestContextPath\\}", ""); //$NON-NLS-1$ //$NON-NLS-2$
-
- return resolvedValue;
+ protected String resolveEL(VpePageContext pageContext, String value) {
+ String resolvedValue = value.replaceFirst("^\\s*(\\#|\\$)\\{facesContext.externalContext.requestContextPath\\}", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ final IFile file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
+
+ resolvedValue = ElService.getInstance().replaceEl(file, resolvedValue);
+ return resolvedValue;
}
}
\ No newline at end of file
16 years, 3 months
JBoss Tools SVN: r9164 - in trunk/vpe/tests/org.jboss.tools.vpe.test: src/org/jboss/tools/vpe/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-07-17 11:04:41 -0400 (Thu, 17 Jul 2008)
New Revision: 9164
Added:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/CommonJBIDE2010Test.java
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2010Test.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/ElPreferencesTestCase.java
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
Log:
ADD JUNIT https://jira.jboss.com:8443/jira/browse/JBIDE-2010
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF 2008-07-17 15:03:05 UTC (rev 9163)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF 2008-07-17 15:04:41 UTC (rev 9164)
@@ -10,8 +10,14 @@
org.junit,
org.jboss.tools.common,
org.jboss.tools.vpe,
+ org.jboss.tools.jst.jsp,
org.jboss.tools.vpe.ui.test,
org.jboss.tools.jsf.vpe.jsf.test,
+ org.jboss.tools.jsf.vpe.richfaces.test,
+ org.jboss.tools.common.model,
+ org.jboss.tools.jsf.vpe.richfaces,
+ org.jboss.tools.vpe.xulrunner,
+ org.mozilla.xpcom,
org.jboss.tools.tests;bundle-version="2.0.0",
org.jboss.tools.common.model.ui;bundle-version="2.0.0"
Eclipse-LazyStart: true
Added: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/CommonJBIDE2010Test.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/CommonJBIDE2010Test.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/CommonJBIDE2010Test.java 2008-07-17 15:04:41 UTC (rev 9164)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * 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.vpe.test;
+
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.jsf.vpe.richfaces.test.CommonRichFacesTestCase;
+import org.jboss.tools.vpe.editor.css.ELReferenceList;
+import org.jboss.tools.vpe.editor.css.ResourceReference;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+
+
+/**
+ * The common test case for the all test cases related to the <a
+ * href="https://jira.jboss.com:8443/jira/browse/JBIDE-2010"
+ * >JBIDE-2010</a>issue.
+ */
+public abstract class CommonJBIDE2010Test extends CommonRichFacesTestCase {
+
+ /** The Constant VALUE_4. */
+ protected static final String VALUE_4 = "background:red";
+
+ /** The Constant KEY_4. */
+ protected static final String KEY_4 = "#{bean1.property2}";
+
+ /** The Constant IMPORT_PROJECT_NAME. */
+ public static final String IMPORT_PROJECT_NAME = "jsfTest";
+
+ /** The Constant KEY_3. */
+ protected static final String KEY_3 = "#{facesContext.requestPath}";
+
+ /** The Constant KEY_2. */
+ protected static final String KEY_2 = "#{beanA.property2}";
+
+ /** The Constant DIR_TEST_PAGE_NAME. */
+ protected static final String DIR_TEST_PAGE_NAME_2 = "JBIDE/2010/page2.jsp";
+
+ /** The Constant DIR_TEST_PAGE_NAME. */
+ protected static final String DIR_TEST_PAGE_NAME = "JBIDE/2010/page.jsp";
+
+ /** The Constant KEY_1. */
+ protected static final String KEY_1 = "#{beanA.property1}";
+
+ /** The Constant elValuesMap. */
+ protected static final Map<String, String> elValuesMap = new HashMap<String, String>();
+
+ /** The file. */
+ protected IFile file;
+
+ /**
+ * The Constructor.
+ *
+ * @param name the name
+ */
+ public CommonJBIDE2010Test(String name) {
+ super(name);
+
+ }
+
+ /**
+ * Sets the up.
+ *
+ * @throws Exception the exception
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ elValuesMap.put(KEY_1, "/path/image/path/to/image/");
+ elValuesMap.put(KEY_2, "/path2/");
+ elValuesMap.put(KEY_3, "/facesContext/");
+ elValuesMap.put(KEY_4, VALUE_4);
+ file = (IFile) TestUtil.getComponentPath(DIR_TEST_PAGE_NAME, IMPORT_PROJECT_NAME);
+ ResourceReference[] entries = new ResourceReference[elValuesMap.size()];
+ int i = 0;
+ for (Entry<String, String> string : elValuesMap.entrySet()) {
+
+ entries[i] = new ResourceReference(string.getKey(), ResourceReference.PROJECT_SCOPE);
+ entries[i].setProperties(string.getValue());
+ i++;
+
+ setValues(entries);
+ }
+ }
+
+ /**
+ * Sets the values.
+ *
+ * @param key the key
+ * @param value the value
+ * @param scope the scope
+ * @param entries the entries
+ */
+ protected void setValues(ResourceReference[] entries) {
+ ELReferenceList.getInstance().setAllResources(file, entries);
+ }
+
+ /**
+ * Tear down.
+ *
+ * @throws Exception the exception
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ ELReferenceList.getInstance().setAllResources(this.file, new ResourceReference[0]);
+ this.file = null;
+
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/CommonJBIDE2010Test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/ElPreferencesTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/ElPreferencesTestCase.java 2008-07-17 15:03:05 UTC (rev 9163)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/ElPreferencesTestCase.java 2008-07-17 15:04:41 UTC (rev 9164)
@@ -1,40 +1,30 @@
+/*******************************************************************************
+ * 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.vpe.test;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
-import org.jboss.tools.vpe.editor.css.ELReferenceList;
-import org.jboss.tools.vpe.editor.css.ResourceReference;
import org.jboss.tools.vpe.editor.util.ElService;
-import org.jboss.tools.vpe.ui.test.TestUtil;
-import org.jboss.tools.vpe.ui.test.VpeTest;
/**
* <p>
- * Test case for testing service {@link ElService}
+ * Test case for testing service {@link ElService}
* <p>
* See <a href="http://jira.jboss.com/jira/browse/JBIDE-2010">JBIDE-2010</a> issue
+ *
*/
-public class ElPreferencesTestCase extends VpeTest {
+public class ElPreferencesTestCase extends CommonJBIDE2010Test {
- /** The Constant KEY_3. */
- private static final String KEY_3 = "#{facesContext.requestPath}";
- /** The Constant KEY_2. */
- private static final String KEY_2 = "#{beanA.property2}";
-
- /** The Constant IMPORT_PROJECT_NAME. */
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
-
- /** The Constant DIR_TEST_PAGE_NAME. */
- private static final String DIR_TEST_PAGE_NAME = "JBIDE/2010/page.xhtml";
-
/**
* The Constructor.
*
@@ -46,71 +36,6 @@
}
/**
- * The Constructor.
- */
- public ElPreferencesTestCase() {
- super(ElPreferencesTestCase.class.getName());
-
- }
-
- /** The Constant KEY_1. */
- private static final String KEY_1 = "#{beanA.property1}";
-
- /** The Constant elValuesMap. */
- protected static final Map<String, String> elValuesMap = new HashMap<String, String>();
-
- /** The file. */
- private IFile file;
-
- /**
- * Sets the up.
- *
- * @throws Exception the exception
- */
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- elValuesMap.put(KEY_1, "/path/image/path/to/image/");
- elValuesMap.put(KEY_2, "/path2/");
- elValuesMap.put(KEY_3, "/facesContext/");
- file = (IFile) TestUtil.getComponentPath(DIR_TEST_PAGE_NAME, IMPORT_PROJECT_NAME);
- ResourceReference[] entries = new ResourceReference[elValuesMap.size()];
- int i = 0;
- for (Entry<String, String> string : elValuesMap.entrySet()) {
-
- entries[i] = new ResourceReference(string.getKey(), ResourceReference.PROJECT_SCOPE);
- entries[i].setProperties(string.getValue());
- i++;
-
- setValues(entries);
- }
- }
-
- /**
- * Sets the values.
- *
- * @param key the key
- * @param value the value
- * @param scope the scope
- * @param entries the entries
- */
- protected void setValues(ResourceReference[] entries) {
-
- ELReferenceList.getInstance().setAllResources(file, entries);
- }
-
- /**
- * Tear down.
- *
- * @throws Exception the exception
- */
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- }
-
- /**
* Test replace attribute value.
*
* @throws CoreException the core exception
Added: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2010Test.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2010Test.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2010Test.java 2008-07-17 15:04:41 UTC (rev 9164)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * 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.vpe.test;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.jsf.vpe.richfaces.test.RichFacesComponentTest;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+
+
+/**
+ * Test case for testing https://jira.jboss.com:8443/jira/browse/JBIDE-2010
+ * issue.
+ *
+ * @author Eugeny Stherbin
+ */
+public class JBIDE2010Test extends CommonJBIDE2010Test {
+
+ /**
+ * The Constructor.
+ *
+ * @param name the name
+ */
+ public JBIDE2010Test(String name) {
+ super(name);
+ }
+
+ /**
+ * Test el template simple.
+ *
+ * @throws CoreException the core exception
+ * @throws Throwable the throwable
+ */
+ public void testElTemplateSimple() throws CoreException, Throwable {
+ final nsIDOMElement rst = performTestForRichFacesComponent((IFile) TestUtil.getComponentPath(DIR_TEST_PAGE_NAME_2,
+ IMPORT_PROJECT_NAME));
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "td" elements
+
+ TestUtil.findAllElementsByName(rst, elements, HTML.TAG_SPAN);
+
+ assertEquals("Count of divs should be equals 1", 1, elements.size());
+ final nsIDOMElement spanOne = (nsIDOMElement) elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertEquals("Style attribute should be substituted", VALUE_4, spanOne.getFirstChild().getNodeValue());
+ int i = 0;
+ DOMTreeDumper dumper = new DOMTreeDumper();
+ dumper.dumpToStream(System.out, rst);
+ // for(nsIDOMNode n:elements){
+ // final nsIDOMElement d = (nsIDOMElement)
+ // elements.get(i++).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ // System.out.println("JBIDE2010Test.testElTemplateSimple()-"+d.
+ // getAttribute("style"));
+ // }
+
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2010Test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-07-17 15:03:05 UTC (rev 9163)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-07-17 15:04:41 UTC (rev 9164)
@@ -41,7 +41,7 @@
suite.addTestSuite(VpeEditorPreferencesPageTest.class);
suite.addTestSuite(VpeTemplateManagerTest.class);
suite.addTestSuite(ElPreferencesTestCase.class);
-
+ suite.addTestSuite(JBIDE2010Test.class);
List<ImportBean> projectToImport = new ArrayList<ImportBean>();
ImportBean importBean = new ImportBean();
16 years, 3 months
JBoss Tools SVN: r9163 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-07-17 11:03:05 -0400 (Thu, 17 Jul 2008)
New Revision: 9163
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page2.jsp
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page.xhtml
Log:
ADD JUNIT https://jira.jboss.com:8443/jira/browse/JBIDE-2010
Copied: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page.jsp (from rev 9138, trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page.xhtml)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page.jsp 2008-07-17 15:03:05 UTC (rev 9163)
@@ -0,0 +1,11 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<html>
+<head>
+</head>
+<body>
+<f:view>
+ <h:outputText value="Hello world"/>
+</f:view>
+</body>
+</html>
\ No newline at end of file
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page.xhtml 2008-07-17 14:46:12 UTC (rev 9162)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page.xhtml 2008-07-17 15:03:05 UTC (rev 9163)
@@ -1,11 +0,0 @@
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-<html>
-<head>
-</head>
-<body>
-<f:view>
- <h:outputText value="Hello world"
-</f:view>
-</body>
-</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page2.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page2.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page2.jsp 2008-07-17 15:03:05 UTC (rev 9163)
@@ -0,0 +1,11 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<html>
+<head>
+</head>
+<body>
+
+
+ <h:outputText id="id1" value="#{bean1.property2}"/>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2010/page2.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
16 years, 3 months
JBoss Tools SVN: r9162 - in trunk/seam/plugins: org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-07-17 10:46:12 -0400 (Thu, 17 Jul 2008)
New Revision: 9162
Removed:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2485 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2008-07-17 13:52:33 UTC (rev 9161)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2008-07-17 14:46:12 UTC (rev 9162)
@@ -28,7 +28,7 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.project.facet.ISeamCoreConstants;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreferenceInitializer;
/**
@@ -244,7 +244,7 @@
throw new IllegalArgumentException("Project must not be null.");
}
try {
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ISeamCoreConstants.SEAM_CORE_FACET_ID);
+ IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ISeamFacetDataModelProperties.SEAM_FACET_ID);
IFacetedProject facetedProject = ProjectFacetsManager.create(project);
if(facetedProject!=null) {
IProjectFacetVersion facetVersion = facetedProject.getInstalledVersion(facet);
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java 2008-07-17 13:52:33 UTC (rev 9161)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java 2008-07-17 14:46:12 UTC (rev 9162)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * 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.seam.internal.core.project.facet;
-
-/**
- * Old fashion way to define constants
- * @author eskimo
- */
-public interface ISeamCoreConstants {
-
- /**
- * Seam Facet ID constant
- */
- String SEAM_CORE_FACET_ID = "jst.seam"; //$NON-NLS-1$
-
- /**
- * Seam 1.2 Facet Version constant
- */
- String SEAM_CORE_FACET_VERSION_12 = "1.2"; //$NON-NLS-1$
-
- /**
- * Seam 2.0 Facet Version constant
- */
- String SEAM_CORE_FACET_VERSION_20 = "2.0"; //$NON-NLS-1$
-}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2008-07-17 13:52:33 UTC (rev 9161)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2008-07-17 14:46:12 UTC (rev 9162)
@@ -34,11 +34,24 @@
*/
public interface ISeamFacetDataModelProperties extends IActionConfigFactory {
- // Seam Preferences names constants
+ /**
+ * Seam Facet ID constant
+ */
+ String SEAM_FACET_ID = "jst.seam"; //$NON-NLS-1$
- String SEAM_FACET_ID = "jst.seam";
+ /**
+ * Seam 1.2 Facet Version constant
+ */
+ String SEAM_FACET_VERSION_12 = "1.2"; //$NON-NLS-1$
/**
+ * Seam 2.0 Facet Version constant
+ */
+ String SEAM_FACET_VERSION_20 = "2.0"; //$NON-NLS-1$
+
+ // Seam Preferences names constants
+
+ /**
* Source folder used session objects: actions, forms, conversations, beans
* web pages backing beans
*/
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-07-17 13:52:33 UTC (rev 9161)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-07-17 14:46:12 UTC (rev 9162)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.jboss.tools.seam.core.SeamCorePlugin;
/**
@@ -94,7 +95,7 @@
} else if (JBOSS_AS_DEPLOY_AS.equals(propertyName)) {
return "Jboos_DEPLOY_AS"; //$NON-NLS-1$
} else if (propertyName.equals(FACET_ID)) {
- return ISeamCoreConstants.SEAM_CORE_FACET_ID;
+ return ISeamFacetDataModelProperties.SEAM_FACET_ID;
} else if (SEAM_TEST_PROJECT.equals(propertyName)) {
return EMPTY_STRING;
} else if (SEAM_EJB_PROJECT.equals(propertyName)) {
@@ -111,6 +112,20 @@
return super.getDefaultProperty(propertyName);
}
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider#getValidPropertyDescriptors(java.lang.String)
+ */
+ public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
+ if (ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER.equals(propertyName)) {
+ String runtimeName = (String)getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+ if(runtimeName!=null) {
+ return SeamFacetProjectCreationDataModelProvider.getServerPropertyDescriptors(runtimeName);
+ }
+ }
+ return super.getValidPropertyDescriptors(propertyName);
+ }
+
/**
* Calculate path to templates folder
*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java 2008-07-17 13:52:33 UTC (rev 9161)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java 2008-07-17 14:46:12 UTC (rev 9162)
@@ -95,7 +95,7 @@
public boolean propertySet(String propertyName, Object propertyValue) {
if( propertyName.equals( IFacetProjectCreationDataModelProperties.FACET_RUNTIME )){
FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
- IDataModel seamFacet = map.getFacetDataModel( ISeamCoreConstants.SEAM_CORE_FACET_ID );
+ IDataModel seamFacet = map.getFacetDataModel(ISeamFacetDataModelProperties.SEAM_FACET_ID);
seamFacet.setProperty( ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, propertyValue );
if (propertyValue != null) {
@@ -108,11 +108,10 @@
}
}
}
-
} else if (propertyName.equals(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER)) {
FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
- IDataModel seamFacet = map.getFacetDataModel( ISeamCoreConstants.SEAM_CORE_FACET_ID );
- seamFacet.setProperty( ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, propertyValue );
+ IDataModel seamFacet = map.getFacetDataModel(ISeamFacetDataModelProperties.SEAM_FACET_ID);
+ seamFacet.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, propertyValue);
}
return super.propertySet(propertyName, propertyValue);
@@ -125,39 +124,41 @@
return names;
}
+ public static DataModelPropertyDescriptor[] getServerPropertyDescriptors(String runtimeName) {
+ List<IServer> list = getServers(runtimeName);
+
+ DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[list.size() + 1];
+
+ Iterator<IServer> iterator = list.iterator();
+ for (int i = 0; i < descriptors.length - 1; i++) {
+ IServer server = (IServer) iterator.next();
+ descriptors[i] = new DataModelPropertyDescriptor(server, server.getName());
+ }
+ descriptors[descriptors.length - 1] = new DataModelPropertyDescriptor(null, "<None>");
+
+ if(descriptors.length > 2){
+ Arrays.sort(descriptors, 0, descriptors.length - 2, new Comparator() {
+ public int compare(Object arg0, Object arg1) {
+ DataModelPropertyDescriptor d1 = (DataModelPropertyDescriptor)arg0;
+ DataModelPropertyDescriptor d2 = (DataModelPropertyDescriptor)arg1;
+ return d1.getPropertyDescription().compareTo(d2.getPropertyDescription());
+ }
+ });
+ }
+
+ return descriptors;
+ }
+
public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
if (ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER.equals(propertyName)) {
- Collection projectFacets = (Collection)getProperty(REQUIRED_FACETS_COLLECTION);
Object rt = getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
String primaryName = getRuntimeName(rt);
-
- List<IServer> list = getServers(primaryName);
-
- DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[list.size() + 1];
-
- Iterator<IServer> iterator = list.iterator();
- for (int i = 0; i < descriptors.length - 1; i++) {
- IServer server = (IServer) iterator.next();
- descriptors[i] = new DataModelPropertyDescriptor(server, server.getName());
- }
- descriptors[descriptors.length - 1] = new DataModelPropertyDescriptor(null, "<None>");
-
- if(descriptors.length > 2){
- Arrays.sort(descriptors, 0, descriptors.length - 2, new Comparator() {
- public int compare(Object arg0, Object arg1) {
- DataModelPropertyDescriptor d1 = (DataModelPropertyDescriptor)arg0;
- DataModelPropertyDescriptor d2 = (DataModelPropertyDescriptor)arg1;
- return d1.getPropertyDescription().compareTo(d2.getPropertyDescription());
- }
- });
- }
-
- return descriptors;
+ return getServerPropertyDescriptors(primaryName);
}
return super.getValidPropertyDescriptors(propertyName);
}
- private List<IServer> getServers(String runtimeName) {
+ private static List<IServer> getServers(String runtimeName) {
ArrayList<IServer> list = new ArrayList<IServer>();
if( runtimeName != null ) {
if (runtimeName != null) {
@@ -175,7 +176,7 @@
}
return list;
}
-
+
/**
* Performs the property validation
*
@@ -230,7 +231,7 @@
return SeamCorePlugin.createErrorStatus(SeamCoreMessages.ERROR_JBOSS_AS_TARGET_SERVER_INCOMPATIBLE, null);
}
- private String getRuntimeName(Object rt) {
+ private static String getRuntimeName(Object rt) {
if( rt == null ) {
return null;
}
@@ -291,5 +292,4 @@
}
}
}
-
-}
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2008-07-17 13:52:33 UTC (rev 9161)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2008-07-17 14:46:12 UTC (rev 9162)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.Set;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
@@ -32,16 +33,19 @@
import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
import org.eclipse.wst.server.ui.ServerUIUtil;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
-import org.jboss.tools.seam.internal.core.project.facet.ISeamCoreConstants;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetProjectCreationDataModelProvider;
import org.jboss.tools.seam.ui.ISeamHelpContextIds;
@@ -69,26 +73,61 @@
return DataModelFactory.createDataModel(new SeamFacetProjectCreationDataModelProvider());
}
+ private SeamWebProjectFirstPage firstPage;
+
@Override
protected IWizardPage createFirstPage() {
-// IWizardPage page = super.createFirstPage();
+ firstPage = new SeamWebProjectFirstPage(model, "first.page"); //$NON-NLS-1$
- IWizardPage page = new SeamWebProjectFirstPage(model, "first.page"); //$NON-NLS-1$
-
- page.setImageDescriptor(ImageDescriptor.createFromFile(SeamFormWizard.class, "SeamWebProjectWizBan.png")); //$NON-NLS-1$
- page.setTitle(SeamUIMessages.SEAM_PROJECT_WIZARD_SEAM_WEB_PROJECT);
- page.setDescription(SeamUIMessages.SEAM_PROJECT_WIZARD_CREATE_STANDALONE_SEAM_WEB_PROJECT);
- return page;
+ firstPage.setImageDescriptor(ImageDescriptor.createFromFile(SeamFormWizard.class, "SeamWebProjectWizBan.png")); //$NON-NLS-1$
+ firstPage.setTitle(SeamUIMessages.SEAM_PROJECT_WIZARD_SEAM_WEB_PROJECT);
+ firstPage.setDescription(SeamUIMessages.SEAM_PROJECT_WIZARD_CREATE_STANDALONE_SEAM_WEB_PROJECT);
+ return firstPage;
}
+ // We need these controls there to listen to them to set seam action models.
+ private Combo matchedServerTargetCombo;
+ private Control[] dependentServerControls;
+ private Combo serverRuntimeTargetCombo;
+
@Override
public void createPageControls(Composite container) {
super.createPageControls(container);
+ synchSeamActionModels();
+ getFacetedProjectWorkingCopy().addListener(new IFacetedProjectListener() {
+ public void handleEvent(IFacetedProjectEvent event) {
+ synchSeamActionModels();
+ }
+ }, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED);
Control control = findGroupByText(getShell(), SeamUIMessages.SEAM_PROJECT_WIZARD_EAR_MEMBERSHIP);
if (control != null)
control.setVisible(false);
}
+ private void synchSeamActionModels() {
+ Set<Action> actions = getFacetedProjectWorkingCopy().getProjectFacetActions();
+ for (Action action : actions) {
+ if(ISeamFacetDataModelProperties.SEAM_FACET_ID.equals(action.getProjectFacetVersion().getProjectFacet().getId())) {
+ IDataModel model = (IDataModel)action.getConfig();
+ Object targetServer = this.model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
+ if(targetServer!=null) {
+ model.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, targetServer);
+ }
+ Object targetRuntime = this.model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+ if(targetRuntime!=null) {
+ Object targetRuntimeName = targetRuntime;
+ if(targetRuntime instanceof IRuntime) {
+ targetRuntimeName = ((IRuntime)targetRuntime).getName();
+ }
+ model.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, targetRuntimeName);
+ }
+ DataModelSynchHelper synchHelper = firstPage.initializeSynchHelper(model);
+ synchHelper.synchCombo(matchedServerTargetCombo, ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, dependentServerControls);
+ synchHelper.synchCombo(serverRuntimeTargetCombo, ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, null);
+ }
+ }
+ }
+
Control findControlByClass(Composite comp, Class claz) {
for (Control child : comp.getChildren()) {
if(child.getClass()==claz) {
@@ -142,14 +181,13 @@
super(model, pageName);
}
- protected Combo matchedServerTargetCombo;
-
protected Composite createTopLevelComposite(Composite parent) {
Composite top = new Composite(parent, SWT.NONE);
top.setLayout(new GridLayout());
top.setLayoutData(new GridData(GridData.FILL_BOTH));
createProjectGroup(top);
createServerTargetComposite(top);
+ serverRuntimeTargetCombo = serverTargetCombo;
createPrimaryFacetComposite(top);
createSeamServerTargetComposite(top);
createPresetPanel(top);
@@ -157,7 +195,6 @@
}
protected void createSeamServerTargetComposite(Composite parent) {
-// super.createServerTargetComposite(parent);
Group group = new Group(parent, SWT.NONE);
group.setText(SeamUIMessages.SEAM_TARGET_SERVER);
group.setLayoutData(gdhfill());
@@ -175,8 +212,8 @@
}
}
});
- Control[] depsMatched = new Control[]{serverTargetCombo, newMatchedServerTargetButton};
- synchHelper.synchCombo(matchedServerTargetCombo, ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, depsMatched);
+ dependentServerControls = new Control[]{serverTargetCombo, newMatchedServerTargetButton};
+ synchHelper.synchCombo(matchedServerTargetCombo, ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, dependentServerControls);
if (matchedServerTargetCombo.getSelectionIndex() == -1 && matchedServerTargetCombo.getVisibleItemCount() != 0)
matchedServerTargetCombo.select(0);
}
@@ -202,7 +239,7 @@
@Override
public boolean isPageComplete() {
if(super.isPageComplete()) {
- IProjectFacet pFacet = ProjectFacetsManager.getProjectFacet(ISeamCoreConstants.SEAM_CORE_FACET_ID);
+ IProjectFacet pFacet = ProjectFacetsManager.getProjectFacet(ISeamFacetDataModelProperties.SEAM_FACET_ID);
IFacetedProjectWorkingCopy fProject = getFacetedProjectWorkingCopy();
if(fProject!=null) {
IProjectFacetVersion seamFacet = fProject.getProjectFacetVersion(pFacet);
16 years, 3 months
JBoss Tools SVN: r9161 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-07-17 09:52:33 -0400 (Thu, 17 Jul 2008)
New Revision: 9161
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
JBIDE-2505
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-07-17 11:39:15 UTC (rev 9160)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-07-17 13:52:33 UTC (rev 9161)
@@ -280,8 +280,9 @@
// TODO Sergey Vasilyev figure out with nsIPressShell
// presShell = browser.getPresShell();
+ //initialization visual selection controller
visualSelectionController = new VpeSelectionController(visualEditor.getEditor().getSelectionController());
-
+
selectionBuilder = new VpeSelectionBuilder(domMapping, sourceBuilder,
visualBuilder, visualSelectionController);
@@ -1032,12 +1033,12 @@
nsIDOMNode node = SelectionUtil.getSelectedNode(selection);
if (node != null
&& node.getNodeType() == nsIDOMNode.TEXT_NODE) {
-
- // selectionBuilder.setSelection(selection);
-
+
selectionManager.setSelection(selection);
}
}
+ //enables cursor on selection event
+ visualSelectionController.setCaretEnabled(true);
} catch (Exception e) {
VpePlugin.reportProblem(e);
} finally {
16 years, 3 months
JBoss Tools SVN: r9160 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor: edit and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-07-17 07:39:15 -0400 (Thu, 17 Jul 2008)
New Revision: 9160
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/AddExceptionOnDiagramHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/AddPageOnDiagramHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2524
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/AddExceptionOnDiagramHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/AddExceptionOnDiagramHandler.java 2008-07-17 00:12:11 UTC (rev 9159)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/AddExceptionOnDiagramHandler.java 2008-07-17 11:39:15 UTC (rev 9160)
@@ -31,7 +31,7 @@
int y = Integer.parseInt(p.getProperty("mouse.y"));
PageException newException = PagesFactoryImpl.eINSTANCE.createPgException();
- newException.setName("");
+ newException.setName("<initialize>");
newException.setLocation(new Point(x,y));
part.getPagesModel().getChildren().add(newException);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/AddPageOnDiagramHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/AddPageOnDiagramHandler.java 2008-07-17 00:12:11 UTC (rev 9159)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/AddPageOnDiagramHandler.java 2008-07-17 11:39:15 UTC (rev 9160)
@@ -30,7 +30,7 @@
int y = Integer.parseInt(p.getProperty("mouse.y"));
Page newPage = PagesFactoryImpl.eINSTANCE.createPage();
- newPage.setName("");
+ newPage.setName("<initialize>");
newPage.setLocation(new Point(x,y));
part.getPagesModel().getChildren().add(newPage);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java 2008-07-17 00:12:11 UTC (rev 9159)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java 2008-07-17 11:39:15 UTC (rev 9160)
@@ -242,7 +242,8 @@
return;
((Notifier) getModel()).eAdapters().add(this);
super.activate();
- if("".equals(getExceptionModel().getName())){
+ if("<initialize>".equals(getExceptionModel().getName())){
+ getExceptionModel().setName("");
DirectEditRequest req = new DirectEditRequest();
req.setType(GraphicalPartFactory.REQ_INIT_EDIT);
performRequest(req);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-07-17 00:12:11 UTC (rev 9159)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-07-17 11:39:15 UTC (rev 9160)
@@ -250,7 +250,8 @@
return;
((Notifier) getModel()).eAdapters().add(this);
super.activate();
- if("".equals(getPageModel().getName())){
+ if("<initialize>".equals(getPageModel().getName())){
+ getPageModel().setName("");
DirectEditRequest req = new DirectEditRequest();
req.setType(GraphicalPartFactory.REQ_INIT_EDIT);
performRequest(req);
16 years, 3 months
JBoss Tools SVN: r9159 - trunk/core/tests/org.jboss.ide.eclipse.archives.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-07-16 20:12:11 -0400 (Wed, 16 Jul 2008)
New Revision: 9159
Modified:
trunk/core/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF
Log:
JBIDE-1406 more changes for max
Modified: trunk/core/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF 2008-07-17 00:10:42 UTC (rev 9158)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/META-INF/MANIFEST.MF 2008-07-17 00:12:11 UTC (rev 9159)
@@ -9,7 +9,8 @@
org.jboss.ide.eclipse.archives.core,
org.eclipse.core.resources,
org.jboss.tools.tests,
- org.jboss.tools.common.test
+ org.jboss.tools.common.test,
+ org.eclipse.core.variables;bundle-version="3.2.100"
Eclipse-LazyStart: true
Bundle-ClassPath: archivestest.jar
Export-Package: org.jboss.ide.eclipse.archives.test,
16 years, 3 months
JBoss Tools SVN: r9158 - in trunk/core/plugins: org.jboss.ide.eclipse.archives.core/schema and 14 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-07-16 20:10:42 -0400 (Wed, 16 Jul 2008)
New Revision: 9158
Added:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveFilesetDestinationComposite.java
Removed:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/schema/variableProvider.exsd
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/IVariableProvider.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariableManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/dialogs/ArchivesVariableDialog.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/dialogs/SelectVariableDialog.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/VariablesPreferencePage.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/VariablesContentProvider.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/VariablesLabelProvider.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveDestinationComposite.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveFilesetDestinationComposite.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveNodeDestinationComposite.java
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/plugin.xml
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVFS.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveImpl.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/META-INF/MANIFEST.MF
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveSourceDestinationComposite.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
Log:
JBIDE-1406 more changes for max
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/plugin.xml
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/plugin.xml 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/plugin.xml 2008-07-17 00:10:42 UTC (rev 9158)
@@ -3,7 +3,6 @@
<plugin>
<extension-point id="archiveTypes" name="JBoss Tools Package Type" schema="schema/archiveTypes.exsd"/>
<extension-point id="actionTypes" name="JBoss Tools Build Action Type" schema="schema/actionTypes.exsd"/>
- <extension-point id="variableProviders" name="Variable Provider" schema="schema/variableProvider.exsd"/>
<extension
id="archivesNature"
name="JBossIDE Packages Nature"
@@ -53,14 +52,13 @@
label="Ant Task">
</actionType>
</extension>
-
-
<extension
- point="org.jboss.ide.eclipse.archives.core.variableProviders">
- <provider class="org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariableManager$DefaultVariableProvider"/>
- <provider class="org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariableManager$LinkedResourceVariableProvider"/>
- <provider class="org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariableManager$ClasspathVariableProvider"/>
- <provider class="org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariableManager$ValueVariableProvider"/>
- </extension>
-
+ point="org.eclipse.core.variables.dynamicVariables">
+ <variable
+ description="The project an archives node is declared in."
+ name="archives_current_project"
+ resolver="org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVFS"
+ supportsArgument="false">
+ </variable>
+ </extension>
</plugin>
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/schema/variableProvider.exsd
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/schema/variableProvider.exsd 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/schema/variableProvider.exsd 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,102 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.jboss.ide.eclipse.archives.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.jboss.ide.eclipse.archives.core" id="packageTypes" name="JBoss Tools Package Type"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="provider" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="provider">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.jboss.ide.eclipse.archives.core.model.IVariableProvider"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiInfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/IVariableProvider.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/IVariableProvider.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/IVariableProvider.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,11 +0,0 @@
-package org.jboss.ide.eclipse.archives.core.model;
-
-public interface IVariableProvider extends IVariableManager {
- public String getId();
- public String getName();
- public boolean getEnabled();
- public void setEnabled(boolean val);
- public int getWeight();
- public void setWeight(int weight);
- public int getDefaultWeight();
-}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceExtensionManager.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -36,7 +36,6 @@
import org.jboss.ide.eclipse.archives.core.model.IActionType;
import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
-import org.jboss.ide.eclipse.archives.core.model.IVariableProvider;
/**
* This class will be responsible for loading extension points in the core.
@@ -125,39 +124,4 @@
}
}
}
-
-
-
- private static Hashtable<String, IVariableProvider> variableProviders;
- public IVariableProvider getVariableProvider(String id) {
- if (variableProviders == null)
- loadVariableProviders();
- return variableProviders.get(id);
- }
- public IVariableProvider[] getVariableProviders() {
- if( variableProviders == null )
- loadVariableProviders();
- Collection<IVariableProvider> c = variableProviders.values();
- return c.toArray(new IVariableProvider[c.size()]);
- }
-
- private void loadVariableProviders() {
- variableProviders = new Hashtable<String, IVariableProvider>();
- IExtension[] extensions = findExtension(VARIABLE_PROVIDER_EXTENSION_ID);
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement elements[] = extensions[i].getConfigurationElements();
- for (int j = 0; j < elements.length; j++) {
- try {
- Object executable = elements[j].createExecutableExtension("class");
- IVariableProvider type = (IVariableProvider)executable;
- variableProviders.put(type.getId(), type);
- } catch (InvalidRegistryObjectException e) {
- ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, e.getMessage(), e);
- } catch( CoreException e ) {
- ArchivesCore.getInstance().getLogger().log(IStatus.WARNING, e.getMessage(), e);
- }
- }
- }
- }
-
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVFS.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVFS.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVFS.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -7,46 +7,21 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.variables.IDynamicVariable;
+import org.eclipse.core.variables.IDynamicVariableResolver;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.model.IArchivesVFS;
-import org.jboss.ide.eclipse.archives.core.model.IVariableManager;
-import org.jboss.ide.eclipse.archives.core.xpl.StringSubstitutionEngineClone;
-public class WorkspaceVFS implements IArchivesVFS {
- protected WorkspaceVariableManager manager;
- protected StringSubstitutionEngineClone engine;
+public class WorkspaceVFS implements IArchivesVFS, IDynamicVariableResolver {
public WorkspaceVFS() {
- manager = new WorkspaceVariableManager();
- engine = new StringSubstitutionEngineClone();
}
-
- public WorkspaceVariableManager getVariableManager() {
- return manager;
- }
-
+
public String performStringSubstitution(String expression,
boolean reportUndefinedVariables) throws CoreException {
return performStringSubstitution(expression, null, reportUndefinedVariables);
}
- public String performStringSubstitution(String expression,
- String projectName, boolean reportUndefinedVariables)
- throws CoreException {
- // set this project name
- if( expression == null )
- return null;
-
- if( projectName != null ) {
- manager.setValue(IVariableManager.CURRENT_PROJECT, projectName);
- }
-
- String ret = engine.performStringSubstitution(expression, reportUndefinedVariables, manager);
-
- if( projectName != null ) {
- manager.setValue(IVariableManager.CURRENT_PROJECT, null);
- }
- return ret;
- }
-
public IPath[] getWorkspaceChildren(IPath path) {
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if( res != null || !(res instanceof IContainer)) {
@@ -90,4 +65,33 @@
return projects[i].getName();
return null;
}
+
+
+ private String currentProject;
+ public synchronized String performStringSubstitution(String expression,
+ String projectName, boolean reportUndefinedVariables)
+ throws CoreException {
+ // set this project name
+ if( expression == null )
+ return null;
+
+ currentProject = projectName;
+ try {
+ return VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(expression);
+ } finally {
+ currentProject = null;
+ }
+ }
+
+ // Since the extension point re-instantiates this, we must delegate to the official instance
+ public String resolveValue(IDynamicVariable variable, String argument)
+ throws CoreException {
+ if( this == ArchivesCore.getInstance().getVFS()) {
+ if( variable.getName().equals("archives_current_project"))
+ return currentProject;
+ } else {
+ return ((WorkspaceVFS)ArchivesCore.getInstance().getVFS()).resolveValue(variable, argument);
+ }
+ return null;
+ }
}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariableManager.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariableManager.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariableManager.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,286 +0,0 @@
-package org.jboss.ide.eclipse.archives.core.model.other.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.variables.IStringVariable;
-import org.eclipse.core.variables.IValueVariable;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.jdt.core.JavaCore;
-import org.jboss.ide.eclipse.archives.core.ArchivesCore;
-import org.jboss.ide.eclipse.archives.core.ArchivesCorePlugin;
-import org.jboss.ide.eclipse.archives.core.model.IArchivesLogger;
-import org.jboss.ide.eclipse.archives.core.model.IExtensionManager;
-import org.jboss.ide.eclipse.archives.core.model.IVariableManager;
-import org.jboss.ide.eclipse.archives.core.model.IVariableProvider;
-import org.osgi.service.prefs.BackingStoreException;
-
-public class WorkspaceVariableManager implements IVariableManager {
- public static final String DEFAULT_PROVIDER = "org.jboss.ide.eclipse.archives.core.defaultVariableProvider";
- protected IVariableProvider[] delegates;
- public WorkspaceVariableManager() {
- }
-
- public IVariableProvider[] getDelegates() {
- sort();
- IVariableProvider[] copy = new IVariableProvider[delegates.length];
- for( int i = 0; i < delegates.length; i++ )
- copy[i] = delegates[i];
- return copy;
- }
-
- public void sort() {
- if( delegates == null ) {
- IExtensionManager mgr = ArchivesCore.getInstance().getExtensionManager();
- delegates = ((WorkspaceExtensionManager)mgr).getVariableProviders();
- }
- List<IVariableProvider> l = Arrays.asList(delegates);
- Comparator<IVariableProvider> x = new Comparator<IVariableProvider>() {
- public int compare(IVariableProvider o1, IVariableProvider o2) {
- // different enablements
- if( o1.getEnabled() != o2.getEnabled())
- return o1.getEnabled() ? 1 : -1;
- // now weights
- if( o1.getWeight() != o2.getWeight() )
- return o1.getWeight() > o2.getWeight() ? 1 : -1;
- return 0;
- }
- };
- Collections.sort(l, x);
- delegates = (IVariableProvider[]) l.toArray(new IVariableProvider[l.size()]);
- }
-
- public String[] getVariableNames() {
- sort();
- ArrayList<String> list = new ArrayList<String>();
- String[] names;
- for(int i = 0; i < delegates.length; i++ ) {
- if( delegates[i].getEnabled()) {
- names = delegates[i].getVariableNames();
- for( int j = 0; j < names.length; j++ ) {
- if( !list.contains(names[j]))
- list.add(names[j]);
- }
- }
- }
-
- return (String[]) list.toArray(new String[list.size()]);
- }
-
- public boolean containsVariable(String variable) {
- sort();
- for(int i = 0; i < delegates.length; i++ )
- if( delegates[i].getEnabled() && delegates[i].containsVariable(variable))
- return true;
- return false;
- }
-
- public String getVariableValue(String variable) {
- sort();
- for(int i = 0; i < delegates.length; i++ )
- if( delegates[i].getEnabled() && delegates[i].containsVariable(variable))
- return delegates[i].getVariableValue(variable);
- return null;
- }
-
-
- public IVariableProvider getVariableLocation(String variable) {
- sort();
- for(int i = 0; i < delegates.length; i++ )
- if( delegates[i].getEnabled() && delegates[i].containsVariable(variable))
- return delegates[i];
- return null;
- }
-
- public static abstract class AbstractVariableProvider implements IVariableProvider {
- protected String id;
- protected String name;
- protected boolean enabled;
- protected int weight;
- protected int defaultWeight;
-
- public AbstractVariableProvider(String id, String name, int defaultWeight) {
- this.id = id;
- this.name = name;
- this.defaultWeight = defaultWeight;
- }
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public boolean getEnabled() {
- IEclipsePreferences prefs = new DefaultScope().getNode(ArchivesCorePlugin.PLUGIN_ID);
- return prefs.getBoolean(getPreferencePrefix() + "enabled", true);
- }
-
- public int getWeight() {
- IEclipsePreferences prefs = new DefaultScope().getNode(ArchivesCorePlugin.PLUGIN_ID);
- return prefs.getInt(getPreferencePrefix() + "weight", defaultWeight);
- }
-
- public void setEnabled(boolean b) {
- try {
- IEclipsePreferences prefs = new DefaultScope().getNode(ArchivesCorePlugin.PLUGIN_ID);
- prefs.putBoolean(getPreferencePrefix() + "enabled", b);
- prefs.flush();
- enabled = b;
- } catch (BackingStoreException e) {
- ArchivesCore.getInstance().getLogger().log(IArchivesLogger.MSG_ERR, e.getMessage(), e);
- }
- }
-
- public void setWeight(int i) {
- try {
- IEclipsePreferences prefs = new DefaultScope().getNode(ArchivesCorePlugin.PLUGIN_ID);
- prefs.putInt(getPreferencePrefix() + "weight", i);
- prefs.flush();
- weight = i;
- } catch (BackingStoreException e) {
- ArchivesCore.getInstance().getLogger().log(IArchivesLogger.MSG_ERR, e.getMessage(), e);
- }
- }
-
- public int getDefaultWeight() {
- return defaultWeight;
- }
-
- public abstract String getPreferencePrefix();
- }
-
-
- public static class DefaultVariableProvider extends AbstractVariableProvider {
- public static final String VALUE_PREFIX = "org.jboss.ide.eclipse.archives.core.model.other.internal.VariableManager.values.";
- public static final String PREFERENCE_PREFIX = "org.jboss.ide.eclipse.archives.core.model.other.internal.VariableManager.prefs.";
- public static final String ID = "org.jboss.ide.eclipse.archives.core.defaultVariableProvider";
- public DefaultVariableProvider() {
- super(ID, "Archives Variables", 0);
- }
- public String getPreferencePrefix() {
- return PREFERENCE_PREFIX;
- }
- public boolean containsVariable(String variable) {
- IEclipsePreferences prefs = new DefaultScope().getNode(ArchivesCorePlugin.PLUGIN_ID);
- return prefs.get(VALUE_PREFIX + variable, null) != null;
- }
-
- public String[] getVariableNames() {
- int prefixLength = VALUE_PREFIX.length();
- ArrayList<String> list = new ArrayList<String>();
- try {
- IEclipsePreferences prefs = new DefaultScope().getNode(ArchivesCorePlugin.PLUGIN_ID);
- String[] keys = prefs.keys();
- for( int i = 0; i < keys.length; i++ )
- if( keys[i].startsWith(VALUE_PREFIX) && !list.contains(keys[i].substring(prefixLength))) {
- list.add(keys[i].substring(prefixLength));
- }
- } catch( BackingStoreException bse) {}
- return (String[]) list.toArray(new String[list.size()]);
- }
-
- public String getVariableValue(String variable) {
- IEclipsePreferences prefs = new DefaultScope().getNode(ArchivesCorePlugin.PLUGIN_ID);
- return prefs.get(VALUE_PREFIX + variable, null);
- }
- }
-
- public static class LinkedResourceVariableProvider extends AbstractVariableProvider {
- public static final String PREFERENCE_PREFIX = "org.jboss.ide.eclipse.archives.core.model.other.internal.LinkedResourceVariableManager.prefs.";
- public static final String ID = "org.jboss.ide.eclipse.archives.core.resourceVariableProvider";
- public LinkedResourceVariableProvider() {
- super(ID, "Linked Resources Path Variables", 1);
- }
- public String getPreferencePrefix() {
- return PREFERENCE_PREFIX;
- }
- public boolean containsVariable(String variable) {
- return ResourcesPlugin.getWorkspace().getPathVariableManager().getValue(variable) != null;
- }
-
- public String[] getVariableNames() {
- return ResourcesPlugin.getWorkspace().getPathVariableManager().getPathVariableNames();
- }
-
- public String getVariableValue(String variable) {
- return ResourcesPlugin.getWorkspace().getPathVariableManager().getValue(variable).toString();
- }
- }
-
- public static class ClasspathVariableProvider extends AbstractVariableProvider {
- public static final String PREFERENCE_PREFIX = "org.jboss.ide.eclipse.archives.core.model.other.internal.JDTVariableProvider.prefs.";
- public static final String ID = "org.jboss.ide.eclipse.archives.core.classpathVariableProvider";
- public ClasspathVariableProvider() {
- super(ID, "Classpath Variables", 2);
- }
- public String getPreferencePrefix() {
- return PREFERENCE_PREFIX;
- }
-
- public boolean containsVariable(String variable) {
- return Arrays.asList(JavaCore.getClasspathVariableNames()).contains(variable);
- }
-
- public String[] getVariableNames() {
- return JavaCore.getClasspathVariableNames();
- }
-
- public String getVariableValue(String variable) {
- return JavaCore.getClasspathVariable(variable).toString();
- }
- }
-
-
- public static class ValueVariableProvider extends AbstractVariableProvider {
- public static final String PREFERENCE_PREFIX = "org.jboss.ide.eclipse.archives.core.model.other.internal.ValueVariableProvider.prefs.";
- public static final String ID = "org.jboss.ide.eclipse.archives.core.stringReplacementValueVariables";
- public ValueVariableProvider() {
- super(ID, "String Replacement Variables", 3);
- }
- public String getPreferencePrefix() {
- return PREFERENCE_PREFIX;
- }
-
- public boolean containsVariable(String variable) {
- return VariablesPlugin.getDefault().getStringVariableManager().getValueVariable(variable) != null;
- }
-
- public String[] getVariableNames() {
- ArrayList<String> list = new ArrayList<String>();
- IStringVariable[] keys2 = VariablesPlugin.getDefault().getStringVariableManager().getValueVariables();
- for( int i = 0; i < keys2.length; i++ )
- list.add(keys2[i].getName());
- return (String[]) list.toArray(new String[list.size()]);
- }
-
- public String getVariableValue(String variable) {
- IValueVariable v = VariablesPlugin.getDefault().getStringVariableManager().getValueVariable(variable);
- if( v != null )
- return v.getValue();
- return null;
- }
- }
-
- public void setValue(String name, String value) {
- try {
- IEclipsePreferences prefs = new DefaultScope().getNode(ArchivesCorePlugin.PLUGIN_ID);
- if( value != null )
- prefs.put(DefaultVariableProvider.VALUE_PREFIX + name, value.toString());
- else
- prefs.remove(DefaultVariableProvider.VALUE_PREFIX + name);
- prefs.flush();
- } catch (BackingStoreException e) {
- ArchivesCore.getInstance().getLogger().log(IArchivesLogger.MSG_ERR, e.getMessage(), e);
- }
- }
-}
\ No newline at end of file
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -97,7 +97,7 @@
}
public void setBasedir2(String path) {
- String translatedPath = replaceVariables(path);
+ String translatedPath = refine(path);
if( translatedPath != null ) {
IPath translatedPath2 = new Path(translatedPath);
if( workspaceRelative ) {
@@ -109,10 +109,17 @@
}
}
}
- public String replaceVariables(String rawPath) {
+ public String refine(String rawPath) {
try {
- return ArchivesCore.getInstance().getVFS().
+ String refined = ArchivesCore.getInstance().getVFS().
performStringSubstitution(rawPath, fs.projectName, true);
+ if( workspaceRelative ) {
+ IPath p = new Path(refined);
+ if( !p.isAbsolute() )
+ p = new Path(fs.projectName).append(p).makeAbsolute();
+ return p.toString();
+ }
+ return refined;
} catch( CoreException ce ) {
}
return null;
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveImpl.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveImpl.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveImpl.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -85,7 +85,8 @@
} else {
return new Path(replaced);
}
- } catch( CoreException ce ) {}
+ } catch( CoreException ce ) {
+ }
return null;
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/xpl/StringSubstitutionEngineClone.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -11,6 +11,7 @@
package org.jboss.ide.eclipse.archives.core.xpl;
import java.util.ArrayList;
+import java.util.EmptyStackException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -28,9 +29,8 @@
public class StringSubstitutionEngineClone {
// delimiters
- private static final String VARIABLE_START = "${"; //$NON-NLS-1$
- private static final char VARIABLE_END = '}';
-// private static final char VARIABLE_ARG = ':';
+ private static final String VARIABLE_START = "${";
+ private static final char VARIABLE_END = '}';
// parsing states
private static final int SCAN_FOR_START = 0;
private static final int SCAN_FOR_END = 1;
@@ -40,102 +40,32 @@
*/
private StringBuffer fResult;
- /**
- * Whether substitutions were performed
- */
- private boolean fSubs;
-
- /**
- * Stack of variables to resolve
- */
- private Stack fStack;
-
class VariableReference {
-
- // the text inside the variable reference
private StringBuffer fText;
-
public VariableReference() {
fText = new StringBuffer();
}
-
public void append(String text) {
fText.append(text);
}
-
public String getText() {
return fText.toString();
}
-
}
- /**
- * Performs recursive string substitution and returns the resulting string.
- *
- * @param expression expression to resolve
- * @param reportUndefinedVariables whether to report undefined variables as an error
- * @return the resulting string with all variables recursively
- * substituted
- * @exception CoreException if unable to resolve a referenced variable or if a cycle exists
- * in referenced variables
- */
public String performStringSubstitution(String expression, boolean reportUndefinedVariables, IVariableManager manager ) throws CoreException {
substitute(expression, reportUndefinedVariables,manager );
- List resolvedVariableSets = new ArrayList();
- while (fSubs) {
- HashSet resolved = substitute(fResult.toString(), reportUndefinedVariables,manager);
-
- for(int i=resolvedVariableSets.size()-1; i>=0; i--) {
-
- HashSet prevSet = (HashSet)resolvedVariableSets.get(i);
-
- if (prevSet.equals(resolved)) {
- HashSet conflictingSet = new HashSet();
- for (; i<resolvedVariableSets.size(); i++)
- conflictingSet.addAll((HashSet)resolvedVariableSets.get(i));
-
- StringBuffer problemVariableList = new StringBuffer();
- for (Iterator it=conflictingSet.iterator(); it.hasNext(); ) {
- problemVariableList.append(it.next().toString());
- problemVariableList.append(", "); //$NON-NLS-1$
- }
- problemVariableList.setLength(problemVariableList.length()-2); //truncate the last ", "
- Status status = new Status(IStatus.ERROR,
- ArchivesCore.PLUGIN_ID,
- "Cycle found in variable replacement",
- null);
- throw new CoreException(status);
- }
- }
-
- resolvedVariableSets.add(resolved);
- }
return fResult.toString();
}
- /**
- * Performs recursive string validation to ensure that all of the variables
- * contained in the expression exist
- * @param expression expression to validate
- * @exception CoreException if a referenced variable does not exist or if a cycle exists
- * in referenced variables
- */
public void validateStringVariables(String expression, IVariableManager manager ) throws CoreException {
performStringSubstitution(expression, true, manager );
}
- /**
- * Makes a substitution pass of the given expression returns a Set of the variables that were resolved in this
- * pass
- *
- * @param expression source expression
- * @param reportUndefinedVariables whether to report undefined variables as an error
- * @exception CoreException if unable to resolve a variable
- */
private HashSet substitute(String expression, boolean reportUndefinedVariables, IVariableManager manager) throws CoreException {
+ Stack fStack;
fResult = new StringBuffer(expression.length());
fStack = new Stack();
- fSubs = false;
HashSet resolvedVariables = new HashSet();
@@ -237,17 +167,6 @@
private String resolve(VariableReference var, boolean reportUndefinedVariables, IVariableManager manager) throws CoreException {
String text = var.getText();
String name = null;
-// int pos = text.indexOf(VARIABLE_ARG);
-// String arg = null;
-// if (pos > 0) {
-// name = text.substring(0, pos);
-// pos++;
-// if (pos < text.length()) {
-// arg = text.substring(pos);
-// }
-// } else {
-// name = text;
-// }
name = text;
if( !manager.containsVariable(name)) {
if( reportUndefinedVariables )
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/META-INF/MANIFEST.MF 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/META-INF/MANIFEST.MF 2008-07-17 00:10:42 UTC (rev 9158)
@@ -11,11 +11,11 @@
org.eclipse.core.resources,
org.jboss.ide.eclipse.archives.core,
org.eclipse.jdt.ui;bundle-version="3.4.0",
- org.eclipse.debug.ui;bundle-version="3.4.0"
+ org.eclipse.debug.ui;bundle-version="3.4.0",
+ org.eclipse.core.variables;bundle-version="3.2.100"
Eclipse-LazyStart: true
Export-Package: org.jboss.ide.eclipse.archives.ui,
org.jboss.ide.eclipse.archives.ui.actions,
- org.jboss.ide.eclipse.archives.ui.dialogs,
org.jboss.ide.eclipse.archives.ui.preferences,
org.jboss.ide.eclipse.archives.ui.providers,
org.jboss.ide.eclipse.archives.ui.util.composites,
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2008-07-17 00:10:42 UTC (rev 9158)
@@ -56,11 +56,6 @@
class="org.jboss.ide.eclipse.archives.ui.preferences.MainPreferencePage"
id="org.jboss.ide.eclipse.archives.ui.archivesPreferencePage"
name="Packaging Archives"/>
- <page
- category="org.jboss.ide.eclipse.archives.ui.archivesPreferencePage"
- class="org.jboss.ide.eclipse.archives.ui.preferences.VariablesPreferencePage"
- id="org.jboss.ide.eclipse.archives.ui.variablesPreferencePage"
- name="Archives Variables"/>
</extension>
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/dialogs/ArchivesVariableDialog.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/dialogs/ArchivesVariableDialog.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/dialogs/ArchivesVariableDialog.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-/*
- * I had to copy this class from debug.ui because
- * there were no getters or setters provided in the
- * FieldSummary class.
- *
- * Assholes.
- */
-package org.jboss.ide.eclipse.archives.ui.dialogs;
-
-import java.io.File;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.jboss.ide.eclipse.archives.core.ArchivesCore;
-import org.jboss.ide.eclipse.archives.core.model.IVariableProvider;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVFS;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariableManager;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariableManager.DefaultVariableProvider;
-
-public class ArchivesVariableDialog extends Dialog {
- private String title;
- protected Composite panel;
- private String name;
- private String value;
- private boolean canChangeName = true;
- public ArchivesVariableDialog(Shell shell) {
- super(shell);
- this.title = "Archives Variable";
- setShellStyle(getShellStyle() | SWT.RESIZE);
- this.name = "";
- this.value = "";
- }
-
- public ArchivesVariableDialog(Shell shell, String name, String value) {
- this(shell);
- this.name = name;
- this.value = value;
- canChangeName = false;
- }
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if (title != null) {
- shell.setText(title);
- }
- }
-
- protected Control createButtonBar(Composite parent) {
- Control bar = super.createButtonBar(parent);
- validateFields();
- return bar;
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite container = (Composite)super.createDialogArea(parent);
- container.setLayout(new GridLayout(2, false));
- container.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- panel = new Composite(container, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- panel.setLayout(layout);
- panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- createNameField("Name", name);
- createValueField("Value", value);
- Dialog.applyDialogFont(container);
- return container;
- }
-
- protected void createNameField(String labelText, String initialValue) {
- Label label = new Label(panel, SWT.NONE);
- label.setText(labelText);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- final Text text = new Text(panel, SWT.SINGLE | SWT.BORDER);
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // make sure rows are the same height on both panels.
- label.setSize(label.getSize().x, text.getSize().y);
-
- if (initialValue != null) {
- text.setText(initialValue);
- }
-
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- name = text.getText();
- validateFields();
- }
- });
- if( !canChangeName )
- text.setEnabled(false);
- }
-
- protected void createValueField(String labelText, String initialValue) {
- Label label = new Label(panel, SWT.NONE);
- label.setText(labelText);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- Composite comp = new Composite(panel, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight=0;
- layout.marginWidth=0;
- comp.setLayout(layout);
- comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- final Text text = new Text(comp, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 200;
- text.setLayoutData(data);
-
- // make sure rows are the same height on both panels.
- label.setSize(label.getSize().x, text.getSize().y);
-
- if (initialValue != null) {
- text.setText(initialValue);
- }
-
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- value=text.getText();
- validateFields();
- }
- });
-
- Button button = createButton(comp, IDialogConstants.IGNORE_ID, "Browse", false);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- String currentWorkingDir = text.getText();
- if (!currentWorkingDir.trim().equals("")) {
- File path = new File(currentWorkingDir);
- if (path.exists()) {
- dialog.setFilterPath(currentWorkingDir);
- }
- }
-
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null) {
- text.setText(selectedDirectory);
- }
- }
- });
- }
-
- public void validateFields() {
- boolean valid = true;
- if( "".equals(name)) valid = false;
- if( "".equals(value)) valid = false;
- WorkspaceVariableManager mgr = ((WorkspaceVFS)ArchivesCore.getInstance().getVFS()).getVariableManager();
- IVariableProvider loc = mgr.getVariableLocation(name);
- // already declared
- if( loc != null && DefaultVariableProvider.ID.equals(loc.getId()) && canChangeName)
- valid = false;
- getButton(IDialogConstants.OK_ID).setEnabled(valid);
- }
- public String getName() {
- return name;
- }
-
- public String getValue() {
- return value;
- }
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/dialogs/SelectVariableDialog.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/dialogs/SelectVariableDialog.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/dialogs/SelectVariableDialog.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,91 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.dialogs;
-
-import java.util.Comparator;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.jboss.ide.eclipse.archives.core.model.IVariableProvider;
-import org.jboss.ide.eclipse.archives.ui.preferences.VariablesPreferencePage.Wrapped;
-import org.jboss.ide.eclipse.archives.ui.providers.VariablesContentProvider;
-import org.jboss.ide.eclipse.archives.ui.providers.VariablesLabelProvider;
-
-public class SelectVariableDialog extends Dialog {
- private TreeViewer viewer;
- private Comparator<IVariableProvider> comparator;
- private VariablesContentProvider cProvider;
- private VariablesLabelProvider lProvider;
- private Object selected;
- public SelectVariableDialog(Shell parentShell) {
- super(parentShell);
- }
-
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText("Title");
- }
- protected Control createButtonBar(Composite parent) {
- Control bar = super.createButtonBar(parent);
- validateFields();
- return bar;
- }
- protected Control createDialogArea(Composite parent) {
- Composite master = new Composite(parent, SWT.NONE);
- master.setLayout(new FormLayout());
- viewer = new TreeViewer(master, SWT.SINGLE | SWT.BORDER);
- comparator = new Comparator<IVariableProvider>() {
- public int compare(IVariableProvider o1, IVariableProvider o2) {
- if( o1.getEnabled() != o2.getEnabled())
- return o1.getEnabled() ? -1 : 1;
-
- // now weights
- if( o1.getWeight() != o2.getWeight() )
- return o1.getWeight() > o2.getWeight() ? 1 : -1;
- return 0;
- }
- };
- cProvider = new VariablesContentProvider(comparator);
- lProvider = new VariablesLabelProvider(null);
- viewer.setContentProvider(cProvider);
- viewer.setLabelProvider(lProvider);
- viewer.setInput("");
- FormData viewerData = new FormData();
- viewerData.left = new FormAttachment(0,0);
- viewerData.right = new FormAttachment(0,250);
- viewerData.top = new FormAttachment(0,0);
- viewerData.bottom = new FormAttachment(0,400);
- viewer.getTree().setLayoutData(viewerData);
- viewer.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event) {
- selectionChanged2();
- validateFields();
- }});
- return viewer.getTree();
- }
-
- protected void selectionChanged2() {
- IStructuredSelection sel = (IStructuredSelection)viewer.getSelection();
- selected = sel.getFirstElement();
- }
- public void validateFields() {
- boolean valid = false;
- if( selected != null && selected instanceof Wrapped && ((Wrapped)selected).getName() != null)
- valid = true;
- getButton(IDialogConstants.OK_ID).setEnabled(valid);
- }
- public String getSelectedVarName() {
- if( selected != null && selected instanceof Wrapped && ((Wrapped)selected).getName() != null)
- return ((Wrapped)selected).getName();
- return null;
- }
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/VariablesPreferencePage.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/VariablesPreferencePage.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/VariablesPreferencePage.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,340 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.preferences;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.jboss.ide.eclipse.archives.core.ArchivesCore;
-import org.jboss.ide.eclipse.archives.core.model.IPreferenceManager;
-import org.jboss.ide.eclipse.archives.core.model.IVariableProvider;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVFS;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariableManager;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariableManager.DefaultVariableProvider;
-import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
-import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
-import org.jboss.ide.eclipse.archives.ui.dialogs.ArchivesVariableDialog;
-import org.jboss.ide.eclipse.archives.ui.providers.VariablesContentProvider;
-import org.jboss.ide.eclipse.archives.ui.providers.VariablesLabelProvider;
-import org.jboss.ide.eclipse.archives.ui.providers.VariablesLabelProvider.IVariableEnablementChecker;
-
-public class VariablesPreferencePage extends PropertyPage implements
- IWorkbenchPreferencePage {
-
- private Group variablesGroup;
- private TreeViewer variablesViewer;
- private Button add,edit,remove,moveUp,moveDown,enable,disable;
- private HashMap<IVariableProvider, Integer> newWeights;
- private HashMap<IVariableProvider, Boolean> newEnablement;
- private Comparator<IVariableProvider> pageComparator;
- private VariablesContentProvider cProvider;
- private VariablesLabelProvider lProvider;
- public VariablesPreferencePage() {
- super();
- setTitle(ArchivesUIMessages.ArchivesVariables);
- setImageDescriptor(ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_PACKAGE));
- newWeights = new HashMap<IVariableProvider, Integer>();
- newEnablement = new HashMap<IVariableProvider, Boolean>();
- pageComparator = createComparator();
- }
-
- protected Comparator<IVariableProvider> createComparator() {
- Comparator<IVariableProvider> x = new Comparator<IVariableProvider>() {
- public int compare(IVariableProvider o1, IVariableProvider o2) {
- if( nowEnabled(o1) != nowEnabled(o2))
- return nowEnabled(o1) ? -1 : 1;
-
- // now weights
- if( nowWeight(o1) != nowWeight(o2) )
- return nowWeight(o1) > nowWeight(o2) ? 1 : -1;
- return 0;
- }
- };
- return x;
- }
-
- protected Control createContents(Composite parent) {
- Composite main = new Composite(parent, SWT.NONE);
- main.setLayout(new GridLayout(1, false));
-
- createVariablesGroup(main);
- return main;
- }
-
- public IPreferenceManager getPrefManager() {
- return ArchivesCore.getInstance().getPreferenceManager();
- }
-
- protected void createVariablesGroup(Composite main) {
- variablesGroup = new Group(main, SWT.NONE);
- variablesGroup.setText(ArchivesUIMessages.VariablesGroup);
- variablesGroup.setLayout(new FormLayout());
- variablesGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- variablesViewer = new TreeViewer(variablesGroup);
- FormData fd = new FormData();
- fd.left = new FormAttachment(0,5);
- fd.top = new FormAttachment(0,5);
- fd.right = new FormAttachment(0,300);
- fd.bottom = new FormAttachment(80,0);
- variablesViewer.getTree().setLayoutData(fd);
- cProvider = new VariablesContentProvider(pageComparator);
- lProvider = new VariablesLabelProvider(new IVariableEnablementChecker() {
- public boolean isEnabled(IVariableProvider element) {
- return nowEnabled((IVariableProvider)element);
- }
- });
- variablesViewer.setContentProvider(cProvider);
- variablesViewer.setLabelProvider(lProvider);
- variablesViewer.setInput("");
-
- variablesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- viewerSelectionChanged();
- }
- });
-
- // buttons
- add = new Button(variablesGroup, SWT.NONE);
- edit = new Button(variablesGroup, SWT.NONE);
- remove = new Button(variablesGroup, SWT.NONE);
- moveUp = new Button(variablesGroup, SWT.NONE);
- moveDown = new Button(variablesGroup, SWT.NONE);
- enable = new Button(variablesGroup, SWT.NONE);
- disable = new Button(variablesGroup, SWT.NONE);
- add.setLayoutData(createButtonLayoutData(null));
- edit.setLayoutData(createButtonLayoutData(add));
- remove.setLayoutData(createButtonLayoutData(edit));
- moveUp.setLayoutData(createButtonLayoutData(remove));
- moveDown.setLayoutData(createButtonLayoutData(moveUp));
- enable.setLayoutData(createButtonLayoutData(moveDown));
- disable.setLayoutData(createButtonLayoutData(enable));
- add.setText(ArchivesUIMessages.Add);
- edit.setText(ArchivesUIMessages.Edit);
- remove.setText(ArchivesUIMessages.Remove);
- moveUp.setText(ArchivesUIMessages.MoveUp);
- moveDown.setText(ArchivesUIMessages.MoveDown);
- enable.setText(ArchivesUIMessages.Enable);
- disable.setText(ArchivesUIMessages.Disable);
-
- add.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- addPressed();
- } });
- edit.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- editPressed();
- } });
- remove.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- removePressed();
- } });
-
- moveUp.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- Object sel = getSelection();
- List<IVariableProvider> sorted = cProvider.getSortedDelegates();
- int current = sorted.indexOf(sel);
- if( current > 0 ) {
- newWeights.put(sorted.get(current-1), new Integer(current));
- newWeights.put(sorted.get(current), new Integer(current-1));
- }
- refreshAll();
- } });
-
- moveDown.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- Object sel = getSelection();
- List<IVariableProvider> sorted = cProvider.getSortedDelegates();
- int current = sorted.indexOf(sel);
- if( current < sorted.size()-1 ) {
- newWeights.put(sorted.get(current+1), new Integer(current));
- newWeights.put(sorted.get(current), new Integer(current+1));
- }
- refreshAll();
- } });
-
-
- enable.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- Object sel = getSelection();
- if( sel instanceof IVariableProvider )
- newEnablement.put((IVariableProvider)sel, new Boolean(true));
- refreshAll();
- } });
- disable.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- Object sel = getSelection();
- if( sel instanceof IVariableProvider )
- newEnablement.put((IVariableProvider)sel, new Boolean(false));
- refreshAll();
- } });
-
- }
- protected void addPressed() {
- ArchivesVariableDialog dialog= new ArchivesVariableDialog(getShell());
- if (dialog.open() == Window.OK) {
- String name= dialog.getName();
- String value = dialog.getValue();
- WorkspaceVariableManager mgr = ((WorkspaceVFS)ArchivesCore.getInstance().getVFS()).getVariableManager();
- mgr.setValue(name, value);
- }
- refreshAll();
- }
- protected void editPressed() {
- Object sel = getSelection();
- if( sel instanceof Wrapped && ((Wrapped)sel).getProvider().getId().equals(DefaultVariableProvider.ID)) {
- String name = ((Wrapped)sel).getName();
- String value = ((WorkspaceVFS)ArchivesCore.getInstance().getVFS()).getVariableManager().getVariableValue(name);
- ArchivesVariableDialog dialog= new ArchivesVariableDialog(getShell(), name, value);
- if (dialog.open() == Window.OK) {
- name= dialog.getName();
- value = dialog.getValue();
- WorkspaceVariableManager mgr = ((WorkspaceVFS)ArchivesCore.getInstance().getVFS()).getVariableManager();
- mgr.setValue(name, value);
- }
- }
- refreshAll();
- }
- protected void removePressed() {
- Object sel = getSelection();
- if( sel instanceof Wrapped && ((Wrapped)sel).getProvider().getId().equals(DefaultVariableProvider.ID)) {
- String name = ((Wrapped)sel).getName();
- ((WorkspaceVFS)ArchivesCore.getInstance().getVFS()).getVariableManager().setValue(name, null);
- }
-
- refreshAll();
- }
-
- protected void refreshAll() {
- variablesViewer.refresh();
- viewerSelectionChanged();
- }
-
- protected FormData createButtonLayoutData(Control top) {
- FormData fd = new FormData();
- if( top != null )
- fd.top = new FormAttachment(top, 5);
- else
- fd.top = new FormAttachment(0,5);
- fd.left = new FormAttachment(variablesViewer.getTree(), 5);
- fd.right = new FormAttachment(100,-5);
- return fd;
- }
-
- public static class Wrapped {
- protected IVariableProvider p;
- protected String name;
- public Wrapped(IVariableProvider p, String name) {
- this.p = p;
- this.name = name;
- }
- public IVariableProvider getProvider() { return p; }
- public String getName() { return name; }
- public String toString() {
- return name + ": " + p.getVariableValue(name);
- }
- }
-
- protected boolean nowEnabled(IVariableProvider o) {
- boolean enabled = o.getEnabled();
- if( newEnablement.get(o) != null)
- enabled = newEnablement.get(o).booleanValue();
- return enabled;
- }
- protected int nowWeight(IVariableProvider o) {
- int weight = o.getWeight();
- if( newWeights.get(o) != null )
- weight = newWeights.get(o).intValue();
- return weight;
- }
-
- protected Object getSelection() {
- IStructuredSelection sel = (IStructuredSelection)variablesViewer.getSelection();
- return sel.getFirstElement();
- }
-
- protected void viewerSelectionChanged() {
- Object selected = getSelection();
- List<IVariableProvider> dels = cProvider.getSortedDelegates();
- boolean variableProvider = selected != null && selected instanceof IVariableProvider;
- boolean defaultProvider = selected != null &&
- (variableProvider ? (IVariableProvider)selected : ((Wrapped)selected).getProvider())
- .getId().equals(WorkspaceVariableManager.DEFAULT_PROVIDER);
- boolean removable = !variableProvider && defaultProvider;
- boolean notLast = dels.indexOf(selected) != dels.size()-1;
- boolean notFirst = dels.indexOf(selected) != 0;
- boolean canMoveDown = variableProvider && notLast
- && nowEnabled(dels.get(dels.indexOf(selected)+1)) == nowEnabled((IVariableProvider)selected);
- boolean canMoveUp = variableProvider && notFirst
- && nowEnabled(dels.get(dels.indexOf(selected)-1)) == nowEnabled((IVariableProvider)selected);
-
- add.setEnabled(defaultProvider || selected == null);
- edit.setEnabled(removable);
- remove.setEnabled(removable);
- moveUp.setEnabled(variableProvider && canMoveUp);
- moveDown.setEnabled(variableProvider && canMoveDown);
- enable.setEnabled(variableProvider && !nowEnabled((IVariableProvider)selected));
- disable.setEnabled(variableProvider && nowEnabled((IVariableProvider)selected));
- }
-
- public void init(IWorkbench workbench) {
- }
-
- public void performDefaults() {
- List<IVariableProvider> dels = cProvider.getSortedDelegates();
- IVariableProvider provider;
- for( int i = 0; i < dels.size(); i++ ) {
- provider = dels.get(i);
- newEnablement.put(provider, new Boolean(true));
- newWeights.put(provider, new Integer(provider.getDefaultWeight()));
- }
- refreshAll();
- }
-
- public boolean performOk() {
- List<IVariableProvider> dels = cProvider.getSortedDelegates();
- IVariableProvider provider;
- for( int i = 0; i < dels.size(); i++ ) {
- provider = dels.get(i);
- if( newEnablement.get(provider) != null )
- provider.setEnabled(newEnablement.get(provider).booleanValue());
- if( newWeights.get(provider) != null )
- provider.setWeight(newWeights.get(provider).intValue());
- }
- return true;
- }
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/VariablesContentProvider.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/VariablesContentProvider.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/VariablesContentProvider.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,61 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.providers;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.jboss.ide.eclipse.archives.core.ArchivesCore;
-import org.jboss.ide.eclipse.archives.core.model.IVariableProvider;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVFS;
-import org.jboss.ide.eclipse.archives.core.model.other.internal.WorkspaceVariableManager;
-import org.jboss.ide.eclipse.archives.ui.preferences.VariablesPreferencePage.Wrapped;
-
-public class VariablesContentProvider implements ITreeContentProvider {
- private Comparator<IVariableProvider> comparator;
- public VariablesContentProvider(Comparator<IVariableProvider> c) {
- this.comparator = c;
- }
- public Object[] getChildren(Object parentElement) {
- if( parentElement instanceof IVariableProvider ) {
- String[] props = ((IVariableProvider)parentElement).getVariableNames();
- Wrapped[] items = new Wrapped[props.length];
- for( int i = 0; i < props.length; i++ )
- items[i] = new Wrapped((IVariableProvider)parentElement, props[i]);
- return items;
- }
- return null;
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return element instanceof IVariableProvider && ((IVariableProvider)element).getVariableNames().length > 0;
- }
-
- public Object[] getElements(Object inputElement) {
- List<IVariableProvider> elements = getSortedDelegates();
- return (IVariableProvider[]) elements
- .toArray(new IVariableProvider[elements.size()]);
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- public List<IVariableProvider> getSortedDelegates() {
- WorkspaceVFS vfs = (WorkspaceVFS)ArchivesCore.getInstance().getVFS();
- WorkspaceVariableManager mgr = vfs.getVariableManager();
- IVariableProvider[] delegates = mgr.getDelegates();
-
- // sort with changed data
- List<IVariableProvider> l = Arrays.asList(delegates);
- Collections.sort(l, this.comparator);
- return l;
- }
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/VariablesLabelProvider.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/VariablesLabelProvider.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/VariablesLabelProvider.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,69 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.providers;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.jdt.internal.ui.JavaPlugin;
-import org.eclipse.jdt.internal.ui.JavaPluginImages;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.DecorationOverlayIcon;
-import org.eclipse.jface.viewers.IDecoration;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.jboss.ide.eclipse.archives.core.model.IVariableProvider;
-import org.jboss.ide.eclipse.archives.ui.preferences.VariablesPreferencePage.Wrapped;
-
-public class VariablesLabelProvider extends BaseLabelProvider implements ILabelProvider {
- private HashMap<Image, Image> disabledImages;
- private IVariableEnablementChecker checker;
-
- public interface IVariableEnablementChecker {
- public boolean isEnabled(IVariableProvider element);
- }
-
- public VariablesLabelProvider(IVariableEnablementChecker checker) {
- disabledImages = new HashMap<Image, Image>();
- }
- public Image getImage(Object element) {
- if( element instanceof IVariableProvider ) {
- String id = ((IVariableProvider)element).getId();
-
- boolean enabled = checker != null ? checker.isEnabled((IVariableProvider)element) : ((IVariableProvider)element).getEnabled();
- if(id.equals("org.jboss.ide.eclipse.archives.core.resourceVariableProvider"))
- return getImage2(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER), enabled);
- if( id.equals("org.jboss.ide.eclipse.archives.core.classpathVariableProvider"))
- return getImage2(JavaPlugin.getDefault().getImageRegistry().get(JavaPluginImages.IMG_OBJS_EXTJAR), enabled);
- if( id.equals("org.jboss.ide.eclipse.archives.core.stringReplacementValueVariables"))
- return getImage2(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_PASTE), enabled);
- }
- if( element instanceof Wrapped ) {
- return getImage(((Wrapped)element).getProvider());
- }
- return null;
- }
- protected Image getImage2(Image original, boolean enabled) {
- if( enabled )
- return original;
- if( disabledImages.get(original) == null ) {
- Image i2 = new DecorationOverlayIcon(original, JavaPluginImages.DESC_OVR_DEPRECATED, IDecoration.TOP_LEFT).createImage();
- disabledImages.put(original, i2);
- }
- return disabledImages.get(original);
- }
- public String getText(Object element) {
- if( element instanceof IVariableProvider ) {
- return ((IVariableProvider)element).getName();
- }
- if( element instanceof Wrapped )
- return ((Wrapped)element).toString();
- return "";
- }
- public void dispose() {
- super.dispose();
- Iterator<Image> i = disabledImages.values().iterator();
- while(i.hasNext())
- i.next().dispose();
- }
-}
Added: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveFilesetDestinationComposite.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveFilesetDestinationComposite.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveFilesetDestinationComposite.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -0,0 +1,165 @@
+package org.jboss.ide.eclipse.archives.ui.util.composites;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.ide.IDE;
+import org.jboss.ide.eclipse.archives.core.ArchivesCorePlugin;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+
+public class ArchiveFilesetDestinationComposite extends Composite {
+
+ protected Composite parent;
+ protected Label destinationImage;
+ protected Text destinationText;
+ protected Object nodeDestination;
+
+ public ArchiveFilesetDestinationComposite(Composite parent, int style, Object destination) {
+ super(parent, style);
+ this.parent = parent;
+ this.nodeDestination = destination;
+
+ createComposite();
+ }
+
+ protected void createComposite() {
+ setLayout(new FormLayout());
+
+ // create widgets
+ destinationImage = new Label(this, SWT.NONE);
+ destinationText = new Text(this, SWT.BORDER);
+ Composite browseComposite = new Composite(this, SWT.NONE);
+
+ // set up their layout positioning
+ destinationImage.setLayoutData(createFormData(0,5,null, 0, 0, 0, null, 0));
+ destinationText.setLayoutData(createFormData(0, 5, null, 0, destinationImage, 5, destinationImage, 205));
+
+
+ // set text, add listeners, etc
+ destinationText.setEditable(false);
+
+ browseComposite.setLayout(new FillLayout());
+ browseComposite.setLayoutData(createFormData(0,0,null,0,destinationText,5,100,-5));
+ fillBrowseComposite(browseComposite);
+
+ // call other functions required for startup
+ updateDestinationViewer();
+ }
+
+ private FormData createFormData(Object topStart, int topOffset, Object bottomStart, int bottomOffset,
+ Object leftStart, int leftOffset, Object rightStart, int rightOffset) {
+ FormData data = new FormData();
+
+ if( topStart != null ) {
+ data.top = topStart instanceof Control ? new FormAttachment((Control)topStart, topOffset) :
+ new FormAttachment(((Integer)topStart).intValue(), topOffset);
+ }
+
+ if( bottomStart != null ) {
+ data.bottom = bottomStart instanceof Control ? new FormAttachment((Control)bottomStart, bottomOffset) :
+ new FormAttachment(((Integer)bottomStart).intValue(), bottomOffset);
+ }
+
+ if( leftStart != null ) {
+ data.left = leftStart instanceof Control ? new FormAttachment((Control)leftStart, leftOffset) :
+ new FormAttachment(((Integer)leftStart).intValue(), leftOffset);
+ }
+
+ if( rightStart != null ) {
+ data.right = rightStart instanceof Control ? new FormAttachment((Control)rightStart, rightOffset) :
+ new FormAttachment(((Integer)rightStart).intValue(), rightOffset);
+ }
+
+ return data;
+ }
+
+ public void setPackageNodeDestination (Object destination) {
+ nodeDestination = destination;
+ updateDestinationViewer();
+ //fireDestinationChanged();
+ }
+
+ protected void updateDestinationViewer () {
+ if (nodeDestination == null) return;
+ destinationText.setText("");
+
+ if (nodeDestination instanceof IArchive) {
+ IArchive pkg = (IArchive) nodeDestination;
+ String txt = pkg.isTopLevel() ? pkg.getName() : pkg.getRootArchiveRelativePath().toOSString();
+ String imgKey = pkg.isExploded() ? ArchivesSharedImages.IMG_PACKAGE_EXPLODED : ArchivesSharedImages.IMG_PACKAGE;
+
+ destinationText.setText(txt);
+ destinationImage.setImage(ArchivesSharedImages.getImage(imgKey));
+ } else if (nodeDestination instanceof IArchiveFolder) {
+ IArchiveFolder folder = (IArchiveFolder) nodeDestination;
+ destinationText.setText(folder.getRootArchiveRelativePath().toString());
+ destinationImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER));
+ } else if (nodeDestination instanceof IProject) {
+ IProject project = (IProject) nodeDestination;
+ destinationText.setText(project.getName());
+ destinationImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT));
+ } else if (nodeDestination instanceof IFolder) {
+ IFolder folder = (IFolder) nodeDestination;
+ destinationText.setText("/" + folder.getProject().getName() + "/" + folder.getProjectRelativePath().toString());
+ destinationImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER));
+ }
+ }
+
+ public Object getPackageNodeDestination () {
+ return nodeDestination;
+ }
+
+ protected void fillBrowseComposite(Composite parent) {
+ Composite browseComposite = new Composite(parent, SWT.NONE);
+ browseComposite.setLayout(new GridLayout(2, false));
+
+ Button filesystemBrowseButton = new Button(browseComposite, SWT.PUSH);
+ filesystemBrowseButton.setText(ArchivesUIMessages.PackageDestinationComposite_workspaceBrowseButton_label);
+ filesystemBrowseButton.addSelectionListener(new SelectionAdapter () {
+ public void widgetSelected(SelectionEvent e) {
+ openDestinationDialog();
+ }
+ });
+ }
+
+ protected void openDestinationDialog() {
+ ArchiveNodeDestinationDialog dialog = new ArchiveNodeDestinationDialog(getShell(), false, true);
+ dialog.setValidator(new ISelectionStatusValidator() {
+ public IStatus validate(Object[] selection) {
+ if( selection != null && selection.length == 1 ) {
+ if( selection[0] instanceof IArchiveNode && !(selection[0] instanceof IArchiveFileSet) )
+ return Status.OK_STATUS;
+ }
+ return new Status(IStatus.ERROR, ArchivesCorePlugin.PLUGIN_ID, "Selection not valid");
+ }
+ });
+ if (nodeDestination != null)
+ dialog.setInitialSelection(nodeDestination);
+
+ if (dialog.open() == Dialog.OK)
+ setPackageNodeDestination(dialog.getResult()[0]);
+ }
+}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveSourceDestinationComposite.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveSourceDestinationComposite.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveSourceDestinationComposite.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -9,6 +9,8 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.variables.IStringVariable;
+import org.eclipse.debug.ui.StringVariableSelectionDialog;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
@@ -36,7 +38,6 @@
import org.jboss.ide.eclipse.archives.core.model.INamedContainerArchiveNode;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
import org.jboss.ide.eclipse.archives.ui.PackagesUIPlugin;
-import org.jboss.ide.eclipse.archives.ui.dialogs.SelectVariableDialog;
public class ArchiveSourceDestinationComposite extends Composite {
private Text text;
@@ -140,14 +141,14 @@
protected void wsRadioButtonPressed() {radioPressed(wsRadioButton);}
protected void variablesPressed() {
- SelectVariableDialog d = new SelectVariableDialog(Display.getDefault().getActiveShell());
- if( d.open() == Window.OK) {
- String val = d.getSelectedVarName();
- if( val != null ) {
- path = path + "${" + val + "}";
+ StringVariableSelectionDialog d = new StringVariableSelectionDialog(Display.getDefault().getActiveShell());
+ if(d.open() == Window.OK) {
+ Object o = d.getFirstResult();
+ if( o != null && o instanceof IStringVariable) {
destinationNode = null;
+ path = path + "${" + ((IStringVariable)o).getName() + "}";
+ validateAndUpdateWidgets();;
}
- validateAndUpdateWidgets();
}
}
@@ -161,7 +162,11 @@
workspaceRelative = true;
} else if( result instanceof IContainer ) {
destinationNode = null;
- path = ((IContainer)result).getFullPath().toString();
+ IPath tmpPath = ((IContainer)result).getFullPath();
+ if( tmpPath.segment(0).equals(projectName))
+ path = tmpPath.removeFirstSegments(1).makeRelative().toString();
+ else
+ path = ((IContainer)result).getFullPath().makeAbsolute().toString();
workspaceRelative = true;
}
validateAndUpdateWidgets();
@@ -260,7 +265,10 @@
String postSub = ArchivesCore.getInstance().getVFS().
performStringSubstitution(path, projectName, true);
if( workspaceRelative ) {
- IPath p = ArchivesCore.getInstance().getVFS().workspacePathToAbsolutePath(new Path(postSub));
+ IPath p2 = new Path(postSub);
+ if( !p2.isAbsolute())
+ p2 = new Path(projectName).append(p2).makeAbsolute();
+ IPath p = ArchivesCore.getInstance().getVFS().workspacePathToAbsolutePath(p2);
if( p != null ) return p.toString();
String ERROR ="Unable to convert workspace path into global path: " + postSub;
Status s = new Status(IStatus.WARNING, PackagesUIPlugin.PLUGIN_ID, ERROR);
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveDestinationComposite.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveDestinationComposite.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveDestinationComposite.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,82 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.util.garbage;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
-import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
-import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
-import org.jboss.ide.eclipse.archives.ui.util.composites.ArchiveNodeDestinationDialog;
-
-public class ArchiveDestinationComposite extends ArchiveNodeDestinationComposite {
-
- protected boolean inWorkspace;
- protected Button filesystemBrowseButton, workspaceBrowseButton;
-
- public ArchiveDestinationComposite (Composite parent, int style, Object destination) {
- super(parent, style, destination);
- }
-
- protected void fillBrowseComposite(Composite parent) {
- Composite browseComposite = new Composite(parent, SWT.NONE);
- browseComposite.setLayout(new GridLayout(2, false));
-
- workspaceBrowseButton = new Button(browseComposite, SWT.PUSH);
- workspaceBrowseButton.setText(ArchivesUIMessages.PackageDestinationComposite_workspaceBrowseButton_label);
- workspaceBrowseButton.addSelectionListener(new SelectionAdapter () {
- public void widgetSelected(SelectionEvent e) {
- openDestinationDialog();
- }
- });
-
- filesystemBrowseButton = new Button(browseComposite, SWT.PUSH);
- filesystemBrowseButton.setText(ArchivesUIMessages.PackageDestinationComposite_filesystemBrowseButton_label);
- filesystemBrowseButton.addSelectionListener(new SelectionAdapter () {
- public void widgetSelected(SelectionEvent e) {
- browseFilesystem();
- }
- });
- }
-
- protected void openDestinationDialog() {
- ArchiveNodeDestinationDialog dialog = new ArchiveNodeDestinationDialog(getShell(), true, true);
- if (nodeDestination != null)
- dialog.setInitialSelection(nodeDestination);
-
- if (dialog.open() == Dialog.OK)
- setPackageNodeDestination(dialog.getResult()[0]);
- }
-
- protected void browseFilesystem () {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- String currentPath = destinationText.getText();
- if (currentPath != null && currentPath.length() > 0 && !inWorkspace) {
- dialog.setFilterPath(destinationText.getText());
- }
-
- String path = dialog.open();
- if (path != null)
- setPackageNodeDestination(new Path(path));
- }
-
- protected void updateDestinationViewer() {
- super.updateDestinationViewer();
-
- if (nodeDestination instanceof IPath) {
- inWorkspace = false;
- IPath path = (IPath) nodeDestination;
- destinationText.setText(path.toString());
- destinationImage.setImage(ArchivesSharedImages.getImage(ArchivesSharedImages.IMG_EXTERNAL_FILE));
- } else if (nodeDestination instanceof IContainer || nodeDestination instanceof IArchiveNode) {
- inWorkspace = true;
- }
- }
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveFilesetDestinationComposite.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveFilesetDestinationComposite.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveFilesetDestinationComposite.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,56 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.util.garbage;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.jboss.ide.eclipse.archives.core.ArchivesCorePlugin;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
-import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
-import org.jboss.ide.eclipse.archives.ui.util.composites.ArchiveNodeDestinationDialog;
-
-public class ArchiveFilesetDestinationComposite extends ArchiveNodeDestinationComposite {
- protected Button filesystemBrowseButton;
- public ArchiveFilesetDestinationComposite(Composite parent, int style,
- Object destination) {
- super(parent, style, destination);
- }
-
- protected void fillBrowseComposite(Composite parent) {
- Composite browseComposite = new Composite(parent, SWT.NONE);
- browseComposite.setLayout(new GridLayout(2, false));
-
- filesystemBrowseButton = new Button(browseComposite, SWT.PUSH);
- filesystemBrowseButton.setText(ArchivesUIMessages.PackageDestinationComposite_workspaceBrowseButton_label);
- filesystemBrowseButton.addSelectionListener(new SelectionAdapter () {
- public void widgetSelected(SelectionEvent e) {
- openDestinationDialog();
- }
- });
- }
-
- protected void openDestinationDialog() {
- ArchiveNodeDestinationDialog dialog = new ArchiveNodeDestinationDialog(getShell(), false, true);
- dialog.setValidator(new ISelectionStatusValidator() {
- public IStatus validate(Object[] selection) {
- if( selection != null && selection.length == 1 ) {
- if( selection[0] instanceof IArchiveNode && !(selection[0] instanceof IArchiveFileSet) )
- return Status.OK_STATUS;
- }
- return new Status(IStatus.ERROR, ArchivesCorePlugin.PLUGIN_ID, "Selection not valid");
- }
- });
- if (nodeDestination != null)
- dialog.setInitialSelection(nodeDestination);
-
- if (dialog.open() == Dialog.OK)
- setPackageNodeDestination(dialog.getResult()[0]);
- }
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveNodeDestinationComposite.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveNodeDestinationComposite.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/garbage/ArchiveNodeDestinationComposite.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,151 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.util.garbage;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
-import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
-
-public abstract class ArchiveNodeDestinationComposite extends Composite {
-
- protected Composite parent;
- protected Label destinationImage;
- protected Text destinationText;
- protected Object nodeDestination;
- //protected ArrayList<DestinationChangeListener> listeners;
-
- public ArchiveNodeDestinationComposite(Composite parent, int style, Object destination) {
- super(parent, style);
- this.parent = parent;
- this.nodeDestination = destination;
- //this.listeners = new ArrayList<DestinationChangeListener>();
-
- createComposite();
- }
-
- protected void createComposite() {
- setLayout(new FormLayout());
-
- // create widgets
- destinationImage = new Label(this, SWT.NONE);
- destinationText = new Text(this, SWT.BORDER);
- Composite browseComposite = new Composite(this, SWT.NONE);
-
- // set up their layout positioning
- destinationImage.setLayoutData(createFormData(0,5,null, 0, 0, 0, null, 0));
- destinationText.setLayoutData(createFormData(0, 5, null, 0, destinationImage, 5, destinationImage, 205));
-
-
- // set text, add listeners, etc
- destinationText.setEditable(false);
-
- browseComposite.setLayout(new FillLayout());
- browseComposite.setLayoutData(createFormData(0,0,null,0,destinationText,5,100,-5));
- fillBrowseComposite(browseComposite);
-
- // call other functions required for startup
- updateDestinationViewer();
- }
-
- protected abstract void fillBrowseComposite(Composite browseComposite);
-
- private FormData createFormData(Object topStart, int topOffset, Object bottomStart, int bottomOffset,
- Object leftStart, int leftOffset, Object rightStart, int rightOffset) {
- FormData data = new FormData();
-
- if( topStart != null ) {
- data.top = topStart instanceof Control ? new FormAttachment((Control)topStart, topOffset) :
- new FormAttachment(((Integer)topStart).intValue(), topOffset);
- }
-
- if( bottomStart != null ) {
- data.bottom = bottomStart instanceof Control ? new FormAttachment((Control)bottomStart, bottomOffset) :
- new FormAttachment(((Integer)bottomStart).intValue(), bottomOffset);
- }
-
- if( leftStart != null ) {
- data.left = leftStart instanceof Control ? new FormAttachment((Control)leftStart, leftOffset) :
- new FormAttachment(((Integer)leftStart).intValue(), leftOffset);
- }
-
- if( rightStart != null ) {
- data.right = rightStart instanceof Control ? new FormAttachment((Control)rightStart, rightOffset) :
- new FormAttachment(((Integer)rightStart).intValue(), rightOffset);
- }
-
- return data;
- }
-
- public void setPackageNodeDestination (Object destination) {
- nodeDestination = destination;
- updateDestinationViewer();
- //fireDestinationChanged();
- }
-
- protected void updateDestinationViewer () {
- if (nodeDestination == null) return;
- destinationText.setText("");
-
- if (nodeDestination instanceof IArchive) {
- IArchive pkg = (IArchive) nodeDestination;
- String txt = pkg.isTopLevel() ? pkg.getName() : pkg.getRootArchiveRelativePath().toOSString();
- String imgKey = pkg.isExploded() ? ArchivesSharedImages.IMG_PACKAGE_EXPLODED : ArchivesSharedImages.IMG_PACKAGE;
-
- destinationText.setText(txt);
- destinationImage.setImage(ArchivesSharedImages.getImage(imgKey));
- } else if (nodeDestination instanceof IArchiveFolder) {
- IArchiveFolder folder = (IArchiveFolder) nodeDestination;
- destinationText.setText(folder.getRootArchiveRelativePath().toString());
- destinationImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER));
- } else if (nodeDestination instanceof IProject) {
- IProject project = (IProject) nodeDestination;
- destinationText.setText(project.getName());
- destinationImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT));
- } else if (nodeDestination instanceof IFolder) {
- IFolder folder = (IFolder) nodeDestination;
- destinationText.setText("/" + folder.getProject().getName() + "/" + folder.getProjectRelativePath().toString());
- destinationImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER));
- }
- }
-
-
- /**
- * The current destination
- * @return
- */
-
- public Object getPackageNodeDestination () {
- return nodeDestination;
- }
-
-
- /*
- * Destination change listeners
- */
-//
-// public void addDestinationChangeListener (DestinationChangeListener listener) {
-// listeners.add(listener);
-// }
-//
-// public void removeDestinationChangeListener (DestinationChangeListener listener) {
-// listeners.remove(listener);
-// }
-//
-// private void fireDestinationChanged () {
-// for (Iterator<DestinationChangeListener> iter = listeners.iterator(); iter.hasNext(); ) {
-// ((DestinationChangeListener) iter.next()).destinationChanged(nodeDestination);
-// }
-// }
-}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -1,9 +1,19 @@
package org.jboss.ide.eclipse.archives.ui.wizards;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.wizard.Wizard;
import org.jboss.ide.eclipse.archives.core.model.ArchiveNodeFactory;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModelException;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.ui.PackagesUIPlugin;
import org.jboss.ide.eclipse.archives.ui.wizards.pages.FilesetInfoWizardPage;
public class FilesetWizard extends Wizard {
@@ -24,39 +34,33 @@
if (createFileset)
this.fileset = ArchiveNodeFactory.createFileset();
+ fillFilesetFromPage(fileset);
+ try {
+ getContainer().run(true, false, new IRunnableWithProgress () {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ if (createFileset)
+ parentNode.addChild(fileset);
+ try {
+ ArchivesModel.instance().save(fileset.getProjectPath(), monitor);
+ } catch( ArchivesModelException ame ) {
+ IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID, "Error Completing Wizard", ame);
+ PackagesUIPlugin.getDefault().getLog().log(status);
+ }
+ }
+ });
+ } catch (InvocationTargetException e) {
+ } catch (InterruptedException e) {
+ } catch(Exception e) {e.printStackTrace();}
return true;
-// fillFilesetFromPage(fileset);
-// try {
-// getContainer().run(true, false, new IRunnableWithProgress () {
-// public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-// if (createFileset)
-// parentNode.addChild(fileset);
-// try {
-// ArchivesModel.instance().save(fileset.getProjectPath(), monitor);
-// } catch( ArchivesModelException ame ) {
-// IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID, "Error Completing Wizard", ame);
-// PackagesUIPlugin.getDefault().getLog().log(status);
-// }
-// }
-// });
-// } catch (InvocationTargetException e) {
-// } catch (InterruptedException e) {
-// } catch(Exception e) {e.printStackTrace();}
-// return true;
-// }
-//
-// private void fillFilesetFromPage (IArchiveFileSet fileset) {
-// fileset.setExcludesPattern(page1.getExcludes());
-// fileset.setIncludesPattern(page1.getIncludes());
-// fileset.setFlattened(page1.getFlatten());
-// if( page1.isRootDirWorkspaceRelative()) {
-// fileset.setSourcePath(new Path(page1.getWorkspaceRelativeRootDir()));
-// fileset.setInWorkspace(true);
-// } else {
-// fileset.setSourcePath(new Path(page1.getAbsoluteRootDir()));
-// fileset.setInWorkspace(false);
-// }
}
+
+ private void fillFilesetFromPage (IArchiveFileSet fileset) {
+ fileset.setExcludesPattern(page1.getExcludes());
+ fileset.setIncludesPattern(page1.getIncludes());
+ fileset.setFlattened(page1.isFlattened());
+ fileset.setRawSourcePath(page1.getRawPath());
+ fileset.setInWorkspace(page1.isRootDirWorkspaceRelative());
+ }
public void addPages() {
page1 = new FilesetInfoWizardPage(getShell(), fileset, parentNode);
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2008-07-16 21:30:02 UTC (rev 9157)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2008-07-17 00:10:42 UTC (rev 9158)
@@ -18,6 +18,7 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
@@ -26,14 +27,12 @@
import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
-import org.jboss.ide.eclipse.archives.core.model.IVariableManager;
import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory.DirectoryScannerExtension;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+import org.jboss.ide.eclipse.archives.ui.util.composites.ArchiveFilesetDestinationComposite;
import org.jboss.ide.eclipse.archives.ui.util.composites.ArchiveSourceDestinationComposite;
import org.jboss.ide.eclipse.archives.ui.util.composites.FilesetPreviewComposite;
-import org.jboss.ide.eclipse.archives.ui.util.garbage.ArchiveFilesetDestinationComposite;
-import org.jboss.ide.eclipse.archives.ui.util.garbage.ArchiveNodeDestinationComposite;
public class FilesetInfoWizardPage extends WizardPage {
@@ -55,7 +54,7 @@
private Button flattenedNo;
private Text includesText;
private Text excludesText;
- private ArchiveNodeDestinationComposite destinationComposite;
+ private ArchiveFilesetDestinationComposite destinationComposite;
public FilesetInfoWizardPage (Shell parent, IArchiveFileSet fileset, IArchiveNode parentNode) {
super(ArchivesUIMessages.FilesetInfoWizardPage_new_title, ArchivesUIMessages.FilesetInfoWizardPage_new_title, null);
@@ -224,6 +223,12 @@
};
flattenedYes.addSelectionListener(flattenAdapter);
flattenedNo.addSelectionListener(flattenAdapter);
+
+ srcDestComposite.addChangeListener(new ArchiveSourceDestinationComposite.ChangeListener() {
+ public void compositeChanged() {
+ changePreview();
+ }
+ });
}
public IArchiveNode getRootNode () {
@@ -280,29 +285,61 @@
}
} else {
- String rawPath = "${" + IVariableManager.CURRENT_PROJECT + "}";
+ String rawPath = "";
srcDestComposite.init(rawPath, true);
flattened = false;
flattenedYes.setSelection(flattened);
flattenedNo.setSelection(!flattened);
+ includes = "**";
+ includesText.setText(includes);
}
}
+ private ChangePreviewRunnable changePreviewRunnable;
private void changePreview() {
- DirectoryScannerExtension ds = DirectoryScannerFactory.createDirectoryScanner(
- replaceVariables(), null, includes, excludes, parentNode.getProjectName(), srcDestComposite.isWorkspaceRelative(), true);
- String[] fsRelative = ds.getIncludedFiles();
- IPath filesetRelative;
- ArrayList<IPath> list = new ArrayList<IPath>();
- for( int i = 0; i < fsRelative.length; i++ ) {
- if( flattened )
- filesetRelative = new Path(new Path(fsRelative[i]).lastSegment());
- else
- filesetRelative = new Path(fsRelative[i]);
- if( !list.contains(filesetRelative))
- list.add(filesetRelative);
+ if( changePreviewRunnable != null )
+ changePreviewRunnable.stop = true;
+ changePreviewRunnable = new ChangePreviewRunnable();
+ Thread t = new Thread(changePreviewRunnable);
+ t.start();
+ }
+
+ protected class ChangePreviewRunnable implements Runnable {
+ public boolean stop = false;
+ public void run() {
+ DirectoryScannerExtension ds = null;
+ Runnable r;
+ try {
+ ds = DirectoryScannerFactory.createDirectoryScanner(
+ replaceVariables(), null, includes, excludes, parentNode.getProjectName(), srcDestComposite.isWorkspaceRelative(), true);
+ String[] fsRelative = ds.getIncludedFiles();
+ IPath filesetRelative;
+ final ArrayList<IPath> list = new ArrayList<IPath>();
+ for( int i = 0; i < fsRelative.length; i++ ) {
+ if( flattened )
+ filesetRelative = new Path(new Path(fsRelative[i]).lastSegment());
+ else
+ filesetRelative = new Path(fsRelative[i]);
+ if( !list.contains(filesetRelative))
+ list.add(filesetRelative);
+ }
+ r = new Runnable() {
+ public void run() {
+ previewComposite.setInput(list.toArray());
+ }
+ };
+ } catch( Exception e ) {
+ r = new Runnable() {
+ public void run() {
+ previewComposite.setInput(new IPath[0]);
+ }
+ };
+ }
+
+ if( !stop ) {
+ Display.getDefault().asyncExec(r);
+ }
}
- previewComposite.setInput(list.toArray());
- }
+ }
}
16 years, 3 months
JBoss Tools SVN: r9157 - in trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards: pages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-07-16 17:30:02 -0400 (Wed, 16 Jul 2008)
New Revision: 9157
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
Log:
JBIDE-2385 - error message was previously just for aarchives in teh same project. Now its for all.
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2008-07-16 18:21:29 UTC (rev 9156)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2008-07-16 21:30:02 UTC (rev 9157)
@@ -34,6 +34,10 @@
public AbstractArchiveWizard () {
this.project = ProjectArchivesView.getInstance().getCurrentProject();
+ IStructuredSelection selection = ProjectArchivesView.getInstance().getSelection();
+ Object s = selection.getFirstElement();
+ if( s instanceof IArchiveNode )
+ initialDestinationNode = (IArchiveNode)s;
}
public AbstractArchiveWizard (IArchive existingPackage) {
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2008-07-16 18:21:29 UTC (rev 9156)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2008-07-16 21:30:02 UTC (rev 9157)
@@ -1,5 +1,10 @@
package org.jboss.ide.eclipse.archives.ui.wizards.pages;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.swt.SWT;
@@ -145,6 +150,11 @@
} else {
destinationComposite.init(archive.getDestinationPath().toString(), archive.isDestinationInWorkspace());
}
+ } else {
+ if(wizard.getInitialNode() != null )
+ destinationComposite.init(wizard.getInitialNode());
+ else
+ destinationComposite.init(wizard.getInitialPath(), wizard.isInitialPathWorkspaceRelative());
}
}
@@ -177,7 +187,12 @@
destinationLocation = new Path(destinationComposite.getPath());
}
- IArchive[] packages = ModelUtil.getProjectArchives(wizard.getProject().getLocation());
+ ArrayList<IArchive> allArchives = new ArrayList<IArchive>();
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for( int i = 0; i < projects.length; i++ )
+ allArchives.addAll(Arrays.asList(ModelUtil.getProjectArchives(projects[i].getLocation())));
+
+ IArchive[] packages = (IArchive[]) allArchives.toArray(new IArchive[allArchives.size()]);
if (packages != null) {
for( int i = 0; i < packages.length; i++ ) {
IArchive pkg = (IArchive) packages[i];
16 years, 3 months