[jbosstools-commits] JBoss Tools SVN: r43685 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal: ui/wizard and 1 other directory.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Fri Sep 14 05:25:39 EDT 2012
Author: adietish
Date: 2012-09-14 05:25:38 -0400 (Fri, 14 Sep 2012)
New Revision: 43685
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPageModel.java
Log:
[JBIDE-11912] checking for password in UserDelegate, listing keys in table
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java 2012-09-14 08:24:02 UTC (rev 43684)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java 2012-09-14 09:25:38 UTC (rev 43685)
@@ -310,7 +310,10 @@
}
public List<IOpenShiftSSHKey> getSSHKeys() {
- return delegate.getSSHKeys();
+ if(checkForPassword()) {
+ return delegate.getSSHKeys();
+ }
+ return null;
}
public IOpenShiftSSHKey getSSHKeyByPublicKey(String publicKey) throws OpenShiftUnknonwSSHKeyTypeException, OpenShiftException {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPage.java 2012-09-14 08:24:02 UTC (rev 43684)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPage.java 2012-09-14 09:25:38 UTC (rev 43685)
@@ -14,12 +14,10 @@
import java.util.Collection;
import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.beans.BeanProperties;
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.viewers.ViewerSupport;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.layout.TableColumnLayout;
@@ -42,7 +40,6 @@
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import com.openshift.client.IEmbeddableCartridge;
import com.openshift.client.IOpenShiftSSHKey;
/**
@@ -74,11 +71,7 @@
this.viewer = createTable(tableContainer);
GridDataFactory.fillDefaults()
.span(1, 4).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(tableContainer);
- ViewerSupport.bind(
- viewer,
- BeanProperties.list(ManageSSHKeysWizardPageModel.PROPERTY_SSH_KEYS).observe(pageModel),
- BeanProperties.values(new String[]{"name", "keyType", "publicKey"}));
-
+
Button addButton = new Button(sshKeysGroup, SWT.PUSH);
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.FILL).applyTo(addButton);
@@ -111,7 +104,7 @@
public int compare(Viewer viewer, Object thisKey, Object thatKey) {
if (thisKey instanceof IOpenShiftSSHKey
&& thatKey instanceof IOpenShiftSSHKey) {
- return ((IOpenShiftSSHKey) thisKey).getName().compareTo(((IEmbeddableCartridge) thatKey).getName());
+ return ((IOpenShiftSSHKey) thisKey).getName().compareTo(((IOpenShiftSSHKey) thatKey).getName());
}
return super.compare(viewer, thisKey, thatKey);
}
@@ -131,7 +124,7 @@
@Override
public void update(ViewerCell cell) {
IOpenShiftSSHKey key = (IOpenShiftSSHKey) cell.getElement();
- cell.setText(key.getName());
+ cell.setText(key.getKeyType().getTypeId());
}
}, viewer, tableLayout);
createTableColumn("Public Key", 1, new CellLabelProvider() {
@@ -161,7 +154,7 @@
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
-// setViewerInput(pageModel.loadSSHKeys());
+ setViewerInput(pageModel.loadSSHKeys());
pageModel.loadSSHKeys();
return Status.OK_STATUS;
} catch (Exception e) {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPageModel.java 2012-09-14 08:24:02 UTC (rev 43684)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPageModel.java 2012-09-14 09:25:38 UTC (rev 43685)
@@ -23,7 +23,7 @@
*/
public class ManageSSHKeysWizardPageModel extends ObservableUIPojo {
- public static final String PROPERTY_SSH_KEYS = "sshKeys";
+ public static final String PROPERTY_SSH_KEYS = "SSHKeys";
private UserDelegate user;
private List<IOpenShiftSSHKey> keys = new ArrayList<IOpenShiftSSHKey>();
@@ -41,6 +41,7 @@
}
public List<IOpenShiftSSHKey> setSSHKeys(List<IOpenShiftSSHKey> keys) {
+ this.keys = keys;
firePropertyChange(PROPERTY_SSH_KEYS, this.keys, this.keys = keys);
return this.keys;
}
More information about the jbosstools-commits
mailing list