JBoss Tools SVN: r35712 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/project.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-10-17 07:10:24 -0400 (Mon, 17 Oct 2011)
New Revision: 35712
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/project/SarArtifactAdapter.java
Log:
JBIDE-9793 - SarArtifactAdapter too aggressive in creating artifacts.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/project/SarArtifactAdapter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/project/SarArtifactAdapter.java 2011-10-17 10:24:51 UTC (rev 35711)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/project/SarArtifactAdapter.java 2011-10-17 11:10:24 UTC (rev 35712)
@@ -17,7 +17,7 @@
IProject p = ((IResource)obj).getProject();
if( p != null ) {
IModule[] mods = ServerUtil.getModules(p);
- if( mods.length == 1 ) {
+ if( mods.length == 1 && mods[0].getModuleType().getId().equals(JBossSARModuleFactory.MODULE_TYPE)) {
return new MBeanNullArtifact(mods[0]);
}
}
13 years, 3 months
JBoss Tools SVN: r35711 - in trunk/as/plugins: org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-10-17 06:24:51 -0400 (Mon, 17 Oct 2011)
New Revision: 35711
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
Log:
JBIDE-9793 - work for run-on server and publishing
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2011-10-17 09:42:02 UTC (rev 35710)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2011-10-17 10:24:51 UTC (rev 35711)
@@ -200,12 +200,17 @@
IWebModule webModule =(IWebModule)module.loadAdapter(IWebModule.class,null);
String host = getHost();
- String url = "http://"+host; //$NON-NLS-1$
+ String url = host;
+ if( !url.startsWith("http://") && !url.startsWith("https://") ) { //$NON-NLS-1$ //$NON-NLS-2$
+ url = "http://"+host; //$NON-NLS-1$
+ }
int port = getJBossWebPort();
if (port != 80)
url += ":" + port; //$NON-NLS-1$
- url += "/"+webModule.getContextRoot(); //$NON-NLS-1$
+ String cxRoot = webModule.getContextRoot();
+ if( !cxRoot.equals("/") && !cxRoot.equals("./")) //$NON-NLS-1$ //$NON-NLS-2$
+ url += "/"+webModule.getContextRoot(); //$NON-NLS-1$
if (!url.endsWith("/")) //$NON-NLS-1$
url += "/"; //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java 2011-10-17 09:42:02 UTC (rev 35710)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBehaviourDelegate.java 2011-10-17 10:24:51 UTC (rev 35711)
@@ -8,21 +8,20 @@
import org.jboss.ide.eclipse.as.core.server.internal.IJBossBehaviourDelegate;
public class ExpressBehaviourDelegate implements IJBossBehaviourDelegate {
-
+ private DelegatingServerBehavior realBehaviour;
+
public ExpressBehaviourDelegate() {
// TODO Auto-generated constructor stub
}
@Override
public String getBehaviourTypeId() {
- // TODO Auto-generated method stub
- return null;
+ return "openshift";
}
@Override
public void setActualBehaviour(DelegatingServerBehavior actualBehaviour) {
- // TODO Auto-generated method stub
-
+ realBehaviour = actualBehaviour;
}
@Override
@@ -57,7 +56,7 @@
@Override
public IStatus canChangeState(String launchMode) {
- return Status.CANCEL_STATUS;
+ return Status.OK_STATUS;
}
@Override
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java 2011-10-17 09:42:02 UTC (rev 35710)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressLaunchDelegate.java 2011-10-17 10:24:51 UTC (rev 35711)
@@ -2,12 +2,17 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.Trace;
+import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.internal.launch.IJBossLaunchDelegate;
+import org.jboss.ide.eclipse.as.core.util.JBossServerBehaviorUtils;
+import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
public class ExpressLaunchDelegate implements IJBossLaunchDelegate {
@@ -26,15 +31,24 @@
@Override
public boolean preLaunchCheck(ILaunchConfiguration configuration,
String mode, IProgressMonitor monitor) throws CoreException {
- // TODO Auto-generated method stub
- return false;
+ DelegatingServerBehavior jbsBehavior = JBossServerBehaviorUtils.getServerBehavior(configuration);
+ IStatus s = jbsBehavior.canStart(mode);
+
+ Trace.trace(Trace.STRING_FINEST, "Ensuring Server can start: " + s.getMessage()); //$NON-NLS-1$
+ if (!s.isOK())
+ throw new CoreException(jbsBehavior.canStart(mode));
+ if (LaunchCommandPreferences.isIgnoreLaunchCommand(jbsBehavior.getServer())) {
+ Trace.trace(Trace.STRING_FINEST, "Server is marked as ignore Launch. Marking as started."); //$NON-NLS-1$
+ jbsBehavior.setServerStarting();
+ jbsBehavior.setServerStarted();
+ return false;
+ }
+ return true;
}
@Override
public void preLaunch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor monitor) throws CoreException {
- // TODO Auto-generated method stub
-
}
@Override
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-10-17 09:42:02 UTC (rev 35710)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-10-17 10:24:51 UTC (rev 35711)
@@ -1,13 +1,16 @@
package org.jboss.tools.openshift.express.internal.core.behaviour;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.egit.core.EGitUtils;
public class ExpressPublishMethod implements IJBossServerPublishMethod {
@@ -33,8 +36,15 @@
public int publishModule(DeployableServerBehavior behaviour, int kind,
int deltaKind, IModule[] module, IProgressMonitor monitor)
throws CoreException {
- // TODO Auto-generated method stub
- return 0;
+ int state = behaviour.getServer().getModulePublishState(module);
+ if( kind == IServer.PUBLISH_FULL || state == IServer.PUBLISH_STATE_FULL) {
+ IProject p = module[module.length-1].getProject();
+ monitor.beginTask("Publishing " + p.getName(), 200);
+ EGitUtils.commit(p, new SubProgressMonitor(monitor, 100));
+ EGitUtils.push(EGitUtils.getRepository(p), new SubProgressMonitor(monitor, 100));
+ return IServer.PUBLISH_STATE_NONE;
+ }
+ return IServer.PUBLISH_STATE_INCREMENTAL;
}
@Override
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2011-10-17 09:42:02 UTC (rev 35710)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2011-10-17 10:24:51 UTC (rev 35711)
@@ -7,6 +7,8 @@
import org.eclipse.wst.server.core.IServerAttributes;
import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
@@ -150,7 +152,11 @@
public static IServer fillServerWithOpenshiftDetails(IServer server,
String host, String username, String password, String domain, String app,
String mode) throws CoreException {
- IServerWorkingCopy wc = server.createWorkingCopy();
+ if( host.indexOf("://") != -1)
+ host = host.substring(host.indexOf("://") + 3);
+ if( host.endsWith("/"))
+ host = host.substring(0, host.length()-1);
+ ServerWorkingCopy wc = (ServerWorkingCopy)server.createWorkingCopy();
wc.setHost(host);
wc.setAttribute(IDeployableServer.SERVER_MODE, "openshift");
wc.setAttribute(ATTRIBUTE_USERNAME, username);
@@ -158,6 +164,10 @@
wc.setAttribute(ATTRIBUTE_DOMAIN, domain);
wc.setAttribute(ATTRIBUTE_APPLICATION, app);
wc.setAttribute(ATTRIBUTE_EXPRESS_MODE, mode);
+ wc.setAutoPublishSetting(Server.AUTO_PUBLISH_DISABLE);
+ wc.setAttribute(IJBossToolingConstants.IGNORE_LAUNCH_COMMANDS, "true");
+ wc.setAttribute(IJBossToolingConstants.WEB_PORT, 80);
+ wc.setAttribute(IJBossToolingConstants.WEB_PORT_DETECT, "false");
return wc.save(true, new NullProgressMonitor());
}
13 years, 3 months
JBoss Tools SVN: r35710 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-17 05:42:02 -0400 (Mon, 17 Oct 2011)
New Revision: 35710
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
Log:
[JBIDE-9889] avoid exception if no project was imported
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-17 09:38:55 UTC (rev 35709)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-17 09:42:02 UTC (rev 35710)
@@ -153,10 +153,8 @@
importedProjects = new GeneralProjectImportOperation(projectFolder).importToWorkspace(monitor);
}
- File gitFolder = new File(projectFolder, Constants.DOT_GIT);
- connectToGitRepo(importedProjects, gitFolder, monitor);
-
- createServerAdapterIfRequired(importedProjects);
+ connectToGitRepo(importedProjects, projectFolder, monitor);
+ createServerAdapterIfRequired(importedProjects, monitor);
return Status.OK_STATUS;
} catch (Exception e) {
IStatus status = new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
@@ -168,8 +166,9 @@
}.schedule();
}
- private void connectToGitRepo(List<IProject> projects, File gitFolder, IProgressMonitor monitor)
+ private void connectToGitRepo(List<IProject> projects, File projectFolder, IProgressMonitor monitor)
throws CoreException {
+ File gitFolder = new File(projectFolder, Constants.DOT_GIT);
for (IProject project : projects) {
if (project != null) {
connectToGitRepo(project, gitFolder, monitor);
@@ -227,12 +226,12 @@
Activator.getDefault();
}
- private void createServerAdapterIfRequired(List<IProject> importedProjects) {
+ private void createServerAdapterIfRequired(List<IProject> importedProjects, IProgressMonitor monitor) {
Boolean b = (Boolean)getProperty(AdapterWizardPageModel.CREATE_SERVER);
if( b != null && b.booleanValue() ) {
try {
IServer server = createServerAdapter();
- addModules(getModules(importedProjects), server);
+ addModules(getModules(importedProjects), server, monitor);
} catch(CoreException ce) {
OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
} catch( OpenshiftException ose) {
@@ -255,7 +254,7 @@
return server;
}
- private void addModules(List<IModule> modules, IServer server) throws CoreException {
+ private void addModules(List<IModule> modules, IServer server, IProgressMonitor monitor) throws CoreException {
if (modules == null
|| modules.size() == 0) {
return;
@@ -263,7 +262,7 @@
IServerWorkingCopy wc = server.createWorkingCopy();
IModule[] add = modules.toArray(new IModule[modules.size()]);
wc.modifyModules(add, new IModule[0], new NullProgressMonitor());
- server = wc.save(true, new NullProgressMonitor());
+ server = wc.save(true, monitor);
}
private List<IModule> getModules(List<IProject> importedProjects) {
13 years, 3 months
JBoss Tools SVN: r35709 - in trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test: suite and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: psrna
Date: 2011-10-17 05:38:55 -0400 (Mon, 17 Oct 2011)
New Revision: 35709
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/AssociateRuntimeTest.java
Modified:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELAllTest.java
Log:
https://issues.jboss.org/browse/JBQA-5311
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/AssociateRuntimeTest.java
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/AssociateRuntimeTest.java (rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/AssociateRuntimeTest.java 2011-10-17 09:38:55 UTC (rev 35709)
@@ -0,0 +1,57 @@
+package org.jboss.tools.bpel.ui.bot.test;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.bpel.ui.bot.test.suite.BPELTest;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+
+@Require(server = @Server(type = ServerType.SOA, state = ServerState.Present, version = "5.2"), perspective="BPEL")
+public class AssociateRuntimeTest extends BPELTest {
+
+ @Test
+ public void associateRuntimeTest(){
+ createNewProject("testproject");
+
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.show();
+ view.setFocus();
+
+ SWTBotTreeItem item = SWTEclipseExt.selectTreeLocation(view.bot(), "testproject");
+
+ ContextMenuHelper.prepareTreeItemForContextMenu(view.bot().tree(), item);
+ ContextMenuHelper.clickContextMenu(view.bot().tree(), "Properties");
+
+ SWTBotShell shell = bot.shell("Properties for testproject");
+ shell.activate();
+
+ SWTEclipseExt.selectTreeLocation(shell.bot(), "Targeted Runtimes");
+
+ String serverName = AssociateRuntimeTest.configuredState.getServer().name;
+ assertTrue(shell.bot().table().containsItem(serverName));
+
+ SWTBotTableItem cell = shell.bot().table().getTableItem(serverName);
+ cell.select();
+ cell.toggleCheck();
+
+ assertTrue(cell.isChecked());
+
+ shell.bot().button(IDELabel.Button.APPLY).click();
+ shell.bot().button(IDELabel.Button.OK).click();
+
+ }
+
+
+
+}
Modified: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELAllTest.java
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELAllTest.java 2011-10-17 09:31:40 UTC (rev 35708)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELAllTest.java 2011-10-17 09:38:55 UTC (rev 35709)
@@ -4,6 +4,7 @@
import org.jboss.tools.bpel.ui.bot.test.ActivityModelingTest;
import org.jboss.tools.bpel.ui.bot.test.AssignActivityTest;
+import org.jboss.tools.bpel.ui.bot.test.AssociateRuntimeTest;
import org.jboss.tools.bpel.ui.bot.test.ToolingCompatibilityTest;
import org.jboss.tools.bpel.ui.bot.test.FaultModelingTest;
import org.jboss.tools.bpel.ui.bot.test.OdeDeployTest;
@@ -17,8 +18,15 @@
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
-(a)SuiteClasses({OdeDeployTest.class, WizardTest.class, ActivityModelingTest.class, AssignActivityTest.class, SimpleModelingTest.class, FaultModelingTest.class, ToolingCompatibilityTest.class})
-//(a)SuiteClasses({ToolingCompatibilityTest.class})
+(a)SuiteClasses({OdeDeployTest.class,
+ WizardTest.class,
+ ActivityModelingTest.class,
+ AssignActivityTest.class,
+ SimpleModelingTest.class,
+ FaultModelingTest.class,
+ ToolingCompatibilityTest.class,
+ AssociateRuntimeTest.class})
+
@RunWith(RequirementAwareSuite.class)
public class BPELAllTest extends TestSuite {
13 years, 3 months
JBoss Tools SVN: r35708 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-17 05:31:40 -0400 (Mon, 17 Oct 2011)
New Revision: 35708
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
Log:
[JBIDE-9889] avoid exception if no project was imported
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-17 09:29:07 UTC (rev 35707)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-17 09:31:40 UTC (rev 35708)
@@ -232,7 +232,7 @@
if( b != null && b.booleanValue() ) {
try {
IServer server = createServerAdapter();
- addModules(importedProjects, server);
+ addModules(getModules(importedProjects), server);
} catch(CoreException ce) {
OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
} catch( OpenshiftException ose) {
@@ -255,19 +255,18 @@
return server;
}
- private void addModules(List<IProject> importedProjects, IServer server) throws CoreException {
- ArrayList<IModule> toAdd = getModules(importedProjects);
- if (toAdd == null
- || toAdd.size() == 0) {
+ private void addModules(List<IModule> modules, IServer server) throws CoreException {
+ if (modules == null
+ || modules.size() == 0) {
return;
}
IServerWorkingCopy wc = server.createWorkingCopy();
- IModule[] add = toAdd.toArray(new IModule[toAdd.size()]);
+ IModule[] add = modules.toArray(new IModule[modules.size()]);
wc.modifyModules(add, new IModule[0], new NullProgressMonitor());
server = wc.save(true, new NullProgressMonitor());
}
- private ArrayList<IModule> getModules(List<IProject> importedProjects) {
+ private List<IModule> getModules(List<IProject> importedProjects) {
Iterator<IProject> i = importedProjects.iterator();
ArrayList<IModule> toAdd = new ArrayList<IModule>();
while(i.hasNext()) {
13 years, 3 months
JBoss Tools SVN: r35707 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-17 05:29:07 -0400 (Mon, 17 Oct 2011)
New Revision: 35707
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
Log:
[JBIDE-9889] avoid exception if no project was imported
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-17 09:27:27 UTC (rev 35706)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-17 09:29:07 UTC (rev 35707)
@@ -230,15 +230,8 @@
private void createServerAdapterIfRequired(List<IProject> importedProjects) {
Boolean b = (Boolean)getProperty(AdapterWizardPageModel.CREATE_SERVER);
if( b != null && b.booleanValue() ) {
- IServerType type = (IServerType)getProperty(AdapterWizardPageModel.SERVER_TYPE);
- IRuntime rt = (IRuntime)getProperty(AdapterWizardPageModel.RUNTIME_DELEGATE);
- String mode = (String)getProperty(AdapterWizardPageModel.MODE);
-
try {
- IServer server = ExpressServerUtils.createServer(rt, type, "Openshift Server1");
- ExpressServerUtils.fillServerWithOpenshiftDetails(server, getApplication().getApplicationUrl(),
- getUser().getRhlogin(), getUser().getPassword(),
- getUser().getDomain().getRhcDomain(), getApplication().getName(), mode);
+ IServer server = createServerAdapter();
addModules(importedProjects, server);
} catch(CoreException ce) {
OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
@@ -249,6 +242,19 @@
}
}
+ private IServer createServerAdapter() throws CoreException,
+ OpenshiftException {
+ IServerType type = (IServerType)getProperty(AdapterWizardPageModel.SERVER_TYPE);
+ IRuntime rt = (IRuntime)getProperty(AdapterWizardPageModel.RUNTIME_DELEGATE);
+ String mode = (String)getProperty(AdapterWizardPageModel.MODE);
+
+ IServer server = ExpressServerUtils.createServer(rt, type, "Openshift Server1");
+ ExpressServerUtils.fillServerWithOpenshiftDetails(server, getApplication().getApplicationUrl(),
+ getUser().getRhlogin(), getUser().getPassword(),
+ getUser().getDomain().getRhcDomain(), getApplication().getName(), mode);
+ return server;
+ }
+
private void addModules(List<IProject> importedProjects, IServer server) throws CoreException {
ArrayList<IModule> toAdd = getModules(importedProjects);
if (toAdd == null
13 years, 3 months
JBoss Tools SVN: r35706 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-17 05:27:27 -0400 (Mon, 17 Oct 2011)
New Revision: 35706
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
Log:
[JBIDE-9889] avoid exception if no project was imported
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-17 09:11:24 UTC (rev 35705)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-17 09:27:27 UTC (rev 35706)
@@ -18,8 +18,6 @@
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-17 09:11:24 UTC (rev 35705)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-17 09:27:27 UTC (rev 35706)
@@ -171,7 +171,9 @@
private void connectToGitRepo(List<IProject> projects, File gitFolder, IProgressMonitor monitor)
throws CoreException {
for (IProject project : projects) {
- connectToGitRepo(project, gitFolder, monitor);
+ if (project != null) {
+ connectToGitRepo(project, gitFolder, monitor);
+ }
}
}
@@ -237,21 +239,7 @@
ExpressServerUtils.fillServerWithOpenshiftDetails(server, getApplication().getApplicationUrl(),
getUser().getRhlogin(), getUser().getPassword(),
getUser().getDomain().getRhcDomain(), getApplication().getName(), mode);
-
- // Now add the projects
- Iterator<IProject> i = importedProjects.iterator();
- ArrayList<IModule> toAdd = new ArrayList<IModule>();
- while(i.hasNext()) {
- IProject p = i.next();
- IModule[] m = ServerUtil.getModules(p);
- if( m != null && m.length > 0 ) {
- toAdd.addAll(Arrays.asList(m));
- }
- }
- IServerWorkingCopy wc = server.createWorkingCopy();
- IModule[] add = toAdd.toArray(new IModule[toAdd.size()]);
- wc.modifyModules(add, new IModule[0], new NullProgressMonitor());
- server = wc.save(true, new NullProgressMonitor());
+ addModules(importedProjects, server);
} catch(CoreException ce) {
OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
} catch( OpenshiftException ose) {
@@ -260,4 +248,29 @@
}
}
}
+
+ private void addModules(List<IProject> importedProjects, IServer server) throws CoreException {
+ ArrayList<IModule> toAdd = getModules(importedProjects);
+ if (toAdd == null
+ || toAdd.size() == 0) {
+ return;
+ }
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ IModule[] add = toAdd.toArray(new IModule[toAdd.size()]);
+ wc.modifyModules(add, new IModule[0], new NullProgressMonitor());
+ server = wc.save(true, new NullProgressMonitor());
+ }
+
+ private ArrayList<IModule> getModules(List<IProject> importedProjects) {
+ Iterator<IProject> i = importedProjects.iterator();
+ ArrayList<IModule> toAdd = new ArrayList<IModule>();
+ while(i.hasNext()) {
+ IProject p = i.next();
+ IModule[] m = ServerUtil.getModules(p);
+ if( m != null && m.length > 0 ) {
+ toAdd.addAll(Arrays.asList(m));
+ }
+ }
+ return toAdd;
+ }
}
13 years, 3 months
JBoss Tools SVN: r35705 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/projectimport.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-17 05:11:24 -0400 (Mon, 17 Oct 2011)
New Revision: 35705
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/projectimport/MavenProjectImportOperation.java
Log:
[JBIDE-9889] "null"-maven project (maven import returns null-project) shall not be added to the import results
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/projectimport/MavenProjectImportOperation.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/projectimport/MavenProjectImportOperation.java 2011-10-17 08:54:48 UTC (rev 35704)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/projectimport/MavenProjectImportOperation.java 2011-10-17 09:11:24 UTC (rev 35705)
@@ -43,8 +43,7 @@
IProjectConfigurationManager configurationManager = mavenPlugin.getProjectConfigurationManager();
MavenModelManager modelManager = mavenPlugin.getMavenModelManager();
List<MavenProjectInfo> projectInfos = getMavenProjects(getProjectDirectory(), modelManager, monitor);
- ProjectImportConfiguration projectImportConfiguration =
- new ProjectImportConfiguration();
+ ProjectImportConfiguration projectImportConfiguration = new ProjectImportConfiguration();
List<IMavenProjectImportResult> importResults =
configurationManager.importProjects(projectInfos, projectImportConfiguration, monitor);
return toProjects(importResults);
@@ -53,7 +52,10 @@
private List<IProject> toProjects(List<IMavenProjectImportResult> importResults) {
List<IProject> projects = new ArrayList<IProject>();
for (IMavenProjectImportResult importResult : importResults) {
- projects.add(importResult.getProject());
+ IProject project = importResult.getProject();
+ if (project != null) {
+ projects.add(importResult.getProject());
+ }
}
return projects;
}
13 years, 3 months
JBoss Tools SVN: r35704 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-17 04:54:48 -0400 (Mon, 17 Oct 2011)
New Revision: 35704
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
Log:
[JBIDE-9793] updating "ssh key warning" after new key was added/removed from SSH2 prefs
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-17 08:53:16 UTC (rev 35703)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-17 08:54:48 UTC (rev 35704)
@@ -123,7 +123,7 @@
public void widgetSelected(SelectionEvent e) {
InputDialog dialog = new PassphraseDialog(getShell());
- if (Dialog.OK == dialog.open()) {
+ if (Dialog.OK == dialog.open()) {
try {
String passPhrase = dialog.getValue();
model.createSShKeyPair(passPhrase);
@@ -175,7 +175,8 @@
@Override
public void widgetSelected(SelectionEvent e) {
SshPrivateKeysPreferences.openPreferencesPage(getShell());
- // refresh warning about key (since user may have changed SSH2 prefs)
+ // refresh warning about key
+ // (since user may have changed SSH2 prefs)
getDatabindingContext().updateTargets();
}
};
@@ -183,9 +184,7 @@
@Override
protected void setupWizardPageSupport(DataBindingContext dbc) {
- ParametrizableWizardPageSupport.create(
- IStatus.ERROR, this,
- dbc);
+ ParametrizableWizardPageSupport.create(IStatus.ERROR, this, dbc);
}
private class SSHKeyValidator implements IValidator {
13 years, 3 months
JBoss Tools SVN: r35703 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-17 04:53:16 -0400 (Mon, 17 Oct 2011)
New Revision: 35703
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
Log:
[JBIDE-9793] updating "ssh key warning" after new key was added/removed from SSH2 prefs
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-17 08:52:30 UTC (rev 35702)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-17 08:53:16 UTC (rev 35703)
@@ -175,6 +175,7 @@
@Override
public void widgetSelected(SelectionEvent e) {
SshPrivateKeysPreferences.openPreferencesPage(getShell());
+ // refresh warning about key (since user may have changed SSH2 prefs)
getDatabindingContext().updateTargets();
}
};
13 years, 3 months