JBoss Tools SVN: r35209 - trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 07:19:56 -0400 (Fri, 30 Sep 2011)
New Revision: 35209
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHPublicKey.java
Log:
[JBIDE-9591] corrected class header
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHPublicKey.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHPublicKey.java 2011-09-30 11:19:44 UTC (rev 35208)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHPublicKey.java 2011-09-30 11:19:56 UTC (rev 35209)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
14 years
JBoss Tools SVN: r35208 - trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 07:19:44 -0400 (Fri, 30 Sep 2011)
New Revision: 35208
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ISSHPublicKey.java
Log:
[JBIDE-9591] corrected class header
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ISSHPublicKey.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ISSHPublicKey.java 2011-09-30 11:19:31 UTC (rev 35207)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ISSHPublicKey.java 2011-09-30 11:19:44 UTC (rev 35208)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
14 years
JBoss Tools SVN: r35207 - trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 07:19:31 -0400 (Fri, 30 Sep 2011)
New Revision: 35207
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IApplication.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IDomain.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IHttpClient.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/InvalidCredentialsOpenshiftException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftEndpointException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKeyPair.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java
Log:
[JBIDE-9591] corrected class header
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/Cartridge.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IApplication.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IApplication.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IApplication.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IDomain.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IDomain.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IDomain.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,6 +1,18 @@
+/*******************************************************************************
+ * 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.ide.eclipse.as.openshift.core;
-
+/**
+ * @author André Dietisheim
+ */
public interface IDomain {
public abstract String getNamespace() throws OpenshiftException;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IHttpClient.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IHttpClient.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IHttpClient.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.core;
import java.util.List;
@@ -27,34 +27,62 @@
public static final String BASE_URL = "https://openshift.redhat.com";
/**
- * the path (url path addition)
+ * The path (url path addition) to the service
*/
public static final String SERVICE_PATH = "/com/broker";
/**
- * returns the url at which the service is reachable.
+ * Returns the url at which the service is reachable.
*
* @return
*/
public String getServiceUrl();
-
+
/**
+ * Returns the url at which the platform is reachable.
+ *
+ * @return
+ */
+ public String getPlatformUrl();
+
+ /**
+ * Returns <code>true</code> if the service is reachable. Returns
+ * <code>false</code> otherwise.
+ *
+ * @return true if the service is reachable.
+ */
+ public boolean isReachable();
+
+ /**
+ * Returns <code>true</code> if the service is reachable and the credentials
+ * are valid. Returns <code>false</code> otherwise.
+ *
+ * @return
+ */
+ public boolean areCredentialsValid();
+
+ /**
* List all cartridges that are available on the Openshift Express platform.
*
- * @param user the user account that shall be used
+ * @param user
+ * the user account that shall be used
* @return the list of cartridges available on the platform
* @throws OpenshiftException
*
* @see InternalUser
*/
- public List<ICartridge> getCartridges(InternalUser user) throws OpenshiftException;
+ public List<ICartridge> getCartridges(InternalUser user) throws OpenshiftException;
/**
- * Creates an application with the given name and cartridge for the given user.
+ * Creates an application with the given name and cartridge for the given
+ * user.
*
- * @param name the application name
- * @param cartridge the cartridge to use
- * @param user the user account
+ * @param name
+ * the application name
+ * @param cartridge
+ * the cartridge to use
+ * @param user
+ * the user account
* @return the application that was created
* @throws OpenshiftException
*
@@ -62,14 +90,19 @@
* @see InternalUser
* @see IApplication
*/
- public IApplication createApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
+ public IApplication createApplication(String name, ICartridge cartridge, InternalUser user)
+ throws OpenshiftException;
/**
- * Destroys the application with the given name and cartridge for the given user.
+ * Destroys the application with the given name and cartridge for the given
+ * user.
*
- * @param name the name of the application that shall be destroyed
- * @param cartridge the cartridge that the application is running on
- * @param user the user account
+ * @param name
+ * the name of the application that shall be destroyed
+ * @param cartridge
+ * the cartridge that the application is running on
+ * @param user
+ * the user account
* @throws OpenshiftException
*
* @see ICartridge
@@ -78,12 +111,16 @@
public void destroyApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
/**
- * Starts the application with the given name and cartridge for the given user account.
- * Starting an application that is already started has no effect.
+ * Starts the application with the given name and cartridge for the given
+ * user account. Starting an application that is already started has no
+ * effect.
*
- * @param name of the application that shall be started
- * @param cartridge the cartridge the application is running on
- * @param user the user account to use
+ * @param name
+ * of the application that shall be started
+ * @param cartridge
+ * the cartridge the application is running on
+ * @param user
+ * the user account to use
* @return the application that was started
* @throws OpenshiftException
*
@@ -91,14 +128,19 @@
* @see InternalUser
* @see IApplication
*/
- public IApplication startApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
-
+ public IApplication startApplication(String name, ICartridge cartridge, InternalUser user)
+ throws OpenshiftException;
+
/**
- * Restarts the application with the given name and cartridge for the given user account.
+ * Restarts the application with the given name and cartridge for the given
+ * user account.
*
- * @param name the name of the application that shall be restarted
- * @param cartridge the cartridge the application is running on
- * @param user the user account to use
+ * @param name
+ * the name of the application that shall be restarted
+ * @param cartridge
+ * the cartridge the application is running on
+ * @param user
+ * the user account to use
* @return the application that was started
* @throws OpenshiftException
*
@@ -106,15 +148,20 @@
* @see InternalUser
* @see IApplication
*/
- public IApplication restartApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
+ public IApplication restartApplication(String name, ICartridge cartridge, InternalUser user)
+ throws OpenshiftException;
/**
- * Stops the application with the given name and cartridge for the given user account. Stopping an application
- * that is already stopped has no effect.
+ * Stops the application with the given name and cartridge for the given
+ * user account. Stopping an application that is already stopped has no
+ * effect.
*
- * @param name the name of the application that shall be restarted
- * @param cartridge the cartridge the application is running on
- * @param user the user account to use
+ * @param name
+ * the name of the application that shall be restarted
+ * @param cartridge
+ * the cartridge the application is running on
+ * @param user
+ * the user account to use
* @return the application that was stopped
* @throws OpenshiftException
*
@@ -125,12 +172,16 @@
public IApplication stopApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
/**
- * Returns the log of the application with the given name and cartridge. Returns the whole log if
- * no new log entry was created since the last call. Returns the new entries otherwise.
+ * Returns the log of the application with the given name and cartridge.
+ * Returns the whole log if no new log entry was created since the last
+ * call. Returns the new entries otherwise.
*
- * @param name of the application that the log shall be returned of
- * @param cartridge the cartridge the application is running on
- * @param user the user account to use
+ * @param name
+ * of the application that the log shall be returned of
+ * @param cartridge
+ * the cartridge the application is running on
+ * @param user
+ * the user account to use
* @return the log of the application
* @throws OpenshiftException
*
@@ -142,9 +193,12 @@
/**
* Changes the current domain (namespace) to the given name.
*
- * @param name the new domain name(-space)
- * @param sshKey the ssh key that shall be used.
- * @param user the user account to use
+ * @param name
+ * the new domain name(-space)
+ * @param sshKey
+ * the ssh key that shall be used.
+ * @param user
+ * the user account to use
* @return the domain that was changed
* @throws OpenshiftException
*
@@ -157,12 +211,16 @@
public IDomain changeDomain(String name, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException;
/**
- * Creates a domain (namespace) with the given name for the given user account with the given ssh public key.
- * If a domain already exists an OpenshiftEndpointException is thrown.
+ * Creates a domain (namespace) with the given name for the given user
+ * account with the given ssh public key. If a domain already exists an
+ * OpenshiftEndpointException is thrown.
*
- * @param name the new domain name(-space)
- * @param sshKey the ssh key that shall be used.
- * @param user the user account to use
+ * @param name
+ * the new domain name(-space)
+ * @param sshKey
+ * the ssh key that shall be used.
+ * @param user
+ * the user account to use
* @return the domain that was changed
* @throws OpenshiftException
*
@@ -175,9 +233,10 @@
public IDomain createDomain(String name, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException;
/**
- * Returns all informations for the given user and its applications.
+ * Returns all informations for the given user and its applications.
*
- * @param user the user account to use
+ * @param user
+ * the user account to use
* @return all user informations (user related info and applications)
* @throws OpenshiftException
*
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/InvalidCredentialsOpenshiftException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/InvalidCredentialsOpenshiftException.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/InvalidCredentialsOpenshiftException.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftEndpointException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftEndpointException.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftEndpointException.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftException.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftException.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKeyPair.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKeyPair.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHKeyPair.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java 2011-09-30 10:39:42 UTC (rev 35206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/User.java 2011-09-30 11:19:31 UTC (rev 35207)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * 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,
14 years
JBoss Tools SVN: r35206 - in trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core: fakes and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 06:39:42 -0400 (Fri, 30 Sep 2011)
New Revision: 35206
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/IOpenshiftTestService.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/OpenshiftTestService.java
trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/ApplicationUtils.java
Log:
[JBIDE-9793] added #getServiceUrl. moved OpenshiftService abd SSHKeyPair to visible package
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationIntegrationTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -17,11 +17,11 @@
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.User;
-import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationUtils;
import org.junit.Before;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderIntegrationTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -21,8 +21,8 @@
import org.jboss.ide.eclipse.as.openshift.core.ApplicationLogReader;
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
-import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationUtils;
import org.junit.Before;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationLogReaderTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -20,9 +20,9 @@
import org.jboss.ide.eclipse.as.openshift.core.ApplicationLogReader;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
-import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.InternalUser;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.NoopOpenshiftServiceFake;
import org.junit.Before;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ApplicationTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -24,10 +24,10 @@
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
import org.jboss.ide.eclipse.as.openshift.core.internal.ApplicationInfo;
import org.jboss.ide.eclipse.as.openshift.core.internal.InternalUser;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.UserInfo;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.ApplicationAction;
import org.jboss.ide.eclipse.as.openshift.core.internal.request.ApplicationRequest;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/CartridgesIntegrationTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -16,8 +16,8 @@
import java.util.List;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.User;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.junit.Before;
import org.junit.Ignore;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/DomainIntegrationTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -14,8 +14,8 @@
import static org.junit.Assert.assertNotNull;
import org.jboss.ide.eclipse.as.openshift.core.IDomain;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.SSHKeyPair;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestSSHKey;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.junit.Before;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/IOpenshiftTestService.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/IOpenshiftTestService.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/IOpenshiftTestService.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.test.internal.core;
-import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
/**
* @author André Dietisheim
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/ListCartridgesIntegrationTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -17,7 +17,7 @@
import java.util.List;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.junit.Before;
import org.junit.Test;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserInfoIntegrationTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -16,11 +16,11 @@
import java.util.List;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.ApplicationInfo;
-import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.UserInfo;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationInfoAsserts;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserIntegrationTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -25,8 +25,8 @@
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftEndpointException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.User;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.TestUser;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.utils.ApplicationUtils;
import org.junit.Before;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserTest.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/UserTest.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -28,9 +28,9 @@
import org.jboss.ide.eclipse.as.openshift.core.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.ApplicationInfo;
import org.jboss.ide.eclipse.as.openshift.core.internal.InternalUser;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.UserInfo;
import org.jboss.ide.eclipse.as.openshift.core.internal.utils.RFC822DateUtils;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes.CartridgeResponseFake;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/OpenshiftTestService.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/OpenshiftTestService.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/fakes/OpenshiftTestService.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.openshift.test.internal.core.fakes;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.test.internal.core.IOpenshiftTestService;
public class OpenshiftTestService extends OpenshiftService implements IOpenshiftTestService {
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/ApplicationUtils.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/ApplicationUtils.java 2011-09-30 10:26:58 UTC (rev 35205)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.openshift.test/src/org/jboss/ide/eclipse/as/openshift/test/internal/core/utils/ApplicationUtils.java 2011-09-30 10:39:42 UTC (rev 35206)
@@ -13,9 +13,9 @@
import org.jboss.ide.eclipse.as.openshift.core.Cartridge;
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.User;
-import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
/**
* @author André Dietisheim
14 years
JBoss Tools SVN: r35205 - in trunk: central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-09-30 06:26:58 -0400 (Fri, 30 Sep 2011)
New Revision: 35205
Added:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesJob.java
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/src/org/jboss/tools/project/examples/cheatsheet/actions/ImportProjectExample.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
Log:
JBIDE-9368 Dashboard(s) for easy news aggregation, twitter and easy additional/3rd party plugin installation and project template/creation
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java 2011-09-30 10:14:12 UTC (rev 35204)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java 2011-09-30 10:26:58 UTC (rev 35205)
@@ -19,9 +19,13 @@
import org.apache.commons.lang.StringEscapeUtils;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.operation.ModalContext;
@@ -60,7 +64,9 @@
import org.jboss.tools.central.actions.JBossRuntimeDetectionPreferencesHandler;
import org.jboss.tools.central.editors.DescriptionToolTip;
import org.jboss.tools.central.model.Tutorial;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.model.IImportProjectExample;
import org.jboss.tools.project.examples.model.Project;
import org.jboss.tools.project.examples.model.ProjectFix;
import org.jboss.tools.runtime.core.RuntimeCoreActivator;
@@ -78,6 +84,7 @@
private ScrolledForm form;
private Composite fixesComposite;
private IProgressMonitor monitor;
+ private Section reqSection;
public ProjectExamplesDialog(Shell parentShell, Tutorial tutorial) {
super(parentShell);
@@ -107,7 +114,7 @@
text.setLayoutData(gd);
descSection.setClient(text);
- Section reqSection = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);
+ reqSection = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);
reqSection.setText("Requirements");
reqSection.setLayout(new GridLayout());
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
@@ -142,6 +149,7 @@
}
fixes = project.getUnsatisfiedFixes();
disposeChildren(fixesComposite);
+ reqSection.setVisible(fixes.size() > 0);
if (fixes.size() > 0) {
for (ProjectFix projectFix : fixes) {
if (ProjectFix.WTP_RUNTIME.equals(projectFix.getType())
@@ -366,7 +374,15 @@
form.reflow(true);
form.redraw();
form.layout(true, true);
+ getShell().pack();
}
+
+ @Override
+ protected void okPressed() {
+ super.okPressed();
+ List<Project> selectedProjects = new ArrayList<Project>();
+ selectedProjects.add(tutorial.getProjectExamples());
+ ProjectExamplesActivator.importProjectExamples(selectedProjects, true);
+ }
-
}
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-09-30 10:14:12 UTC (rev 35204)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-09-30 10:26:58 UTC (rev 35205)
@@ -14,8 +14,10 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.apache.commons.lang.StringEscapeUtils;
import org.eclipse.core.runtime.CoreException;
@@ -91,7 +93,9 @@
import org.jboss.tools.central.model.NewsEntry;
import org.jboss.tools.central.model.Tutorial;
import org.jboss.tools.central.model.TutorialCategory;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectFix;
import org.osgi.framework.Bundle;
/**
@@ -129,6 +133,8 @@
private Composite projectsComposite;
private Composite documentationComposite;
+ private Set<TutorialCategory> expandedCategories = new HashSet<TutorialCategory>();
+
public GettingStartedPage(FormEditor editor) {
super(editor, ID, "Getting Started");
}
@@ -669,15 +675,18 @@
List<TutorialCategory> sortedCategories = new ArrayList<TutorialCategory>();
sortedCategories.addAll(tempCategories);
Collections.sort(sortedCategories);
- for (TutorialCategory category:sortedCategories) {
+ for (final TutorialCategory category:sortedCategories) {
+ int style = ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE;
+ if (expandedCategories.contains(category)) {
+ style|=ExpandableComposite.EXPANDED;
+ }
final ExpandableComposite categoryComposite = toolkit.createExpandableComposite(tutorialsComposite,
- ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE);
+ style);
categoryComposite.setTitleBarForeground(toolkit.getColors().getColor(IFormColors.TB_TOGGLE));
categoryComposite.setText(category.getName());
GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false);
categoryComposite.setLayoutData(gd);
categoryComposite.setLayout(new GridLayout());
-
final Composite composite = toolkit.createComposite(categoryComposite);
gd = new GridData(SWT.FILL, SWT.FILL, false, false);
composite.setLayoutData(gd);
@@ -685,6 +694,11 @@
categoryComposite.addExpansionListener(new ExpansionAdapter() {
public void expansionStateChanged(ExpansionEvent e) {
+ if (e.getState()) {
+ expandedCategories.add(category);
+ } else {
+ expandedCategories.remove(category);
+ }
resize();
}
});
@@ -735,6 +749,14 @@
tutorialText.setText(text , true, false);
Image image;
Project project = tutorial.getProjectExamples();
+ List<ProjectFix> fixes = project.getFixes();
+ List<ProjectFix> unsatisfiedFixes = new ArrayList<ProjectFix>();
+ project.setUnsatisfiedFixes(unsatisfiedFixes);
+ for (ProjectFix fix:fixes) {
+ if (!ProjectExamplesActivator.canFix(project, fix)) {
+ unsatisfiedFixes.add(fix);
+ }
+ }
if (project.getUnsatisfiedFixes().size() > 0) {
image = JBossCentralActivator.getDefault().getImage("/icons/nwarning.gif");
} else {
@@ -748,8 +770,8 @@
Object object = e.data;
if (object instanceof String) {
ProjectExamplesDialog dialog = new ProjectExamplesDialog(getSite().getShell(), tutorial);
-
dialog.open();
+ refreshTutorials();
}
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2011-09-30 10:14:12 UTC (rev 35204)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2011-09-30 10:26:58 UTC (rev 35205)
@@ -20,8 +20,10 @@
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.StringTokenizer;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
@@ -43,17 +45,45 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveRegistry;
+import org.eclipse.ui.IPluginContribution;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPreferenceConstants;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.activities.IActivityManager;
+import org.eclipse.ui.activities.IIdentifier;
+import org.eclipse.ui.activities.IWorkbenchActivitySupport;
+import org.eclipse.ui.activities.WorkbenchActivityHelper;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.internal.IPreferenceConstants;
+import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.cheatsheets.state.DefaultStateManager;
import org.eclipse.ui.internal.cheatsheets.views.CheatSheetView;
import org.eclipse.ui.internal.cheatsheets.views.ViewUtilities;
+import org.eclipse.ui.internal.ide.IDEInternalPreferences;
+import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
+import org.eclipse.ui.internal.util.PrefUtil;
+import org.eclipse.ui.internal.wizards.newresource.ResourceMessages;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.wst.validation.internal.operations.ValidationBuilder;
+import org.jboss.tools.project.examples.dialog.MarkerDialog;
import org.jboss.tools.project.examples.fixes.PluginFix;
import org.jboss.tools.project.examples.fixes.ProjectExamplesFix;
import org.jboss.tools.project.examples.fixes.SeamRuntimeFix;
@@ -63,6 +93,7 @@
import org.jboss.tools.project.examples.model.ProjectFix;
import org.jboss.tools.project.examples.model.ProjectUtil;
import org.jboss.tools.project.examples.wizard.ImportDefaultMavenProjectExample;
+import org.jboss.tools.project.examples.wizard.NewProjectExamplesJob;
import org.osgi.framework.BundleContext;
/**
@@ -460,4 +491,268 @@
return true;
}
+ public static void updatePerspective(List<Project> projects) {
+ if (projects == null || projects.size() != 1) {
+ return;
+ }
+ final String perspectiveId = projects.get(0).getPerspectiveId();
+ if (perspectiveId == null || perspectiveId.length() <= 0) {
+ return;
+ }
+ // Retrieve the new project open perspective preference setting
+ String perspSetting = PrefUtil.getAPIPreferenceStore().getString(
+ IDE.Preferences.PROJECT_OPEN_NEW_PERSPECTIVE);
+
+ String promptSetting = IDEWorkbenchPlugin.getDefault()
+ .getPreferenceStore().getString(
+ IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
+
+ // Return if do not switch perspective setting and are not prompting
+ if (!(promptSetting.equals(MessageDialogWithToggle.PROMPT))
+ && perspSetting.equals(IWorkbenchPreferenceConstants.NO_NEW_PERSPECTIVE)) {
+ return;
+ }
+
+ // Map perspective id to descriptor.
+ IPerspectiveRegistry reg = PlatformUI.getWorkbench()
+ .getPerspectiveRegistry();
+
+ // leave this code in - the perspective of a given project may map to
+ // activities other than those that the wizard itself maps to.
+ final IPerspectiveDescriptor finalPersp = reg
+ .findPerspectiveWithId(perspectiveId);
+ if (finalPersp != null && finalPersp instanceof IPluginContribution) {
+ IPluginContribution contribution = (IPluginContribution) finalPersp;
+ if (contribution.getPluginId() != null) {
+ IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI
+ .getWorkbench().getActivitySupport();
+ IActivityManager activityManager = workbenchActivitySupport
+ .getActivityManager();
+ IIdentifier identifier = activityManager
+ .getIdentifier(WorkbenchActivityHelper
+ .createUnifiedId(contribution));
+ Set idActivities = identifier.getActivityIds();
+
+ if (!idActivities.isEmpty()) {
+ Set enabledIds = new HashSet(activityManager
+ .getEnabledActivityIds());
+
+ if (enabledIds.addAll(idActivities)) {
+ workbenchActivitySupport
+ .setEnabledActivityIds(enabledIds);
+ }
+ }
+ }
+ } else {
+ IDEWorkbenchPlugin.log("Unable to find perspective " //$NON-NLS-1$
+ + perspectiveId
+ + " in NewProjectExamplesWizard.updatePerspective"); //$NON-NLS-1$
+ return;
+ }
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window == null) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ switchPerspective(perspectiveId, finalPersp, win);
+ }
+ });
+ } else {
+ switchPerspective(perspectiveId, finalPersp, window);
+ }
+ }
+
+ private static void switchPerspective(String perspectiveId,
+ IPerspectiveDescriptor finalPersp, IWorkbenchWindow window) {
+ if (window != null) {
+ IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ IPerspectiveDescriptor currentPersp = page.getPerspective();
+ if (currentPersp != null
+ && perspectiveId.equals(currentPersp.getId())) {
+ return;
+ }
+ }
+ }
+
+ if (!confirmPerspectiveSwitch(window, finalPersp)) {
+ return;
+ }
+
+ int workbenchPerspectiveSetting = WorkbenchPlugin.getDefault().getPreferenceStore().getInt(IPreferenceConstants.OPEN_PERSP_MODE);
+
+ if (workbenchPerspectiveSetting == IPreferenceConstants.OPM_NEW_WINDOW) {
+ openInNewWindow(finalPersp);
+ return;
+ }
+
+ replaceCurrentPerspective(finalPersp);
+ }
+
+ /**
+ * Prompts the user for whether to switch perspectives.
+ *
+ * @param window
+ * The workbench window in which to switch perspectives; must not
+ * be <code>null</code>
+ * @param finalPersp
+ * The perspective to switch to; must not be <code>null</code>.
+ *
+ * @return <code>true</code> if it's OK to switch, <code>false</code>
+ * otherwise
+ */
+ private static boolean confirmPerspectiveSwitch(IWorkbenchWindow window,
+ IPerspectiveDescriptor finalPersp) {
+ IPreferenceStore store = IDEWorkbenchPlugin.getDefault()
+ .getPreferenceStore();
+ String pspm = store
+ .getString(IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
+ if (!IDEInternalPreferences.PSPM_PROMPT.equals(pspm)) {
+ // Return whether or not we should always switch
+ return IDEInternalPreferences.PSPM_ALWAYS.equals(pspm);
+ }
+ String desc = finalPersp.getDescription();
+ String message;
+ if (desc == null || desc.length() == 0)
+ message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessage,
+ finalPersp.getLabel());
+ else
+ message = NLS.bind(
+ ResourceMessages.NewProject_perspSwitchMessageWithDesc,
+ new String[] { finalPersp.getLabel(), desc });
+
+ MessageDialogWithToggle dialog = MessageDialogWithToggle
+ .openYesNoQuestion(window.getShell(),
+ ResourceMessages.NewProject_perspSwitchTitle, message,
+ null /* use the default message for the toggle */,
+ false /* toggle is initially unchecked */, store,
+ IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
+ int result = dialog.getReturnCode();
+
+ // If we are not going to prompt anymore propogate the choice.
+ if (dialog.getToggleState()) {
+ String preferenceValue;
+ if (result == IDialogConstants.YES_ID) {
+ // Doesn't matter if it is replace or new window
+ // as we are going to use the open perspective setting
+ preferenceValue = IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE;
+ } else {
+ preferenceValue = IWorkbenchPreferenceConstants.NO_NEW_PERSPECTIVE;
+ }
+
+ // update PROJECT_OPEN_NEW_PERSPECTIVE to correspond
+ PrefUtil.getAPIPreferenceStore().setValue(
+ IDE.Preferences.PROJECT_OPEN_NEW_PERSPECTIVE,
+ preferenceValue);
+ }
+ return result == IDialogConstants.YES_ID;
+ }
+
+ /*
+ * (non-Javadoc) Opens a new window with a particular perspective and input.
+ */
+ private static void openInNewWindow(IPerspectiveDescriptor desc) {
+
+ // Open the page.
+ try {
+ PlatformUI.getWorkbench().openWorkbenchWindow(desc.getId(),
+ ResourcesPlugin.getWorkspace().getRoot());
+ } catch (WorkbenchException e) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow();
+ if (window != null) {
+ ErrorDialog.openError(window.getShell(), ResourceMessages.NewProject_errorOpeningWindow,
+ e.getMessage(), e.getStatus());
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc) Replaces the current perspective with the new one.
+ */
+ private static void replaceCurrentPerspective(IPerspectiveDescriptor persp) {
+
+ // Get the active page.
+ IWorkbenchWindow window = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow();
+ if (window == null) {
+ return;
+ }
+ IWorkbenchPage page = window.getActivePage();
+ if (page == null) {
+ return;
+ }
+
+ // Set the perspective.
+ page.setPerspective(persp);
+ }
+
+ public static void showQuickFix(final List<Project> projects) {
+
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+
+ Shell shell = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell();
+ Dialog dialog = new MarkerDialog(shell, projects);
+ dialog.open();
+ }
+
+ });
+ }
+
+ public static void importProjectExamples(
+ final List<Project> selectedProjects, final boolean showQuickFix) {
+ final NewProjectExamplesJob workspaceJob = new NewProjectExamplesJob(
+ Messages.NewProjectExamplesWizard_Downloading, selectedProjects);
+ workspaceJob.setUser(true);
+ workspaceJob.addJobChangeListener(new IJobChangeListener() {
+
+ public void aboutToRun(IJobChangeEvent event) {
+
+ }
+
+ public void awake(IJobChangeEvent event) {
+
+ }
+
+ public void done(IJobChangeEvent event) {
+ List<Project> projects = workspaceJob.getProjects();
+ try {
+ ProjectExamplesActivator.updatePerspective(projects);
+ ProjectExamplesActivator.waitForBuildAndValidation
+ .schedule();
+ ProjectExamplesActivator.waitForBuildAndValidation.join();
+ } catch (InterruptedException e) {
+ return;
+ }
+ if (showQuickFix && projects != null && projects.size() > 0) {
+ List<IMarker> markers = ProjectExamplesActivator
+ .getMarkers(projects);
+ if (markers != null && markers.size() > 0) {
+ ProjectExamplesActivator.showQuickFix(projects);
+ }
+ }
+ ProjectExamplesActivator.openWelcome(projects);
+ }
+
+ public void running(IJobChangeEvent event) {
+
+ }
+
+ public void scheduled(IJobChangeEvent event) {
+
+ }
+
+ public void sleeping(IJobChangeEvent event) {
+
+ }
+
+ });
+
+ workspaceJob.schedule();
+ }
+
}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesJob.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesJob.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesJob.java 2011-09-30 10:26:58 UTC (rev 35205)
@@ -0,0 +1,90 @@
+package org.jboss.tools.project.examples.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.project.examples.Messages;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.model.IImportProjectExample;
+import org.jboss.tools.project.examples.model.Project;
+
+public class NewProjectExamplesJob extends WorkspaceJob {
+
+ private List<Project> selectedProjects;
+ private List<Project> projects = new ArrayList<Project>();
+
+ public NewProjectExamplesJob(String name, List<Project> selectedProjects) {
+ super(name);
+ this.selectedProjects = selectedProjects;
+ }
+
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor)
+ throws CoreException {
+ projects .clear();
+ for (Project selectedProject : selectedProjects) {
+ boolean success = ProjectExamplesActivator.downloadProject(
+ selectedProject, monitor);
+ if (success) {
+ projects.add(selectedProject);
+ }
+ }
+ try {
+ setName(Messages.NewProjectExamplesWizard_Importing);
+ for (final Project project : projects) {
+ IImportProjectExample importProjectExample =
+ ProjectExamplesActivator.getDefault().getImportProjectExample(project.getImportType());
+ if (importProjectExample == null) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ MessageDialogWithToggle.openError(getShell(),
+ Messages.NewProjectExamplesWizard_Error,
+ "Cannot import a project of the '" + project.getImportType() + "' type.");
+ }
+ });
+ return Status.OK_STATUS;
+ }
+ importProjectExample.importProject(project, project.getFile(), monitor);
+ importProjectExample.fix(project, monitor);
+ }
+ } catch (final Exception e) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ MessageDialogWithToggle.openError(getShell(),
+ Messages.NewProjectExamplesWizard_Error, e.getMessage(), Messages.NewProjectExamplesWizard_Detail, false,
+ ProjectExamplesActivator.getDefault()
+ .getPreferenceStore(),
+ "errorDialog"); //$NON-NLS-1$
+ }
+
+ });
+ ProjectExamplesActivator.log(e);
+ }
+ return Status.OK_STATUS;
+ }
+
+ protected Shell getShell() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window != null) {
+ return window.getShell();
+ }
+ return null;
+ }
+
+ public List<Project> getProjects() {
+ return projects;
+ }
+
+}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2011-09-30 10:14:12 UTC (rev 35204)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2011-09-30 10:26:58 UTC (rev 35205)
@@ -14,82 +14,24 @@
* @author snjeza
*
*/
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.IPluginContribution;
import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPreferenceConstants;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.activities.IActivityManager;
-import org.eclipse.ui.activities.IIdentifier;
-import org.eclipse.ui.activities.IWorkbenchActivitySupport;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-import org.eclipse.ui.browser.IWebBrowser;
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.internal.IPreferenceConstants;
-import org.eclipse.ui.internal.WorkbenchPlugin;
-import org.eclipse.ui.internal.cheatsheets.state.DefaultStateManager;
-import org.eclipse.ui.internal.cheatsheets.views.CheatSheetView;
-import org.eclipse.ui.internal.cheatsheets.views.ViewUtilities;
-import org.eclipse.ui.internal.ide.IDEInternalPreferences;
-import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
-import org.eclipse.ui.internal.util.PrefUtil;
-import org.eclipse.ui.internal.wizards.newresource.ResourceMessages;
-import org.eclipse.ui.wizards.datatransfer.IImportStructureProvider;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
-import org.jboss.tools.project.examples.dialog.MarkerDialog;
-import org.jboss.tools.project.examples.model.IImportProjectExample;
import org.jboss.tools.project.examples.model.Project;
-import org.jboss.tools.project.examples.model.ProjectUtil;
public class NewProjectExamplesWizard extends Wizard implements INewWizard {
private List<Project> projects = new ArrayList<Project>();
private NewProjectExamplesWizardPage page;
-
- private WorkspaceJob workspaceJob;
public NewProjectExamplesWizard() {
super();
@@ -103,338 +45,24 @@
@Override
public boolean performFinish() {
-
+ final List<Project> selectedProjects = new ArrayList<Project>();
if (page.getSelection() == null || page.getSelection().size() <= 0) {
return false;
}
- workspaceJob = new WorkspaceJob(Messages.NewProjectExamplesWizard_Downloading) {
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor)
- throws CoreException {
- IStructuredSelection selection = page.getSelection();
- Iterator iterator = selection.iterator();
- projects.clear();
- while (iterator.hasNext()) {
- Object object = iterator.next();
- if (object instanceof Project) {
- Project project = (Project) object;
- boolean success = ProjectExamplesActivator.downloadProject(project, monitor);
- if (success) {
- projects.add(project);
- }
- }
- }
- try {
- setName(Messages.NewProjectExamplesWizard_Importing);
- for (final Project project : projects) {
- IImportProjectExample importProjectExample =
- ProjectExamplesActivator.getDefault().getImportProjectExample(project.getImportType());
- if (importProjectExample == null) {
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- MessageDialogWithToggle.openError(getShell(),
- Messages.NewProjectExamplesWizard_Error,
- "Cannot import a project of the '" + project.getImportType() + "' type.");
- }
- });
- return Status.OK_STATUS;
- }
- importProjectExample.importProject(project, project.getFile(), monitor);
- importProjectExample.fix(project, monitor);
- }
- } catch (final Exception e) {
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- MessageDialogWithToggle.openError(getShell(),
- Messages.NewProjectExamplesWizard_Error, e.getMessage(), Messages.NewProjectExamplesWizard_Detail, false,
- ProjectExamplesActivator.getDefault()
- .getPreferenceStore(),
- "errorDialog"); //$NON-NLS-1$
- }
-
- });
- ProjectExamplesActivator.log(e);
- }
- return Status.OK_STATUS;
+ IStructuredSelection selection = page.getSelection();
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object object = iterator.next();
+ if (object instanceof Project) {
+ Project project = (Project) object;
+ selectedProjects.add(project);
}
-
- };
- workspaceJob.setUser(true);
- final boolean showQuickFix = page.showQuickFix();
-
- if (showQuickFix) {
- workspaceJob.addJobChangeListener(new IJobChangeListener() {
-
- public void aboutToRun(IJobChangeEvent event) {
-
- }
-
- public void awake(IJobChangeEvent event) {
-
- }
-
- public void done(IJobChangeEvent event) {
- try {
- updatePerspective();
- ProjectExamplesActivator.waitForBuildAndValidation
- .schedule();
- ProjectExamplesActivator.waitForBuildAndValidation
- .join();
- } catch (InterruptedException e) {
- return;
- }
- if (showQuickFix && projects != null && projects.size() > 0) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
-
- }
- List<IMarker> markers = ProjectExamplesActivator
- .getMarkers(projects);
- if (markers != null && markers.size() > 0) {
- showQuickFix(projects);
- }
- }
- ProjectExamplesActivator.openWelcome(projects);
- }
-
- public void running(IJobChangeEvent event) {
-
- }
-
- public void scheduled(IJobChangeEvent event) {
-
- }
-
- public void sleeping(IJobChangeEvent event) {
-
- }
-
- });
- } else {
- updatePerspective();
- ProjectExamplesActivator.openWelcome(projects);
}
- workspaceJob.schedule();
+ ProjectExamplesActivator.importProjectExamples(selectedProjects, page.showQuickFix());
return true;
}
- protected void updatePerspective() {
- if (projects == null || projects.size() != 1) {
- return;
- }
- final String perspectiveId = projects.get(0).getPerspectiveId();
- if (perspectiveId == null || perspectiveId.length() <= 0) {
- return;
- }
- // Retrieve the new project open perspective preference setting
- String perspSetting = PrefUtil.getAPIPreferenceStore().getString(
- IDE.Preferences.PROJECT_OPEN_NEW_PERSPECTIVE);
-
- String promptSetting = IDEWorkbenchPlugin.getDefault()
- .getPreferenceStore().getString(
- IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
-
- // Return if do not switch perspective setting and are not prompting
- if (!(promptSetting.equals(MessageDialogWithToggle.PROMPT))
- && perspSetting.equals(IWorkbenchPreferenceConstants.NO_NEW_PERSPECTIVE)) {
- return;
- }
-
- // Map perspective id to descriptor.
- IPerspectiveRegistry reg = PlatformUI.getWorkbench()
- .getPerspectiveRegistry();
-
- // leave this code in - the perspective of a given project may map to
- // activities other than those that the wizard itself maps to.
- final IPerspectiveDescriptor finalPersp = reg
- .findPerspectiveWithId(perspectiveId);
- if (finalPersp != null && finalPersp instanceof IPluginContribution) {
- IPluginContribution contribution = (IPluginContribution) finalPersp;
- if (contribution.getPluginId() != null) {
- IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI
- .getWorkbench().getActivitySupport();
- IActivityManager activityManager = workbenchActivitySupport
- .getActivityManager();
- IIdentifier identifier = activityManager
- .getIdentifier(WorkbenchActivityHelper
- .createUnifiedId(contribution));
- Set idActivities = identifier.getActivityIds();
-
- if (!idActivities.isEmpty()) {
- Set enabledIds = new HashSet(activityManager
- .getEnabledActivityIds());
-
- if (enabledIds.addAll(idActivities)) {
- workbenchActivitySupport
- .setEnabledActivityIds(enabledIds);
- }
- }
- }
- } else {
- IDEWorkbenchPlugin.log("Unable to find perspective " //$NON-NLS-1$
- + perspectiveId
- + " in NewProjectExamplesWizard.updatePerspective"); //$NON-NLS-1$
- return;
- }
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null) {
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- switchPerspective(perspectiveId, finalPersp, win);
- }
- });
- } else {
- switchPerspective(perspectiveId, finalPersp, window);
- }
- }
-
- private void switchPerspective(String perspectiveId,
- IPerspectiveDescriptor finalPersp, IWorkbenchWindow window) {
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IPerspectiveDescriptor currentPersp = page.getPerspective();
- if (currentPersp != null
- && perspectiveId.equals(currentPersp.getId())) {
- return;
- }
- }
- }
-
- if (!confirmPerspectiveSwitch(window, finalPersp)) {
- return;
- }
-
- int workbenchPerspectiveSetting = WorkbenchPlugin.getDefault().getPreferenceStore().getInt(IPreferenceConstants.OPEN_PERSP_MODE);
-
- if (workbenchPerspectiveSetting == IPreferenceConstants.OPM_NEW_WINDOW) {
- openInNewWindow(finalPersp);
- return;
- }
-
- replaceCurrentPerspective(finalPersp);
- }
-
- /**
- * Prompts the user for whether to switch perspectives.
- *
- * @param window
- * The workbench window in which to switch perspectives; must not
- * be <code>null</code>
- * @param finalPersp
- * The perspective to switch to; must not be <code>null</code>.
- *
- * @return <code>true</code> if it's OK to switch, <code>false</code>
- * otherwise
- */
- private static boolean confirmPerspectiveSwitch(IWorkbenchWindow window,
- IPerspectiveDescriptor finalPersp) {
- IPreferenceStore store = IDEWorkbenchPlugin.getDefault()
- .getPreferenceStore();
- String pspm = store
- .getString(IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
- if (!IDEInternalPreferences.PSPM_PROMPT.equals(pspm)) {
- // Return whether or not we should always switch
- return IDEInternalPreferences.PSPM_ALWAYS.equals(pspm);
- }
- String desc = finalPersp.getDescription();
- String message;
- if (desc == null || desc.length() == 0)
- message = NLS.bind(ResourceMessages.NewProject_perspSwitchMessage,
- finalPersp.getLabel());
- else
- message = NLS.bind(
- ResourceMessages.NewProject_perspSwitchMessageWithDesc,
- new String[] { finalPersp.getLabel(), desc });
-
- MessageDialogWithToggle dialog = MessageDialogWithToggle
- .openYesNoQuestion(window.getShell(),
- ResourceMessages.NewProject_perspSwitchTitle, message,
- null /* use the default message for the toggle */,
- false /* toggle is initially unchecked */, store,
- IDEInternalPreferences.PROJECT_SWITCH_PERSP_MODE);
- int result = dialog.getReturnCode();
-
- // If we are not going to prompt anymore propogate the choice.
- if (dialog.getToggleState()) {
- String preferenceValue;
- if (result == IDialogConstants.YES_ID) {
- // Doesn't matter if it is replace or new window
- // as we are going to use the open perspective setting
- preferenceValue = IWorkbenchPreferenceConstants.OPEN_PERSPECTIVE_REPLACE;
- } else {
- preferenceValue = IWorkbenchPreferenceConstants.NO_NEW_PERSPECTIVE;
- }
-
- // update PROJECT_OPEN_NEW_PERSPECTIVE to correspond
- PrefUtil.getAPIPreferenceStore().setValue(
- IDE.Preferences.PROJECT_OPEN_NEW_PERSPECTIVE,
- preferenceValue);
- }
- return result == IDialogConstants.YES_ID;
- }
-
- /*
- * (non-Javadoc) Opens a new window with a particular perspective and input.
- */
- private static void openInNewWindow(IPerspectiveDescriptor desc) {
-
- // Open the page.
- try {
- PlatformUI.getWorkbench().openWorkbenchWindow(desc.getId(),
- ResourcesPlugin.getWorkspace().getRoot());
- } catch (WorkbenchException e) {
- IWorkbenchWindow window = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow();
- if (window != null) {
- ErrorDialog.openError(window.getShell(), ResourceMessages.NewProject_errorOpeningWindow,
- e.getMessage(), e.getStatus());
- }
- }
- }
-
- /*
- * (non-Javadoc) Replaces the current perspective with the new one.
- */
- private static void replaceCurrentPerspective(IPerspectiveDescriptor persp) {
-
- // Get the active page.
- IWorkbenchWindow window = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow();
- if (window == null) {
- return;
- }
- IWorkbenchPage page = window.getActivePage();
- if (page == null) {
- return;
- }
-
- // Set the perspective.
- page.setPerspective(persp);
- }
-
- public static void showQuickFix(final List<Project> projects) {
-
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
-
- Shell shell = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getShell();
- Dialog dialog = new MarkerDialog(shell, projects);
- dialog.open();
- }
-
- });
- }
-
-
+
public void init(IWorkbench workbench, IStructuredSelection selection) {
initializeDefaultPageImageDescriptor();
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/src/org/jboss/tools/project/examples/cheatsheet/actions/ImportProjectExample.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/src/org/jboss/tools/project/examples/cheatsheet/actions/ImportProjectExample.java 2011-09-30 10:14:12 UTC (rev 35204)
+++ trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/src/org/jboss/tools/project/examples/cheatsheet/actions/ImportProjectExample.java 2011-09-30 10:26:58 UTC (rev 35205)
@@ -107,7 +107,7 @@
List<IMarker> markers = ProjectExamplesActivator
.getMarkers(projects);
if (markers != null && markers.size() > 0) {
- NewProjectExamplesWizard.showQuickFix(projects);
+ ProjectExamplesActivator.showQuickFix(projects);
}
}
14 years
JBoss Tools SVN: r35204 - in trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core: internal and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 06:14:12 -0400 (Fri, 30 Sep 2011)
New Revision: 35204
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHPublicKey.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/SSHPublicKey.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/UserInfo.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/ApplicationResponseUnmarshaller.java
Log:
[JBIDE-9793] added #getServiceUrl. moved OpenshiftService abd SSHKeyPair to visible package
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-30 09:43:53 UTC (rev 35203)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-30 10:14:12 UTC (rev 35204)
@@ -27,11 +27,18 @@
public static final String BASE_URL = "https://openshift.redhat.com";
/**
- * The service base url
+ * the path (url path addition)
*/
- public static final String SERVICE_BASE_URL = BASE_URL + "/com/broker";
+ public static final String SERVICE_PATH = "/com/broker";
/**
+ * returns the url at which the service is reachable.
+ *
+ * @return
+ */
+ public String getServiceUrl();
+
+ /**
* List all cartridges that are available on the Openshift Express platform.
*
* @param user the user account that shall be used
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java (from rev 35203, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java 2011-09-30 10:14:12 UTC (rev 35204)
@@ -0,0 +1,234 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.as.openshift.core;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
+import org.jboss.ide.eclipse.as.openshift.core.internal.InternalUser;
+import org.jboss.ide.eclipse.as.openshift.core.internal.UserInfo;
+import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.HttpClientException;
+import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.UnauthorizedException;
+import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.UrlConnectionHttpClient;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.AbstractDomainRequest;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.ApplicationAction;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.ApplicationRequest;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.ChangeDomainRequest;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.CreateDomainRequest;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.ListCartridgesRequest;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.OpenshiftEnvelopeFactory;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.UserInfoRequest;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.ApplicationRequestJsonMarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.DomainRequestJsonMarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.ListCartridgesRequestJsonMarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.UserInfoRequestJsonMarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.response.OpenshiftResponse;
+import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.ApplicationResponseUnmarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.ApplicationStatusResponseUnmarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.DomainResponseUnmarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.JsonSanitizer;
+import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.ListCartridgesResponseUnmarshaller;
+import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.UserInfoResponseUnmarshaller;
+
+/**
+ * @author André Dietisheim
+ */
+public class OpenshiftService implements IOpenshiftService {
+
+ private String baseUrl;
+
+ public OpenshiftService() {
+ this(BASE_URL);
+ }
+
+ protected OpenshiftService(String baseUrl) {
+ this.baseUrl = baseUrl;
+ }
+
+ public String getServiceUrl() {
+ return baseUrl + SERVICE_PATH;
+ }
+
+ @Override
+ public UserInfo getUserInfo(InternalUser user) throws OpenshiftException {
+ UserInfoRequest request = new UserInfoRequest(user.getRhlogin(), true);
+ String url = request.getUrlString(getServiceUrl());
+ try {
+ String requestString = new UserInfoRequestJsonMarshaller().marshall(request);
+ String openShiftRequestString = new OpenshiftEnvelopeFactory(user.getPassword(), requestString)
+ .createString();
+ String responseString = createHttpClient(url).post(openShiftRequestString);
+ responseString = JsonSanitizer.sanitize(responseString);
+ OpenshiftResponse<UserInfo> response =
+ new UserInfoResponseUnmarshaller().unmarshall(responseString);
+ return response.getOpenshiftObject();
+ } catch (MalformedURLException e) {
+ throw new OpenshiftEndpointException(
+ url, e, "Could not get user info for user \"{0}\" at \"{1}\"", user.getRhlogin(), url, e);
+ } catch (HttpClientException e) {
+ throw new OpenshiftEndpointException(
+ url, e, "Could not get user info for user \"{0}\" at \"{1}\"", user.getRhlogin(), url, e);
+ }
+ }
+
+ @Override
+ public List<ICartridge> getCartridges(InternalUser user) throws OpenshiftException {
+ ListCartridgesRequest listCartridgesRequest = new ListCartridgesRequest(user.getRhlogin(), true);
+ String url = listCartridgesRequest.getUrlString(BASE_URL);
+ try {
+ String listCartridgesRequestString =
+ new ListCartridgesRequestJsonMarshaller().marshall(listCartridgesRequest);
+ String request = new OpenshiftEnvelopeFactory(user.getPassword(), listCartridgesRequestString)
+ .createString();
+ String listCatridgesReponse = createHttpClient(url).post(request);
+ listCatridgesReponse = JsonSanitizer.sanitize(listCatridgesReponse);
+ OpenshiftResponse<List<ICartridge>> response =
+ new ListCartridgesResponseUnmarshaller().unmarshall(listCatridgesReponse);
+ return response.getOpenshiftObject();
+ } catch (MalformedURLException e) {
+ throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
+ } catch (HttpClientException e) {
+ throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
+ }
+ }
+
+ @Override
+ public IDomain createDomain(String name, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException {
+ return requestDomainAction(new CreateDomainRequest(name, sshKey, user.getRhlogin(), true), user);
+ }
+
+ @Override
+ public IDomain changeDomain(String newName, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException {
+ return requestDomainAction(new ChangeDomainRequest(newName, sshKey, user.getRhlogin(), true), user);
+ }
+
+ protected IDomain requestDomainAction(AbstractDomainRequest request, InternalUser user) throws OpenshiftException {
+ String url = request.getUrlString(getServiceUrl());
+ try {
+ String requestString =
+ new OpenshiftEnvelopeFactory(
+ user.getPassword(),
+ new DomainRequestJsonMarshaller().marshall(request))
+ .createString();
+ String responseString = createHttpClient(url).post(requestString);
+ responseString = JsonSanitizer.sanitize(responseString);
+ OpenshiftResponse<IDomain> response =
+ new DomainResponseUnmarshaller(request.getName(), user).unmarshall(responseString);
+ return response.getOpenshiftObject();
+ } catch (MalformedURLException e) {
+ throw new OpenshiftEndpointException(url, e, "Could reach openshift platform at \"{0}\"", url);
+ } catch (HttpClientException e) {
+ throw new OpenshiftEndpointException(url, e, "Could not {0}", request.toHumanReadable());
+ }
+ }
+
+ @Override
+ public Application createApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+ Application application = requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.CONFIGURE,
+ user.getRhlogin(), true), user);
+ return application;
+ }
+
+ @Override
+ public void destroyApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+ IApplication application = requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.DECONFIGURE,
+ user.getRhlogin(), true), user);
+ user.remove(application);
+ }
+
+ @Override
+ public IApplication startApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+ return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.START,
+ user.getRhlogin(), true), user);
+ }
+
+ @Override
+ public IApplication restartApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+ return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.RESTART,
+ user.getRhlogin(), true), user);
+ }
+
+ @Override
+ public IApplication stopApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+ return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.STOP,
+ user.getRhlogin(), true), user);
+ }
+
+ @Override
+ public String getStatus(String applicationName, ICartridge cartridge, InternalUser user) throws OpenshiftException {
+ ApplicationRequest applicationRequest =
+ new ApplicationRequest(applicationName, cartridge, ApplicationAction.STATUS, user.getRhlogin(), true);
+ String url = applicationRequest.getUrlString(getServiceUrl());
+ try {
+ String applicationRequestString =
+ new ApplicationRequestJsonMarshaller().marshall(applicationRequest);
+ String request = new OpenshiftEnvelopeFactory(user.getPassword(), applicationRequestString).createString();
+ String response = createHttpClient(url).post(request);
+
+ response = JsonSanitizer.sanitize(response);
+ OpenshiftResponse<String> openshiftResponse =
+ new ApplicationStatusResponseUnmarshaller().unmarshall(response);
+ return openshiftResponse.getOpenshiftObject();
+ } catch (MalformedURLException e) {
+ throw new OpenshiftException(
+ e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
+ applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
+ } catch (UnauthorizedException e) {
+ throw new InvalidCredentialsOpenshiftException(
+ url, e,
+ "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
+ applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url,
+ user.getRhlogin(), user.getPassword());
+ } catch (HttpClientException e) {
+ throw new OpenshiftEndpointException(
+ url, e, "Could not {0} application \"{1}\" at \"{2}\"",
+ applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
+ }
+ }
+
+ protected Application requestApplicationAction(ApplicationRequest applicationRequest, InternalUser user)
+ throws OpenshiftException {
+ String url = applicationRequest.getUrlString(getServiceUrl());
+ try {
+ String applicationRequestString =
+ new ApplicationRequestJsonMarshaller().marshall(applicationRequest);
+ String request = new OpenshiftEnvelopeFactory(user.getPassword(), applicationRequestString).createString();
+ String response = createHttpClient(url).post(request);
+
+ response = JsonSanitizer.sanitize(response);
+ OpenshiftResponse<Application> openshiftResponse =
+ new ApplicationResponseUnmarshaller(applicationRequest.getName(),
+ applicationRequest.getCartridge(), user, this).unmarshall(response);
+ return openshiftResponse.getOpenshiftObject();
+ } catch (MalformedURLException e) {
+ throw new OpenshiftException(
+ e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
+ applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
+ } catch (UnauthorizedException e) {
+ throw new InvalidCredentialsOpenshiftException(
+ url, e,
+ "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
+ applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url,
+ user.getRhlogin(),
+ user.getPassword());
+ } catch (HttpClientException e) {
+ throw new OpenshiftEndpointException(
+ url, e, "Could not {0} application \"{1}\" at \"{2}\"",
+ applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
+ }
+ }
+
+ private IHttpClient createHttpClient(String url) throws MalformedURLException {
+ return new UrlConnectionHttpClient(new URL(url));
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/OpenshiftService.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHPublicKey.java (from rev 35151, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/SSHPublicKey.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHPublicKey.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHPublicKey.java 2011-09-30 10:14:12 UTC (rev 35204)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.as.openshift.core;
+
+
+/**
+ * @author André Dietisheim
+ */
+public class SSHPublicKey implements ISSHPublicKey {
+
+ private String publicKey;
+
+ public SSHPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ void update(String publicKey) {
+ }
+
+ public void update(ISSHPublicKey sshPublicKey) throws OpenshiftException {
+ this.publicKey = sshPublicKey.getPublicKey();
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/SSHPublicKey.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java 2011-09-30 09:43:53 UTC (rev 35203)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java 2011-09-30 10:14:12 UTC (rev 35204)
@@ -22,6 +22,7 @@
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.IUser;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
/**
* @author André Dietisheim
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-30 09:43:53 UTC (rev 35203)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-30 10:14:12 UTC (rev 35204)
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.ide.eclipse.as.openshift.core.internal;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.ide.eclipse.as.openshift.core.IApplication;
-import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
-import org.jboss.ide.eclipse.as.openshift.core.IDomain;
-import org.jboss.ide.eclipse.as.openshift.core.IHttpClient;
-import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
-import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
-import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
-import org.jboss.ide.eclipse.as.openshift.core.OpenshiftEndpointException;
-import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
-import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.HttpClientException;
-import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.UnauthorizedException;
-import org.jboss.ide.eclipse.as.openshift.core.internal.httpclient.UrlConnectionHttpClient;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.AbstractDomainRequest;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.ApplicationAction;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.ApplicationRequest;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.ChangeDomainRequest;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.CreateDomainRequest;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.ListCartridgesRequest;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.OpenshiftEnvelopeFactory;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.UserInfoRequest;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.ApplicationRequestJsonMarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.DomainRequestJsonMarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.ListCartridgesRequestJsonMarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.request.marshalling.UserInfoRequestJsonMarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.response.OpenshiftResponse;
-import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.ApplicationResponseUnmarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.ApplicationStatusResponseUnmarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.DomainResponseUnmarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.JsonSanitizer;
-import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.ListCartridgesResponseUnmarshaller;
-import org.jboss.ide.eclipse.as.openshift.core.internal.response.unmarshalling.UserInfoResponseUnmarshaller;
-
-/**
- * @author André Dietisheim
- */
-public class OpenshiftService implements IOpenshiftService {
-
- private String baseUrl;
-
- public OpenshiftService() {
- this(BASE_URL);
- }
-
- protected OpenshiftService(String baseUrl) {
- this.baseUrl = baseUrl;
- }
-
- @Override
- public UserInfo getUserInfo(InternalUser user) throws OpenshiftException {
- UserInfoRequest request = new UserInfoRequest(user.getRhlogin(), true);
- String url = request.getUrlString(baseUrl);
- try {
- String requestString = new UserInfoRequestJsonMarshaller().marshall(request);
- String openShiftRequestString = new OpenshiftEnvelopeFactory(user.getPassword(), requestString)
- .createString();
- String responseString = createHttpClient(url).post(openShiftRequestString);
- responseString = JsonSanitizer.sanitize(responseString);
- OpenshiftResponse<UserInfo> response =
- new UserInfoResponseUnmarshaller().unmarshall(responseString);
- return response.getOpenshiftObject();
- } catch (MalformedURLException e) {
- throw new OpenshiftEndpointException(
- url, e, "Could not get user info for user \"{0}\" at \"{1}\"", user.getRhlogin(), url, e);
- } catch (HttpClientException e) {
- throw new OpenshiftEndpointException(
- url, e, "Could not get user info for user \"{0}\" at \"{1}\"", user.getRhlogin(), url, e);
- }
- }
-
- @Override
- public List<ICartridge> getCartridges(InternalUser user) throws OpenshiftException {
- ListCartridgesRequest listCartridgesRequest = new ListCartridgesRequest(user.getRhlogin(), true);
- String url = listCartridgesRequest.getUrlString(BASE_URL);
- try {
- String listCartridgesRequestString =
- new ListCartridgesRequestJsonMarshaller().marshall(listCartridgesRequest);
- String request = new OpenshiftEnvelopeFactory(user.getPassword(), listCartridgesRequestString)
- .createString();
- String listCatridgesReponse = createHttpClient(url).post(request);
- listCatridgesReponse = JsonSanitizer.sanitize(listCatridgesReponse);
- OpenshiftResponse<List<ICartridge>> response =
- new ListCartridgesResponseUnmarshaller().unmarshall(listCatridgesReponse);
- return response.getOpenshiftObject();
- } catch (MalformedURLException e) {
- throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
- } catch (HttpClientException e) {
- throw new OpenshiftEndpointException(url, e, "Could not list available cartridges at \"{0}\"", url);
- }
- }
-
- @Override
- public IDomain createDomain(String name, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException {
- return requestDomainAction(new CreateDomainRequest(name, sshKey, user.getRhlogin(), true), user);
- }
-
- @Override
- public IDomain changeDomain(String newName, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException {
- return requestDomainAction(new ChangeDomainRequest(newName, sshKey, user.getRhlogin(), true), user);
- }
-
- protected IDomain requestDomainAction(AbstractDomainRequest request, InternalUser user) throws OpenshiftException {
- String url = request.getUrlString(baseUrl);
- try {
- String requestString =
- new OpenshiftEnvelopeFactory(
- user.getPassword(),
- new DomainRequestJsonMarshaller().marshall(request))
- .createString();
- String responseString = createHttpClient(url).post(requestString);
- responseString = JsonSanitizer.sanitize(responseString);
- OpenshiftResponse<IDomain> response =
- new DomainResponseUnmarshaller(request.getName(), user).unmarshall(responseString);
- return response.getOpenshiftObject();
- } catch (MalformedURLException e) {
- throw new OpenshiftEndpointException(url, e, "Could reach openshift platform at \"{0}\"", url);
- } catch (HttpClientException e) {
- throw new OpenshiftEndpointException(url, e, "Could not {0}", request.toHumanReadable());
- }
- }
-
- @Override
- public Application createApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
- Application application = requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.CONFIGURE,
- user.getRhlogin(), true), user);
- return application;
- }
-
- @Override
- public void destroyApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
- IApplication application = requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.DECONFIGURE,
- user.getRhlogin(), true), user);
- user.remove(application);
- }
-
- @Override
- public IApplication startApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
- return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.START,
- user.getRhlogin(), true), user);
- }
-
- @Override
- public IApplication restartApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
- return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.RESTART,
- user.getRhlogin(), true), user);
- }
-
- @Override
- public IApplication stopApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException {
- return requestApplicationAction(new ApplicationRequest(name, cartridge, ApplicationAction.STOP,
- user.getRhlogin(), true), user);
- }
-
- @Override
- public String getStatus(String applicationName, ICartridge cartridge, InternalUser user) throws OpenshiftException {
- ApplicationRequest applicationRequest =
- new ApplicationRequest(applicationName, cartridge, ApplicationAction.STATUS, user.getRhlogin(), true);
- String url = applicationRequest.getUrlString(baseUrl);
- try {
- String applicationRequestString =
- new ApplicationRequestJsonMarshaller().marshall(applicationRequest);
- String request = new OpenshiftEnvelopeFactory(user.getPassword(), applicationRequestString).createString();
- String response = createHttpClient(url).post(request);
-
- response = JsonSanitizer.sanitize(response);
- OpenshiftResponse<String> openshiftResponse =
- new ApplicationStatusResponseUnmarshaller().unmarshall(response);
- return openshiftResponse.getOpenshiftObject();
- } catch (MalformedURLException e) {
- throw new OpenshiftException(
- e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
- applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
- } catch (UnauthorizedException e) {
- throw new InvalidCredentialsOpenshiftException(
- url, e,
- "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
- applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url,
- user.getRhlogin(), user.getPassword());
- } catch (HttpClientException e) {
- throw new OpenshiftEndpointException(
- url, e, "Could not {0} application \"{1}\" at \"{2}\"",
- applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
- }
- }
-
- protected Application requestApplicationAction(ApplicationRequest applicationRequest, InternalUser user)
- throws OpenshiftException {
- String url = applicationRequest.getUrlString(baseUrl);
- try {
- String applicationRequestString =
- new ApplicationRequestJsonMarshaller().marshall(applicationRequest);
- String request = new OpenshiftEnvelopeFactory(user.getPassword(), applicationRequestString).createString();
- String response = createHttpClient(url).post(request);
-
- response = JsonSanitizer.sanitize(response);
- OpenshiftResponse<Application> openshiftResponse =
- new ApplicationResponseUnmarshaller(applicationRequest.getName(),
- applicationRequest.getCartridge(), user, this).unmarshall(response);
- return openshiftResponse.getOpenshiftObject();
- } catch (MalformedURLException e) {
- throw new OpenshiftException(
- e, "Could not {0} application \"{1}\" at \"{2}\": Invalid url \"{2}\"",
- applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
- } catch (UnauthorizedException e) {
- throw new InvalidCredentialsOpenshiftException(
- url, e,
- "Could not {0} application \"{1}\" at \"{2}\": Invalid credentials user \"{3}\", password \"{4}\"",
- applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url,
- user.getRhlogin(),
- user.getPassword());
- } catch (HttpClientException e) {
- throw new OpenshiftEndpointException(
- url, e, "Could not {0} application \"{1}\" at \"{2}\"",
- applicationRequest.getAction().toHumanReadable(), applicationRequest.getName(), url);
- }
- }
-
- private IHttpClient createHttpClient(String url) throws MalformedURLException {
- return new UrlConnectionHttpClient(new URL(url));
- }
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/SSHPublicKey.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/SSHPublicKey.java 2011-09-30 09:43:53 UTC (rev 35203)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/SSHPublicKey.java 2011-09-30 10:14:12 UTC (rev 35204)
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.ide.eclipse.as.openshift.core.internal;
-
-import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
-import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
-
-/**
- * @author André Dietisheim
- */
-public class SSHPublicKey implements ISSHPublicKey {
-
- private String publicKey;
-
- public SSHPublicKey(String publicKey) {
- this.publicKey = publicKey;
- }
-
- public String getPublicKey() {
- return publicKey;
- }
-
- void update(String publicKey) {
- }
-
- public void update(ISSHPublicKey sshPublicKey) throws OpenshiftException {
- this.publicKey = sshPublicKey.getPublicKey();
- }
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/UserInfo.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/UserInfo.java 2011-09-30 09:43:53 UTC (rev 35203)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/UserInfo.java 2011-09-30 10:14:12 UTC (rev 35204)
@@ -12,7 +12,9 @@
import java.util.List;
+import org.jboss.ide.eclipse.as.openshift.core.SSHPublicKey;
+
/**
* @author André Dietisheim
*/
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/ApplicationResponseUnmarshaller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/ApplicationResponseUnmarshaller.java 2011-09-30 09:43:53 UTC (rev 35203)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/response/unmarshalling/ApplicationResponseUnmarshaller.java 2011-09-30 10:14:12 UTC (rev 35204)
@@ -12,8 +12,8 @@
import org.jboss.dmr.ModelNode;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
+import org.jboss.ide.eclipse.as.openshift.core.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
-import org.jboss.ide.eclipse.as.openshift.core.internal.OpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.InternalUser;
/**
14 years
JBoss Tools SVN: r35203 - in trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core: internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 05:43:53 -0400 (Fri, 30 Sep 2011)
New Revision: 35203
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IOpenshiftService.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java
trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
Log:
[JBIDE-9793] moved IOpenshiftService to visible package
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java 2011-09-30 09:14:58 UTC (rev 35202)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/ApplicationLogReader.java 2011-09-30 09:43:53 UTC (rev 35203)
@@ -17,7 +17,6 @@
import java.util.regex.Pattern;
import org.jboss.ide.eclipse.as.openshift.core.internal.Application;
-import org.jboss.ide.eclipse.as.openshift.core.internal.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.internal.InternalUser;
/**
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java (from rev 35151, trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IOpenshiftService.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java 2011-09-30 09:43:53 UTC (rev 35203)
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.as.openshift.core;
+
+import java.util.List;
+
+import org.jboss.ide.eclipse.as.openshift.core.internal.ApplicationInfo;
+import org.jboss.ide.eclipse.as.openshift.core.internal.InternalUser;
+import org.jboss.ide.eclipse.as.openshift.core.internal.UserInfo;
+
+/**
+ * @author André Dietisheim
+ */
+public interface IOpenshiftService {
+
+ /**
+ * The platform base url
+ */
+ public static final String BASE_URL = "https://openshift.redhat.com";
+
+ /**
+ * The service base url
+ */
+ public static final String SERVICE_BASE_URL = BASE_URL + "/com/broker";
+
+ /**
+ * List all cartridges that are available on the Openshift Express platform.
+ *
+ * @param user the user account that shall be used
+ * @return the list of cartridges available on the platform
+ * @throws OpenshiftException
+ *
+ * @see InternalUser
+ */
+ public List<ICartridge> getCartridges(InternalUser user) throws OpenshiftException;
+
+ /**
+ * Creates an application with the given name and cartridge for the given user.
+ *
+ * @param name the application name
+ * @param cartridge the cartridge to use
+ * @param user the user account
+ * @return the application that was created
+ * @throws OpenshiftException
+ *
+ * @see ICartridge
+ * @see InternalUser
+ * @see IApplication
+ */
+ public IApplication createApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
+
+ /**
+ * Destroys the application with the given name and cartridge for the given user.
+ *
+ * @param name the name of the application that shall be destroyed
+ * @param cartridge the cartridge that the application is running on
+ * @param user the user account
+ * @throws OpenshiftException
+ *
+ * @see ICartridge
+ * @see InternalUser
+ */
+ public void destroyApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
+
+ /**
+ * Starts the application with the given name and cartridge for the given user account.
+ * Starting an application that is already started has no effect.
+ *
+ * @param name of the application that shall be started
+ * @param cartridge the cartridge the application is running on
+ * @param user the user account to use
+ * @return the application that was started
+ * @throws OpenshiftException
+ *
+ * @see ICartridge
+ * @see InternalUser
+ * @see IApplication
+ */
+ public IApplication startApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
+
+ /**
+ * Restarts the application with the given name and cartridge for the given user account.
+ *
+ * @param name the name of the application that shall be restarted
+ * @param cartridge the cartridge the application is running on
+ * @param user the user account to use
+ * @return the application that was started
+ * @throws OpenshiftException
+ *
+ * @see ICartridge
+ * @see InternalUser
+ * @see IApplication
+ */
+ public IApplication restartApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
+
+ /**
+ * Stops the application with the given name and cartridge for the given user account. Stopping an application
+ * that is already stopped has no effect.
+ *
+ * @param name the name of the application that shall be restarted
+ * @param cartridge the cartridge the application is running on
+ * @param user the user account to use
+ * @return the application that was stopped
+ * @throws OpenshiftException
+ *
+ * @see ICartridge
+ * @see InternalUser
+ * @see IApplication
+ */
+ public IApplication stopApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
+
+ /**
+ * Returns the log of the application with the given name and cartridge. Returns the whole log if
+ * no new log entry was created since the last call. Returns the new entries otherwise.
+ *
+ * @param name of the application that the log shall be returned of
+ * @param cartridge the cartridge the application is running on
+ * @param user the user account to use
+ * @return the log of the application
+ * @throws OpenshiftException
+ *
+ * @see ICartridge
+ * @see InternalUser
+ */
+ public String getStatus(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
+
+ /**
+ * Changes the current domain (namespace) to the given name.
+ *
+ * @param name the new domain name(-space)
+ * @param sshKey the ssh key that shall be used.
+ * @param user the user account to use
+ * @return the domain that was changed
+ * @throws OpenshiftException
+ *
+ * @see ICartridge
+ * @see InternalUser
+ * @see SSHKeyPair
+ * @see ISSHPublicKey
+ * @see IDomain
+ */
+ public IDomain changeDomain(String name, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException;
+
+ /**
+ * Creates a domain (namespace) with the given name for the given user account with the given ssh public key.
+ * If a domain already exists an OpenshiftEndpointException is thrown.
+ *
+ * @param name the new domain name(-space)
+ * @param sshKey the ssh key that shall be used.
+ * @param user the user account to use
+ * @return the domain that was changed
+ * @throws OpenshiftException
+ *
+ * @see ICartridge
+ * @see InternalUser
+ * @see SSHKeyPair
+ * @see ISSHPublicKey
+ * @see IDomain
+ */
+ public IDomain createDomain(String name, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException;
+
+ /**
+ * Returns all informations for the given user and its applications.
+ *
+ * @param user the user account to use
+ * @return all user informations (user related info and applications)
+ * @throws OpenshiftException
+ *
+ * @see InternalUser
+ * @see InternalUserInfo
+ * @see ApplicationInfo
+ */
+ public UserInfo getUserInfo(InternalUser user) throws OpenshiftException;
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/IOpenshiftService.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java 2011-09-30 09:14:58 UTC (rev 35202)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/Application.java 2011-09-30 09:43:53 UTC (rev 35203)
@@ -17,6 +17,7 @@
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.IDomain;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
/**
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IOpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IOpenshiftService.java 2011-09-30 09:14:58 UTC (rev 35202)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/IOpenshiftService.java 2011-09-30 09:43:53 UTC (rev 35203)
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.ide.eclipse.as.openshift.core.internal;
-
-import java.util.List;
-
-import org.jboss.ide.eclipse.as.openshift.core.IApplication;
-import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
-import org.jboss.ide.eclipse.as.openshift.core.IDomain;
-import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
-import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
-
-/**
- * @author André Dietisheim
- */
-public interface IOpenshiftService {
-
- public static final String BASE_URL = "https://openshift.redhat.com/broker";
-
- /**
- * List all cartridges that are available on the Openshift Express platform.
- *
- * @param user the user account that shall be used
- * @return the list of cartridges available on the platform
- * @throws OpenshiftException
- *
- * @see InternalUser
- */
- public List<ICartridge> getCartridges(InternalUser user) throws OpenshiftException;
-
- /**
- * Creates an application with the given name and cartridge for the given user.
- *
- * @param name the application name
- * @param cartridge the cartridge to use
- * @param user the user account
- * @return the application that was created
- * @throws OpenshiftException
- *
- * @see ICartridge
- * @see InternalUser
- * @see IApplication
- */
- public IApplication createApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
-
- /**
- * Destroys the application with the given name and cartridge for the given user.
- *
- * @param name the name of the application that shall be destroyed
- * @param cartridge the cartridge that the application is running on
- * @param user the user account
- * @throws OpenshiftException
- *
- * @see ICartridge
- * @see InternalUser
- */
- public void destroyApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
-
- /**
- * Starts the application with the given name and cartridge for the given user account.
- * Starting an application that is already started has no effect.
- *
- * @param name of the application that shall be started
- * @param cartridge the cartridge the application is running on
- * @param user the user account to use
- * @return the application that was started
- * @throws OpenshiftException
- *
- * @see ICartridge
- * @see InternalUser
- * @see IApplication
- */
- public IApplication startApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
-
- /**
- * Restarts the application with the given name and cartridge for the given user account.
- *
- * @param name the name of the application that shall be restarted
- * @param cartridge the cartridge the application is running on
- * @param user the user account to use
- * @return the application that was started
- * @throws OpenshiftException
- *
- * @see ICartridge
- * @see InternalUser
- * @see IApplication
- */
- public IApplication restartApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
-
- /**
- * Stops the application with the given name and cartridge for the given user account. Stopping an application
- * that is already stopped has no effect.
- *
- * @param name the name of the application that shall be restarted
- * @param cartridge the cartridge the application is running on
- * @param user the user account to use
- * @return the application that was stopped
- * @throws OpenshiftException
- *
- * @see ICartridge
- * @see InternalUser
- * @see IApplication
- */
- public IApplication stopApplication(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
-
- /**
- * Returns the log of the application with the given name and cartridge. Returns the whole log if
- * no new log entry was created since the last call. Returns the new entries otherwise.
- *
- * @param name of the application that the log shall be returned of
- * @param cartridge the cartridge the application is running on
- * @param user the user account to use
- * @return the log of the application
- * @throws OpenshiftException
- *
- * @see ICartridge
- * @see InternalUser
- */
- public String getStatus(String name, ICartridge cartridge, InternalUser user) throws OpenshiftException;
-
- /**
- * Changes the current domain (namespace) to the given name.
- *
- * @param name the new domain name(-space)
- * @param sshKey the ssh key that shall be used.
- * @param user the user account to use
- * @return the domain that was changed
- * @throws OpenshiftException
- *
- * @see ICartridge
- * @see InternalUser
- * @see SSHKeyPair
- * @see ISSHPublicKey
- * @see IDomain
- */
- public IDomain changeDomain(String name, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException;
-
- /**
- * Creates a domain (namespace) with the given name for the given user account with the given ssh public key.
- * If a domain already exists an OpenshiftEndpointException is thrown.
- *
- * @param name the new domain name(-space)
- * @param sshKey the ssh key that shall be used.
- * @param user the user account to use
- * @return the domain that was changed
- * @throws OpenshiftException
- *
- * @see ICartridge
- * @see InternalUser
- * @see SSHKeyPair
- * @see ISSHPublicKey
- * @see IDomain
- */
- public IDomain createDomain(String name, ISSHPublicKey sshKey, InternalUser user) throws OpenshiftException;
-
- /**
- * Returns all informations for the given user and its applications.
- *
- * @param user the user account to use
- * @return all user informations (user related info and applications)
- * @throws OpenshiftException
- *
- * @see InternalUser
- * @see UserInfo
- * @see ApplicationInfo
- */
- public UserInfo getUserInfo(InternalUser user) throws OpenshiftException;
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java 2011-09-30 09:14:58 UTC (rev 35202)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/InternalUser.java 2011-09-30 09:43:53 UTC (rev 35203)
@@ -18,6 +18,7 @@
import org.jboss.ide.eclipse.as.openshift.core.IApplication;
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.IDomain;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.IUser;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftException;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-30 09:14:58 UTC (rev 35202)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.openshift.core/src/org/jboss/ide/eclipse/as/openshift/core/internal/OpenshiftService.java 2011-09-30 09:43:53 UTC (rev 35203)
@@ -18,6 +18,7 @@
import org.jboss.ide.eclipse.as.openshift.core.ICartridge;
import org.jboss.ide.eclipse.as.openshift.core.IDomain;
import org.jboss.ide.eclipse.as.openshift.core.IHttpClient;
+import org.jboss.ide.eclipse.as.openshift.core.IOpenshiftService;
import org.jboss.ide.eclipse.as.openshift.core.ISSHPublicKey;
import org.jboss.ide.eclipse.as.openshift.core.InvalidCredentialsOpenshiftException;
import org.jboss.ide.eclipse.as.openshift.core.OpenshiftEndpointException;
14 years
JBoss Tools SVN: r35202 - in trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui: databinding and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 05:14:58 -0400 (Fri, 30 Sep 2011)
New Revision: 35202
Added:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringChecker.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringValidator.java
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIMessages.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
Log:
[JBIDE-9793] implemented simplified url validation
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIMessages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIMessages.java 2011-09-30 08:53:08 UTC (rev 35201)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIMessages.java 2011-09-30 09:14:58 UTC (rev 35202)
@@ -70,6 +70,8 @@
public static String BROWSER_COULD_NOT_DISPLAY_MALFORMED_URL;
+ public static String URLSTRINGVALIDATOR_NOT_A_VALID_URL;
+
static {
NLS.initializeMessages(BUNDLE_NAME, CommonUIMessages.class);
}
Added: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringChecker.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringChecker.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringChecker.java 2011-09-30 09:14:58 UTC (rev 35202)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.common.ui.databinding;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author André Dietisheim
+ */
+public class SimpleUrlStringChecker {
+
+ private static final Pattern simpleUrlPattern = Pattern.compile(".+://[^\\.]+\\.[^\\.]+(\\.[^\\.]+){0,1}");
+ private String url;
+
+ public SimpleUrlStringChecker(String url) {
+ this.url = url;
+ }
+
+ public boolean isValid() {
+ return simpleUrlPattern.matcher(url).matches();
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringChecker.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringValidator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringValidator.java 2011-09-30 09:14:58 UTC (rev 35202)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.common.ui.databinding;
+
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.ui.CommonUIMessages;
+
+/**
+ * A {@link IValidator} that validates ok if the string it shall validate is not
+ * empty.
+ */
+public class SimpleUrlStringValidator implements IValidator {
+
+ /**
+ *
+ * validates the given url string. Validation passes only if the given value
+ * is not <tt>null</tt> and is a valid url. The url check is done on a
+ * simplified regex.
+ *
+ * @see SimpleUrlStringChecker#isValid()
+ *
+ */
+ public IStatus validate(Object value) {
+ if (!(value instanceof String
+ && new SimpleUrlStringChecker((String) value).isValid())) {
+ return ValidationStatus
+ .error(NLS.bind(CommonUIMessages.URLSTRINGVALIDATOR_NOT_A_VALID_URL, (String) value));
+ }
+ return ValidationStatus.ok();
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/SimpleUrlStringValidator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java 2011-09-30 08:53:08 UTC (rev 35201)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java 2011-09-30 09:14:58 UTC (rev 35202)
@@ -12,7 +12,6 @@
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.regex.Pattern;
import org.eclipse.core.databinding.conversion.Converter;
@@ -25,7 +24,6 @@
*/
public class UrlString2BooleanConverter extends Converter {
- private static final Pattern simpleUrlPattern = Pattern.compile(".+://[^\\.]+\\.[^\\.]+(\\.[^\\.]+){0,1}");
public UrlString2BooleanConverter() {
super(String.class, Boolean.class);
@@ -42,7 +40,7 @@
private URL toUrl(String url) {
try {
- if (!simpleUrlPattern.matcher(url).matches()) {
+ if (!new SimpleUrlStringChecker(url).isValid()) {
return null;
}
return new URL(url);
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-09-30 08:53:08 UTC (rev 35201)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-09-30 09:14:58 UTC (rev 35202)
@@ -28,4 +28,6 @@
BUTTON_REMOVE=Remove
BROWSER_COULD_NOT_OPEN_BROWSER=Could not open browser for url \"{0}\".
-BROWSER_COULD_NOT_DISPLAY_MALFORMED_URL=Could not display malformed url \"{0}\".
\ No newline at end of file
+BROWSER_COULD_NOT_DISPLAY_MALFORMED_URL=Could not display malformed url \"{0}\".
+
+URLSTRINGVALIDATOR_NOT_A_VALID_URL=\"{0}\" is not a valid url.
\ No newline at end of file
14 years
JBoss Tools SVN: r35201 - in trunk: common/plugins/org.jboss.tools.common/src/org/jboss/tools/common and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 04:53:08 -0400 (Fri, 30 Sep 2011)
New Revision: 35201
Added:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/MandatoryStringValidator.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ObservableUIPojo.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/databinding/
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/databinding/ObservablePojo.java
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/internal/deltacloud/core/observable/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/ObservableUIPojo.java
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/META-INF/MANIFEST.MF
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPageModel.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPageModel.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
Log:
[JBIDE-9805] moved ObservablePojo and ObservableUIPojo to org.jboss.tools.common and org.jboss.tools.common.ui
Modified: trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2011-09-30 08:44:47 UTC (rev 35200)
+++ trunk/common/plugins/org.jboss.tools.common/META-INF/MANIFEST.MF 2011-09-30 08:53:08 UTC (rev 35201)
@@ -6,6 +6,7 @@
Bundle-SymbolicName: org.jboss.tools.common;singleton:=true
Bundle-Localization: plugin
Export-Package: org.jboss.tools.common,
+ org.jboss.tools.common.databinding,
org.jboss.tools.common.java,
org.jboss.tools.common.java.impl,
org.jboss.tools.common.jobs,
Added: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/databinding/ObservablePojo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/databinding/ObservablePojo.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/databinding/ObservablePojo.java 2011-09-30 08:53:08 UTC (rev 35201)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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.common.databinding;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+/**
+ * A POJO base class that may notify observers on behalf of
+ * {@link PropertyChangeSupport}
+ */
+public abstract class ObservablePojo {
+
+ private PropertyChangeSupport propertyChangeSupport;
+
+ public ObservablePojo() {
+ this.propertyChangeSupport = new PropertyChangeSupport(this);
+ }
+
+ public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
+ }
+
+ public void fireIndexedPropertyChange(String propertyName, int index, Object oldValue, Object newValue) {
+ propertyChangeSupport.fireIndexedPropertyChange(propertyName, index, oldValue, newValue);
+ }
+
+ public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ if (!contains(listener)) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ if (!contains(listener)) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+ }
+
+ public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName, listener);
+ }
+
+ public void removePropertyChangeListener(
+ PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ protected boolean contains(PropertyChangeListener listener) {
+ boolean contains = false;
+ for (PropertyChangeListener registeredListener : propertyChangeSupport.getPropertyChangeListeners()) {
+ if (registeredListener == listener) {
+ contains = true;
+ break;
+ }
+ }
+ return contains;
+ }
+
+ protected PropertyChangeSupport getPropertyChangeSupport() {
+ return propertyChangeSupport;
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/databinding/ObservablePojo.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2011-09-30 08:44:47 UTC (rev 35200)
+++ trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2011-09-30 08:53:08 UTC (rev 35201)
@@ -14,9 +14,11 @@
org.eclipse.jst.j2ee.ui;bundle-version="1.1.500",
org.eclipse.ui.forms;bundle-version="3.5.100";visibility:=reexport,
org.eclipse.ui.workbench.texteditor;bundle-version="3.7.0",
- org.eclipse.jface.text;bundle-version="3.7.0"
+ org.eclipse.jface.text;bundle-version="3.7.0",
+ org.eclipse.core.databinding;bundle-version="1.4.0"
Export-Package: org.jboss.tools.common.ui,
org.jboss.tools.common.ui.browser,
+ org.jboss.tools.common.ui.databinding,
org.jboss.tools.common.ui.preferences,
org.jboss.tools.common.ui.widget.editor,
org.jboss.tools.common.ui.widget.field,
Added: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/MandatoryStringValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/MandatoryStringValidator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/MandatoryStringValidator.java 2011-09-30 08:53:08 UTC (rev 35201)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.common.ui.databinding;
+
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
+import org.eclipse.core.runtime.IStatus;
+
+/**
+ * A {@link IValidator} that validates ok if the string it shall validate is not empty.
+ */
+public class MandatoryStringValidator implements IValidator {
+
+ private String errorMessage;
+
+ public MandatoryStringValidator(String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+
+ /**
+ *
+ * validates the given string. Validation passes only if the given value is
+ * not <tt>null</tt> and it's length's larger than 0
+ *
+ */
+ public IStatus validate(Object value) {
+ if (!((value instanceof String) && ((String) value).length() > 0)) {
+ return ValidationStatus.error(errorMessage);
+ }
+ return ValidationStatus.ok();
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/MandatoryStringValidator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ObservableUIPojo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ObservableUIPojo.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ObservableUIPojo.java 2011-09-30 08:53:08 UTC (rev 35201)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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.common.ui.databinding;
+
+import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.common.databinding.ObservablePojo;
+
+/**
+ * @author André Dietisheim
+ *
+ */
+public class ObservableUIPojo extends ObservablePojo {
+
+ @Override
+ public void firePropertyChange(final String propertyName, final Object oldValue, final Object newValue) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ ObservableUIPojo.super.firePropertyChange(propertyName, oldValue, newValue);
+ }
+ });
+ }
+
+ @Override
+ public void fireIndexedPropertyChange(final String propertyName, final int index, final Object oldValue,
+ final Object newValue) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ ObservableUIPojo.super.fireIndexedPropertyChange(propertyName, index, oldValue, newValue);
+ }
+ });
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ObservableUIPojo.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java 2011-09-30 08:53:08 UTC (rev 35201)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.common.ui.databinding;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.databinding.conversion.Converter;
+
+/**
+ * Converts an url in string form to a boolean. Returns true if the string is a
+ * valid url. The validity check is a simplified check for a valid url.
+ *
+ * @author André Dietisheim
+ *
+ */
+public class UrlString2BooleanConverter extends Converter {
+
+ private static final Pattern simpleUrlPattern = Pattern.compile(".+://[^\\.]+\\.[^\\.]+(\\.[^\\.]+){0,1}");
+
+ public UrlString2BooleanConverter() {
+ super(String.class, Boolean.class);
+ }
+
+ @Override
+ public Object convert(Object fromObject) {
+ if (!(fromObject instanceof String)) {
+ return Boolean.FALSE;
+ }
+
+ return toUrl((String) fromObject) != null;
+ }
+
+ private URL toUrl(String url) {
+ try {
+ if (!simpleUrlPattern.matcher(url).matches()) {
+ return null;
+ }
+ return new URL(url);
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/UrlString2BooleanConverter.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/META-INF/MANIFEST.MF 2011-09-30 08:44:47 UTC (rev 35200)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/META-INF/MANIFEST.MF 2011-09-30 08:53:08 UTC (rev 35201)
@@ -13,7 +13,7 @@
Export-Package: org.apache.deltacloud.client;x-friends:="org.jboss.tools.deltacloud.integration,org.jboss.tools.deltacloud.test",
org.apache.deltacloud.client.utils;x-friends:="org.jboss.tools.deltacloud.test,org.jboss.tools.deltacloud.ui",
org.jboss.tools.deltacloud.core;x-friends:="org.jboss.tools.deltacloud.ui,org.jboss.tools.deltacloud.test,org.jboss.tools.deltacloud.integration",
- org.jboss.tools.deltacloud.core.job;x-friends:="org.jboss.tools.deltacloud.ui,org.jboss.tools.deltacloud.test,org.jboss.tools.deltacloud.integration",
- org.jboss.tools.internal.deltacloud.core.observable;x-friends:="org.jboss.tools.deltacloud.ui"
+ org.jboss.tools.deltacloud.core.job;x-friends:="org.jboss.tools.deltacloud.ui,org.jboss.tools.deltacloud.test,org.jboss.tools.deltacloud.integration"
+Import-Package: org.jboss.tools.common.databinding
Bundle-ClassPath: client-0.2.0-SNAPSHOT.jar,
.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-09-30 08:44:47 UTC (rev 35200)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-09-30 08:53:08 UTC (rev 35201)
@@ -28,8 +28,8 @@
import org.apache.deltacloud.client.Key;
import org.apache.deltacloud.client.Realm;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.common.databinding.ObservablePojo;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance.State;
-import org.jboss.tools.internal.deltacloud.core.observable.ObservablePojo;
/**
* @author Jeff Jonston
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2011-09-30 08:44:47 UTC (rev 35200)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2011-09-30 08:53:08 UTC (rev 35201)
@@ -29,3 +29,4 @@
org.jboss.tools.deltacloud.ui.preferences,
org.jboss.tools.deltacloud.ui.wizard,
org.jboss.tools.internal.deltacloud.ui.utils;x-friends:="org.jboss.tools.deltacloud.test,org.jboss.tools.deltacloud.integration"
+Import-Package: org.jboss.tools.common.ui.databinding
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/ObservableUIPojo.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/ObservableUIPojo.java 2011-09-30 08:44:47 UTC (rev 35200)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/ObservableUIPojo.java 2011-09-30 08:53:08 UTC (rev 35201)
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.internal.deltacloud.ui.common.databinding.validator;
-
-import org.eclipse.swt.widgets.Display;
-import org.jboss.tools.internal.deltacloud.core.observable.ObservablePojo;
-
-/**
- * @author André Dietisheim
- *
- */
-public class ObservableUIPojo extends ObservablePojo {
-
- @Override
- public void firePropertyChange(final String propertyName, final Object oldValue, final Object newValue) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- ObservableUIPojo.super.firePropertyChange(propertyName, oldValue, newValue);
- }
- });
- }
-
- @Override
- public void fireIndexedPropertyChange(final String propertyName, final int index, final Object oldValue,
- final Object newValue) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- ObservableUIPojo.super.fireIndexedPropertyChange(propertyName, index, oldValue, newValue);
- }
- });
- }
-
-}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPageModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPageModel.java 2011-09-30 08:44:47 UTC (rev 35200)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPageModel.java 2011-09-30 08:53:08 UTC (rev 35201)
@@ -16,10 +16,10 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudDriver;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
-import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.ObservableUIPojo;
import org.jboss.tools.internal.deltacloud.ui.utils.URIUtils;
/**
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPageModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPageModel.java 2011-09-30 08:44:47 UTC (rev 35200)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPageModel.java 2011-09-30 08:53:08 UTC (rev 35201)
@@ -16,10 +16,10 @@
import java.util.Arrays;
import java.util.List;
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudKey;
-import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.ObservableUIPojo;
/**
* @author André Dietisheim
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2011-09-30 08:44:47 UTC (rev 35200)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2011-09-30 08:53:08 UTC (rev 35201)
@@ -19,13 +19,13 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProfile;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.DeltaCloudRealm;
import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob;
import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob.CLOUDELEMENT;
-import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.ObservableUIPojo;
/**
* @author Jeff Jonhston
14 years
JBoss Tools SVN: r35200 - trunk/common/plugins/org.jboss.tools.common.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-09-30 04:44:47 -0400 (Fri, 30 Sep 2011)
New Revision: 35200
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
Log:
[JBIDE-9805] copied BrowserUtil to commons.ui
Modified: trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2011-09-30 08:43:59 UTC (rev 35199)
+++ trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2011-09-30 08:44:47 UTC (rev 35200)
@@ -14,8 +14,7 @@
org.eclipse.jst.j2ee.ui;bundle-version="1.1.500",
org.eclipse.ui.forms;bundle-version="3.5.100";visibility:=reexport,
org.eclipse.ui.workbench.texteditor;bundle-version="3.7.0",
- org.eclipse.jface.text;bundle-version="3.7.0",
- org.eclipse.core.databinding;bundle-version="1.4.0"
+ org.eclipse.jface.text;bundle-version="3.7.0"
Export-Package: org.jboss.tools.common.ui,
org.jboss.tools.common.ui.browser,
org.jboss.tools.common.ui.preferences,
14 years