Author: rob.stryker(a)jboss.com
Date: 2012-07-25 05:35:31 -0400 (Wed, 25 Jul 2012)
New Revision: 42704
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java
Log:
UI freeze to maintenance JBIDE-10997
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF
===================================================================
---
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF 2012-07-25
09:35:02 UTC (rev 42703)
+++
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF 2012-07-25
09:35:31 UTC (rev 42704)
@@ -5,10 +5,10 @@
Bundle-Version: 2.3.1.qualifier
Bundle-Activator: org.jboss.tools.openshift.egit.core.internal.EGitCoreActivator
Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
- org.eclipse.jgit;bundle-version="1.2.0",
- org.eclipse.egit;bundle-version="1.2.0",
+ org.eclipse.jgit;bundle-version="1.1.0",
+ org.eclipse.egit;bundle-version="1.1.0",
com.jcraft.jsch;bundle-version="0.1.41",
- org.eclipse.egit.core;bundle-version="1.2.0",
+ org.eclipse.egit.core;bundle-version="1.1.0",
org.eclipse.team.core;bundle-version="3.6.0",
org.eclipse.wst.server.core;bundle-version="1.1.302",
org.eclipse.core.resources;bundle-version="3.7.100",
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java
===================================================================
---
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java 2012-07-25
09:35:02 UTC (rev 42703)
+++
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java 2012-07-25
09:35:31 UTC (rev 42704)
@@ -38,6 +38,7 @@
private String username;
private String password;
private IUser delegate;
+ private boolean isDomainLoaded = false;
private boolean rememberPassword;
private boolean connected;
private boolean alreadyPromptedForPassword;
@@ -233,11 +234,17 @@
public IDomain getDefaultDomain() throws OpenShiftException {
if(checkForPassword()) {
- return delegate.getDefaultDomain();
+ IDomain d = delegate.getDefaultDomain();
+ isDomainLoaded = true;
+ return d;
}
return null;
}
-
+
+ public boolean isDomainLoaded() throws OpenShiftException {
+ return isDomainLoaded;
+ }
+
public List<IEmbeddableCartridge> getEmbeddableCartridges()
throws OpenShiftException {
if(checkForPassword()) {
@@ -275,6 +282,7 @@
}
public void refresh() throws OpenShiftException {
+ isDomainLoaded = false;
if(checkForPassword()) {
delegate.refresh();
}
Modified:
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java
===================================================================
---
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java 2012-07-25
09:35:02 UTC (rev 42703)
+++
branches/jbosstools-3.3.x/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java 2012-07-25
09:35:31 UTC (rev 42704)
@@ -10,6 +10,13 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.viewer.property;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.PropertyDescriptor;
@@ -50,8 +57,10 @@
if(!user.isConnected() && !user.canPromptForPassword()) {
return OpenShiftExpressUIMessages.USER_NOT_CONNECTED_LABEL;
}
- if(!user.isConnected() && user.canPromptForPassword()) {
- user.checkForPassword();
+
+ boolean requiresConnect = !user.isConnected() && user.canPromptForPassword();
+ if( requiresConnect || !user.isDomainLoaded()) {
+ loadRemoteDetails();
}
if (id.equals(PROPERTY_USERNAME)) {
@@ -66,6 +75,33 @@
return null;
}
+ private void loadRemoteDetails() throws OpenShiftException {
+ IRunnableWithProgress longRunning = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
+ monitor.beginTask("Checking Remote Details", 200);
+ try {
+ if( !user.isConnected() && user.canPromptForPassword())
+ user.checkForPassword();
+ monitor.worked(100);
+ if( user.isConnected())
+ user.getDefaultDomain();
+ monitor.worked(100);
+ } catch(OpenShiftException ose) {
+ throw new InvocationTargetException(ose);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ try {
+ PlatformUI.getWorkbench().getProgressService().busyCursorWhile(longRunning);
+ } catch( InvocationTargetException ite ) {
+ Throwable t = ite.getCause();
+ throw (OpenShiftException)t;
+ } catch( InterruptedException ie ) {
+ }
+ }
+
@Override
public void resetPropertyValue(Object id) {
// TODO Auto-generated method stub