JBoss Tools SVN: r35802 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-10-19 08:39:25 -0400 (Wed, 19 Oct 2011)
New Revision: 35802
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareViews.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StartServer.java
Log:
botext: moved disabling autofocusing console to StartServer req
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareViews.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareViews.java 2011-10-19 12:31:12 UTC (rev 35801)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/PrepareViews.java 2011-10-19 12:39:25 UTC (rev 35802)
@@ -30,15 +30,6 @@
public String getName() {
return IDELabel.View.WELCOME;
}});
-
- // force console view not to steal focus when something happens
- try {
- SWTBotView consoleView = SWTTestExt.console.show();
- consoleView.toolbarToggleButton(IDELabel.ConsoleView.BUTTON_SHOW_WHEN_STDOUT_CHANGES_TOOLTIP).deselect();
- consoleView.toolbarToggleButton(IDELabel.ConsoleView.BUTTON_SHOW_WHEN_STDERR_CHANGES_TOOLTIP).deselect();
- } catch (Exception ex) {
- // do nothing since buttons must not always be available
- }
SWTTestExt.configuredState.setViewsPrepared(true);
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StartServer.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StartServer.java 2011-10-19 12:31:12 UTC (rev 35801)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StartServer.java 2011-10-19 12:39:25 UTC (rev 35802)
@@ -1,30 +1,47 @@
package org.jboss.tools.ui.bot.ext.config.requirement;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+
/**
* Starts server (as dependent requirement has {@link AddServer}
+ *
* @author lzoubek
- *
+ *
*/
public class StartServer extends RequirementBase {
public StartServer() {
- // define dependency
+ // define dependency
getDependsOn().add(createAddServer());
}
-
+
@Override
public boolean checkFulfilled() {
return SWTTestExt.configuredState.getServer().isRunning;
}
@Override
- public void handle(){
- if (!checkFulfilled()){
- String server = SWTTestExt.configuredState.getServer().name;
- String user = SWTTestExt.configuredState.getRemoteSystem().remoteUser;
- SWTTestExt.servers.startServer(server,user,null);
- SWTTestExt.configuredState.getServer().isRunning = true;
- }
+ public void handle() {
+ if (!checkFulfilled()) {
+ String server = SWTTestExt.configuredState.getServer().name;
+ String user = SWTTestExt.configuredState.getRemoteSystem().remoteUser;
+ SWTTestExt.servers.startServer(server, user, null);
+ SWTTestExt.configuredState.getServer().isRunning = true;
+ // force console view not to steal focus when something happens on server
+ try {
+ SWTBotView consoleView = SWTTestExt.console.show();
+ consoleView
+ .toolbarToggleButton(
+ IDELabel.ConsoleView.BUTTON_SHOW_WHEN_STDOUT_CHANGES_TOOLTIP)
+ .deselect();
+ consoleView
+ .toolbarToggleButton(
+ IDELabel.ConsoleView.BUTTON_SHOW_WHEN_STDERR_CHANGES_TOOLTIP)
+ .deselect();
+ } catch (Exception ex) {
+ }
+ }
}
}
14 years, 5 months
JBoss Tools SVN: r35801 - trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-10-19 08:31:12 -0400 (Wed, 19 Oct 2011)
New Revision: 35801
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
Log:
esb bot tests: fix example selection based on current AS/EAP
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2011-10-19 11:56:19 UTC (rev 35800)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2011-10-19 12:31:12 UTC (rev 35801)
@@ -80,6 +80,7 @@
SWTBotTreeItem jmsCall = SWTEclipseExt.selectTreeLocation(packageExplorer.show().bot(),clientClass);
eclipse.runTreeItemAsJavaApplication(jmsCall);
bot.sleep(Timing.time5S());
+ util.waitForNonIgnoredJobs();
console.switchConsole(configuredState.getServer().name);
String text2 = console.getConsoleText(TIME_5S, TIME_20S, false);
if (text.length()>=text2.length()) {
@@ -182,12 +183,9 @@
if (!configuredState.getServer().isConfigured) {
throw new NullPointerException("No server was configured for test, but it is required");
}
- if (configuredState.getServer().version.equals("5.0")) {
+ if (configuredState.getServer().version.startsWith("5.")) {
ret+="5.0";
}
- else if (configuredState.getServer().version.equals("5.1")) {
- ret+="5.0";
- }
else if (configuredState.getServer().version.equals("4.3")) {
ret+="4.3";
}
14 years, 5 months
JBoss Tools SVN: r35800 - 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-19 07:56:19 -0400 (Wed, 19 Oct 2011)
New Revision: 35800
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
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/NewApplicationDialog.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPageModel.java
Log:
[JBIDE-9939] selecting freshly created app now
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-19 11:35:48 UTC (rev 35799)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-19 11:56:19 UTC (rev 35800)
@@ -129,7 +129,6 @@
this.viewer = createTable(tableContainer);
GridDataFactory.fillDefaults().span(3, 1).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(tableContainer);
viewer.addDoubleClickListener(onApplicationDoubleClick());
-
Binding selectedApplicationBinding = dbc.bindValue(
ViewerProperties.singleSelection().observe(viewer),
BeanProperties.value(ApplicationWizardPageModel.PROPERTY_SELECTED_APPLICATION).observe(model),
@@ -318,9 +317,10 @@
@Override
public void widgetSelected(SelectionEvent e) {
Shell shell = getContainer().getShell();
- if (WizardUtils.openWizardDialog(
- new NewApplicationDialog(model.getUser()), shell) == Dialog.OK) {
+ NewApplicationDialog applicationDialog = new NewApplicationDialog(model.getUser());
+ if (WizardUtils.openWizardDialog(applicationDialog, shell) == Dialog.OK) {
viewer.refresh();
+ model.setSelectedApplication(applicationDialog.getApplication());
}
}
};
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-19 11:35:48 UTC (rev 35799)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-19 11:56:19 UTC (rev 35800)
@@ -41,7 +41,6 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerUtil;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationDialog.java 2011-10-19 11:35:48 UTC (rev 35799)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationDialog.java 2011-10-19 11:56:19 UTC (rev 35800)
@@ -11,6 +11,7 @@
package org.jboss.tools.openshift.express.internal.ui.wizard;
import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.TimeUnit;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -19,6 +20,7 @@
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.IUser;
import org.jboss.tools.openshift.express.client.OpenShiftException;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
@@ -54,14 +56,18 @@
return Status.OK_STATUS;
}
}, getContainer());
+ return queue.poll(10, TimeUnit.SECONDS);
} catch (Exception e) {
- // ignore
+ return false;
}
- return queue.poll();
}
@Override
public void addPages() {
addPage(new NewApplicationWizardPage(newApplicationModel, this));
}
+
+ public IApplication getApplication() {
+ return newApplicationModel.getApplication();
+ }
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPageModel.java 2011-10-19 11:35:48 UTC (rev 35799)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPageModel.java 2011-10-19 11:56:19 UTC (rev 35800)
@@ -15,6 +15,7 @@
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.common.ui.preferencevalue.StringPreferenceValue;
+import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.ICartridge;
import org.jboss.tools.openshift.express.client.IUser;
import org.jboss.tools.openshift.express.client.OpenShiftException;
@@ -25,12 +26,14 @@
*/
public class NewApplicationWizardPageModel extends ObservableUIPojo {
+ public static final String PROPERTY_APPLICATION = "application";
public static final String PROPERTY_NAME = "name";
public static final String PROPERTY_CARTRIDGES = "cartridges";
public static final String PROPERTY_SELECTED_CARTRIDGE = "selectedCartridge";
private IUser user;
private String name;
+ private IApplication application;
private List<ICartridge> cartridges = new ArrayList<ICartridge>();
private ICartridge selectedCartridge;
@@ -104,9 +107,18 @@
}
public void createApplication() throws OpenShiftException {
- user.createApplication(name, selectedCartridge);
+ IApplication application = user.createApplication(name, selectedCartridge);
+ setApplication(application);
}
+ public void setApplication(IApplication application) {
+ firePropertyChange(PROPERTY_APPLICATION, this.application, this.application = application);
+ }
+
+ public IApplication getApplication() {
+ return application;
+ }
+
public boolean hasApplication(String name) {
try {
return user.getApplicationByName(name) != null;
14 years, 5 months
JBoss Tools SVN: r35799 - trunk/jst/plugins/org.jboss.tools.jst.web.ui.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-10-19 07:35:48 -0400 (Wed, 19 Oct 2011)
New Revision: 35799
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-9892 - Fixed: force the plug-in to be loaded on content assist invocation.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2011-10-19 10:16:27 UTC (rev 35798)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2011-10-19 11:35:48 UTC (rev 35799)
@@ -695,7 +695,7 @@
<extension
point="org.eclipse.wst.sse.ui.completionProposal">
<proposalComputer
- activate="false"
+ activate="true"
categoryId="org.eclipse.wst.html.ui.proposalCategory.htmlTemplates"
class="org.jboss.tools.jst.web.ui.editor.pref.template.contentassist.XHTMLTemplateContentAssistComputer"
id="org.jboss.tools.jst.web.ui.editor.template">
14 years, 5 months
JBoss Tools SVN: r35798 - 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: rob.stryker(a)jboss.com
Date: 2011-10-19 06:16:27 -0400 (Wed, 19 Oct 2011)
New Revision: 35798
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
Log:
JBIDE-9793 - wizard error - loading of git uri done in ui thread.
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-19 10:14:54 UTC (rev 35797)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-19 10:16:27 UTC (rev 35798)
@@ -20,6 +20,10 @@
import org.eclipse.core.databinding.beans.BeanProperties;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
@@ -38,6 +42,7 @@
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
@@ -58,12 +63,14 @@
import org.jboss.tools.common.ui.databinding.DataBindingUtils;
import org.jboss.tools.common.ui.databinding.InvertingBooleanConverter;
import org.jboss.tools.common.ui.ssh.SshPrivateKeysPreferences;
+import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.ICartridge;
import org.jboss.tools.openshift.express.client.OpenShiftException;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
public class AdapterWizardPage extends AbstractOpenShiftWizardPage implements IWizardPage, PropertyChangeListener {
-
+ private Text gitUriValueText;
+
private AdapterWizardPageModel model;
private Combo suitableRuntimes;
private IServerType serverTypeToCreate;
@@ -109,7 +116,7 @@
gitUriLabel.setText("Cloning From");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(gitUriLabel);
- Text gitUriValueText = new Text(cloneGroup, SWT.BORDER);
+ gitUriValueText = new Text(cloneGroup, SWT.BORDER);
gitUriValueText.setEditable(false);
// gitUriValueText.setBackground(cloneGroup.getBackground());
GridDataFactory.fillDefaults().span(3, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(gitUriValueText);
@@ -353,12 +360,9 @@
}
protected void onPageActivated(DataBindingContext dbc) {
+ gitUriValueText.setEnabled(false);
+ gitUriValueText.setText("Loading...");
model.resetRepositoryPath();
- try {
- model.updateGitUri();
- } catch (OpenShiftException e) {
- OpenShiftUIActivator.log(OpenShiftUIActivator.createErrorStatus(e.getMessage(), e));
- }
serverTypeToCreate = getServerTypeToCreate();
model.getParentModel().setProperty(AdapterWizardPageModel.SERVER_TYPE, serverTypeToCreate);
@@ -369,15 +373,41 @@
}
IRuntimeType type = getValidRuntimeType();
addRuntimeLink.setEnabled(type != null);
-
- try {
- domainLabel.setText("Host: " + model.getParentModel().getApplication().getApplicationUrl());
- modeLabel.setText("Mode: Source");
- model.getParentModel().setProperty(AdapterWizardPageModel.MODE, AdapterWizardPageModel.MODE_SOURCE);
- } catch (OpenShiftException ose) {
- OpenShiftUIActivator.log(OpenShiftUIActivator.createErrorStatus(ose.getMessage(), ose));
- }
+ modeLabel.setText("Mode: Source");
+ model.getParentModel().setProperty(AdapterWizardPageModel.MODE, AdapterWizardPageModel.MODE_SOURCE);
+
+ setPageComplete(false);
+ getWizard().getContainer().updateButtons();
+ onPageActivatedBackground(dbc);
}
+
+ protected void onPageActivatedBackground2(DataBindingContext dbc) throws OpenShiftException {
+ model.updateGitUri();
+ gitUriValueText.setEnabled(true);
+ domainLabel.setText("Host: " + model.getParentModel().getApplication().getApplicationUrl());
+ setPageComplete(true);
+ getWizard().getContainer().updateButtons();
+ }
+
+ protected void onPageActivatedBackground(final DataBindingContext dbc) {
+ new Job("Loading remote OpenShift application") {
+ public IStatus run(IProgressMonitor monitor) {
+ final IApplication application = model.getParentModel().getApplication();
+ if (application != null) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ onPageActivatedBackground2(dbc);
+ } catch( OpenShiftException e) {
+ OpenShiftUIActivator.log(OpenShiftUIActivator.createErrorStatus(e.getMessage(), e));
+ }
+ }
+ });
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
protected void refreshValidRuntimes() {
IRuntimeType type = getValidRuntimeType();
14 years, 5 months
JBoss Tools SVN: r35797 - workspace/snjeza/jbossas7-examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-19 06:14:54 -0400 (Wed, 19 Oct 2011)
New Revision: 35797
Modified:
workspace/snjeza/jbossas7-examples/kitchensink.zip
Log:
JBIDE-9368 Dashboard(s) for easy news aggregation, twitter and easy additional/3rd party plugin installation and project template/creation
Modified: workspace/snjeza/jbossas7-examples/kitchensink.zip
===================================================================
(Binary files differ)
14 years, 5 months
JBoss Tools SVN: r35796 - 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-19 06:04:06 -0400 (Wed, 19 Oct 2011)
New Revision: 35796
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizard.java
Log:
[JBIDE-9923] not closing the wizard if cloning failed.
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizard.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizard.java 2011-10-19 10:03:24 UTC (rev 35795)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizard.java 2011-10-19 10:04:06 UTC (rev 35796)
@@ -13,6 +13,8 @@
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.net.URISyntaxException;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.TimeUnit;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -48,46 +50,45 @@
@Override
public boolean performFinish() {
try {
- WizardUtils.runInWizard(
- new Job("Cloning local git repo...") {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
- String errorMessage = null;
- try {
- File repositoryFile = model.cloneRepository(monitor);
- model.importProject(repositoryFile, monitor);
- } catch (OpenShiftException e) {
- errorMessage = "An exception occurred while creating local git repository.";
- status = OpenShiftUIActivator.createErrorStatus(e.getMessage(), e);
- } catch (URISyntaxException e) {
- errorMessage = "The url of the remote git repository is not valid";
- status = OpenShiftUIActivator.createErrorStatus(e.getMessage(), e);
- } catch (InvocationTargetException e) {
- if (isTransportException(e)) {
- errorMessage = "Could not clone the repository. Authentication failed.\n"
- + " Please make sure that you added your private key to the ssh preferences.";
- TransportException te = getTransportException(e);
- status = OpenShiftUIActivator.createErrorStatus(te.getMessage(), te);
- } else {
- errorMessage = "An exception occurred while creating local git repository.";
- status = OpenShiftUIActivator.createErrorStatus(e.getMessage(), e);
- }
- } catch (Exception e) {
- errorMessage = "An exception occurred while creating local git repository.";
- status = OpenShiftUIActivator.createErrorStatus(e.getMessage(), e);
- }
-
- if (!status.isOK()) {
- OpenShiftUIActivator.log(status);
- openErrorDialog(errorMessage, status);
- }
- return status;
+ final ArrayBlockingQueue<IStatus> queue = new ArrayBlockingQueue<IStatus>(1);
+ WizardUtils.runInWizard(new Job("Cloning local git repo...") {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IStatus status = Status.OK_STATUS;
+ try {
+ File repositoryFile = model.cloneRepository(monitor);
+ model.importProject(repositoryFile, monitor);
+ } catch (OpenShiftException e) {
+ status = OpenShiftUIActivator.createErrorStatus(
+ "An exception occurred while creating local git repository.", e);
+ } catch (URISyntaxException e) {
+ status = OpenShiftUIActivator.createErrorStatus(
+ "The url of the remote git repository is not valid", e);
+ } catch (InvocationTargetException e) {
+ if (isTransportException(e)) {
+ TransportException te = getTransportException(e);
+ status = OpenShiftUIActivator.createErrorStatus(
+ "Could not clone the repository. Authentication failed.\n"
+ + " Please make sure that you added your private key to the ssh preferences.", te);
+ } else {
+ status = OpenShiftUIActivator.createErrorStatus(
+ "An exception occurred while creating local git repository.", e);
}
+ } catch (Exception e) {
+ status = OpenShiftUIActivator.createErrorStatus(
+ "An exception occurred while creating local git repository.", e);
+ }
- }, getContainer());
- return true;
+ if (!status.isOK()) {
+ OpenShiftUIActivator.log(status);
+ }
+ queue.offer(status);
+ return status;
+ }
+ }, getContainer());
+ IStatus status = queue.poll(10, TimeUnit.SECONDS);
+ return status != null
+ && status.isOK();
} catch (Exception e) {
ErrorDialog.openError(getShell(), "Error", "Could not create local git repository.",
new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
@@ -115,15 +116,4 @@
}
return null;
}
-
- private void openErrorDialog(final String errorMessage, final IStatus status) {
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- ErrorDialog.openError(getShell(), "Error cloning the git repo", errorMessage, status);
- }
- });
- }
-
}
14 years, 5 months
JBoss Tools SVN: r35795 - 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-19 06:03:24 -0400 (Wed, 19 Oct 2011)
New Revision: 35795
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
Log:
cleanup
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-10-19 09:18:50 UTC (rev 35794)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-10-19 10:03:24 UTC (rev 35795)
@@ -82,10 +82,6 @@
DataBindingUtils.bindMandatoryTextField(
passwordText, "Password", CredentialsWizardPageModel.PROPERTY_PASSWORD, model, dbc);
- // Label credentialsValidatyLabel = new Label(container, SWT.None);
- // GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).hint(64,
- // 64).applyTo(credentialsValidatyLabel);
-
Label spacerLabel = new Label(container, SWT.None);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(spacerLabel);
@@ -149,20 +145,6 @@
dbc);
}
- private static class CredentialsStatusValidator implements IValidator {
- public IStatus validate(Object value) {
- if (value instanceof IStatus) {
- int currentSeverity = ((IStatus) value).getSeverity();
- if (currentSeverity < IStatus.ERROR) {
- return ValidationStatus.ok();
- }
- } else if (value == null) {
- return ValidationStatus.info("You have to validate your credentials");
- }
- return ValidationStatus.error("The given credentials are not valid");
- }
- }
-
@Override
protected void onPageWillGetDeactivated(PageChangingEvent event, DataBindingContext dbc) {
if (!model.areCredentialsValidated()) {
@@ -181,9 +163,22 @@
queue.poll(10, TimeUnit.SECONDS);
event.doit = model.areCredentialsValid();
} catch (Exception ex) {
- // ignore
+ event.doit = false;
}
}
+ }
+ private static class CredentialsStatusValidator implements IValidator {
+ public IStatus validate(Object value) {
+ if (value instanceof IStatus) {
+ int currentSeverity = ((IStatus) value).getSeverity();
+ if (currentSeverity < IStatus.ERROR) {
+ return ValidationStatus.ok();
+ }
+ } else if (value == null) {
+ return ValidationStatus.info("You have to validate your credentials");
+ }
+ return ValidationStatus.error("The given credentials are not valid");
+ }
}
}
14 years, 5 months
JBoss Tools SVN: r35794 - 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-19 05:18:50 -0400 (Wed, 19 Oct 2011)
New Revision: 35794
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
Log:
[JBIDE-9928] implemented validating credentials on hitting "Next >"
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java 2011-10-19 08:08:26 UTC (rev 35793)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftWizardPage.java 2011-10-19 09:18:50 UTC (rev 35794)
@@ -13,7 +13,9 @@
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.IPageChangedListener;
+import org.eclipse.jface.dialogs.IPageChangingListener;
import org.eclipse.jface.dialogs.PageChangedEvent;
+import org.eclipse.jface.dialogs.PageChangingEvent;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
@@ -73,6 +75,17 @@
}
}
});
+ ((WizardDialog) getContainer()).addPageChangingListener(new IPageChangingListener() {
+
+ @Override
+ public void handlePageChanging(PageChangingEvent event) {
+ if (event.getTargetPage() == AbstractOpenShiftWizardPage.this) {
+ onPageWillGetActivated(event, dbc);
+ } else {
+ onPageWillGetDeactivated(event, dbc);
+ }
+ }
+ });
}
}
@@ -86,6 +99,11 @@
protected void onPageDeactivated(DataBindingContext dbc) {
}
+ protected void onPageWillGetActivated(PageChangingEvent event, DataBindingContext dbc) {
+ }
+
+ protected void onPageWillGetDeactivated(PageChangingEvent event, DataBindingContext dbc) {
+ }
protected abstract void doCreateControls(Composite parent, DataBindingContext dbc);
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-10-19 08:08:26 UTC (rev 35793)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-10-19 09:18:50 UTC (rev 35794)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeanProperties;
@@ -20,6 +23,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.PageChangingEvent;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
@@ -34,6 +38,7 @@
import org.jboss.tools.common.ui.BrowserUtil;
import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.common.ui.databinding.DataBindingUtils;
+import org.jboss.tools.common.ui.databinding.ParametrizableWizardPageSupport;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
/**
@@ -61,25 +66,6 @@
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(3, 1).hint(SWT.DEFAULT, 30).applyTo(signupLink);
signupLink.addSelectionListener(onSignupLinkClicked());
- // Label serverUrlLabel = new Label(container, SWT.NONE);
- // serverUrlLabel.setText("Server URL");
- // GridDataFactory.fillDefaults().align(SWT.LEFT,
- // SWT.CENTER).applyTo(serverUrlLabel);
- // Text serverUrlText = new Text(container, SWT.BORDER);
- // GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true,
- // false).span(2, 1).applyTo(serverUrlText);
- // dbc.bindValue(
- // WidgetProperties.text(SWT.Modify).observe(serverUrlText),
- // BeanProperties.value(
- // ImportProjectWizardModel.class,
- // ImportProjectWizardModel.PROPERTY_SERVER_URL).observe(model),
- // new UpdateValueStrategy()
- // .setAfterGetValidator(new
- // MandatoryStringValidator("You have to provide a value for the server url."))
- // .setBeforeSetValidator(new SimpleUrlStringValidator())
- // .setConverter(new TrimTrailingSlashConverter()),
- // null);
-
Label rhLoginLabel = new Label(container, SWT.NONE);
rhLoginLabel.setText("&Username");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rhLoginLabel);
@@ -105,10 +91,11 @@
this.validateButton = new Button(container, SWT.NONE);
validateButton.setText("&Validate");
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).indent(0, 10).hint(100, SWT.DEFAULT).applyTo(validateButton);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).indent(0, 10).hint(100, SWT.DEFAULT)
+ .applyTo(validateButton);
DataBindingUtils.bindEnablementToValidationStatus(
validateButton
- , IStatus.INFO
+ , IStatus.INFO
, dbc);
validateButton.addSelectionListener(onValidate(dbc));
dbc.bindValue(
@@ -128,7 +115,7 @@
public void widgetSelected(SelectionEvent e) {
try {
WizardUtils.runInWizard(
- new Job("Testing user credentials") {
+ new Job("Testing user credentials...") {
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -154,7 +141,14 @@
}
};
}
-
+
+ @Override
+ protected void setupWizardPageSupport(DataBindingContext dbc) {
+ ParametrizableWizardPageSupport.create(
+ IStatus.ERROR | IStatus.CANCEL, this,
+ dbc);
+ }
+
private static class CredentialsStatusValidator implements IValidator {
public IStatus validate(Object value) {
if (value instanceof IStatus) {
@@ -169,4 +163,27 @@
}
}
+ @Override
+ protected void onPageWillGetDeactivated(PageChangingEvent event, DataBindingContext dbc) {
+ if (!model.areCredentialsValidated()) {
+ try {
+ final ArrayBlockingQueue<IStatus> queue = new ArrayBlockingQueue<IStatus>(1);
+ WizardUtils.runInWizard(
+ new Job("Testing user credentials...") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IStatus status = model.validateCredentials();
+ queue.offer(status);
+ return Status.OK_STATUS;
+ }
+ }, getContainer(), getDatabindingContext());
+ queue.poll(10, TimeUnit.SECONDS);
+ event.doit = model.areCredentialsValid();
+ } catch (Exception ex) {
+ // ignore
+ }
+ }
+
+ }
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2011-10-19 08:08:26 UTC (rev 35793)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2011-10-19 09:18:50 UTC (rev 35794)
@@ -119,6 +119,12 @@
public IStatus getCredentialsValidity() {
return credentialsValidity;
}
+
+ public boolean areCredentialsValid() {
+ IStatus validationStatus = getCredentialsValidity();
+ return validationStatus != null
+ && validationStatus.isOK();
+ }
public boolean areCredentialsValidated() {
return credentialsValidity != null;
14 years, 5 months
JBoss Tools SVN: r35793 - 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-19 04:08:26 -0400 (Wed, 19 Oct 2011)
New Revision: 35793
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
Log:
JBIDE-9793 - If there are NO changes to be commit, then do not ask to commit / push, and do not commit / push.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-10-19 06:54:34 UTC (rev 35792)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-10-19 08:08:26 UTC (rev 35793)
@@ -22,13 +22,17 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.egit.core.EclipseGitProgressTransformer;
+import org.eclipse.egit.core.IteratorService;
import org.eclipse.egit.core.op.CommitOperation;
import org.eclipse.egit.core.op.PushOperation;
import org.eclipse.egit.core.op.PushOperationSpecification;
import org.eclipse.egit.core.project.RepositoryMapping;
+import org.eclipse.egit.ui.UIText;
import org.eclipse.jgit.errors.NotSupportedException;
import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.IndexDiff;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.StoredConfig;
@@ -445,4 +449,27 @@
}
return status;
}
+
+ public static int countCommitableChanges(IProject project, IProgressMonitor monitor) {
+ try {
+ Repository repo = getRepository(project);
+
+ EclipseGitProgressTransformer jgitMonitor = new EclipseGitProgressTransformer(monitor);
+ IndexDiff indexDiff = new IndexDiff(repo, Constants.HEAD,
+ IteratorService.createInitialIterator(repo));
+ indexDiff.diff(jgitMonitor, 0, 0, NLS.bind(
+ UIText.CommitActionHandler_repository, repo.getDirectory().getPath()));
+ System.out.println(indexDiff.getAdded().size());
+ System.out.println(indexDiff.getChanged().size());
+ System.out.println(indexDiff.getConflicting().size());
+ System.out.println(indexDiff.getMissing().size());
+ System.out.println(indexDiff.getModified().size());
+ System.out.println(indexDiff.getRemoved().size());
+ System.out.println(indexDiff.getUntracked().size());
+
+ return indexDiff.getModified().size();
+ } catch( IOException ioe ) {
+ }
+ return -1;
+ }
}
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-19 06:54:34 UTC (rev 35792)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-10-19 08:08:26 UTC (rev 35793)
@@ -4,7 +4,12 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
@@ -37,16 +42,37 @@
int deltaKind, IModule[] module, IProgressMonitor monitor)
throws CoreException {
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;
+ IProject p = module[module.length-1].getProject();
+ int changed = EGitUtils.countCommitableChanges(p, new NullProgressMonitor() );
+ if( changed != 0 && (kind == IServer.PUBLISH_FULL || state == IServer.PUBLISH_STATE_FULL)) {
+ if( requestApproval(module)) {
+ 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;
}
+ private boolean requestApproval(final IModule[] module) {
+ final boolean[] b = new boolean[1];
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
+ String projName = module[module.length-1].getProject().getName();
+ String msg = "Do you wish to publish \"" + projName + "\" to OpenShift by commiting and pushing it's git repository?";
+ messageBox.setMessage(msg);
+ messageBox.setText("Publish " + projName + "?");
+ int response = messageBox.open();
+ if (response == SWT.YES)
+ b[0] = true;
+ b[1] = false;
+ }
+ });
+ return b[0];
+ }
+
@Override
public IPublishCopyCallbackHandler getCallbackHandler(IPath path,
IServer server) {
14 years, 5 months