JBoss Tools SVN: r43758 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-09-17 13:00:41 -0400 (Mon, 17 Sep 2012)
New Revision: 43758
Modified:
trunk/build/target-platform/jbds.target
trunk/build/target-platform/local.target
trunk/build/target-platform/multiple.target
trunk/build/target-platform/unified.target
Log:
bump up version of org.eclipse.m2e.wtp.feature.feature.group to 0.16.0.20120914-0945 from 2 other version (not so consistent, folks\!)
Modified: trunk/build/target-platform/jbds.target
===================================================================
--- trunk/build/target-platform/jbds.target 2012-09-17 17:00:33 UTC (rev 43757)
+++ trunk/build/target-platform/jbds.target 2012-09-17 17:00:41 UTC (rev 43758)
@@ -43,7 +43,7 @@
<!-- m2e, m2e-wtp + deps -->
<unit id="org.eclipse.m2e.sdk.feature.feature.group" version="1.2.0.20120903-1050"/>
<unit id="org.eclipse.m2e.feature.feature.group" version="1.2.0.20120903-1050"/>
- <unit id="org.eclipse.m2e.wtp.feature.feature.group" version="0.16.0.20120910-0913"/>
+ <unit id="org.eclipse.m2e.wtp.feature.feature.group" version="0.16.0.20120914-0945"/>
<unit id="org.sonatype.m2e.mavenarchiver.feature.feature.group" version="0.15.0.201207090125"/>
<unit id="ch.qos.logback.classic" version="1.0.0.v20111214-2030"/>
<unit id="ch.qos.logback.core" version="1.0.0.v20111214-2030"/>
Modified: trunk/build/target-platform/local.target
===================================================================
--- trunk/build/target-platform/local.target 2012-09-17 17:00:33 UTC (rev 43757)
+++ trunk/build/target-platform/local.target 2012-09-17 17:00:41 UTC (rev 43758)
@@ -44,7 +44,7 @@
<!-- m2e, m2e-wtp + deps -->
<unit id="org.eclipse.m2e.sdk.feature.feature.group" version="1.2.0.20120903-1050"/>
<unit id="org.eclipse.m2e.feature.feature.group" version="1.2.0.20120903-1050"/>
- <unit id="org.eclipse.m2e.wtp.feature.feature.group" version="0.16.0.20120910-0913"/>
+ <unit id="org.eclipse.m2e.wtp.feature.feature.group" version="0.16.0.20120914-0945"/>
<unit id="org.sonatype.m2e.mavenarchiver.feature.feature.group" version="0.15.0.201207090125"/>
<unit id="ch.qos.logback.classic" version="1.0.0.v20111214-2030"/>
<unit id="ch.qos.logback.core" version="1.0.0.v20111214-2030"/>
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2012-09-17 17:00:33 UTC (rev 43757)
+++ trunk/build/target-platform/multiple.target 2012-09-17 17:00:41 UTC (rev 43758)
@@ -43,7 +43,7 @@
<!-- m2e, m2e-wtp + deps -->
<unit id="org.eclipse.m2e.sdk.feature.feature.group" version="1.2.0.20120903-1050"/>
<unit id="org.eclipse.m2e.feature.feature.group" version="1.2.0.20120903-1050"/>
- <unit id="org.eclipse.m2e.wtp.feature.feature.group" version="0.16.0.20120913-2037"/>
+ <unit id="org.eclipse.m2e.wtp.feature.feature.group" version="0.16.0.20120914-0945"/>
<unit id="org.sonatype.m2e.mavenarchiver.feature.feature.group" version="0.15.0.201207090125"/>
<unit id="ch.qos.logback.classic" version="1.0.0.v20111214-2030"/>
<unit id="ch.qos.logback.core" version="1.0.0.v20111214-2030"/>
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2012-09-17 17:00:33 UTC (rev 43757)
+++ trunk/build/target-platform/unified.target 2012-09-17 17:00:41 UTC (rev 43758)
@@ -43,7 +43,7 @@
<!-- m2e, m2e-wtp + deps -->
<unit id="org.eclipse.m2e.sdk.feature.feature.group" version="1.2.0.20120903-1050"/>
<unit id="org.eclipse.m2e.feature.feature.group" version="1.2.0.20120903-1050"/>
- <unit id="org.eclipse.m2e.wtp.feature.feature.group" version="0.16.0.20120910-0913"/>
+ <unit id="org.eclipse.m2e.wtp.feature.feature.group" version="0.16.0.20120914-0945"/>
<unit id="org.sonatype.m2e.mavenarchiver.feature.feature.group" version="0.15.0.201207090125"/>
<unit id="ch.qos.logback.classic" version="1.0.0.v20111214-2030"/>
<unit id="ch.qos.logback.core" version="1.0.0.v20111214-2030"/>
13 years, 6 months
JBoss Tools SVN: r43757 - in trunk/download.jboss.org/jbosstools/updates/requirements: m2e-wtp/0.16.0.20120914-0945 and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-09-17 13:00:33 -0400 (Mon, 17 Sep 2012)
New Revision: 43757
Removed:
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/build-0....
Modified:
trunk/download.jboss.org/jbosstools/updates/requirements/m2eclipse/build.xml
Log:
remove requirements/m2e-wtp builder and update requirements/m2eclipse/build.xml (JBIDE-12629)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/0.16.0.2...
===================================================================
(Binary files differ)
Deleted: trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/build-0....
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/build-0.... 2012-09-17 17:00:20 UTC (rev 43756)
+++ trunk/download.jboss.org/jbosstools/updates/requirements/m2e-wtp/build-0.... 2012-09-17 17:00:33 UTC (rev 43757)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project default="mirror">
- <!-- run locally in Eclipse (to resolve p2 tasks) using these commandline options:
- -os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}
- -consoleLog -nosplash -data /tmp
- -application org.eclipse.ant.core.antRunner
- -f build-0.16.0.RC2.xml
- -->
- <target name="mirror">
- <property name="version" value="0.16.0.20120914-0945"/>
- <property name="URL" value="http://download.eclipse.org/m2e-wtp/milestones/0.16.0/0.16.0.20120914-0945/" />
- <property name="compress" value="true" />
-
- <p2.mirror>
- <repository location="file:${basedir}/0.16.0.20120914-0945/" name="m2e-wtp 0.16.0 RC2" />
- <source>
- <repository location="${URL}" />
- </source>
-
- <slicingOptions includeFeatures="true" followStrict="true" />
- </p2.mirror>
-
- <p2.publish.featuresAndBundles metadataRepository="file:${basedir}/${version}/" artifactRepository="file:${basedir}/${version}/" publishartifacts="true" source="${basedir}/${version}/" compress="${compress}" />
- </target>
-</project>
Modified: trunk/download.jboss.org/jbosstools/updates/requirements/m2eclipse/build.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/requirements/m2eclipse/build.xml 2012-09-17 17:00:20 UTC (rev 43756)
+++ trunk/download.jboss.org/jbosstools/updates/requirements/m2eclipse/build.xml 2012-09-17 17:00:33 UTC (rev 43757)
@@ -20,7 +20,9 @@
<property name="URL1" value="http://download.eclipse.org/technology/m2e/milestones/1.2/1.2.0.20120903-..."/>
<property name="URL2" value="https://repository.sonatype.org/content/repositories/forge-sites/m2e-extr..."/>
- <property name="URL3" value="http://download.jboss.org/jbosstools/updates/requirements/m2eclipse/m2e-w..."/> <!-- 0.16 -->
+ <property name="URL3" value="http://download.eclipse.org/m2e-wtp/milestones/0.16.0/"/> <!-- 0.16 milestone -->
+ <!-- <property name="URL3" value="http://download.jboss.org/jbosstools/updates/requirements/m2eclipse/m2e-w..."/> --> <!-- 0.16 nightly -->
+
<property name="URL4" value="http://download.jboss.org/jbosstools/updates/requirements/m2eclipse/m2e-j..."/>
<property name="URL5" value="http://download.jboss.org/jbosstools/updates/requirements/m2eclipse/m2e-a..."/>
@@ -28,7 +30,7 @@
<property name="compress" value="true" />
<p2.mirror>
- <repository location="file:${destination}/20120905-1550" name="m2e 1.2, m2e-extras 0.15, m2e-wtp 0.16, m2e-jdt-compiler 1.0, m2e-apt 1.0 (mirrored 20120905-1550)" />
+ <repository location="file:${destination}/20120917-1234" name="m2e 1.2, m2e-extras 0.15, m2e-wtp 0.16, m2e-jdt-compiler 1.0, m2e-apt 1.0 (mirrored 20120917-1234)" />
<source>
<repository location="${URL1}" />
<repository location="${URL2}" />
@@ -40,7 +42,7 @@
<slicingOptions includeFeatures="true" followStrict="true" />
</p2.mirror>
- <p2.publish.featuresAndBundles metadataRepository="file:${destination}/20120905-1550/" artifactRepository="file:${destination}/20120905-1550/"
- publishartifacts="true" source="${destination}/20120905-1550/" compress="${compress}" />
+ <p2.publish.featuresAndBundles metadataRepository="file:${destination}/20120917-1234/" artifactRepository="file:${destination}/20120917-1234/"
+ publishartifacts="true" source="${destination}/20120917-1234/" compress="${compress}" />
</target>
</project>
13 years, 6 months
JBoss Tools SVN: r43756 - trunk/download.jboss.org/jbosstools/updates/juno/SR0a.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-09-17 13:00:20 -0400 (Mon, 17 Sep 2012)
New Revision: 43756
Modified:
trunk/download.jboss.org/jbosstools/updates/juno/SR0a/compositeArtifacts.xml
trunk/download.jboss.org/jbosstools/updates/juno/SR0a/compositeContent.xml
Log:
bump up m2e-wtp version to latest milestone
Modified: trunk/download.jboss.org/jbosstools/updates/juno/SR0a/compositeArtifacts.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/juno/SR0a/compositeArtifacts.xml 2012-09-17 16:57:41 UTC (rev 43755)
+++ trunk/download.jboss.org/jbosstools/updates/juno/SR0a/compositeArtifacts.xml 2012-09-17 17:00:20 UTC (rev 43756)
@@ -3,7 +3,7 @@
<repository name='JBoss Tools Requirements - Composite Juno SR0a Mirror' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
<properties size='2'>
<property name='p2.compressed' value='true'/>
-<property name='p2.timestamp' value='1347033375000'/>
+<property name='p2.timestamp' value='1347900512000'/>
</properties>
<children size='13'>
<!-- new for Juno SR1 -->
@@ -13,11 +13,9 @@
<child location='../../requirements/webtools/M-3.4.1-20120831042944/'/>
<child location='../../requirements/gwt/3.1.0.v201208080121-rel-r42/'/>
<!-- includes m2e 1.2, m2e-extras 0.15, m2e-wtp 0.16, m2e-jdt-compiler 1.0, m2e-apt 1.0 -->
-<child location='../../requirements/m2eclipse/20120905-1550/'/>
+<child location='../../requirements/m2eclipse/20120917-1234/'/>
+<!-- JBIDE-12629 do not include latest integration build <child location='../../requirements/m2eclipse/m2e-wtp-juno/'/> -->
-<!-- latest integration build -->
-<child location='../../requirements/m2eclipse/m2e-wtp-juno/'/>
-
<!-- same atlassian version in SR0 -->
<child location='../../requirements/atlassian/3.0.6.v20120628/'/>
Modified: trunk/download.jboss.org/jbosstools/updates/juno/SR0a/compositeContent.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/juno/SR0a/compositeContent.xml 2012-09-17 16:57:41 UTC (rev 43755)
+++ trunk/download.jboss.org/jbosstools/updates/juno/SR0a/compositeContent.xml 2012-09-17 17:00:20 UTC (rev 43756)
@@ -3,7 +3,7 @@
<repository name='JBoss Tools Requirements - Composite Juno SR0a Mirror' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
<properties size='2'>
<property name='p2.compressed' value='true'/>
-<property name='p2.timestamp' value='1347033380000'/>
+<property name='p2.timestamp' value='1347900524000'/>
</properties>
<children size='13'>
<!-- new for Juno SR1 -->
@@ -13,11 +13,9 @@
<child location='../../requirements/webtools/M-3.4.1-20120831042944/'/>
<child location='../../requirements/gwt/3.1.0.v201208080121-rel-r42/'/>
<!-- includes m2e 1.2, m2e-extras 0.15, m2e-wtp 0.16, m2e-jdt-compiler 1.0, m2e-apt 1.0 -->
-<child location='../../requirements/m2eclipse/20120905-1550/'/>
+<child location='../../requirements/m2eclipse/20120917-1234/'/>
+<!-- JBIDE-12629 do not include latest integration build <child location='../../requirements/m2eclipse/m2e-wtp-juno/'/> -->
-<!-- latest integration build -->
-<child location='../../requirements/m2eclipse/m2e-wtp-juno/'/>
-
<!-- same atlassian version in SR0 -->
<child location='../../requirements/atlassian/3.0.6.v20120628/'/>
13 years, 6 months
JBoss Tools SVN: r43755 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-09-17 12:57:41 -0400 (Mon, 17 Sep 2012)
New Revision: 43755
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/AlphanumericStringValidator.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/RequiredControlDecorationUpdater.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/ValidationStatusControlDecoration.java
Log:
[JBIDE-11912] implemented binding and decoration. Renamed CustomControlDecorationUpdater to RequiredControlDecorationUpdater & moved to databinding package. Extracted AlphanumerStringValidator. Extracted SSH2Home extraction from DomainWizard to util-class.
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/AlphanumericStringValidator.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/AlphanumericStringValidator.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/AlphanumericStringValidator.java 2012-09-17 16:57:41 UTC (rev 43755)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.databinding;
+
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
+import org.eclipse.core.runtime.IStatus;
+import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class AlphanumericStringValidator implements IValidator {
+
+ private String fieldName;
+
+ public AlphanumericStringValidator(String fieldName) {
+ this.fieldName = fieldName;
+ }
+
+ @Override
+ public IStatus validate(Object value) {
+ String name = (String) value;
+ if (StringUtils.isEmpty(name)) {
+ return ValidationStatus.cancel("You have to provide a " + fieldName);
+ } else if (!StringUtils.isAlphaNumeric(name)) {
+ return ValidationStatus.cancel("You have to provide an alphanumeric " + fieldName);
+ }
+ return ValidationStatus.ok();
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/AlphanumericStringValidator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/RequiredControlDecorationUpdater.java (from rev 43743, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CustomControlDecorationUpdater.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/RequiredControlDecorationUpdater.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/RequiredControlDecorationUpdater.java 2012-09-17 16:57:41 UTC (rev 43755)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.databinding;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.databinding.fieldassist.ControlDecorationUpdater;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A custom control decoration updater that would display the "required" (*)
+ * decoration to a control if the validation status is IStatus#CANCEL
+ *
+ * @author Xavier Coulon
+ *
+ * @see IStatus#CANCEL
+ */
+public class RequiredControlDecorationUpdater extends ControlDecorationUpdater {
+
+ private final boolean showRequiredDecorator;
+
+ /**
+ * Default constructor: provides a 'REQUIRED' decorator when the status is
+ * CANCEL
+ */
+ public RequiredControlDecorationUpdater() {
+ this(true);
+ }
+
+ /**
+ * Default constructor: provides a 'REQUIRED' decorator when the status is
+ * CANCEL
+ */
+ public RequiredControlDecorationUpdater(final boolean showRequiredDecorator) {
+ super();
+ this.showRequiredDecorator = showRequiredDecorator;
+ }
+
+ /**
+ * {@inheritDoc} Overrides the standard behaviour: for CANCEL status, items
+ * are decorated with the REQUIRED decorator, not the ERROR one.
+ */
+ @Override
+ protected Image getImage(IStatus status) {
+ if (status == null) {
+ return null;
+ }
+ String fieldDecorationID = null;
+ switch (status.getSeverity()) {
+ case IStatus.INFO:
+ fieldDecorationID = FieldDecorationRegistry.DEC_INFORMATION;
+ break;
+ case IStatus.WARNING:
+ fieldDecorationID = FieldDecorationRegistry.DEC_WARNING;
+ break;
+ case IStatus.ERROR:
+ fieldDecorationID = FieldDecorationRegistry.DEC_ERROR;
+ break;
+ case IStatus.CANCEL:
+ fieldDecorationID = showRequiredDecorator ? FieldDecorationRegistry.DEC_REQUIRED : null;
+ break;
+ }
+
+ FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(fieldDecorationID);
+ return fieldDecoration == null ? null : fieldDecoration.getImage();
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/RequiredControlDecorationUpdater.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/ValidationStatusControlDecoration.java (from rev 43743, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/ValidationStatusControlDecoration.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/ValidationStatusControlDecoration.java 2012-09-17 16:57:41 UTC (rev 43755)
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.databinding;
+
+import org.eclipse.core.databinding.ValidationStatusProvider;
+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.IStatus;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author André Dietisheim
+ */
+public class ValidationStatusControlDecoration {
+
+ private IObservableValue validationStatus;
+
+ public ValidationStatusControlDecoration(ValidationStatusProvider provider) {
+ this.validationStatus = provider.getValidationStatus();
+ }
+
+ public void showFor(Control control, int position) {
+ ControlDecoration decoration = createDecoration(control, position);
+ IValueChangeListener validationStatusListener = onValidationStatusChanged(decoration);
+
+ validationStatus.addValueChangeListener(validationStatusListener);
+ control.addDisposeListener(onControlDisposed(validationStatusListener));
+
+ }
+
+ private ControlDecoration createDecoration(Control control, int position) {
+ ControlDecoration controlDecoration = new ControlDecoration(control, position);
+ FieldDecoration fieldDecoration =
+ FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
+ controlDecoration.setImage(fieldDecoration.getImage());
+ if (validationStatus.getValue() instanceof IStatus) {
+ showDecoration(controlDecoration, (IStatus) validationStatus.getValue());
+ }
+ return controlDecoration;
+ }
+
+ private DisposeListener onControlDisposed(final IValueChangeListener validationStatusListener) {
+ return new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ validationStatus.removeValueChangeListener(validationStatusListener);
+ }
+ };
+ }
+
+ private IValueChangeListener onValidationStatusChanged(final ControlDecoration controlDecoration) {
+ return new IValueChangeListener() {
+
+ @Override
+ public void handleValueChange(ValueChangeEvent event) {
+ if (!(event.diff.getNewValue() instanceof IStatus)) {
+ return;
+ }
+ IStatus validationStatus = (IStatus) event.diff.getNewValue();
+ showDecoration(controlDecoration, validationStatus);
+ }
+ };
+ }
+
+ private void showDecoration(final ControlDecoration controlDecoration, IStatus validationStatus) {
+ if (validationStatus.isOK()) {
+ controlDecoration.hide();
+ } else {
+ controlDecoration.show();
+ }
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/ValidationStatusControlDecoration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 6 months
JBoss Tools SVN: r43754 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: utils and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-09-17 12:57:11 -0400 (Mon, 17 Sep 2012)
New Revision: 43754
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/databinding/
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SSHUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPageModel.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CustomControlDecorationUpdater.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java
Log:
[JBIDE-11912] implemented binding and decoration. Renamed CustomControlDecorationUpdater to RequiredControlDecorationUpdater & moved to databinding package. Extracted AlphanumerStringValidator. Extracted SSH2Home extraction from DomainWizard to util-class.
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java 2012-09-17 16:54:41 UTC (rev 43753)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/ValidationStatusControlDecoration.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui;
-
-import org.eclipse.core.databinding.ValidationStatusProvider;
-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.IStatus;
-import org.eclipse.jface.fieldassist.ControlDecoration;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @author André Dietisheim
- */
-public class ValidationStatusControlDecoration {
-
- private IObservableValue validationStatus;
-
- public ValidationStatusControlDecoration(ValidationStatusProvider provider) {
- this.validationStatus = provider.getValidationStatus();
- }
-
- public void showFor(Control control, int position) {
- ControlDecoration decoration = createDecoration(control, position);
- IValueChangeListener validationStatusListener = onValidationStatusChanged(decoration);
-
- validationStatus.addValueChangeListener(validationStatusListener);
- control.addDisposeListener(onControlDisposed(validationStatusListener));
-
- }
-
- private ControlDecoration createDecoration(Control control, int position) {
- ControlDecoration controlDecoration = new ControlDecoration(control, position);
- FieldDecoration fieldDecoration =
- FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
- controlDecoration.setImage(fieldDecoration.getImage());
- if (validationStatus.getValue() instanceof IStatus) {
- showDecoration(controlDecoration, (IStatus) validationStatus.getValue());
- }
- return controlDecoration;
- }
-
- private DisposeListener onControlDisposed(final IValueChangeListener validationStatusListener) {
- return new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- validationStatus.removeValueChangeListener(validationStatusListener);
- }
- };
- }
-
- private IValueChangeListener onValidationStatusChanged(final ControlDecoration controlDecoration) {
- return new IValueChangeListener() {
-
- @Override
- public void handleValueChange(ValueChangeEvent event) {
- if (!(event.diff.getNewValue() instanceof IStatus)) {
- return;
- }
- IStatus validationStatus = (IStatus) event.diff.getNewValue();
- showDecoration(controlDecoration, validationStatus);
- }
- };
- }
-
- private void showDecoration(final ControlDecoration controlDecoration, IStatus validationStatus) {
- if (validationStatus.isOK()) {
- controlDecoration.hide();
- } else {
- controlDecoration.show();
- }
- }
-
-}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SSHUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SSHUtils.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SSHUtils.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.utils;
+
+import org.eclipse.jsch.internal.core.IConstants;
+import org.eclipse.jsch.internal.core.JSchCorePlugin;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class SSHUtils {
+
+ public static String getSSH2Home() {
+ return JSchCorePlugin.getPlugin().getPluginPreferences().getString(IConstants.KEY_SSH2HOME);
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SSHUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-09-17 16:54:41 UTC (rev 43753)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -76,6 +76,7 @@
import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.databinding.RequiredControlDecorationUpdater;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.UIUtils;
@@ -179,7 +180,7 @@
useExistingAppBtnSelection, existingAppNameTextObservable, existingApplicationsLoaded);
dbc.addValidationStatusProvider(existingAppValidator);
ControlDecorationSupport.create(
- existingAppValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater(false));
+ existingAppValidator, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater(false));
return existingAppSelectionGroup;
}
@@ -262,7 +263,7 @@
new NewApplicationNameValidator(useExistingAppBtnSelection, applicationNameTextObservable);
dbc.addValidationStatusProvider(newApplicationNameValidator);
ControlDecorationSupport.create(
- newApplicationNameValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater());
+ newApplicationNameValidator, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
// application type
final Label newAppTypeLabel = new Label(newAppConfigurationGroup, SWT.NONE);
@@ -343,7 +344,7 @@
new NewApplicationTypeValidator(useExistingAppBtnSelection, selectedCartridgeIndexObservable);
dbc.addValidationStatusProvider(newApplicationTypeValidator);
ControlDecorationSupport.create(newApplicationTypeValidator, SWT.LEFT | SWT.TOP, null,
- new CustomControlDecorationUpdater());
+ new RequiredControlDecorationUpdater());
// embeddable cartridges
this.newAppEmbeddableCartridgesGroup = new Group(newAppConfigurationGroup, SWT.NONE);
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CustomControlDecorationUpdater.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CustomControlDecorationUpdater.java 2012-09-17 16:54:41 UTC (rev 43753)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CustomControlDecorationUpdater.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.wizard;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.databinding.fieldassist.ControlDecorationUpdater;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Xavier Coulon
- *
- */
-public class CustomControlDecorationUpdater extends ControlDecorationUpdater {
-
- private final boolean showRequiredDecorator;
-
- /**
- * Default constructor: provides a 'REQUIRED' decorator when the status is CANCEL
- */
- public CustomControlDecorationUpdater() {
- this(true);
- }
-
- /**
- * Default constructor: provides a 'REQUIRED' decorator when the status is CANCEL
- */
- public CustomControlDecorationUpdater(final boolean showRequiredDecorator) {
- super();
- this.showRequiredDecorator = showRequiredDecorator;
- }
-
- /**
- * {@inheritDoc} Overrides the standard behaviour: for CANCEL status, items are decorated with the REQUIRED
- * decorator, not the ERROR one.
- */
- @Override
- protected Image getImage(IStatus status) {
- if (status == null) {
- return null;
- }
- String fieldDecorationID = null;
- switch (status.getSeverity()) {
- case IStatus.INFO:
- fieldDecorationID = FieldDecorationRegistry.DEC_INFORMATION;
- break;
- case IStatus.WARNING:
- fieldDecorationID = FieldDecorationRegistry.DEC_WARNING;
- break;
- case IStatus.ERROR:
- fieldDecorationID = FieldDecorationRegistry.DEC_ERROR;
- break;
- case IStatus.CANCEL:
- fieldDecorationID = showRequiredDecorator ? FieldDecorationRegistry.DEC_REQUIRED : null;
- break;
- }
-
- FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(fieldDecorationID);
- return fieldDecoration == null ? null : fieldDecoration.getImage();
- }
-}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-09-17 16:54:41 UTC (rev 43753)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -30,6 +30,7 @@
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.ui.databinding.ParametrizableWizardPageSupport;
import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
+import org.jboss.tools.openshift.express.internal.ui.databinding.RequiredControlDecorationUpdater;
import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
/**
@@ -63,7 +64,7 @@
final NamespaceValidator namespaceValidator = new NamespaceValidator(namespaceTextObservable);
dbc.addValidationStatusProvider(namespaceValidator);
ControlDecorationSupport.create(namespaceValidator, SWT.LEFT | SWT.TOP, null,
- new CustomControlDecorationUpdater());
+ new RequiredControlDecorationUpdater());
final IObservableValue namespaceModelObservable = BeanProperties.value(
EditDomainWizardPageModel.PROPERTY_DOMAIN_ID).observe(pageModel);
ValueBindingBuilder.bind(namespaceTextObservable).to(namespaceModelObservable).in(dbc);
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-09-17 16:54:41 UTC (rev 43753)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -53,8 +53,10 @@
import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.common.ui.ssh.SshPrivateKeysPreferences;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.databinding.RequiredControlDecorationUpdater;
import org.jboss.tools.openshift.express.internal.ui.utils.FileUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.SSHUserConfig;
+import org.jboss.tools.openshift.express.internal.ui.utils.SSHUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
import com.openshift.client.OpenShiftException;
@@ -89,7 +91,7 @@
final NamespaceValidator namespaceValidator = new NamespaceValidator(namespaceTextObservable);
dbc.addValidationStatusProvider(namespaceValidator);
ControlDecorationSupport.create(namespaceValidator, SWT.LEFT | SWT.TOP, null,
- new CustomControlDecorationUpdater());
+ new RequiredControlDecorationUpdater());
final IObservableValue namespaceModelObservable = BeanProperties.value(
NewDomainWizardPageModel.PROPERTY_DOMAIN_ID).observe(pageModel);
ValueBindingBuilder.bind(namespaceTextObservable).to(namespaceModelObservable).in(dbc);
@@ -232,7 +234,7 @@
if (pageModel.hasConfiguredFixedPrivateKeys()) {
return ValidationStatus.warning(
NLS.bind("Your SSH config ({0}) contains fixed keys for OpenShift servers. " +
- "This can override any Eclipse specific SSH key preferences.", new SSHUserConfig(pageModel.getSSH2Home()).getFile()));
+ "This can override any Eclipse specific SSH key preferences.", new SSHUserConfig(SSHUtils.getSSH2Home()).getFile()));
} else if (!isKeyKnownToSsh((String) value)) {
return ValidationStatus.warning(
NLS.bind("Could not find the private portion for your public key in the preferences. "
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2012-09-17 16:54:41 UTC (rev 43753)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -23,6 +23,7 @@
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.ui.utils.FileUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.SSHUserConfig;
+import org.jboss.tools.openshift.express.internal.ui.utils.SSHUtils;
import com.openshift.client.IDomain;
import com.openshift.client.IOpenShiftSSHKey;
@@ -90,7 +91,7 @@
}
private String checkedGetSSH2Home() throws OpenShiftException {
- String ssh2Home = getSSH2Home();
+ String ssh2Home = SSHUtils.getSSH2Home();
if (ssh2Home == null
|| ssh2Home.trim().length() == 0) {
throw new OpenShiftException("Could not determine your ssh2 home directory");
@@ -98,10 +99,6 @@
return ssh2Home;
}
- public String getSSH2Home() {
- return JSchCorePlugin.getPlugin().getPluginPreferences().getString(IConstants.KEY_SSH2HOME);
- }
-
public boolean hasConfiguredFixedPrivateKeys() {
try {
SSHUserConfig sshUserConfig = new SSHUserConfig(checkedGetSSH2Home());
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java 2012-09-17 16:54:41 UTC (rev 43753)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -19,7 +19,8 @@
public class AddSSHKeyWizard extends Wizard {
private UserDelegate user;
-
+ private AddSSHKeyWizardPage addSSHKeyWizardPage;
+
public AddSSHKeyWizard(UserDelegate user) {
this.user = user;
setNeedsProgressMonitor(true);
@@ -27,11 +28,12 @@
@Override
public boolean performFinish() {
+ addSSHKeyWizardPage.addConfiguredSSHKey();
return true;
}
@Override
public void addPages() {
- addPage(new AddSSHKeyWizardPage(user, this));
+ addPage(this.addSSHKeyWizardPage = new AddSSHKeyWizardPage(user, this));
}
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java 2012-09-17 16:54:41 UTC (rev 43753)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -10,17 +10,29 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+import org.jboss.tools.openshift.express.internal.ui.databinding.AlphanumericStringValidator;
+import org.jboss.tools.openshift.express.internal.ui.databinding.RequiredControlDecorationUpdater;
+import org.jboss.tools.openshift.express.internal.ui.utils.SSHUtils;
import org.jboss.tools.openshift.express.internal.ui.wizard.AbstractOpenShiftWizardPage;
/**
@@ -28,12 +40,12 @@
*/
public class AddSSHKeyWizardPage extends AbstractOpenShiftWizardPage {
- private UserDelegate user;
+ private AddSSHKeyWizardPageModel pageModel;
public AddSSHKeyWizardPage(UserDelegate user, IWizard wizard) {
super("Add existing SSH Key", "Add an exiting SSH key to your OpenShift account",
"AddSSHKeysPage", wizard);
- this.user = user;
+ this.pageModel = new AddSSHKeyWizardPageModel(user);
}
@Override
@@ -54,9 +66,16 @@
.align(SWT.LEFT, SWT.CENTER).applyTo(nameLabel);
Text nameText = new Text(addSSHKeyGroup, SWT.BORDER);
- nameText.setEditable(false);
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(nameText);
+ Binding nameBinding = ValueBindingBuilder
+ .bind(WidgetProperties.text(SWT.Modify).observe(nameText))
+ .validatingAfterConvert(new AlphanumericStringValidator("key name"))
+ .to(BeanProperties.value(AddSSHKeyWizardPageModel.PROPERTY_NAME).observe(pageModel))
+ .notUpdatingParticipant()
+ .in(dbc);
+ ControlDecorationSupport.create(
+ nameBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
Label fileLabel = new Label(addSSHKeyGroup, SWT.NONE);
GridDataFactory.fillDefaults()
@@ -67,10 +86,38 @@
fileText.setEditable(false);
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(fileText);
+ Binding filePathBinding = ValueBindingBuilder
+ .bind(WidgetProperties.text(SWT.Modify).observe(fileText))
+ .validatingAfterConvert(new AlphanumericStringValidator("key file"))
+ .to(BeanProperties.value(AddSSHKeyWizardPageModel.PROPERTY_FILEPATH).observe(pageModel))
+ .in(dbc);
+ ControlDecorationSupport.create(
+ filePathBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
Button browseButton = new Button(addSSHKeyGroup, SWT.PUSH);
+ browseButton.setText("Browse...");
+ browseButton.addSelectionListener(onBrowse());
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.CENTER).applyTo(browseButton);
- browseButton.setText("Browse...");
+
}
-}
\ No newline at end of file
+
+ private SelectionListener onBrowse() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
+ dialog.setFilterPath(SSHUtils.getSSH2Home());
+ String filePath = null;
+ if ((filePath = dialog.open()) != null) {
+ pageModel.setFilePath(filePath);
+ }
+ }
+ };
+ }
+
+ public void addConfiguredSSHKey() {
+ pageModel.addConfiguredSSHKey();
+ }
+}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPageModel.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPageModel.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class AddSSHKeyWizardPageModel extends ObservableUIPojo {
+
+ public static final String PROPERTY_FILEPATH = "filePath";
+ public static final String PROPERTY_NAME = "name";
+
+ private String name;
+ private String filePath;
+ private UserDelegate user;
+
+ public AddSSHKeyWizardPageModel(UserDelegate user) {
+ this.user = user;
+ }
+
+ public String getFilePath() {
+ return filePath;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ firePropertyChange(PROPERTY_NAME, this.name, this.name = name);
+ }
+
+ public void setFilePath(String filePath) {
+ firePropertyChange(PROPERTY_FILEPATH, this.filePath, this.filePath = filePath);
+ }
+
+ public void addConfiguredSSHKey() {
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPageModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java 2012-09-17 16:54:41 UTC (rev 43753)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java 2012-09-17 16:57:11 UTC (rev 43754)
@@ -41,7 +41,6 @@
}
public List<IOpenShiftSSHKey> setSSHKeys(List<IOpenShiftSSHKey> keys) {
- this.keys = keys;
firePropertyChange(PROPERTY_SSH_KEYS, this.keys, this.keys = keys);
return this.keys;
}
13 years, 6 months
JBoss Tools SVN: r43753 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-09-17 12:54:41 -0400 (Mon, 17 Sep 2012)
New Revision: 43753
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
Log:
[JBIDE-11912] corrected "Manage SSH Keys" context-menu entry visibility (was always visible, but only enabled on user, now: only visible on user)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-09-17 16:18:31 UTC (rev 43752)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-09-17 16:54:41 UTC (rev 43753)
@@ -692,14 +692,6 @@
<handler
class="org.jboss.tools.openshift.express.internal.ui.command.ManageSSHKeysHandler"
commandId="org.jboss.tools.openshift.express.ui.command.manageKeys">
- <enabledWhen>
- <with variable="selection">
- <iterate ifEmpty="false" operator="or">
- <instanceof
- value="org.jboss.tools.openshift.express.internal.core.console.UserDelegate" />
- </iterate>
- </with>
- </enabledWhen>
</handler>
</extension>
<extension
@@ -711,6 +703,14 @@
icon="icons/key-icon.png"
id="org.jboss.tools.openshift.express.ui.command.manageKeys"
mnemonic="K">
+ <visibleWhen>
+ <with variable="selection">
+ <iterate ifEmpty="false" operator="or">
+ <instanceof
+ value="org.jboss.tools.openshift.express.internal.core.console.UserDelegate" />
+ </iterate>
+ </with>
+ </visibleWhen>
</command>
</menuContribution>
</extension>
13 years, 6 months
JBoss Tools SVN: r43752 - trunk/build/target-platforms/unified.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-09-17 12:18:31 -0400 (Mon, 17 Sep 2012)
New Revision: 43752
Modified:
trunk/build/target-platforms/unified/pom.xml
Log:
JBIDE-12629: Fix URL to reference aggregated TP site in unified.target
Modified: trunk/build/target-platforms/unified/pom.xml
===================================================================
--- trunk/build/target-platforms/unified/pom.xml 2012-09-17 15:20:08 UTC (rev 43751)
+++ trunk/build/target-platforms/unified/pom.xml 2012-09-17 16:18:31 UTC (rev 43752)
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.tools</groupId>
- <artifactId>target-platforms</artifactId>
+ <artifactId>target-platforms</artifactId>
<version>4.0.0.Alpha2-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.target-platforms</groupId>
@@ -13,7 +13,7 @@
<packaging>pom</packaging>
<properties>
- <unified.URL>http://download.jboss.org/jbosstools/updates/target-platform_4.0.juno.SR0...</unified.URL>
+ <unified.URL>http://download.jboss.org/jbosstools/updates/target-platform_4.0.juno.SR0...</unified.URL>
</properties>
<build>
@@ -86,7 +86,7 @@
<execution>
<phase>verify</phase>
<goals>
- <goal>validate-target-platform</goal>
+ <goal>validate-target-platform</goal>
</goals>
<configuration>
<targetFiles>
13 years, 6 months
JBoss Tools SVN: r43750 - trunk/openshift/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: 2012-09-17 11:06:50 -0400 (Mon, 17 Sep 2012)
New Revision: 43750
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
Log:
removed commented code
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-09-17 14:56:03 UTC (rev 43749)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-09-17 15:06:50 UTC (rev 43750)
@@ -93,10 +93,6 @@
final IObservableValue namespaceModelObservable = BeanProperties.value(
NewDomainWizardPageModel.PROPERTY_DOMAIN_ID).observe(pageModel);
ValueBindingBuilder.bind(namespaceTextObservable).to(namespaceModelObservable).in(dbc);
-
- /*DataBindingUtils.bindMandatoryTextField(
- namespaceText, "Domain name", NewDomainWizardPageModel.PROPERTY_NAMESPACE, model, dbc);
- */
Label sshKeyLabel = new Label(container, SWT.NONE);
sshKeyLabel.setText("SSH Public Key");
13 years, 6 months
JBoss Tools SVN: r43749 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: utils and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-09-17 10:56:03 -0400 (Mon, 17 Sep 2012)
New Revision: 43749
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUpdatingJob.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizard.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
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/command/ManageSSHKeysHandler.java
Log:
[JBIDE-11912] added "Add existing SSH Key" dialog
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/command/ManageSSHKeysHandler.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/command/ManageSSHKeysHandler.java 2012-09-17 14:40:42 UTC (rev 43748)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/command/ManageSSHKeysHandler.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -18,7 +18,7 @@
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-import org.jboss.tools.openshift.express.internal.ui.wizard.ManageSSHKeysWizard;
+import org.jboss.tools.openshift.express.internal.ui.wizard.ssh.ManageSSHKeysWizard;
/**
* @author Andre Dietisheim
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.utils;
+
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class JobScheduler {
+
+ private Job job;
+
+ public JobScheduler(Job job) {
+ this.job = job;
+ }
+
+ public class ChainedJob {
+ private Job job;
+
+ private ChainedJob(Job job) {
+ this.job = job;
+ }
+
+ public ChainedJob andWhenDone(final Job constrainedJob) {
+ job.addJobChangeListener(new JobChangeAdapter() {
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ constrainedJob.schedule();
+ }});
+ return new ChainedJob(constrainedJob);
+ }
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUpdatingJob.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUpdatingJob.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUpdatingJob.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -0,0 +1,36 @@
+package org.jboss.tools.openshift.express.internal.ui.utils;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.ui.progress.UIJob;
+
+public abstract class UIUpdatingJob extends Job {
+
+ public UIUpdatingJob(String name) {
+ super(name);
+ addJobChangeListener(new JobChangeAdapter() {
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ new UIJob(getName()) {
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ return updateUI(monitor);
+ }
+ }.schedule();
+ }});
+ }
+
+ @Override
+ protected abstract IStatus run(IProgressMonitor monitor);
+
+ protected IStatus updateUI(IProgressMonitor monitor) {
+ return Status.OK_STATUS;
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUpdatingJob.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizard.java 2012-09-17 14:40:42 UTC (rev 43748)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizard.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.wizard;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-
-/**
- * @author André Dietisheim
- */
-public class ManageSSHKeysWizard extends Wizard {
-
- private UserDelegate user;
-
- public ManageSSHKeysWizard(UserDelegate user) {
- this.user = user;
- setNeedsProgressMonitor(true);
- }
-
- @Override
- public boolean performFinish() {
- return true;
- }
-
- @Override
- public void addPages() {
- addPage(new ManageSSHKeysWizardPage(user, this));
- }
-}
Deleted: 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-17 14:40:42 UTC (rev 43748)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPage.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.wizard;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.core.databinding.DataBindingContext;
-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.layout.GridDataFactory;
-import org.eclipse.jface.layout.GridLayoutFactory;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.IElementComparer;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Table;
-import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
-import org.jboss.tools.openshift.express.internal.ui.utils.TableViewerBuilder;
-import org.jboss.tools.openshift.express.internal.ui.utils.TableViewerBuilder.IColumnLabelProvider;
-
-import com.openshift.client.IOpenShiftSSHKey;
-
-/**
- * @author André Dietisheim
- */
-public class ManageSSHKeysWizardPage extends AbstractOpenShiftWizardPage {
-
- private ManageSSHKeysWizardPageModel pageModel;
- private TableViewer viewer;
-
- public ManageSSHKeysWizardPage(UserDelegate user, IWizard wizard) {
- super("Manage SSH Keys", "Manage the SSH keys that are available to your OpenShift account",
- "ManageSSHKeysPage", wizard);
- this.pageModel = new ManageSSHKeysWizardPageModel(user);
- }
-
- @Override
- protected void doCreateControls(Composite parent, DataBindingContext dbc) {
- GridLayoutFactory.fillDefaults().margins(10, 10).applyTo(parent);
-
- Group sshKeysGroup = new Group(parent, SWT.NONE);
- sshKeysGroup.setText("SSH Public Keys");
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(sshKeysGroup);
- GridLayoutFactory.fillDefaults()
- .numColumns(2).margins(6, 6).applyTo(sshKeysGroup);
-
- Composite tableContainer = new Composite(sshKeysGroup, SWT.NONE);
- this.viewer = createTable(tableContainer);
- GridDataFactory.fillDefaults()
- .span(1, 5).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(tableContainer);
-
- Button addButton = new Button(sshKeysGroup, SWT.PUSH);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.FILL).applyTo(addButton);
- addButton.setText("Add Existing...");
-
- Button newButton = new Button(sshKeysGroup, SWT.PUSH);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.FILL).applyTo(newButton);
- newButton.setText("New...");
-
- Button removeButton = new Button(sshKeysGroup, SWT.PUSH);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.FILL).applyTo(removeButton);
- removeButton.setText("Remove...");
-
- Composite filler = new Composite(sshKeysGroup, SWT.None);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.FILL).applyTo(filler);
-
- Button refreshButton = new Button(sshKeysGroup, SWT.PUSH);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.END).applyTo(refreshButton);
- refreshButton.setText("Refresh...");
-}
-
- protected TableViewer createTable(Composite tableContainer) {
- Table table =
- new Table(tableContainer, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- this.viewer = new TableViewerBuilder(table, tableContainer)
- .contentProvider(new ArrayContentProvider())
- .column(new IColumnLabelProvider<IOpenShiftSSHKey>() {
-
- @Override
- public String getValue(IOpenShiftSSHKey key) {
- return key.getName();
- }
- })
- .name("Name").align(SWT.LEFT).weight(2).minWidth(200).buildColumn()
- .column(new IColumnLabelProvider<IOpenShiftSSHKey>() {
-
- @Override
- public String getValue(IOpenShiftSSHKey key) {
- return key.getKeyType().getTypeId();
- }
- })
- .name("Type").align(SWT.LEFT).weight(1).minWidth(50).buildColumn()
- .column(new IColumnLabelProvider<IOpenShiftSSHKey>() {
-
- @Override
- public String getValue(IOpenShiftSSHKey key) {
- return StringUtils.shorten(key.getPublicKey(), 24);
- }
- })
- .name("Type").align(SWT.LEFT).weight(4).minWidth(100).buildColumn()
- .buildViewer();
-
- return viewer;
- }
-
- @Override
- protected void onPageActivated(DataBindingContext dbc) {
- try {
- WizardUtils.runInWizard(new Job("Loading ssh keys...") {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- setViewerInput(pageModel.loadSSHKeys());
- pageModel.loadSSHKeys();
- return Status.OK_STATUS;
- } catch (Exception e) {
- clearViewer();
- return OpenShiftUIActivator.createErrorStatus("Could not load ssh keys.", e);
- }
- }
-
- }, getContainer(), getDataBindingContext());
- } catch (Exception e) {
- // ignore
- }
- }
-
- private void clearViewer() {
- setViewerInput(new ArrayList<IOpenShiftSSHKey>());
- }
-
- private void setViewerInput(final Collection<IOpenShiftSSHKey> keys) {
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- viewer.setInput(keys);
- }
- });
- }
-}
\ No newline at end of file
Deleted: 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-17 14:40:42 UTC (rev 43748)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizardPageModel.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.wizard;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
-import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-
-import com.openshift.client.IOpenShiftSSHKey;
-
-/**
- * @author André Dietisheim
- */
-public class ManageSSHKeysWizardPageModel extends ObservableUIPojo {
-
- public static final String PROPERTY_SSH_KEYS = "SSHKeys";
-
- private UserDelegate user;
- private List<IOpenShiftSSHKey> keys = new ArrayList<IOpenShiftSSHKey>();
-
- public ManageSSHKeysWizardPageModel(UserDelegate user) {
- this.user = user;
- }
-
- public List<IOpenShiftSSHKey> loadSSHKeys() {
- return setSSHKeys(user.getSSHKeys());
- }
-
- public List<IOpenShiftSSHKey> getSSHKeys() {
- return keys;
- }
-
- public List<IOpenShiftSSHKey> setSSHKeys(List<IOpenShiftSSHKey> keys) {
- this.keys = keys;
- firePropertyChange(PROPERTY_SSH_KEYS, this.keys, this.keys = keys);
- return this.keys;
- }
-
- public UserDelegate getUser() {
- return user;
- }
-
-}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+
+/**
+ * @author André Dietisheim
+ */
+public class AddSSHKeyWizard extends Wizard {
+
+ private UserDelegate user;
+
+ public AddSSHKeyWizard(UserDelegate user) {
+ this.user = user;
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ public boolean performFinish() {
+ return true;
+ }
+
+ @Override
+ public void addPages() {
+ addPage(new AddSSHKeyWizardPage(user, this));
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+import org.jboss.tools.openshift.express.internal.ui.wizard.AbstractOpenShiftWizardPage;
+
+/**
+ * @author André Dietisheim
+ */
+public class AddSSHKeyWizardPage extends AbstractOpenShiftWizardPage {
+
+ private UserDelegate user;
+
+ public AddSSHKeyWizardPage(UserDelegate user, IWizard wizard) {
+ super("Add existing SSH Key", "Add an exiting SSH key to your OpenShift account",
+ "AddSSHKeysPage", wizard);
+ this.user = user;
+ }
+
+ @Override
+ protected void doCreateControls(Composite parent, DataBindingContext dbc) {
+ GridLayoutFactory.fillDefaults()
+ .margins(10, 10).applyTo(parent);
+
+ Group addSSHKeyGroup = new Group(parent, SWT.NONE);
+ addSSHKeyGroup.setText("Add existing SSH Key");
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(addSSHKeyGroup);
+ GridLayoutFactory.fillDefaults()
+ .numColumns(3).margins(6, 6).applyTo(addSSHKeyGroup);
+
+ Label nameLabel = new Label(addSSHKeyGroup, SWT.NONE);
+ nameLabel.setText("Name:");
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).applyTo(nameLabel);
+
+ Text nameText = new Text(addSSHKeyGroup, SWT.BORDER);
+ nameText.setEditable(false);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(nameText);
+
+ Label fileLabel = new Label(addSSHKeyGroup, SWT.NONE);
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).applyTo(fileLabel);
+ fileLabel.setText("SSH Key:");
+
+ Text fileText = new Text(addSSHKeyGroup, SWT.BORDER);
+ fileText.setEditable(false);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(fileText);
+
+ Button browseButton = new Button(addSSHKeyGroup, SWT.PUSH);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.CENTER).applyTo(browseButton);
+ browseButton.setText("Browse...");
+ }
+}
\ No newline at end of file
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizard.java (from rev 43743, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ManageSSHKeysWizard.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizard.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizard.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+
+/**
+ * @author André Dietisheim
+ */
+public class ManageSSHKeysWizard extends Wizard {
+
+ private UserDelegate user;
+
+ public ManageSSHKeysWizard(UserDelegate user) {
+ this.user = user;
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ public boolean performFinish() {
+ return true;
+ }
+
+ @Override
+ public void addPages() {
+ addPage(new ManageSSHKeysWizardPage(user, this));
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizard.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java (from rev 43743, 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/ssh/ManageSSHKeysWizardPage.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.core.databinding.DataBindingContext;
+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.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.statushandlers.StatusManager;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
+import org.jboss.tools.openshift.express.internal.ui.utils.TableViewerBuilder;
+import org.jboss.tools.openshift.express.internal.ui.utils.TableViewerBuilder.IColumnLabelProvider;
+import org.jboss.tools.openshift.express.internal.ui.utils.UIUpdatingJob;
+import org.jboss.tools.openshift.express.internal.ui.wizard.AbstractOpenShiftWizardPage;
+
+import com.openshift.client.IOpenShiftSSHKey;
+
+/**
+ * @author André Dietisheim
+ */
+public class ManageSSHKeysWizardPage extends AbstractOpenShiftWizardPage {
+
+ private ManageSSHKeysWizardPageModel pageModel;
+ private TableViewer viewer;
+
+ public ManageSSHKeysWizardPage(UserDelegate user, IWizard wizard) {
+ super("Manage SSH Keys", "Manage the SSH keys that are available to your OpenShift account",
+ "ManageSSHKeysPage", wizard);
+ this.pageModel = new ManageSSHKeysWizardPageModel(user);
+ }
+
+ @Override
+ protected void doCreateControls(Composite parent, DataBindingContext dbc) {
+ GridLayoutFactory.fillDefaults().margins(10, 10).applyTo(parent);
+
+ Group sshKeysGroup = new Group(parent, SWT.NONE);
+ sshKeysGroup.setText("SSH Public Keys");
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(sshKeysGroup);
+ GridLayoutFactory.fillDefaults()
+ .numColumns(2).margins(6, 6).applyTo(sshKeysGroup);
+
+ Composite tableContainer = new Composite(sshKeysGroup, SWT.NONE);
+ this.viewer = createTable(tableContainer);
+ GridDataFactory.fillDefaults()
+ .span(1, 5).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(tableContainer);
+
+ Button addButton = new Button(sshKeysGroup, SWT.PUSH);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.FILL).applyTo(addButton);
+ addButton.setText("Add Existing...");
+ addButton.addSelectionListener(onAdd());
+
+ Button newButton = new Button(sshKeysGroup, SWT.PUSH);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.FILL).applyTo(newButton);
+ newButton.setText("New...");
+
+ Button removeButton = new Button(sshKeysGroup, SWT.PUSH);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.FILL).applyTo(removeButton);
+ removeButton.setText("Remove...");
+
+ Composite filler = new Composite(sshKeysGroup, SWT.None);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.FILL).applyTo(filler);
+
+ Button refreshButton = new Button(sshKeysGroup, SWT.PUSH);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.END).applyTo(refreshButton);
+ refreshButton.setText("Refresh...");
+ refreshButton.addSelectionListener(onRefresh());
+ }
+
+ private SelectionListener onAdd() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ WizardUtils.openWizardDialog(new AddSSHKeyWizard(pageModel.getUser()), getShell());
+ }
+ };
+ }
+
+ protected TableViewer createTable(Composite tableContainer) {
+ Table table =
+ new Table(tableContainer, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+ this.viewer = new TableViewerBuilder(table, tableContainer)
+ .contentProvider(new ArrayContentProvider())
+ .column(new IColumnLabelProvider<IOpenShiftSSHKey>() {
+
+ @Override
+ public String getValue(IOpenShiftSSHKey key) {
+ return key.getName();
+ }
+ })
+ .name("Name").align(SWT.LEFT).weight(2).minWidth(200).buildColumn()
+ .column(new IColumnLabelProvider<IOpenShiftSSHKey>() {
+
+ @Override
+ public String getValue(IOpenShiftSSHKey key) {
+ return key.getKeyType().getTypeId();
+ }
+ })
+ .name("Type").align(SWT.LEFT).weight(1).minWidth(50).buildColumn()
+ .column(new IColumnLabelProvider<IOpenShiftSSHKey>() {
+
+ @Override
+ public String getValue(IOpenShiftSSHKey key) {
+ return StringUtils.shorten(key.getPublicKey(), 24);
+ }
+ })
+ .name("Type").align(SWT.LEFT).weight(4).minWidth(100).buildColumn()
+ .buildViewer();
+
+ return viewer;
+ }
+
+ @Override
+ protected void onPageActivated(DataBindingContext dbc) {
+ try {
+ WizardUtils.runInWizard(new Job("Loading ssh keys...") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ setViewerInput(pageModel.loadSSHKeys());
+ pageModel.loadSSHKeys();
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ clearViewer();
+ return OpenShiftUIActivator.createErrorStatus("Could not load ssh keys.", e);
+ }
+ }
+
+ }, getContainer(), getDataBindingContext());
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
+ private SelectionListener onRefresh() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ WizardUtils.runInWizard(new UIUpdatingJob("Refreshing keys...") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ pageModel.getUser().refresh();
+ setViewerInput(pageModel.getUser().getSSHKeys());
+ return Status.OK_STATUS;
+ }
+ }, getContainer());
+ } catch (Exception ex) {
+ StatusManager.getManager().handle(
+ OpenShiftUIActivator.createErrorStatus("Could not refresh keys.", ex), StatusManager.LOG);
+ }
+ }
+
+ };
+ }
+
+ private void clearViewer() {
+ setViewerInput(new ArrayList<IOpenShiftSSHKey>());
+ }
+
+ private void setViewerInput(final Collection<IOpenShiftSSHKey> keys) {
+ getShell().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ viewer.setInput(keys);
+ }
+ });
+ }
+}
\ No newline at end of file
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java (from rev 43743, 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/ssh/ManageSSHKeysWizardPageModel.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java 2012-09-17 14:56:03 UTC (rev 43749)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+
+import com.openshift.client.IOpenShiftSSHKey;
+
+/**
+ * @author André Dietisheim
+ */
+public class ManageSSHKeysWizardPageModel extends ObservableUIPojo {
+
+ public static final String PROPERTY_SSH_KEYS = "SSHKeys";
+
+ private UserDelegate user;
+ private List<IOpenShiftSSHKey> keys = new ArrayList<IOpenShiftSSHKey>();
+
+ public ManageSSHKeysWizardPageModel(UserDelegate user) {
+ this.user = user;
+ }
+
+ public List<IOpenShiftSSHKey> loadSSHKeys() {
+ return setSSHKeys(user.getSSHKeys());
+ }
+
+ public List<IOpenShiftSSHKey> getSSHKeys() {
+ return keys;
+ }
+
+ public List<IOpenShiftSSHKey> setSSHKeys(List<IOpenShiftSSHKey> keys) {
+ this.keys = keys;
+ firePropertyChange(PROPERTY_SSH_KEYS, this.keys, this.keys = keys);
+ return this.keys;
+ }
+
+ public UserDelegate getUser() {
+ return user;
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 6 months