JBoss Tools SVN: r38709 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-14 11:11:11 -0500 (Tue, 14 Feb 2012)
New Revision: 38709
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java
Log:
Modifying to use waitForShell method instead of sleep, and finishWithWait instead of finish
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java 2012-02-14 16:09:54 UTC (rev 38708)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java 2012-02-14 16:11:11 UTC (rev 38709)
@@ -20,7 +20,6 @@
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardBaseExt;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.SearchNamedDialogWizard;
-import org.jboss.tools.ui.bot.ext.Timing;
import org.junit.After;
import org.junit.Test;
@@ -48,14 +47,13 @@
@After
public void waitForJobs() {
editResourceUtil.deletePackage(getProjectName(), getPackageName());
- util.waitForNonIgnoredJobs();
}
@Test
public void testSearchDefaultNamedBean() {
wizardExt.bean(getPackageName(), beanName, true, false, false,
- false, false, false, "", null, null, null).finish();
+ false, false, false, "", null, null, null).finishWithWait();
namedDialog = openSearchNamedDialog().setNamedPrefix(beanName);
assertTrue(namedDialog.matchingItems().size() == 1);
@@ -71,7 +69,7 @@
String namedParam = "someBean";
wizardExt.bean(getPackageName(), beanName, true, false, false,
- false, false, false, namedParam, null, null, null).finish();
+ false, false, false, namedParam, null, null, null).finishWithWait();
namedDialog = openSearchNamedDialog().setNamedPrefix(namedParam);
assertTrue(namedDialog.matchingItems().size() == 1);
@@ -88,7 +86,7 @@
String changedNamedParam = "someOtherBean";
wizardExt.bean(getPackageName(), beanName, true, false, false,
- false, false, false, namedParam, null, null, null).finish();
+ false, false, false, namedParam, null, null, null).finishWithWait();
setEd(bot.activeEditor().toTextEditor());
namedDialog = openSearchNamedDialog().setNamedPrefix(namedParam);
@@ -116,9 +114,9 @@
String namedParam = "someBean";
wizardExt.bean(getPackageName(), beanName, true, false, false,
- false, false, false, namedParam, null, null, null).finish();
+ false, false, false, namedParam, null, null, null).finishWithWait();
wizardExt.bean(getPackageName(), beanName2, true, false, false,
- false, false, false, namedParam, null, null, null).finish();
+ false, false, false, namedParam, null, null, null).finishWithWait();
namedDialog = openSearchNamedDialog().setNamedPrefix(namedParam);
List<String> matchingItems = namedDialog.matchingItems();
@@ -149,7 +147,7 @@
for (String beanName : beansNames) {
wizardExt.bean(getPackageName(), beanName, true, false, false,
- false, false, false, "", null, null, null).finish();
+ false, false, false, "", null, null, null).finishWithWait();
}
for (String prefix : prefixesWithCount.keySet()) {
@@ -164,7 +162,7 @@
public void testSearchBeanWithStereotype() {
wizardExt.stereotype(getPackageName(), stereotypeName, null, null, false, true,
- false, false, false).finish();
+ false, false, false).finishWithWait();
wizard.createCDIComponentWithContent(CDIWizardType.BEAN, beanName, getPackageName(),
null, BEAN_STEREOTYPE_PATH);
@@ -183,7 +181,7 @@
String namedParam = "someBean";
wizardExt.stereotype(getPackageName(), stereotypeName, null, null, false, true,
- false, false, false).finish();
+ false, false, false).finishWithWait();
wizard.createCDIComponentWithContent(CDIWizardType.BEAN, beanName, getPackageName(),
null, BEAN_STEREOTYPE_NAMED_PATH);
@@ -204,7 +202,7 @@
String changedNamedParam = "someOtherBean";
wizardExt.stereotype(getPackageName(), stereotypeName, null, null, false, true,
- false, false, false).finish();
+ false, false, false).finishWithWait();
wizard.createCDIComponentWithContent(CDIWizardType.BEAN, beanName, getPackageName(),
null, BEAN_STEREOTYPE_NAMED_PATH);
@@ -231,7 +229,7 @@
private SearchNamedDialogWizard openSearchNamedDialog() {
bot.menu(CDIConstants.NAVIGATE).menu(CDIConstants.OPEN_CDI_NAMED_BEANS).click();
- bot.sleep(Timing.time500MS());
+ bot.waitForShell(CDIConstants.OPEN_CDI_NAMED_BEANS);
return new SearchNamedDialogWizard();
}
14 years, 1 month
JBoss Tools SVN: r38708 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-14 11:09:54 -0500 (Tue, 14 Feb 2012)
New Revision: 38708
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java
Log:
Small fix
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java 2012-02-14 16:09:08 UTC (rev 38707)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java 2012-02-14 16:09:54 UTC (rev 38708)
@@ -36,6 +36,7 @@
public IValidationProvider validationProvider() {
return validationProvider;
+
}
// https://issues.jboss.org/browse/JBIDE-7680
@@ -45,7 +46,7 @@
String className = "Decorator1";
wizard.createCDIComponentWithContent(CDIWizardType.DECORATOR, className,
- getPackageName(), "java.util.set", "/resources/quickfix/decorator/" +
+ getPackageName(), "java.util.Set", "/resources/quickfix/decorator/" +
"DecoratorWithStateless.java.cdi");
editResourceUtil.replaceInEditor("DecoratorComponent", className);
@@ -61,7 +62,7 @@
String className = "Decorator2";
wizard.createCDIComponentWithContent(CDIWizardType.DECORATOR, className,
- getPackageName(), "java.util.set", "/resources/quickfix/decorator/" +
+ getPackageName(), "java.util.Set", "/resources/quickfix/decorator/" +
"DecoratorWithNamed.java.cdi");
editResourceUtil.replaceInEditor("DecoratorComponent", className);
@@ -77,7 +78,7 @@
String className = "Decorator3";
wizard.createCDIComponentWithContent(CDIWizardType.DECORATOR, className,
- getPackageName(), "java.util.set", "/resources/quickfix/decorator/" +
+ getPackageName(), "java.util.Set", "/resources/quickfix/decorator/" +
"DecoratorWithProducer.java.cdi");
editResourceUtil.replaceInEditor("DecoratorComponent", className);
@@ -93,7 +94,7 @@
String className = "Decorator4";
wizard.createCDIComponentWithContent(CDIWizardType.DECORATOR, className,
- getPackageName(), "java.util.set", "/resources/quickfix/decorator/" +
+ getPackageName(), "java.util.Set", "/resources/quickfix/decorator/" +
"DecoratorWithDisposes.java.cdi");
editResourceUtil.replaceInEditor("DecoratorComponent", className);
@@ -109,7 +110,7 @@
String className = "Decorator5";
wizard.createCDIComponentWithContent(CDIWizardType.DECORATOR, className,
- getPackageName(), "java.util.set", "/resources/quickfix/decorator/" +
+ getPackageName(), "java.util.Set", "/resources/quickfix/decorator/" +
"DecoratorWithDisposes.java.cdi");
editResourceUtil.replaceInEditor("import javax.enterprise.inject.Disposes;",
@@ -128,7 +129,7 @@
String className = "Decorator6";
wizard.createCDIComponentWithContent(CDIWizardType.DECORATOR, className,
- getPackageName(), "java.util.set", "/resources/quickfix/decorator/" +
+ getPackageName(), "java.util.Set", "/resources/quickfix/decorator/" +
"DecoratorWithSpecializes.java.cdi");
editResourceUtil.replaceInEditor("DecoratorComponent", className);
14 years, 1 month
JBoss Tools SVN: r38707 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-14 11:09:08 -0500 (Tue, 14 Feb 2012)
New Revision: 38707
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java
Log:
Small fix
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java 2012-02-14 16:08:20 UTC (rev 38706)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/EditorResourceHelper.java 2012-02-14 16:09:08 UTC (rev 38707)
@@ -184,7 +184,8 @@
bot.menu(IDELabel.Menu.EDIT).menu(IDELabel.Menu.DELETE).click();
bot.waitForShell(IDELabel.Shell.CONFIRM_DELETE);
- bot.shell(IDELabel.Shell.CONFIRM_DELETE).bot().button(IDELabel.Button.OK).click();
+ bot.shell(IDELabel.Shell.CONFIRM_DELETE).bot().button(IDELabel.Button.OK).click();
+ util.waitForNonIgnoredJobs();
}
/**
14 years, 1 month
JBoss Tools SVN: r38706 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-14 11:08:20 -0500 (Tue, 14 Feb 2012)
New Revision: 38706
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardBase.java
Log:
Modifying to use waitUntil method instead of sleep
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardBase.java 2012-02-14 15:39:41 UTC (rev 38705)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardBase.java 2012-02-14 16:08:20 UTC (rev 38706)
@@ -21,7 +21,9 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
-import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.cdi.bot.test.condition.NonEmptyTableCondition;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
public class CDIWizardBase extends Wizard {
@@ -227,10 +229,11 @@
case STEREOTYPE:
case INTERCEPTOR:
setFocus();
- bot().button("Add", 0).click();
+ bot().button(IDELabel.Button.ADD_WITHOUT_DOTS, 0).click();
SWTBotShell sh = bot().activeShell();
sh.bot().text().setText(ib);
- sh.bot().button("OK").click();
+ sh.bot().waitUntil(new NonEmptyTableCondition(sh.bot().table()), TaskDuration.NORMAL.getTimeout());
+ sh.bot().button(IDELabel.Button.OK).click();
setFocus();
break;
default:
@@ -312,12 +315,12 @@
case DECORATOR:
case BEAN:
setFocus();
- bot().button("Add...", 0).click();
+ bot().button(IDELabel.Button.ADD, 0).click();
SWTBotShell sh = bot().activeShell();
sh.bot().text().setText(intf);
- sh.bot().sleep(Timing.time3S());
+ sh.bot().waitUntil(new NonEmptyTableCondition(sh.bot().table()), TaskDuration.NORMAL.getTimeout());
sh.bot().table().getTableItem(0).select();
- sh.bot().button("OK").click();
+ sh.bot().button(IDELabel.Button.OK).click();
setFocus();
break;
default:
@@ -340,7 +343,7 @@
}
SWTBotShell sh = bot().activeShell();
sh.bot().text().setText(qualifier);
- sh.bot().sleep(Timing.time2S());
+ sh.bot().waitUntil(new NonEmptyTableCondition(sh.bot().table()), TaskDuration.SHORT.getTimeout());
sh.bot().table().getTableItem(0).select();
sh.bot().button("OK").click();
setFocus();
14 years, 1 month
JBoss Tools SVN: r38705 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-14 10:39:41 -0500 (Tue, 14 Feb 2012)
New Revision: 38705
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
Log:
[JBIDE-10893] fixed credentials page, removed user related methods from activator
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-14 15:38:34 UTC (rev 38704)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-14 15:39:41 UTC (rev 38705)
@@ -38,7 +38,6 @@
import org.jboss.tools.common.ui.DelegatingProgressMonitor;
import org.jboss.tools.common.ui.JobUtils;
import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
@@ -168,7 +167,7 @@
success = importProject();
}
- wizardModel.addToUserModel(getWizardModel().getUser());
+ wizardModel.addUserToModel();
return success;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-14 15:38:34 UTC (rev 38704)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-14 15:39:41 UTC (rev 38705)
@@ -431,5 +431,4 @@
Assert.isNotNull(user);
UserModel.getDefault().addUser(user);
}
-
}
\ No newline at end of file
14 years, 1 month
JBoss Tools SVN: r38704 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: action and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-14 10:38:34 -0500 (Tue, 14 Feb 2012)
New Revision: 38704
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ConnectToOpenShiftWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IUserAwareModel.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftWizardModel.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/ConnectToOpenShiftWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/OpenShiftConsoleExpressView.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionDialogModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
Log:
[JBIDE-10893] fixed credentials page, removed user related methods from activator
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -99,29 +99,6 @@
/**
- * Create a new user and add it to the model
- * @param username
- * @param password
- * @return
- * @throws OpenShiftException
- * @throws IOException
- */
- public IUser createUser(String username, String password) throws OpenShiftException, IOException {
- IUser u = UserModel.getDefault().createUser(username, password);
- UserModel.getDefault().addUser(u);
- return u;
- }
-
- /**
- * Get the most recently created or used user
- *
- * @return the user
- */
- public final IUser getUser() {
- return UserModel.getDefault().getRecentUser();
- }
-
- /**
* Creates an image by loading it from a file in the plugin's images
* directory.
*
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.action;
import org.eclipse.jface.viewers.ITreeSelection;
@@ -3,4 +13,5 @@
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
@@ -10,6 +21,9 @@
import com.openshift.express.client.IApplication;
import com.openshift.express.client.IUser;
+/**
+ * @author Xavier Coulon
+ */
public class EditCartridgesAction extends AbstractAction {
public EditCartridgesAction() {
@@ -22,7 +36,7 @@
final ITreeSelection treeSelection = (ITreeSelection)selection;
if (selection != null && selection instanceof ITreeSelection && treeSelection.getFirstElement() instanceof IApplication) {
final IApplication application = (IApplication) treeSelection.getFirstElement();
- final IUser user = OpenShiftUIActivator.getDefault().getUser();
+ final IUser user = UserModel.getDefault().getRecentUser();
EmbedCartridgeWizard wizard = new EmbedCartridgeWizard(application, user);
WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
dialog.create();
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -46,9 +46,9 @@
import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyCommand;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import org.jboss.tools.openshift.express.internal.core.console.UserModel;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.wizard.ConnectToOpenShiftWizardModel;
import org.jboss.tools.openshift.express.internal.ui.wizard.CredentialsWizardPageModel;
-import org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftWizardModel;
+import org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftExpressWizardModel;
import org.jboss.tools.openshift.express.internal.ui.wizard.ImportOpenShiftExpressApplicationWizard;
import org.jboss.tools.openshift.express.internal.ui.wizard.OpenShiftExpressApplicationWizard;
@@ -132,7 +132,7 @@
userLabel.setText("Username: ");
passLabel.setText("Password: ");
remoteLabel.setText("Remote: ");
- remoteText.setText(IOpenShiftWizardModel.NEW_PROJECT_REMOTE_NAME_DEFAULT);
+ remoteText.setText(IOpenShiftExpressWizardModel.NEW_PROJECT_REMOTE_NAME_DEFAULT);
String n = ExpressServerUtils.getExpressUsername(server);
String[] appNames = null;
@@ -264,7 +264,7 @@
}
private void verifyPressed() {
- final CredentialsWizardPageModel model = new CredentialsWizardPageModel();
+ final CredentialsWizardPageModel model = new CredentialsWizardPageModel(new ConnectToOpenShiftWizardModel());
this.fapplication = null;
this.fuser = null;
this.appListNames = null;
@@ -375,7 +375,7 @@
private void verifyApplicationBinaryMode(CredentialsWizardPageModel model) {
IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(deployProject);
try {
- fuser = OpenShiftUIActivator.getDefault().getUser();
+ fuser = UserModel.getDefault().getRecentUser();
final List<IApplication> allApps = fuser.getApplications();
fapplication = ExpressServerUtils.findApplicationForProject(p, allApps);
@@ -401,7 +401,7 @@
// now check the app name and cartridge
String[] appNames = new String[]{};
try {
- IUser user = OpenShiftUIActivator.getDefault().getUser();
+ IUser user = UserModel.getDefault().getRecentUser();
final List<IApplication> allApps = user.getApplications();
appNames = getAppNamesAsStrings(allApps);
int index = Arrays.asList(appNames).indexOf(app);
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/ConnectToOpenShiftWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/ConnectToOpenShiftWizard.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/ConnectToOpenShiftWizard.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -11,6 +11,7 @@
package org.jboss.tools.openshift.express.internal.ui.viewer;
import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.openshift.express.internal.ui.wizard.ConnectToOpenShiftWizardModel;
import org.jboss.tools.openshift.express.internal.ui.wizard.CredentialsWizardPage;
/**
@@ -18,7 +19,7 @@
*/
public class ConnectToOpenShiftWizard extends Wizard {
- private final CredentialsWizardPage page = new CredentialsWizardPage(this);
+ private final CredentialsWizardPage page = new CredentialsWizardPage(this, new ConnectToOpenShiftWizardModel());
public ConnectToOpenShiftWizard() {
setNeedsProgressMonitor(true);
@@ -32,12 +33,8 @@
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#addPages()
- */
@Override
public void addPages() {
addPage(page);
}
-
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/OpenShiftConsoleExpressView.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/OpenShiftConsoleExpressView.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/OpenShiftConsoleExpressView.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -28,7 +28,7 @@
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import com.openshift.express.client.IUser;
@@ -90,7 +90,7 @@
int returnCode = WizardUtils.openWizardDialog(connectToOpenShiftWizard, shell);
if (returnCode == Window.OK) {
Logger.debug("OpenShift Auth succeeded.");
- final IUser user = OpenShiftUIActivator.getDefault().getUser();
+ final IUser user = UserModel.getDefault().getRecentUser();
getCommonViewer().setInput(new OpenShiftExpressConsoleContentCategory(user));
switchToCommonViewer();
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionDialogModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionDialogModel.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionDialogModel.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -31,9 +31,9 @@
private IApplication selectedApplication;
- private IOpenShiftWizardModel wizardModel;
+ private IOpenShiftExpressWizardModel wizardModel;
- public ApplicationSelectionDialogModel(IOpenShiftWizardModel wizardModel) {
+ public ApplicationSelectionDialogModel(IOpenShiftExpressWizardModel wizardModel) {
this.wizardModel = wizardModel;
this.selectedApplication = wizardModel.getApplication();
}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ConnectToOpenShiftWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ConnectToOpenShiftWizardModel.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ConnectToOpenShiftWizardModel.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
+
+import com.openshift.express.client.IUser;
+
+/**
+ * @author André Dietisheim
+ */
+public class ConnectToOpenShiftWizardModel implements IUserAwareModel {
+
+ @Override
+ public IUser getUser() {
+ return UserModel.getDefault().getRecentUser();
+ }
+
+ @Override
+ public IUser setUser(IUser user) {
+ UserModel.getDefault().addUser(user);
+ return user;
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ConnectToOpenShiftWizardModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -60,10 +60,10 @@
private Text rhLoginText = null;
private Text passwordText = null;
- public CredentialsWizardPage(IWizard wizard) {
+ public CredentialsWizardPage(IWizard wizard, IUserAwareModel wizardModel) {
super("Server connection", "Please provide your OpenShift Express credentials.", "Server Connection",
wizard);
- this.pageModel = new CredentialsWizardPageModel();
+ this.pageModel = new CredentialsWizardPageModel(wizardModel);
}
protected void doCreateControls(Composite container, DataBindingContext dbc) {
@@ -235,12 +235,6 @@
return ValidationStatus.ok();
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.core.databinding.validation.MultiValidator#getTargets()
- */
@Override
public IObservableList getTargets() {
WritableList targets = new WritableList();
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -15,6 +15,7 @@
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.common.ui.preferencevalue.StringPreferenceValue;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import org.jboss.tools.openshift.express.internal.ui.utils.OpenShiftPasswordStorageKey;
@@ -47,7 +48,10 @@
private final String libraServer;
private SecurePasswordStore store;
- public CredentialsWizardPageModel() {
+ private IUserAwareModel wizardModel;
+
+ public CredentialsWizardPageModel(IUserAwareModel wizardModel) {
+ this.wizardModel = wizardModel;
this.rhLoginPreferenceValue = new StringPreferenceValue(RHLOGIN_PREFS_KEY, OpenShiftUIActivator.PLUGIN_ID);
this.libraServer = initLibraServer();
this.rhLogin = initRhLogin();
@@ -182,16 +186,25 @@
}
public boolean areCredentialsValidated() {
- return credentialsStatus != null;// && credentialsValidity.isOK();
+ return credentialsStatus != null;
}
public IStatus validateCredentials() {
+ IStatus status = getValidityStatus(getRhLogin(), getPassword());
+ setCredentialsStatus(status);
+ return status;
+ }
+
+ protected void setUser(IUser user) {
+ wizardModel.setUser(user);
+ }
+
+ private IStatus getValidityStatus(String rhLogin, String password) {
IStatus status = Status.OK_STATUS;
try {
- // reset without notifying
- // this.credentialsValidity = null;
- IUser user = OpenShiftUIActivator.getDefault().createUser(getRhLogin(), getPassword());
+ IUser user = UserModel.getDefault().createUser(getRhLogin(), getPassword());
if (user.isValid()) {
+ setUser(user);
if (rememberPassword) {
storePassword(password);
} else {
@@ -208,8 +221,6 @@
status = OpenShiftUIActivator.createErrorStatus(NLS.bind(
"Could not check user credentials: {0}.", e.getMessage()));
}
-
- setCredentialsStatus(status);
return status;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -51,7 +51,7 @@
private Button useDefaultRepoPathButton;
private Text remoteNameText;
- public GitCloningSettingsWizardPage(OpenShiftExpressApplicationWizard wizard, IOpenShiftWizardModel model) {
+ public GitCloningSettingsWizardPage(OpenShiftExpressApplicationWizard wizard, IOpenShiftExpressWizardModel model) {
super(
"Import an existing OpenShift application",
"Configure the cloning settings by specifying the clone destination if you create a new project, and the git remote name if you're using an existing project.",
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -10,8 +10,8 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard;
-import static org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftWizardModel.EXISTING_PROJECT_REMOTE_NAME_DEFAULT;
-import static org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftWizardModel.NEW_PROJECT_REMOTE_NAME_DEFAULT;
+import static org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftExpressWizardModel.EXISTING_PROJECT_REMOTE_NAME_DEFAULT;
+import static org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftExpressWizardModel.NEW_PROJECT_REMOTE_NAME_DEFAULT;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -59,7 +59,7 @@
public static final String PROPERTY_CUSTOM_REMOTE_NAME_VALIDITY = "customRemoteNameValidity";
- private IOpenShiftWizardModel wizardModel;
+ private IOpenShiftExpressWizardModel wizardModel;
private boolean loading;
private boolean useDefaultRepoPath = true;
@@ -70,7 +70,7 @@
private boolean useDefaultRemoteName = true;
- public GitCloningSettingsWizardPageModel(IOpenShiftWizardModel wizardModel) {
+ public GitCloningSettingsWizardPageModel(IOpenShiftExpressWizardModel wizardModel) {
this.wizardModel = wizardModel;
setRepositoryPath(getDefaultRepositoryPath());
}
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java (from rev 38693, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftWizardModel.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URISyntaxException;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServerType;
+import org.jboss.tools.openshift.egit.ui.util.EGitUIUtils;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.ICartridge;
+import com.openshift.express.client.OpenShiftException;
+
+/**
+ * @author André Dietisheim
+ */
+public interface IOpenShiftExpressWizardModel extends IUserAwareModel {
+
+ public static final String NEW_PROJECT = "enableProject";
+ public static final String USER = "user";
+ public static final String APPLICATION = "application";
+ public static final String APPLICATION_NAME = "applicationName";
+ public static final String APPLICATION_CARTRIDGE = "applicationCartridge";
+ public static final String USE_EXISTING_APPLICATION = "useExistingApplication";
+ public static final String REMOTE_NAME = "remoteName";
+ public static final String REPOSITORY_PATH = "repositoryPath";
+ public static final String PROJECT_NAME = "projectName";
+ public static final String MERGE_URI = "mergeUri";
+ public static final String RUNTIME_DELEGATE = "runtimeDelegate";
+ public static final String CREATE_SERVER_ADAPTER = "createServerAdapter";
+ public static final String PUBLICATION_MODE = "serverMode";
+ public static final String PUBLISH_SOURCE = ExpressServerUtils.EXPRESS_SOURCE_MODE;
+ public static final String PUBLISH_BINARY = ExpressServerUtils.EXPRESS_BINARY_MODE;
+ public static final String SERVER_TYPE = "serverType";
+ public static final String NEW_PROJECT_REMOTE_NAME_DEFAULT = "origin";
+ public static final String EXISTING_PROJECT_REMOTE_NAME_DEFAULT = "openshift";
+ public static final String DEFAULT_REPOSITORY_PATH = EGitUIUtils.getEGitDefaultRepositoryPath();
+
+ /**
+ * Imports the project that the user has chosen into the workspace.
+ *
+ * @param monitor
+ * the monitor to report progress to
+ * @throws OpenShiftException
+ * @throws CoreException
+ * @throws InterruptedException
+ * @throws URISyntaxException
+ * @throws InvocationTargetException
+ * @throws IOException
+ */
+ public void importProject(IProgressMonitor monitor) throws OpenShiftException, CoreException, InterruptedException,
+ URISyntaxException, InvocationTargetException, IOException;
+
+ /**
+ * Enables the user chosen, unshared project to be used on the chosen
+ * OpenShift application. Clones the application git repository, copies the
+ * configuration files to the user project (in the workspace), shares the
+ * user project with git and creates the server adapter.
+ *
+ * @param monitor
+ * the monitor to report progress to
+ * @throws URISyntaxException
+ * The OpenShift application repository could not be cloned,
+ * because the uri it is located at is not a valid git uri
+ * @throws OpenShiftException
+ *
+ * @throws InvocationTargetException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation failed.
+ * @throws InterruptedException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation was interrupted.
+ * @throws IOException
+ * The configuration files could not be copied from the git
+ * clone to the user project
+ * @throws CoreException
+ * The user project could not be shared with the git
+ */
+ public void configureUnsharedProject(IProgressMonitor monitor)
+ throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
+ URISyntaxException;
+
+ /**
+ * Enables the user chosen, unshared project to be used on the chosen
+ * OpenShift application. Clones the application git repository, copies the
+ * configuration files to the user project (in the workspace), adds the
+ * appication git repo as remote and creates the server adapter.
+ *
+ * @param monitor
+ * the monitor to report progress to
+ * @throws URISyntaxException
+ * The OpenShift application repository could not be cloned,
+ * because the uri it is located at is not a valid git uri
+ * @throws OpenShiftException
+ *
+ * @throws InvocationTargetException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation failed.
+ * @throws InterruptedException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation was interrupted.
+ * @throws IOException
+ * The configuration files could not be copied from the git
+ * clone to the user project
+ * @throws CoreException
+ * The user project could not be shared with the git
+ */
+ public void configureGitSharedProject(IProgressMonitor monitor)
+ throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
+ URISyntaxException;
+
+ public File getRepositoryFile();
+
+ public Object setProperty(String key, Object value);
+
+ public Object getProperty(String key);
+
+// public void setUser(IUser user);
+//
+// public IUser getUser();
+
+ public IApplication getApplication();
+
+ public String getApplicationName();
+
+ public ICartridge getApplicationCartridge();
+
+ public void setApplication(IApplication application);
+
+ public String setRemoteName(String remoteName);
+
+ public String getRemoteName();
+
+ public String setRepositoryPath(String repositoryPath);
+
+ public String getRepositoryPath();
+
+ public boolean isNewProject();
+
+ public boolean isExistingProject();
+
+ public Boolean setNewProject(boolean newProject);
+
+ public Boolean setExistingProject(boolean existingProject);
+
+ public String setProjectName(String projectName);
+
+ public IProject setProject(IProject project);
+
+ public boolean isGitSharedProject();
+
+ public Boolean setCreateServerAdapter(Boolean createServerAdapter);
+
+ public String getProjectName();
+
+ public String setMergeUri(String mergeUri);
+
+ public String getMergeUri();
+
+ public IRuntime getRuntime();
+
+ public String getMode();
+
+ public boolean isCreateServerAdapter();
+
+ public IServerType getServerType();
+
+ public void setServerType(IServerType serverType);
+
+ public boolean isExistingApplication();
+
+ public void setUseExistingApplication(boolean useExistingApplication);
+
+}
\ No newline at end of file
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftWizardModel.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftWizardModel.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.wizard;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URISyntaxException;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerType;
-import org.jboss.tools.openshift.egit.ui.util.EGitUIUtils;
-import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
-
-import com.openshift.express.client.IApplication;
-import com.openshift.express.client.ICartridge;
-import com.openshift.express.client.IUser;
-import com.openshift.express.client.OpenShiftException;
-
-/**
- * @author André Dietisheim
- */
-public interface IOpenShiftWizardModel {
-
- public static final String NEW_PROJECT = "enableProject";
- public static final String USER = "user";
- public static final String APPLICATION = "application";
- public static final String APPLICATION_NAME = "applicationName";
- public static final String APPLICATION_CARTRIDGE = "applicationCartridge";
- public static final String USE_EXISTING_APPLICATION = "useExistingApplication";
- public static final String REMOTE_NAME = "remoteName";
- public static final String REPOSITORY_PATH = "repositoryPath";
- public static final String PROJECT_NAME = "projectName";
- public static final String MERGE_URI = "mergeUri";
- public static final String RUNTIME_DELEGATE = "runtimeDelegate";
- public static final String CREATE_SERVER_ADAPTER = "createServerAdapter";
- public static final String PUBLICATION_MODE = "serverMode";
- public static final String PUBLISH_SOURCE = ExpressServerUtils.EXPRESS_SOURCE_MODE;
- public static final String PUBLISH_BINARY = ExpressServerUtils.EXPRESS_BINARY_MODE;
- public static final String SERVER_TYPE = "serverType";
- public static final String NEW_PROJECT_REMOTE_NAME_DEFAULT = "origin";
- public static final String EXISTING_PROJECT_REMOTE_NAME_DEFAULT = "openshift";
- public static final String DEFAULT_REPOSITORY_PATH = EGitUIUtils.getEGitDefaultRepositoryPath();
-
- /**
- * Imports the project that the user has chosen into the workspace.
- *
- * @param monitor
- * the monitor to report progress to
- * @throws OpenShiftException
- * @throws CoreException
- * @throws InterruptedException
- * @throws URISyntaxException
- * @throws InvocationTargetException
- * @throws IOException
- */
- public void importProject(IProgressMonitor monitor) throws OpenShiftException, CoreException, InterruptedException,
- URISyntaxException, InvocationTargetException, IOException;
-
- /**
- * Enables the user chosen, unshared project to be used on the chosen
- * OpenShift application. Clones the application git repository, copies the
- * configuration files to the user project (in the workspace), shares the
- * user project with git and creates the server adapter.
- *
- * @param monitor
- * the monitor to report progress to
- * @throws URISyntaxException
- * The OpenShift application repository could not be cloned,
- * because the uri it is located at is not a valid git uri
- * @throws OpenShiftException
- *
- * @throws InvocationTargetException
- * The OpenShift application repository could not be cloned, the
- * clone operation failed.
- * @throws InterruptedException
- * The OpenShift application repository could not be cloned, the
- * clone operation was interrupted.
- * @throws IOException
- * The configuration files could not be copied from the git
- * clone to the user project
- * @throws CoreException
- * The user project could not be shared with the git
- */
- public void configureUnsharedProject(IProgressMonitor monitor)
- throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
- URISyntaxException;
-
- /**
- * Enables the user chosen, unshared project to be used on the chosen
- * OpenShift application. Clones the application git repository, copies the
- * configuration files to the user project (in the workspace), adds the
- * appication git repo as remote and creates the server adapter.
- *
- * @param monitor
- * the monitor to report progress to
- * @throws URISyntaxException
- * The OpenShift application repository could not be cloned,
- * because the uri it is located at is not a valid git uri
- * @throws OpenShiftException
- *
- * @throws InvocationTargetException
- * The OpenShift application repository could not be cloned, the
- * clone operation failed.
- * @throws InterruptedException
- * The OpenShift application repository could not be cloned, the
- * clone operation was interrupted.
- * @throws IOException
- * The configuration files could not be copied from the git
- * clone to the user project
- * @throws CoreException
- * The user project could not be shared with the git
- */
- public void configureGitSharedProject(IProgressMonitor monitor)
- throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
- URISyntaxException;
-
- public File getRepositoryFile();
-
- public Object setProperty(String key, Object value);
-
- public Object getProperty(String key);
-
-// public void setUser(IUser user);
-//
-// public IUser getUser();
-
- public IApplication getApplication();
-
- public String getApplicationName();
-
- public ICartridge getApplicationCartridge();
-
- public void setApplication(IApplication application);
-
- public String setRemoteName(String remoteName);
-
- public String getRemoteName();
-
- public String setRepositoryPath(String repositoryPath);
-
- public String getRepositoryPath();
-
- public boolean isNewProject();
-
- public boolean isExistingProject();
-
- public Boolean setNewProject(boolean newProject);
-
- public Boolean setExistingProject(boolean existingProject);
-
- public String setProjectName(String projectName);
-
- public IProject setProject(IProject project);
-
- public boolean isGitSharedProject();
-
- public Boolean setCreateServerAdapter(Boolean createServerAdapter);
-
- public String getProjectName();
-
- public String setMergeUri(String mergeUri);
-
- public String getMergeUri();
-
- public IRuntime getRuntime();
-
- public String getMode();
-
- public boolean isCreateServerAdapter();
-
- public IServerType getServerType();
-
- public void setServerType(IServerType serverType);
-
- public boolean isExistingApplication();
-
- public void setUseExistingApplication(boolean useExistingApplication);
-
- public IUser getUser();
-
- public IUser setUser(IUser user);
-
-}
\ No newline at end of file
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IUserAwareModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IUserAwareModel.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IUserAwareModel.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -0,0 +1,11 @@
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import com.openshift.express.client.IUser;
+
+public interface IUserAwareModel {
+
+ public IUser getUser();
+
+ public IUser setUser(IUser user);
+
+}
\ No newline at end of file
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IUserAwareModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -38,6 +38,7 @@
import org.jboss.tools.common.ui.DelegatingProgressMonitor;
import org.jboss.tools.common.ui.JobUtils;
import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
@@ -138,7 +139,7 @@
@Override
public void addPages() {
- addPage(new CredentialsWizardPage(this));
+ addPage(new CredentialsWizardPage(this, getWizardModel()));
addPage(new ApplicationConfigurationWizardPage(this, getWizardModel()));
addPage(new ProjectAndServerAdapterSettingsWizardPage(this, getWizardModel()));
addPage(new GitCloningSettingsWizardPage(this, getWizardModel()));
@@ -166,6 +167,8 @@
if (success) {
success = importProject();
}
+
+ wizardModel.addToUserModel(getWizardModel().getUser());
return success;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -22,7 +22,6 @@
import org.jboss.tools.openshift.egit.core.EGitUtils;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import org.jboss.tools.openshift.express.internal.core.console.UserModel;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.ConfigureGitSharedProject;
import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.ConfigureUnsharedProject;
@@ -36,17 +35,17 @@
import com.openshift.express.client.OpenShiftApplicationNotAvailableException;
import com.openshift.express.client.OpenShiftException;
-public class OpenShiftExpressApplicationWizardModel extends ObservableUIPojo implements IOpenShiftWizardModel {
+public class OpenShiftExpressApplicationWizardModel extends ObservableUIPojo implements IOpenShiftExpressWizardModel {
protected HashMap<String, Object> dataModel = new HashMap<String, Object>();
private static final int APP_CREATION_TIMEOUT = 60;
private static final String KEY_SELECTED_EMBEDDABLE_CARTRIDGES = "selectedEmbeddableCartridges";
- public OpenShiftExpressApplicationWizardModel() {
- this(OpenShiftUIActivator.getDefault().getUser(), null, null);
+ public OpenShiftExpressApplicationWizardModel(IUser user) {
+ this(user, null, null);
}
-
+
public OpenShiftExpressApplicationWizardModel(IUser user, IProject project, IApplication application) {
// default value(s)
setUser(user);
@@ -71,7 +70,7 @@
* @throws InterruptedException
* @throws URISyntaxException
* @throws InvocationTargetException
- * @throws IOException
+ * @throws IOException
*/
@Override
public void importProject(IProgressMonitor monitor) throws OpenShiftException, CoreException, InterruptedException,
@@ -119,7 +118,7 @@
getProjectName()
, getApplication()
, getRemoteName()
- , OpenShiftUIActivator.getDefault().getUser())
+ , getUser())
.execute(monitor);
createServerAdapter(monitor, importedProjects);
}
@@ -261,8 +260,8 @@
public String setProjectName(String projectName) {
return (String) setProperty(PROJECT_NAME, projectName);
}
-
- @Override
+
+ @Override
public IProject setProject(IProject project) {
if (project != null && project.exists()) {
setExistingProject(false);
@@ -417,24 +416,20 @@
public String getApplicationName() {
return (String) dataModel.get(APPLICATION_NAME);
}
-
- /**
- * Returns the user that was stored in this model or the recent user from UserModel
- *
- * @see OpenShiftExpressApplicationWizardModel(IUser)
- * @see OpenShiftExpressApplicationWizardModel()
- */
+
public IUser getUser() {
- IUser user = (IUser) dataModel.get(USER);
- if (user == null) {
- user = UserModel.getDefault().getRecentUser();
- }
- return user;
+ return (IUser) dataModel.get(USER);
}
-
+
public IUser setUser(IUser user) {
dataModel.put(USER, user);
return user;
}
+ public void addUserToModel() {
+ IUser user = getUser();
+ Assert.isNotNull(user);
+ UserModel.getDefault().addUser(user);
+ }
+
}
\ No newline at end of file
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -58,7 +58,7 @@
private Text existingProjectNameText = null;
- public ProjectAndServerAdapterSettingsWizardPage(IWizard wizard, IOpenShiftWizardModel wizardModel) {
+ public ProjectAndServerAdapterSettingsWizardPage(IWizard wizard, IOpenShiftExpressWizardModel wizardModel) {
super("Setup Project",
"Configure your project and server adapter settings, then click 'next' or 'finish'.",
"Project Configuration", wizard);
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPageModel.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPageModel.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -37,11 +37,11 @@
/** Whether the existing project is a valid one or not. */
public static final String PROPERTY_EXISTING_PROJECT_VALIDITY = "existingProjectValidity";
- private IOpenShiftWizardModel wizardModel;
+ private IOpenShiftExpressWizardModel wizardModel;
private IStatus existingProjectValidity;
- public ProjectAndServerAdapterSettingsWizardPageModel(IOpenShiftWizardModel wizardModel) {
+ public ProjectAndServerAdapterSettingsWizardPageModel(IOpenShiftExpressWizardModel wizardModel) {
this.wizardModel = wizardModel;
setNewProject(true);
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java 2012-02-14 15:21:52 UTC (rev 38703)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java 2012-02-14 15:38:34 UTC (rev 38704)
@@ -34,7 +34,7 @@
import org.eclipse.wst.server.core.internal.Server;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftWizardModel;
+import org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftExpressWizardModel;
import com.openshift.express.client.IApplication;
import com.openshift.express.client.IUser;
@@ -49,7 +49,7 @@
public ServerAdapterFactory() {
}
- public void create(IProject project, IOpenShiftWizardModel wizardModel, IProgressMonitor monitor) throws OpenShiftException {
+ public void create(IProject project, IOpenShiftExpressWizardModel wizardModel, IProgressMonitor monitor) throws OpenShiftException {
createServerAdapter(project, wizardModel.getServerType(), wizardModel.getRuntime(), wizardModel.getMode(),
wizardModel.getApplication(), wizardModel.getUser(), wizardModel.getRemoteName(), monitor);
}
14 years, 1 month
JBoss Tools SVN: r38701 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-14 10:12:45 -0500 (Tue, 14 Feb 2012)
New Revision: 38701
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
Log:
cleared warnings about unused instance var and import
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-02-14 14:51:28 UTC (rev 38700)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-02-14 15:12:45 UTC (rev 38701)
@@ -27,10 +27,8 @@
import com.openshift.express.client.IApplication;
import com.openshift.express.client.IUser;
-import com.openshift.express.client.OpenShiftException;
public class ExpressWizardFragment extends WizardFragment implements ICompletable {
- private IWizardHandle handle;
private ExpressDetailsComposite composite;
private NewServerWizardBehaviourCallback callback;
@@ -47,7 +45,6 @@
public Composite createComposite(Composite parent, IWizardHandle handle) {
- this.handle = handle;
handle.setTitle("Create an Openshift Server");
handle.setDescription("Create an Openshift Server adapter by typing in your credentials and choosing an application.");
callback = new NewServerWizardBehaviourCallback(getTaskModel(), handle, this) {
14 years, 1 month
JBoss Tools SVN: r38700 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/ui/action and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-14 09:51:28 -0500 (Tue, 14 Feb 2012)
New Revision: 38700
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewOpenShiftExpressApplicationWizard.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizard.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateApplicationAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java
Log:
Fixed - JBIDE-10829 No shell title in New Openshift Application Wizard
https://issues.jboss.org/browse/JBIDE-10829
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-14 14:22:47 UTC (rev 38699)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-14 14:51:28 UTC (rev 38700)
@@ -14,7 +14,7 @@
</category>
<wizard
category="org.jboss.ide.eclipse.as.openshift.express.ui.wizard.category"
- class="org.jboss.tools.openshift.express.internal.ui.wizard.OpenShiftExpressApplicationWizard"
+ class="org.jboss.tools.openshift.express.internal.ui.wizard.NewOpenShiftExpressApplicationWizard"
icon="icons/openshift-logo-white-icon.png"
id="org.jboss.ide.eclipse.as.openshift.express.ui.wizard.createNewApplicationWizard"
name="OpenShift Express Application">
@@ -28,7 +28,7 @@
</category>
<wizard
category="org.jboss.tools.openshift.express.ui.wizard.importCategory"
- class="org.jboss.tools.openshift.express.internal.ui.wizard.OpenShiftExpressApplicationWizard"
+ class="org.jboss.tools.openshift.express.internal.ui.wizard.ImportOpenShiftExpressApplicationWizard"
icon="icons/openshift-logo-white-icon.png"
id="org.jboss.tools.openshift.express.ui.importExistingApplicationWizard"
name="Existing OpenShift Express Application">
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateApplicationAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateApplicationAction.java 2012-02-14 14:22:47 UTC (rev 38699)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateApplicationAction.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -5,6 +5,7 @@
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
+import org.jboss.tools.openshift.express.internal.ui.wizard.NewOpenShiftExpressApplicationWizard;
import org.jboss.tools.openshift.express.internal.ui.wizard.OpenShiftExpressApplicationWizard;
import com.openshift.express.client.IUser;
@@ -29,7 +30,7 @@
Object sel = ((ITreeSelection)selection).getFirstElement();
if( sel instanceof IUser) {
IUser user = (IUser) sel;
- OpenShiftExpressApplicationWizard wizard = new OpenShiftExpressApplicationWizard(user, "New OpenShift Application");
+ OpenShiftExpressApplicationWizard wizard = new NewOpenShiftExpressApplicationWizard(user);
new WizardDialog(new Shell(), wizard).open();
}
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java 2012-02-14 14:22:47 UTC (rev 38699)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -18,6 +18,7 @@
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
+import org.jboss.tools.openshift.express.internal.ui.wizard.ImportOpenShiftExpressApplicationWizard;
import org.jboss.tools.openshift.express.internal.ui.wizard.OpenShiftExpressApplicationWizard;
import com.openshift.express.client.IApplication;
@@ -41,7 +42,7 @@
final IApplication application = (IApplication) treeSelection.getFirstElement();
final IUser user = getUser(treeSelection.getPaths());
final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(application.getName());
- OpenShiftExpressApplicationWizard wizard = new OpenShiftExpressApplicationWizard(user, project, application, "Import");
+ OpenShiftExpressApplicationWizard wizard = new ImportOpenShiftExpressApplicationWizard(user, project, application);
WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
dialog.create();
dialog.open();
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java 2012-02-14 14:22:47 UTC (rev 38699)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowPropertiesAction.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -2,7 +2,6 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-02-14 14:22:47 UTC (rev 38699)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -49,6 +49,7 @@
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.wizard.CredentialsWizardPageModel;
import org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftWizardModel;
+import org.jboss.tools.openshift.express.internal.ui.wizard.ImportOpenShiftExpressApplicationWizard;
import org.jboss.tools.openshift.express.internal.ui.wizard.OpenShiftExpressApplicationWizard;
import com.openshift.express.client.IApplication;
@@ -241,7 +242,7 @@
if( verifyButton != null ) {
importLink.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
- OpenShiftExpressApplicationWizard wizard = new OpenShiftExpressApplicationWizard("Import");
+ OpenShiftExpressApplicationWizard wizard = new ImportOpenShiftExpressApplicationWizard();
wizard.setInitialUser(fuser);
wizard.setSelectedApplication(fapplication);
WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizard.java 2012-02-14 14:22:47 UTC (rev 38699)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizard.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.wizard;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URISyntaxException;
-
-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.MessageDialog;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jgit.api.errors.JGitInternalException;
-import org.eclipse.jgit.errors.TransportException;
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.common.ui.DelegatingProgressMonitor;
-import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
-
-import com.openshift.express.client.OpenShiftException;
-
-/**
- * @author Andre Dietisheim
- *
- */
-public abstract class AbstractOpenShiftApplicationWizard<T extends IOpenShiftWizardModel> extends Wizard {
-
- private T wizardModel;
-
- public AbstractOpenShiftApplicationWizard() {
- super();
- }
-
- void setWizardModel(T wizardModel) {
- this.wizardModel = wizardModel;
- }
-
- T getWizardModel() {
- return wizardModel;
- }
-
- protected boolean isTransportException(InvocationTargetException e) {
- return e.getTargetException() instanceof JGitInternalException
- && e.getTargetException().getCause() instanceof TransportException;
- }
-
- protected TransportException getTransportException(InvocationTargetException e) {
- if (isTransportException(e)) {
- return (TransportException) ((JGitInternalException) e.getTargetException()).getCause();
- }
- return null;
- }
-
- protected void openError(final String title, final String message) {
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openError(getShell(), title, message);
- }
- });
- }
-
- protected boolean askForConfirmation(final String message, final String applicationName) {
- final boolean[] confirmed = new boolean[1];
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- confirmed[0] = MessageDialog.openConfirm(
- getShell(),
- NLS.bind("Import OpenShift Application ", applicationName),
- message);
- }
- });
- return confirmed[0];
- }
-
- /**
- * A workspace job that will create a new project or enable the selected
- * project to be used with OpenShift.
- */
- class ImportJob extends WorkspaceJob {
-
- private DelegatingProgressMonitor delegatingMonitor;
-
- public ImportJob(DelegatingProgressMonitor delegatingMonitor) {
- super("Importing project to workspace...");
- this.delegatingMonitor = delegatingMonitor;
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- try {
- delegatingMonitor.add(monitor);
-
- if (wizardModel.isNewProject()) {
- wizardModel.importProject(delegatingMonitor);
- } else if (!wizardModel.isGitSharedProject()) {
- if (!askForConfirmation(
- NLS.bind("OpenShift application {0} will be enabled on project {1} by " +
- "copying OpenShift configuration and enabling Git for the project.\n " +
- "This cannot be undone. Do you wish to continue ?",
- wizardModel.getApplicationName(), wizardModel.getProjectName()),
- wizardModel.getApplicationName())) {
- return Status.CANCEL_STATUS;
- }
- wizardModel.configureUnsharedProject(delegatingMonitor);
- } else {
- if (!askForConfirmation(
- NLS.bind("OpenShift application {0} will be enabled on project {1} by copying OpenShift " +
- "configuration and adding the OpenShift git repo as remote.\n " +
- "This cannot be undone. Do you wish to continue ?",
- wizardModel.getApplicationName(), wizardModel.getProjectName()),
- wizardModel.getApplicationName())) {
- return Status.CANCEL_STATUS;
- }
- wizardModel.configureGitSharedProject(delegatingMonitor);
- }
-
- return Status.OK_STATUS;
- } catch (final WontOverwriteException e) {
- openError("Project already present", e.getMessage());
- return Status.CANCEL_STATUS;
- } catch (final ImportFailedException e) {
- return OpenShiftUIActivator.createErrorStatus(
- "Could not import maven project {0}.", e,
- wizardModel.getProjectName());
- } catch (IOException e) {
- return OpenShiftUIActivator.createErrorStatus(
- "Could not copy openshift configuration files to project {0}", e,
- wizardModel.getProjectName());
- } catch (OpenShiftException e) {
- return OpenShiftUIActivator.createErrorStatus(
- "Could not import project to the workspace.", e);
- } catch (URISyntaxException e) {
- return OpenShiftUIActivator.createErrorStatus(
- "The url of the remote git repository is not valid", e);
- } catch (InvocationTargetException e) {
- if (isTransportException(e)) {
- TransportException te = getTransportException(e);
- return OpenShiftUIActivator
- .createErrorStatus(
- "Could not clone the repository. Authentication failed.\n"
- + " Please make sure that you added your private key to the ssh preferences.",
- te);
- } else {
- return OpenShiftUIActivator.createErrorStatus(
- "An exception occurred while creating local git repository.", e);
- }
- } catch (Exception e) {
- return OpenShiftUIActivator.createErrorStatus(
- "Could not import project to the workspace.", e);
- } finally {
- delegatingMonitor.done();
- }
- }
- }
-
-}
\ No newline at end of file
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-14 14:22:47 UTC (rev 38699)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -23,7 +23,6 @@
import com.openshift.express.client.IUser;
import com.openshift.express.client.NotFoundOpenShiftException;
-import com.openshift.express.client.OpenShiftException;
import com.openshift.express.client.configuration.OpenShiftConfiguration;
/**
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -0,0 +1,33 @@
+/**
+ *
+ */
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import org.eclipse.core.resources.IProject;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+
+/**
+ * @author Xavier Coulon
+ *
+ */
+public class ImportOpenShiftExpressApplicationWizard extends OpenShiftExpressApplicationWizard {
+
+ /**
+ * Constructor
+ */
+ public ImportOpenShiftExpressApplicationWizard() {
+ super("Import OpenShift Express Application");
+ }
+
+ /**
+ * Constructor
+ * @param user
+ * @param project
+ * @param application
+ */
+ public ImportOpenShiftExpressApplicationWizard(IUser user, IProject project, IApplication application) {
+ super(user, project, application, "Import OpenShift Express Application");
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewOpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewOpenShiftExpressApplicationWizard.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewOpenShiftExpressApplicationWizard.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -0,0 +1,24 @@
+/**
+ *
+ */
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import com.openshift.express.client.IUser;
+
+/**
+ * @author Xavier Coulon
+ *
+ */
+public class NewOpenShiftExpressApplicationWizard extends OpenShiftExpressApplicationWizard {
+
+ /**
+ * Constructor
+ */
+ public NewOpenShiftExpressApplicationWizard() {
+ super("New OpenShift Express Application");
+ }
+
+ public NewOpenShiftExpressApplicationWizard(IUser user) {
+ super(user, null, null, "New OpenShift Express Application");
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewOpenShiftExpressApplicationWizard.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-14 14:22:47 UTC (rev 38699)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -25,8 +25,11 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.errors.TransportException;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IImportWizard;
@@ -48,20 +51,12 @@
* @author Andre Dietisheim
* @author Xavier Coulon
*/
-public class OpenShiftExpressApplicationWizard extends
- AbstractOpenShiftApplicationWizard<OpenShiftExpressApplicationWizardModel> implements IImportWizard, INewWizard {
+public abstract class OpenShiftExpressApplicationWizard extends Wizard implements IImportWizard, INewWizard {
private IUser initialUser;
- /**
- * @see #getUser which calls UserModel#getRecentUser if no user present at
- * construction time
- */
- public OpenShiftExpressApplicationWizard() {
- this(null, null, null, null);
- }
+ private OpenShiftExpressApplicationWizardModel wizardModel;
-
/**
* @see #getUser which calls UserModel#getRecentUser if no user present at
* construction time
@@ -70,16 +65,57 @@
this(null, null, null, wizardTitle);
}
- public OpenShiftExpressApplicationWizard(IUser user, String wizardTitle) {
- this(user, null, null, wizardTitle);
- }
-
public OpenShiftExpressApplicationWizard(IUser user, IProject project, IApplication application, String wizardTitle) {
setWizardModel(new OpenShiftExpressApplicationWizardModel(user, project, application));
setWindowTitle(wizardTitle);
setNeedsProgressMonitor(true);
}
+ void setWizardModel(OpenShiftExpressApplicationWizardModel wizardModel) {
+ this.wizardModel = wizardModel;
+ }
+
+ OpenShiftExpressApplicationWizardModel getWizardModel() {
+ return wizardModel;
+ }
+
+ protected boolean isTransportException(InvocationTargetException e) {
+ return e.getTargetException() instanceof JGitInternalException
+ && e.getTargetException().getCause() instanceof TransportException;
+ }
+
+ protected TransportException getTransportException(InvocationTargetException e) {
+ if (isTransportException(e)) {
+ return (TransportException) ((JGitInternalException) e.getTargetException()).getCause();
+ }
+ return null;
+ }
+
+ protected void openError(final String title, final String message) {
+ getShell().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(getShell(), title, message);
+ }
+ });
+ }
+
+ protected boolean askForConfirmation(final String message, final String applicationName) {
+ final boolean[] confirmed = new boolean[1];
+ getShell().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ confirmed[0] = MessageDialog.openConfirm(
+ getShell(),
+ NLS.bind("Import OpenShift Application ", applicationName),
+ message);
+ }
+ });
+ return confirmed[0];
+ }
+
public void setSelectedApplication(IApplication application) {
getWizardModel().setApplication(application);
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java 2012-02-14 14:22:47 UTC (rev 38699)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java 2012-02-14 14:51:28 UTC (rev 38700)
@@ -59,7 +59,7 @@
private Text existingProjectNameText = null;
public ProjectAndServerAdapterSettingsWizardPage(IWizard wizard, IOpenShiftWizardModel wizardModel) {
- super("Project Configuration",
+ super("Setup Project",
"Configure your project and server adapter settings, then click 'next' or 'finish'.",
"Project Configuration", wizard);
this.pageModel = new ProjectAndServerAdapterSettingsWizardPageModel(wizardModel);
14 years, 1 month