Author: rombert
Date: Thu Oct 2 19:31:40 2014
New Revision: 1629052
URL: http://svn.apache.org/r1629052
Log:
SLING-3997 - Allow skipping server configuration when creating new
project
Modified:
sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/AbstractNewSlingApplicationWizard.java
sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java
Modified:
sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/AbstractNewSlingApplicationWizard.java
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/AbstractNewSlingApplicationWizard.java?rev=1629052&r1=1629051&r2=1629052&view=diff
==============================================================================
---
sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/AbstractNewSlingApplicationWizard.java
(original)
+++
sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/AbstractNewSlingApplicationWizard.java
Thu Oct 2 19:31:40 2014
@@ -164,6 +164,10 @@ public abstract class AbstractNewSlingAp
protected void deployProjectsOnServer(Projects projects, IProgressMonitor
monitor) throws CoreException {
IServer server = setupServerWizardPage.getOrCreateServer(monitor);
+ if (server == null) {
+ monitor.done();
+ return;
+ }
advance(monitor, 1);
IServerWorkingCopy wc = server.createWorkingCopy();
@@ -196,6 +200,9 @@ public abstract class AbstractNewSlingAp
protected void publishModules(final List<IProject> createdProjects,
IProgressMonitor monitor) throws CoreException {
IServer server = setupServerWizardPage.getOrCreateServer(monitor);
+ if (server == null) {
+ return;
+ }
if (setupServerWizardPage.getStartServer()) {
server.start(ILaunchManager.RUN_MODE, monitor);
}
Modified:
sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java?rev=1629052&r1=1629051&r2=1629052&view=diff
==============================================================================
---
sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java
(original)
+++
sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java
Thu Oct 2 19:31:40 2014
@@ -78,6 +78,8 @@ public class SetupServerWizardPage exten
private Button startExistingServerButton;
+ private Button skipServerConfiguration;
+
public SetupServerWizardPage(AbstractNewSlingApplicationWizard parent) {
super("chooseArchetypePage");
setTitle("Select or Create Server");
@@ -130,6 +132,10 @@ public class SetupServerWizardPage exten
startExistingServerButton.setSelection(true);
}
+ skipServerConfiguration = new Button(container, SWT.RADIO);
+ skipServerConfiguration.setText("Don't deploy on a server");
+ singleRowGridDataFactory.applyTo(skipServerConfiguration);
+
setupNewServer = new Button(container, SWT.RADIO);
setupNewServer.setText("Setup new server");
singleRowGridDataFactory.applyTo(setupNewServer);
@@ -301,8 +307,19 @@ public class SetupServerWizardPage exten
return startExistingServerButton.getSelection();
}
+ /**
+ * Gets or creates a <tt>IServer</tt> instance to deploy projects on
+ *
+ * @param monitor
+ * @return the server instance, possibly null if the user requested to
skip deployment
+ * @throws CoreException
+ */
public IServer getOrCreateServer(IProgressMonitor monitor) throws
CoreException {
+ if (skipServerConfiguration.getSelection()) {
+ return null;
+ }
+
if (server != null) {
return server;
}