JBoss Tools SVN: r6030 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-30 09:10:22 -0500 (Wed, 30 Jan 2008)
New Revision: 6030
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
Log:
Java Model Exception: Core Exception [code 0] Runtime JBoss 4.2 Runtime does not exist. This classpath container cannot be initialized.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-01-30 13:57:58 UTC (rev 6029)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2008-01-30 14:10:22 UTC (rev 6030)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.ILogListener;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
@@ -21,6 +22,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.common.model.util.ClassLoaderUtil;
+import org.jboss.tools.jst.firstrun.JBossASAdapterInitializer;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.VpeEditorPart;
@@ -72,11 +74,11 @@
* @see TestCase#setUp()
*/
protected void setUp() throws Exception {
-
super.setUp();
Platform.addLogListener(this);
-
+ String jbossPath = System.getProperty("jbosstools.test.jboss.home.4.2", "C:\\java\\jboss-4.2.2.GA");
+ JBossASAdapterInitializer.initJBossAS(jbossPath, new NullProgressMonitor());
closeEditors();
}
16 years, 11 months
JBoss Tools SVN: r6029 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-30 08:57:58 -0500 (Wed, 30 Jan 2008)
New Revision: 6029
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java
Log:
fix test error
expected node value is #{user} not #{currentUser}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java 2008-01-30 13:42:23 UTC (rev 6028)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java 2008-01-30 13:57:58 UTC (rev 6029)
@@ -407,7 +407,7 @@
nsIDOMText.NS_IDOMTEXT_IID);
assertEquals("Component's content is not shown", text.getNodeValue(),
- "#{currentUser}");
+ "#{user}");
if (getException() != null) {
throw getException();
16 years, 11 months
JBoss Tools SVN: r6028 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-01-30 08:42:23 -0500 (Wed, 30 Jan 2008)
New Revision: 6028
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1707 fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-01-30 12:36:36 UTC (rev 6027)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-01-30 13:42:23 UTC (rev 6028)
@@ -77,6 +77,7 @@
ISeamProject seamProject;
public SeamSettingsPreferencePage() {
+ noDefaultAndApplyButton();
}
@Override
16 years, 11 months
JBoss Tools SVN: r6027 - trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/preferences.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-01-30 07:36:36 -0500 (Wed, 30 Jan 2008)
New Revision: 6027
Modified:
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/preferences/RulesConfigurationPage.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1702
Modified: trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/preferences/RulesConfigurationPage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/preferences/RulesConfigurationPage.java 2008-01-30 09:17:32 UTC (rev 6026)
+++ trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/preferences/RulesConfigurationPage.java 2008-01-30 12:36:36 UTC (rev 6027)
@@ -119,18 +119,27 @@
}
}
-
+ private void setChecked(TreeItem item){
+ item.setChecked(true);
+ for(int i=0;i<item.getItemCount();i++){
+ TreeItem child = item.getItem(i);
+ setChecked(child);
+ }
+ }
public void performDefaults() {
RuleSetWrapper[] ruleSets = provider.getRuleSets();
for (int i = 0; i < ruleSets.length; i++) {
ruleSets[i].setDefaults();
}
-
+
if (treeViewer != null) {
-// treeViewer.refresh(ruleSets[i], true);
- treeViewer.refresh();
-// ruleSets[i].getParent();
+ Tree tree = treeViewer.getTree();
+
+ for(int i=0;i<tree.getItemCount();i++){
+ setChecked(tree.getItem(i));
+ }
+ treeViewer.refresh();
}
significance.loadDefaults();
16 years, 11 months
JBoss Tools SVN: r6026 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-01-30 04:17:32 -0500 (Wed, 30 Jan 2008)
New Revision: 6026
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
Revert from revision 5972
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-01-30 03:02:07 UTC (rev 6025)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-01-30 09:17:32 UTC (rev 6026)
@@ -16,7 +16,6 @@
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -111,9 +110,6 @@
private nsIDOMNode headNode;
private List includeStack;
boolean rebuildFlag = false;
-
- // Fix for JBIDE-1119
- private Collection<nsIDOMHTMLInputElement> inputElements = new ArrayList<nsIDOMHTMLInputElement>();
/** faceletFile */
private boolean faceletFile = false;
@@ -198,7 +194,6 @@
public void rebuildDom(Document sourceDocument) {
cleanHead();
- inputElements.clear();
domMapping.clear(visualContentArea);
pageContext.clearAll();
refreshExternalLinks();
@@ -228,9 +223,7 @@
if (visualNewNode != null) {
nsIDOMHTMLInputElement iDOMInputElement = (nsIDOMHTMLInputElement) visualNewNode
.queryInterface(nsIDOMHTMLInputElement.NS_IDOMHTMLINPUTELEMENT_IID);
- // Fix for JBIDE-1119
- inputElements.add(iDOMInputElement);
- //iDOMInputElement.setReadOnly(true);
+ iDOMInputElement.setReadOnly(true);
}
} catch (XPCOMException ex) {
// just ignore this exception
@@ -803,11 +796,6 @@
}
nsIDOMNode visualOldNode = domMapping.remove(sourceNode);
if (visualOldNode != null) {
-
- if (inputElements.contains(visualOldNode)) {
- inputElements.remove(visualOldNode);
- }
-
if (elementMapping != null) {
nsIDOMElement border = elementMapping.getBorder();
if (border != null) {
@@ -828,12 +816,7 @@
}
public void removeNode(Node sourceNode) {
- nsIDOMNode visualOldNode = domMapping.remove(sourceNode);
- if (visualOldNode != null) {
- if (inputElements.contains(visualOldNode)) {
- inputElements.remove(visualOldNode);
- }
- }
+ domMapping.remove(sourceNode);
}
private Node getParentTable(Node sourceNode, int depth) {
@@ -1248,11 +1231,6 @@
public void resize(nsIDOMElement element, int resizerConstrains, int top,
int left, int width, int height) {
-
- for (nsIDOMHTMLInputElement inputElement : inputElements) {
- inputElement.setReadOnly(true);
- }
-
VpeElementMapping elementMapping = (VpeElementMapping) domMapping
.getNodeMapping(element);
if (elementMapping != null) {
@@ -1261,11 +1239,6 @@
element, elementMapping.getData(), resizerConstrains, top,
left, width, height);
}
-
- for (nsIDOMHTMLInputElement inputElement : inputElements) {
- inputElement.setReadOnly(false);
- }
-
}
static boolean isAnonElement(nsIDOMNode visualNode) {
16 years, 11 months
JBoss Tools SVN: r6025 - in trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as: test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-29 22:02:07 -0500 (Tue, 29 Jan 2008)
New Revision: 6025
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java
Removed:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASClasspathTest.java
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
Moving tests around. Loosely related to JBIDE-1657
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java (from rev 5678, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASClasspathTest.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/classpath/test/ASClasspathTest.java 2008-01-30 03:02:07 UTC (rev 6025)
@@ -0,0 +1,164 @@
+package org.jboss.ide.eclipse.as.classpath.test;
+
+import java.util.HashSet;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+public class ASClasspathTest extends TestCase {
+
+
+ private static final String ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42 = "org.jboss.ide.eclipse.as.runtime.42";
+
+ private static final String JBOSS_AS_HOME = System.getProperty("jbosstools.test.jboss.home", "/home/max/rhdevstudio/jboss-eap/jboss-as");
+
+ private TestProjectProvider provider;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
+ project = provider.getProject();
+
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=201340
+ // skipped since reported issue and always failing
+ public void skip_testDoubleCreateEclipseBug201340() throws CoreException {
+
+ createGenericRuntime("org.eclipse.jst.server.tomcat.runtime.55");
+
+ createGenericRuntime(ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42);
+
+
+ }
+
+ private IRuntime[] createGenericRuntime(String runtimeId) throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, runtimeId);
+ assertEquals("expects only one runtime type", runtimeTypes.length, 1);
+
+ IRuntimeType runtimeType = runtimeTypes[0];
+
+ IRuntimeWorkingCopy firstRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
+ IRuntime savedRuntime = firstRuntime.save(true, new NullProgressMonitor());
+
+ IRuntimeWorkingCopy secondRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
+ IRuntime secondSavedRuntime = secondRuntime.save(true, new NullProgressMonitor());
+
+ assertEquals(savedRuntime.getName(), secondSavedRuntime.getName());
+ assertNotSame(savedRuntime, secondSavedRuntime);
+ assertFalse("Why are two different runtimes " + runtimeId + " created with the same ID ?!", savedRuntime.getId().equals(secondSavedRuntime.getId()));
+ return new IRuntime[] { savedRuntime, secondSavedRuntime };
+ }
+ public void testCreateBrokenServer() throws CoreException {
+
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42);
+ assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
+
+ IRuntimeType runtimeType = runtimeTypes[0];
+
+ IRuntimeWorkingCopy jbossRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
+
+ IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
+
+ assertEquals("Neither vm install nor configuration is set - should not be able to validate",savedRuntime.validate(null).getSeverity(), Status.ERROR);
+
+
+ }
+
+ // see JBIDE-1355 why this is skipped
+ public void skip_testClasspathAvailable() throws CoreException {
+ // Weirdness: If this method is the only to run everything works as expected.
+
+ IJavaProject javaProject = JavaCore.create(project);
+ assertTrue(javaProject.exists());
+
+ String id = "cp-runtime";
+ IRuntime createdRuntime = createRuntime(id);
+ setTargetRuntime(createdRuntime, project);
+
+ //assertEquals(createdRuntime.getId(), "cp-runtime");
+
+
+
+ IClasspathEntry paths[] = javaProject.getRawClasspath();
+ boolean found = false;
+ for (int i = 0; i < paths.length; i++) {
+ IClasspathEntry classpathEntry = paths[i];
+
+ if(classpathEntry.getPath().toString().equals("org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer/" + id)) {
+ IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), javaProject);
+ assertEquals("container not returning userclasses!", container.getKind(), container.K_APPLICATION);
+ found = true;
+ }
+ }
+ assertTrue("could not find jboss as specific entry in raw classpath", found);
+
+ IClasspathEntry[] resolvedClasspath = javaProject.getResolvedClasspath(false);
+
+ boolean jsfFound = false;
+ for (int i = 0; i < resolvedClasspath.length; i++) {
+ IClasspathEntry classpathEntry = resolvedClasspath[i];
+ if(classpathEntry.getPath().toString().contains("jsf")) {
+ System.out.println(classpathEntry);
+ jsfFound = true;
+ }
+
+ }
+ assertTrue("jsf lib not found!", jsfFound);
+
+
+ }
+
+ private void setTargetRuntime(IRuntime runtime, IProject theProject) throws CoreException {
+
+ final org.eclipse.wst.common.project.facet.core.runtime.IRuntime facetRuntime = RuntimeManager.getRuntime(runtime.getId());
+
+ assertNotNull("bridged facet runtime not found", facetRuntime);
+
+ IFacetedProject facetedProject = ProjectFacetsManager.create(theProject);
+
+ facetedProject.setTargetedRuntimes(new HashSet<org.eclipse.wst.common.project.facet.core.runtime.IRuntime>() { { this.add(facetRuntime);}}, null);
+ facetedProject.setPrimaryRuntime(facetRuntime, null);
+
+ }
+
+ private IRuntime createRuntime(String runtimeName) throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42);
+ assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
+
+ IRuntimeType runtimeType = runtimeTypes[0];
+
+ RuntimeWorkingCopy jbossRuntime = (RuntimeWorkingCopy)runtimeType.createRuntime(runtimeName, new NullProgressMonitor());
+
+ jbossRuntime.setLocation(new Path(JBOSS_AS_HOME));
+ jbossRuntime.setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, "default");
+ IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
+
+ assertEquals(savedRuntime.validate(null).getCode(), Status.OK);
+
+ return savedRuntime;
+ }
+
+}
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASClasspathTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASClasspathTest.java 2008-01-30 02:56:06 UTC (rev 6024)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASClasspathTest.java 2008-01-30 03:02:07 UTC (rev 6025)
@@ -1,164 +0,0 @@
-package org.jboss.ide.eclipse.as.test;
-
-import java.util.HashSet;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-
-public class ASClasspathTest extends TestCase {
-
-
- private static final String ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42 = "org.jboss.ide.eclipse.as.runtime.42";
-
- private static final String JBOSS_AS_HOME = System.getProperty("jbosstools.test.jboss.home", "/home/max/rhdevstudio/jboss-eap/jboss-as");
-
- private TestProjectProvider provider;
- private IProject project;
-
- protected void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
- project = provider.getProject();
-
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
-
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=201340
- // skipped since reported issue and always failing
- public void skip_testDoubleCreateEclipseBug201340() throws CoreException {
-
- createGenericRuntime("org.eclipse.jst.server.tomcat.runtime.55");
-
- createGenericRuntime(ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42);
-
-
- }
-
- private IRuntime[] createGenericRuntime(String runtimeId) throws CoreException {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, runtimeId);
- assertEquals("expects only one runtime type", runtimeTypes.length, 1);
-
- IRuntimeType runtimeType = runtimeTypes[0];
-
- IRuntimeWorkingCopy firstRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
- IRuntime savedRuntime = firstRuntime.save(true, new NullProgressMonitor());
-
- IRuntimeWorkingCopy secondRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
- IRuntime secondSavedRuntime = secondRuntime.save(true, new NullProgressMonitor());
-
- assertEquals(savedRuntime.getName(), secondSavedRuntime.getName());
- assertNotSame(savedRuntime, secondSavedRuntime);
- assertFalse("Why are two different runtimes " + runtimeId + " created with the same ID ?!", savedRuntime.getId().equals(secondSavedRuntime.getId()));
- return new IRuntime[] { savedRuntime, secondSavedRuntime };
- }
- public void testCreateBrokenServer() throws CoreException {
-
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42);
- assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
-
- IRuntimeType runtimeType = runtimeTypes[0];
-
- IRuntimeWorkingCopy jbossRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
-
- IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
-
- assertEquals("Neither vm install nor configuration is set - should not be able to validate",savedRuntime.validate(null).getSeverity(), Status.ERROR);
-
-
- }
-
- // see JBIDE-1355 why this is skipped
- public void skip_testClasspathAvailable() throws CoreException {
- // Weirdness: If this method is the only to run everything works as expected.
-
- IJavaProject javaProject = JavaCore.create(project);
- assertTrue(javaProject.exists());
-
- String id = "cp-runtime";
- IRuntime createdRuntime = createRuntime(id);
- setTargetRuntime(createdRuntime, project);
-
- //assertEquals(createdRuntime.getId(), "cp-runtime");
-
-
-
- IClasspathEntry paths[] = javaProject.getRawClasspath();
- boolean found = false;
- for (int i = 0; i < paths.length; i++) {
- IClasspathEntry classpathEntry = paths[i];
-
- if(classpathEntry.getPath().toString().equals("org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer/" + id)) {
- IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), javaProject);
- assertEquals("container not returning userclasses!", container.getKind(), container.K_APPLICATION);
- found = true;
- }
- }
- assertTrue("could not find jboss as specific entry in raw classpath", found);
-
- IClasspathEntry[] resolvedClasspath = javaProject.getResolvedClasspath(false);
-
- boolean jsfFound = false;
- for (int i = 0; i < resolvedClasspath.length; i++) {
- IClasspathEntry classpathEntry = resolvedClasspath[i];
- if(classpathEntry.getPath().toString().contains("jsf")) {
- System.out.println(classpathEntry);
- jsfFound = true;
- }
-
- }
- assertTrue("jsf lib not found!", jsfFound);
-
-
- }
-
- private void setTargetRuntime(IRuntime runtime, IProject theProject) throws CoreException {
-
- final org.eclipse.wst.common.project.facet.core.runtime.IRuntime facetRuntime = RuntimeManager.getRuntime(runtime.getId());
-
- assertNotNull("bridged facet runtime not found", facetRuntime);
-
- IFacetedProject facetedProject = ProjectFacetsManager.create(theProject);
-
- facetedProject.setTargetedRuntimes(new HashSet<org.eclipse.wst.common.project.facet.core.runtime.IRuntime>() { { this.add(facetRuntime);}}, null);
- facetedProject.setPrimaryRuntime(facetRuntime, null);
-
- }
-
- private IRuntime createRuntime(String runtimeName) throws CoreException {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ORG_JBOSS_IDE_ECLIPSE_AS_RUNTIME_42);
- assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
-
- IRuntimeType runtimeType = runtimeTypes[0];
-
- RuntimeWorkingCopy jbossRuntime = (RuntimeWorkingCopy)runtimeType.createRuntime(runtimeName, new NullProgressMonitor());
-
- jbossRuntime.setLocation(new Path(JBOSS_AS_HOME));
- jbossRuntime.setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, "default");
- IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
-
- assertEquals(savedRuntime.validate(null).getCode(), Status.OK);
-
- return savedRuntime;
- }
-
-}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-30 02:56:06 UTC (rev 6024)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-01-30 03:02:07 UTC (rev 6025)
@@ -1,5 +1,6 @@
package org.jboss.ide.eclipse.as.test;
+import org.jboss.ide.eclipse.as.classpath.test.ASClasspathTest;
import org.jboss.ide.eclipse.as.classpath.test.JEEClasspathContainerTest;
import junit.framework.Test;
16 years, 11 months
JBoss Tools SVN: r6024 - in trunk/as/tests/org.jboss.ide.eclipse.as.test: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-29 21:56:06 -0500 (Tue, 29 Jan 2008)
New Revision: 6024
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF
trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties
Log:
no JIRA issue... improper build.properties AND manifest.mf!
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF 2008-01-30 02:34:51 UTC (rev 6023)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF 2008-01-30 02:56:06 UTC (rev 6024)
@@ -18,4 +18,4 @@
org.eclipse.debug.core,
org.eclipse.jdt.launching
Eclipse-LazyStart: true
-Bundle-ClassPath: archivestest.jar
+Bundle-ClassPath: jbossastest.jar
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties 2008-01-30 02:34:51 UTC (rev 6023)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties 2008-01-30 02:56:06 UTC (rev 6024)
@@ -1,8 +1,8 @@
source.. = src/
-output.jbossastest.jar = bin/
bin.includes = META-INF/,\
jbossastest.jar,\
projects/
+source.jbossastest.jar = src/
jars.compile.order = .
+output.jbossastest.jar = bin/
source.jbossastest.jar = src/
-output.jbossastest.jar = bin/
16 years, 11 months
JBoss Tools SVN: r6023 - trunk/as/tests/org.jboss.ide.eclipse.as.test.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-29 21:34:51 -0500 (Tue, 29 Jan 2008)
New Revision: 6023
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties
Log:
no JIRA issue... improper build.properties file. (yuck)
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties 2008-01-30 02:01:55 UTC (rev 6022)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties 2008-01-30 02:34:51 UTC (rev 6023)
@@ -1,6 +1,8 @@
source.. = src/
-output.archivestest.jar = bin/
+output.jbossastest.jar = bin/
bin.includes = META-INF/,\
- archivestest.jar,\
+ jbossastest.jar,\
projects/
-source.archivestest.jar = src/
+jars.compile.order = .
+source.jbossastest.jar = src/
+output.jbossastest.jar = bin/
16 years, 11 months
JBoss Tools SVN: r6022 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-29 21:01:55 -0500 (Tue, 29 Jan 2008)
New Revision: 6022
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/publishDetails.gif
Log:
JBIDE-1404 - missing icon
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/publishDetails.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/publishDetails.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 11 months
JBoss Tools SVN: r6021 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui: jbossui/org/jboss/ide/eclipse/as/ui/packages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-29 20:59:22 -0500 (Tue, 29 Jan 2008)
New Revision: 6021
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/EditPublishAction.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PublishAction.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-1404 - implementation
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java 2008-01-30 01:59:22 UTC (rev 6021)
@@ -0,0 +1,214 @@
+package org.jboss.ide.eclipse.as.ui.packages;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+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.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.as.core.modules.ArchivesBuildListener;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+
+public class ArchivePublishWizard extends Wizard {
+
+ private ArchivePublishWizardPage page;
+ private IArchive pack;
+ public ArchivePublishWizard(IArchive pack) {
+ this.pack = pack;
+ }
+ public boolean performFinish() {
+ if( new Boolean(page.getAlwaysPublish()).booleanValue() ) {
+ pack.setProperty(ArchivesBuildListener.DEPLOY_SERVERS, getServers());
+ pack.setProperty(ArchivesBuildListener.DEPLOY_AFTER_BUILD, getAutoDeploy());
+ IPath p = pack.getProjectPath();
+ ArchivesModel.instance().saveModel(p, null);
+ }
+ return true;
+ }
+ public void addPages() {
+ page = new ArchivePublishWizardPage(pack);
+ addPage(page);
+ }
+
+ protected String getServers() {
+ return page.getServers();
+ }
+ protected String getAutoDeploy() {
+ return page.getAutoDeploy();
+ }
+ protected String getAlwaysPublish() {
+ return page.getAlwaysPublish();
+ }
+
+
+ public class ArchivePublishWizardPage extends WizardPage {
+ protected IArchive pack;
+ protected ListViewer viewer;
+ protected Button autoDeploy, alwaysPublish;
+ protected String viewerResult = "";
+ protected String deployResult = Boolean.toString(false);
+ protected String alwaysPublishResult = Boolean.toString(false);
+
+ protected ArchivePublishWizardPage(IArchive pack) {
+ super("Select Server Wizard");
+ setDescription("Select the server to publish the archive to.");
+ setTitle("Publish archive to a server");
+ this.pack = pack;
+ }
+
+ public void createControl(Composite parent) {
+ Composite mainComposite = new Composite(parent, SWT.NONE);
+ mainComposite.setLayout(new FormLayout());
+ mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ fillComposite(mainComposite);
+ addListeners();
+ setControl(mainComposite);
+ getContainer().updateTitleBar();
+ setPackageDefaults();
+ }
+
+ protected void setPackageDefaults() {
+ String servers = pack.getProperty(ArchivesBuildListener.DEPLOY_SERVERS);
+ viewerResult = servers;
+ String deployAfterBuild = pack.getProperty(ArchivesBuildListener.DEPLOY_AFTER_BUILD);
+ if( servers != null ) {
+ alwaysPublish.setSelection(true);
+ alwaysPublishSelected();
+ boolean depAfterBld = !(deployAfterBuild == null || new Boolean(deployAfterBuild).booleanValue() == false);
+ autoDeploy.setSelection(depAfterBld);
+ autoDeploySelected();
+
+ IDeployableServer[] depServers = ServerConverter.getAllDeployableServers();
+ String[] serverList = servers.split(",");
+ final ArrayList selected = new ArrayList();
+ for(int i = 0; i < serverList.length; i++ ) {
+ for( int j = 0; j < depServers.length; j++ ) {
+ if( serverList[i].equals(depServers[j].getServer().getId()))
+ selected.add(depServers[j]);
+ }
+ }
+ viewer.setSelection(new StructuredSelection(selected.toArray()));
+ }
+ }
+
+ protected void fillComposite(Composite mainComposite) {
+ viewer = new ListViewer(mainComposite);
+ FormData viewerData = new FormData();
+ viewerData.left = new FormAttachment(15,0);
+ viewerData.right = new FormAttachment(85,0);
+ viewerData.top = new FormAttachment(0,10);
+ viewerData.bottom = new FormAttachment(80,0);
+ viewer.getList().setLayoutData(viewerData);
+
+ this.alwaysPublish = new Button(mainComposite, SWT.CHECK);
+ FormData always = new FormData();
+ always.left = new FormAttachment(15,0);
+ always.top = new FormAttachment(viewer.getList(), 5);
+ alwaysPublish.setLayoutData(always);
+ alwaysPublish.setText("Always publish to these servers");
+
+ autoDeploy = new Button(mainComposite, SWT.CHECK);
+ FormData add = new FormData();
+ add.left = new FormAttachment(15,0);
+ add.top = new FormAttachment(alwaysPublish, 5);
+ autoDeploy.setLayoutData(add);
+ autoDeploy.setText("Auto-deploy to selected servers after builds");
+ }
+
+ protected void addListeners() {
+ autoDeploy.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ autoDeploySelected();
+ }
+ });
+ viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ viewerSelected();
+ }
+ } );
+
+ alwaysPublish.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ alwaysPublishSelected();
+ }
+ });
+
+ viewer.setContentProvider(new ArrayContentProvider());
+ viewer.setLabelProvider(new ArchivePublishLabelProvider());
+ viewer.setInput(ServerConverter.getAllDeployableServers());
+ autoDeploy.setEnabled(false);
+ }
+
+ protected void autoDeploySelected() {
+ deployResult = Boolean.toString(autoDeploy.getSelection() && autoDeploy.getEnabled());
+ }
+
+ protected void alwaysPublishSelected() {
+ autoDeploy.setEnabled(alwaysPublish.getSelection());
+ deployResult = Boolean.toString(autoDeploy.getSelection() && autoDeploy.getEnabled());
+ alwaysPublishResult = Boolean.toString(alwaysPublish.getSelection());
+ }
+
+ protected void viewerSelected() {
+ ISelection sel = viewer.getSelection();
+ if( sel instanceof IStructuredSelection ) {
+ IStructuredSelection sel2 = (IStructuredSelection)sel;
+ Object[] os = sel2.toArray();
+ String tmp = "";
+ for( int i = 0; i < os.length; i++ ) {
+ tmp += ((IDeployableServer)os[i]).getServer().getId() + ",";
+ }
+ viewerResult = tmp;
+ }
+ }
+ protected String getServers() {
+ return viewerResult;
+ }
+ protected String getAutoDeploy() {
+ return deployResult;
+ }
+ protected String getAlwaysPublish() {
+ return alwaysPublishResult;
+ }
+ }
+
+ protected class ArchivePublishLabelProvider extends LabelProvider {
+ public Image getImage(Object element) {
+ return null;
+ }
+ public String getText(Object element) {
+ if( element instanceof IDeployableServer ) {
+ return ((IDeployableServer)element).getServer().getName();
+ }
+ return element == null ? "" : element.toString();//$NON-NLS-1$
+ }
+
+ }
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/EditPublishAction.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/EditPublishAction.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/EditPublishAction.java 2008-01-30 01:59:22 UTC (rev 6021)
@@ -0,0 +1,22 @@
+package org.jboss.ide.eclipse.as.ui.packages;
+
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.ui.actions.INodeActionDelegate;
+
+public class EditPublishAction implements INodeActionDelegate {
+
+ public boolean isEnabledFor(IArchiveNode node) {
+ if( node.getNodeType() == IArchiveNode.TYPE_ARCHIVE)
+ return true;
+ return false;
+ }
+
+ public void run(IArchiveNode node) {
+ ArchivePublishWizard wiz = new ArchivePublishWizard((IArchive)node);
+ new WizardDialog(new Shell(), wiz).open();
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PublishAction.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PublishAction.java 2008-01-29 22:48:06 UTC (rev 6020)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PublishAction.java 2008-01-30 01:59:22 UTC (rev 6021)
@@ -21,38 +21,15 @@
*/
package org.jboss.ide.eclipse.as.ui.packages;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-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.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.ui.actions.INodeActionDelegate;
import org.jboss.ide.eclipse.as.core.modules.ArchivesBuildListener;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class PublishAction implements INodeActionDelegate {
@@ -65,8 +42,7 @@
&& ((IArchive)node).isTopLevel()) {
IArchive pkg = (IArchive)node;
String servers = node.getProperty(ArchivesBuildListener.DEPLOY_SERVERS);
- if( !new Boolean(pkg.getProperty(ArchivesBuildListener.DEPLOY_AFTER_BUILD)).booleanValue() ||
- servers == null || "".equals(servers) || anyServerDoesntExist(servers)){
+ if( servers == null || "".equals(servers) || anyServerDoesntExist(servers)){
servers = showSelectServersDialog(pkg);
}
if( servers != null )
@@ -92,155 +68,11 @@
}
protected String showSelectServersDialog(IArchive node) {
- SelectServerWizard wiz = new SelectServerWizard(node);
+ ArchivePublishWizard wiz = new ArchivePublishWizard(node);
int result = new WizardDialog(new Shell(), wiz).open();
if( result == Window.OK) {
return wiz.getServers();
}
return null;
}
-
-
- protected class SelectServerWizard extends Wizard {
- private SelectServerWizardPage page;
- private IArchive pack;
- protected SelectServerWizard(IArchive pack) {
- this.pack = pack;
- }
- public boolean performFinish() {
- pack.setProperty(ArchivesBuildListener.DEPLOY_SERVERS, getServers());
- pack.setProperty(ArchivesBuildListener.DEPLOY_AFTER_BUILD, getAutoDeploy());
- IPath p = pack.getProjectPath();
- ArchivesModel.instance().saveModel(p, null);
- return true;
- }
- public void addPages() {
- page = new SelectServerWizardPage(pack);
- addPage(page);
- }
-
- protected String getServers() {
- return page.getServers();
- }
- protected String getAutoDeploy() {
- return page.getAutoDeploy();
- }
- protected String getAlwaysPublish() {
- return page.getAlwaysPublish();
- }
- }
-
- protected class SelectServerWizardPage extends WizardPage {
- protected IArchive pack;
- protected ListViewer viewer;
- protected Button autoDeploy, alwaysPublish;
- protected String viewerResult = "";
- protected String deployResult = Boolean.toString(false);
- protected String alwaysPublishResult = Boolean.toString(false);
-
- protected SelectServerWizardPage(IArchive pack) {
- super("Select Server Wizard");
- setDescription("Select the server to publish the archive to.");
- setTitle("Publish archive to a server");
- this.pack = pack;
- }
-
- public void createControl(Composite parent) {
- Composite mainComposite = new Composite(parent, SWT.NONE);
- mainComposite.setLayout(new FormLayout());
- mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- fillComposite(mainComposite);
- addListeners();
- setControl(mainComposite);
- getContainer().updateTitleBar();
- }
-
- protected void fillComposite(Composite mainComposite) {
- viewer = new ListViewer(mainComposite);
- FormData viewerData = new FormData();
- viewerData.left = new FormAttachment(15,0);
- viewerData.right = new FormAttachment(85,0);
- viewerData.top = new FormAttachment(0,10);
- viewerData.bottom = new FormAttachment(80,0);
- viewer.getList().setLayoutData(viewerData);
-
- this.alwaysPublish = new Button(mainComposite, SWT.CHECK);
- FormData always = new FormData();
- always.left = new FormAttachment(15,0);
- always.top = new FormAttachment(viewer.getList(), 5);
- alwaysPublish.setLayoutData(always);
- alwaysPublish.setText("Always publish to these servers");
-
- autoDeploy = new Button(mainComposite, SWT.CHECK);
- FormData add = new FormData();
- add.left = new FormAttachment(15,0);
- add.top = new FormAttachment(alwaysPublish, 5);
- autoDeploy.setLayoutData(add);
- autoDeploy.setText("Auto-deploy to selected servers after builds");
- }
-
- protected void addListeners() {
- autoDeploy.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- deployResult = Boolean.toString(autoDeploy.getSelection() && autoDeploy.getEnabled());
- }
- });
- viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection sel = viewer.getSelection();
- if( sel instanceof IStructuredSelection ) {
- IStructuredSelection sel2 = (IStructuredSelection)sel;
- Object[] os = sel2.toArray();
- String tmp = "";
- for( int i = 0; i < os.length; i++ ) {
- tmp += ((IDeployableServer)os[i]).getServer().getId() + ",";
- }
- viewerResult = tmp;
- }
- }
- } );
-
- alwaysPublish.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- public void widgetSelected(SelectionEvent e) {
- autoDeploy.setEnabled(alwaysPublish.getSelection());
- deployResult = Boolean.toString(autoDeploy.getSelection() && autoDeploy.getEnabled());
- alwaysPublishResult = Boolean.toString(alwaysPublish.getSelection());
- }
- });
-
- viewer.setContentProvider(new ArrayContentProvider());
- viewer.setLabelProvider(new PublishServerLabelProvider());
- viewer.setInput(ServerConverter.getAllDeployableServers());
- autoDeploy.setEnabled(false);
- }
-
- protected String getServers() {
- return viewerResult;
- }
- protected String getAutoDeploy() {
- return deployResult;
- }
- protected String getAlwaysPublish() {
- return alwaysPublishResult;
- }
- }
- protected class PublishServerLabelProvider extends LabelProvider {
- public Image getImage(Object element) {
- return null;
- }
- public String getText(Object element) {
- if( element instanceof IDeployableServer ) {
- return ((IDeployableServer)element).getServer().getName();
- }
- return element == null ? "" : element.toString();//$NON-NLS-1$
- }
-
- }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-01-29 22:48:06 UTC (rev 6020)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-01-30 01:59:22 UTC (rev 6021)
@@ -268,9 +268,15 @@
<nodeContribution
class="org.jboss.ide.eclipse.as.ui.packages.PublishAction"
icon="icons/publish.gif"
- id="org.jboss.ide.eclipse.as.ui.nodeContextContrib"
+ id="org.jboss.ide.eclipse.as.ui.publishNodeContextContrib"
label="Publish To Server"
weight="1"/>
+ <nodeContribution
+ class="org.jboss.ide.eclipse.as.ui.packages.EditPublishAction"
+ icon="icons/publishDetails.gif"
+ id="org.jboss.ide.eclipse.as.ui.modifyPublishNodeContextContrib"
+ label="Edit publish settings...">
+ </nodeContribution>
</extension>
<extension
point="org.jboss.ide.eclipse.archives.ui.newArchiveActions">
16 years, 11 months