JBoss Tools SVN: r38689 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-14 06:18:00 -0500 (Tue, 14 Feb 2012)
New Revision: 38689
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStoreException.java
Log:
added class header
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStoreException.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStoreException.java 2012-02-14 11:17:40 UTC (rev 38688)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStoreException.java 2012-02-14 11:18:00 UTC (rev 38689)
@@ -1,6 +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.utils;
/**
14 years, 1 month
JBoss Tools SVN: r38688 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-14 06:17:40 -0500 (Tue, 14 Feb 2012)
New Revision: 38688
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
Log:
added class header and authors
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java 2012-02-14 11:16:23 UTC (rev 38687)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java 2012-02-14 11:17:40 UTC (rev 38688)
@@ -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.utils;
import java.io.UnsupportedEncodingException;
@@ -10,6 +20,7 @@
/**
* @author Andre Dietisheim
+ * @author Xavier Coulon
*
*/
public class SecurePasswordStore {
14 years, 1 month
JBoss Tools SVN: r38687 - 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: xcoulon
Date: 2012-02-14 06:16:23 -0500 (Tue, 14 Feb 2012)
New Revision: 38687
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CustomControlDecorationUpdater.java
Log:
Fixed - JBIDE-10800 Application names mustn't contain "_" in their name
https://issues.jboss.org/browse/JBIDE-10800
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-14 10:41:46 UTC (rev 38686)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-14 11:16:23 UTC (rev 38687)
@@ -175,8 +175,7 @@
new ApplicationToSelectNameValidator(
useExistingAppBtnSelection, existingAppNameTextObservable, existingAppsObservable);
dbc.addValidationStatusProvider(existingAppValidator);
- ControlDecorationSupport.create(existingAppValidator, SWT.LEFT | SWT.TOP);
-
+ ControlDecorationSupport.create(existingAppValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater(false));
return existingAppSelectionGroup;
}
@@ -269,21 +268,17 @@
.in(dbc);
final ISWTObservableValue useExistingAppBtnSelection = WidgetProperties.selection().observe(useExistingAppBtn);
- final ApplicationToCreateInputValidator applicationInputValidator =
- new ApplicationToCreateInputValidator(
- useExistingAppBtnSelection, applicationNameTextObservable, selectedCartridgeComboObservable);
- dbc.addValidationStatusProvider(applicationInputValidator);
- //ControlDecorationSupport.create(applicationInputValidator, SWT.LEFT | SWT.TOP);
- ControlDecorationSupport.create(applicationInputValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater());
+ final NewApplicationNameValidator newApplicationNameValidator =
+ new NewApplicationNameValidator(
+ useExistingAppBtnSelection, applicationNameTextObservable);
+ dbc.addValidationStatusProvider(newApplicationNameValidator);
+ ControlDecorationSupport.create(newApplicationNameValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater());
+ final NewApplicationTypeValidator newApplicationTypeValidator =
+ new NewApplicationTypeValidator(
+ useExistingAppBtnSelection, selectedCartridgeComboObservable);
+ dbc.addValidationStatusProvider(newApplicationTypeValidator);
+ ControlDecorationSupport.create(newApplicationTypeValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater());
- /*
- * final ApplicationToSelectNameValidator applicationNameValidator = new
- * ApplicationToSelectNameValidator(us applicationNameStatusObservable,
- * applicationNameTextObservable);
- * dbc.addValidationStatusProvider(applicationNameValidator);
- * ControlDecorationSupport.create(applicationNameValidator, SWT.LEFT |
- * SWT.TOP);
- */
// embeddable cartridges
Group cartridgesGroup = new Group(container, SWT.NONE);
cartridgesGroup.setText("Embeddable Cartridges");
@@ -720,7 +715,8 @@
if (!useExistingApp) {
return ValidationStatus.ok();
}
- if (existingApps != null) {
+
+ if (existingApps != null && appName != null && !appName.isEmpty()) {
for (IApplication application : pageModel.getExistingApplications()) {
if (application.getName().equalsIgnoreCase(appName)) {
return ValidationStatus.ok();
@@ -743,18 +739,15 @@
}
- class ApplicationToCreateInputValidator extends MultiValidator {
+ class NewApplicationNameValidator extends MultiValidator {
private final ISWTObservableValue useExistingAppBtnbservable;
private final ISWTObservableValue applicationNameTextObservable;
- private final ISWTObservableValue cartridgesComboObservable;
- public ApplicationToCreateInputValidator(ISWTObservableValue useExistingAppBtnbservable,
- ISWTObservableValue applicationNameTextObservable,
- ISWTObservableValue cartridgesComboObservable) {
+ public NewApplicationNameValidator(ISWTObservableValue useExistingAppBtnbservable,
+ ISWTObservableValue applicationNameTextObservable) {
this.useExistingAppBtnbservable = useExistingAppBtnbservable;
this.applicationNameTextObservable = applicationNameTextObservable;
- this.cartridgesComboObservable = cartridgesComboObservable;
}
@Override
@@ -766,12 +759,13 @@
}
if (applicationName.isEmpty()) {
return new Status(IStatus.CANCEL, OpenShiftUIActivator.PLUGIN_ID,
- "Give a name and select a type for the application you want to create.");
+ "Select an alphanumerical name and a type for the application to create.");
}
-
- if (!applicationName.matches("\\S+")) {
- return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "The application name must not contain spaces.");
+ for (int i = 0; i < applicationName.length(); ++i) {
+ if (!Character.isLetterOrDigit(applicationName.charAt(i))) {
+ return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ "The application name must not contain spaces.");
+ }
}
for (IApplication application : pageModel.getExistingApplications()) {
if (application.getName().equalsIgnoreCase(applicationName)) {
@@ -786,6 +780,38 @@
public IObservableList getTargets() {
WritableList targets = new WritableList();
targets.add(applicationNameTextObservable);
+ return targets;
+ }
+ }
+
+ class NewApplicationTypeValidator extends MultiValidator {
+
+ private final ISWTObservableValue useExistingAppBtnbservable;
+ private final ISWTObservableValue cartridgesComboObservable;
+
+ public NewApplicationTypeValidator(ISWTObservableValue useExistingAppBtnbservable,
+ ISWTObservableValue cartridgesComboObservable) {
+ this.useExistingAppBtnbservable = useExistingAppBtnbservable;
+ this.cartridgesComboObservable = cartridgesComboObservable;
+ }
+
+ @Override
+ protected IStatus validate() {
+ final boolean useExistingApp = (Boolean) useExistingAppBtnbservable.getValue();
+ final String cartridge = (String) cartridgesComboObservable.getValue();
+ if (useExistingApp) {
+ return ValidationStatus.ok();
+ }
+ if(cartridge == null || cartridge.isEmpty()) {
+ return new Status(IStatus.CANCEL, OpenShiftUIActivator.PLUGIN_ID,
+ "Select an alphanumerical name and a type for the application to create.");
+ }
+ return ValidationStatus.ok();
+ }
+
+ @Override
+ public IObservableList getTargets() {
+ WritableList targets = new WritableList();
targets.add(cartridgesComboObservable);
return targets;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CustomControlDecorationUpdater.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CustomControlDecorationUpdater.java 2012-02-14 10:41:46 UTC (rev 38686)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CustomControlDecorationUpdater.java 2012-02-14 11:16:23 UTC (rev 38687)
@@ -15,7 +15,24 @@
*/
public class CustomControlDecorationUpdater extends ControlDecorationUpdater {
+ private final boolean showRequiredDecorator;
+
/**
+ * Default constructor: provides a 'REQUIRED' decorator when the status is CANCEL
+ */
+ public CustomControlDecorationUpdater() {
+ this(true);
+ }
+
+ /**
+ * Default constructor: provides a 'REQUIRED' decorator when the status is CANCEL
+ */
+ public CustomControlDecorationUpdater(final boolean showRequiredDecorator) {
+ super();
+ this.showRequiredDecorator = showRequiredDecorator;
+ }
+
+ /**
* {@inheritDoc} Overrides the standard behaviour: for CANCEL status, items are decorated with the REQUIRED
* decorator, not the ERROR one.
*/
@@ -36,7 +53,7 @@
fieldDecorationID = FieldDecorationRegistry.DEC_ERROR;
break;
case IStatus.CANCEL:
- fieldDecorationID = FieldDecorationRegistry.DEC_REQUIRED;
+ fieldDecorationID = showRequiredDecorator ? FieldDecorationRegistry.DEC_REQUIRED : null;
break;
}
14 years, 1 month
JBoss Tools SVN: r38686 - 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: xcoulon
Date: 2012-02-14 05:41:46 -0500 (Tue, 14 Feb 2012)
New Revision: 38686
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
Log:
JBIDE-10845 Application configuration UI issues JBIDE-10849
"Application creation" is tiny / not clear
https://issues.jboss.org/browse/JBIDE-10849
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-14 10:35:05 UTC (rev 38685)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-14 10:41:46 UTC (rev 38686)
@@ -122,7 +122,7 @@
// existing app checkbox
useExistingAppBtn = new Button(existingAppSelectionGroup, SWT.CHECK);
- useExistingAppBtn.setText("Use existing application");
+ useExistingAppBtn.setText("Use existing application:");
useExistingAppBtn.setToolTipText("Select an existing application or uncheck to create a new one.");
useExistingAppBtn.setFocus();
GridDataFactory.fillDefaults().span(1, 1).align(SWT.FILL, SWT.CENTER).grab(false, false)
@@ -185,7 +185,7 @@
FieldDecoration contentProposalFieldIndicator =
FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
dec.setImage(contentProposalFieldIndicator.getImage());
- dec.setDescriptionText("Auto-completion is enabled when you start typing a project name.");
+ dec.setDescriptionText("Auto-completion is enabled when you start typing an application name.");
dec.setShowOnlyOnFocus(true);
AutoCompleteField adapter =
@@ -223,7 +223,7 @@
private void createApplicationConfigurationGroup(Composite parent, DataBindingContext dbc) {
Group container = new Group(parent, SWT.NONE);
- container.setText("Application creation");
+ container.setText("New application");
GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).applyTo(container);
GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(container);
14 years, 1 month
JBoss Tools SVN: r38685 - 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: xcoulon
Date: 2012-02-14 05:35:05 -0500 (Tue, 14 Feb 2012)
New Revision: 38685
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
Log:
Fixed - textfield/browse for existing app does not work
https://issues.jboss.org/browse/JBIDE-10848
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-14 10:13:18 UTC (rev 38684)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-14 10:35:05 UTC (rev 38685)
@@ -160,7 +160,7 @@
createContentAssist(existingAppNameText);
this.browseAppsButton = new Button(existingAppSelectionGroup, SWT.NONE);
- browseAppsButton.setText("Browse");
+ browseAppsButton.setText("Browse...");
browseAppsButton.addSelectionListener(onBrowseApps());
GridDataFactory.fillDefaults()
.align(SWT.LEFT, SWT.CENTER).hint(100, SWT.DEFAULT).span(1, 1).grab(false, false)
14 years, 1 month
JBoss Tools SVN: r38684 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-14 05:13:18 -0500 (Tue, 14 Feb 2012)
New Revision: 38684
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/ApplicationPropertySource.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/EmbeddableCartridgePropertySource.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java
Log:
Fixed - OpenShift Express Console - Properties view: Properties are editable, but chaning them has no effect
https://issues.jboss.org/browse/JBIDE-10815
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/ApplicationPropertySource.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/ApplicationPropertySource.java 2012-02-14 10:09:08 UTC (rev 38683)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/ApplicationPropertySource.java 2012-02-14 10:13:18 UTC (rev 38684)
@@ -14,7 +14,7 @@
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import com.openshift.express.client.IApplication;
@@ -33,17 +33,17 @@
@Override
public Object getEditableValue() {
- return this;
+ return null;
}
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
- return new IPropertyDescriptor[] { new TextPropertyDescriptor("3.URL", "Public URL"),
- new TextPropertyDescriptor("1.Name", "Name"),
- new TextPropertyDescriptor("6.UUID", "UUID"),
- new TextPropertyDescriptor("5.Git URI", "Git URI"),
- new TextPropertyDescriptor("2.Type", "Type"),
- new TextPropertyDescriptor("4.Created on", "Created on") };
+ return new IPropertyDescriptor[] { new PropertyDescriptor("3.URL", "Public URL"),
+ new PropertyDescriptor("1.Name", "Name"),
+ new PropertyDescriptor("6.UUID", "UUID"),
+ new PropertyDescriptor("5.Git URI", "Git URI"),
+ new PropertyDescriptor("2.Type", "Type"),
+ new PropertyDescriptor("4.Created on", "Created on") };
}
@Override
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/EmbeddableCartridgePropertySource.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/EmbeddableCartridgePropertySource.java 2012-02-14 10:09:08 UTC (rev 38683)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/EmbeddableCartridgePropertySource.java 2012-02-14 10:13:18 UTC (rev 38684)
@@ -12,7 +12,7 @@
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import com.openshift.express.client.IEmbeddableCartridge;
@@ -36,8 +36,8 @@
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
- return new IPropertyDescriptor[] { new TextPropertyDescriptor("Name", "Name"),
- new TextPropertyDescriptor("URL", "URL") };
+ return new IPropertyDescriptor[] { new PropertyDescriptor("Name", "Name"),
+ new PropertyDescriptor("URL", "URL") };
}
@Override
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java 2012-02-14 10:09:08 UTC (rev 38683)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java 2012-02-14 10:13:18 UTC (rev 38684)
@@ -12,7 +12,7 @@
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import com.openshift.express.client.IUser;
@@ -36,8 +36,8 @@
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
- return new IPropertyDescriptor[] { new TextPropertyDescriptor("Username", "Username"),
- new TextPropertyDescriptor("Domain", "Domain") };
+ return new IPropertyDescriptor[] { new PropertyDescriptor("Username", "Username"),
+ new PropertyDescriptor("Domain", "Domain") };
}
@Override
14 years, 1 month
JBoss Tools SVN: r38683 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test: template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-02-14 05:09:08 -0500 (Tue, 14 Feb 2012)
New Revision: 38683
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletRuntime4x.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletRuntime5x.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreateJavaPortletTemplate.java
Removed:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/JavaPortletTestSuite.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/LoadJavaPortletInBrowserRuntime4x.java
Log:
Created separated tests for EPP 4x and 5x
Deleted: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java 2012-02-14 10:08:46 UTC (rev 38682)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java 2012-02-14 10:09:08 UTC (rev 38683)
@@ -1,104 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.core;
-
-import static org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortletProject.PROJECT_NAME;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.osgi.baseadaptor.BaseData;
-import org.eclipse.osgi.framework.internal.core.BundleHost;
-import org.jboss.tools.portlet.ui.bot.entity.XMLNode;
-import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.AbstractPortletCreationTask;
-import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JavaPortletCreationTask;
-import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JavaPortletWizardPageFillingTask;
-import org.jboss.tools.portlet.ui.bot.test.template.CreatePortletTemplate;
-import org.junit.Before;
-import org.osgi.framework.Bundle;
-
-/**
- * Creates a new java portlet and checks if the right files are generated.
- *
- * @author Lucia Jelinkova
- *
- */
-public class CreateJavaPortlet extends CreatePortletTemplate {
-
- public static final String CLASS_NAME = "UITestingJavaPortlet";
-
- private static final String PACKAGE_NAME = "org.jboss.tools.tests.ui.portlet";
-
- private static final String SOURCE_FILE_NAME = "src";
-
- private static final String CLASS_FILE = SOURCE_FILE_NAME + "/" + PACKAGE_NAME + "/" + CLASS_NAME + ".java";
-
- private static final String FULL_CLASS_NAME = PACKAGE_NAME + "." + CLASS_NAME;
-
- /**
- * An ugly fix of Eclipse issue:
- * ID: Bug 368436
- * URL: https://bugs.eclipse.org/bugs/show_bug.cgi?id=368436
- */
- @Before
- public void setUp() throws Exception {
- super.setUp();
- removeSlash("org.eclipse.jst.j2ee");
- removeSlash("org.eclipse.jst.j2ee.web");
- removeSlash("org.jboss.tools.portlet.ui");
- }
-
- private void removeSlash(String pluginName){
- Bundle bundle = Platform.getBundle(pluginName);
- if (bundle instanceof BundleHost){
- BundleHost bundleHost = (BundleHost) bundle;
- if (bundleHost.getBundleData() instanceof BaseData){
- BaseData baseData = (BaseData) bundleHost.getBundleData();
- if (baseData.getLocation().endsWith("/")){
- baseData.setLocation(baseData.getLocation().substring(0, baseData.getLocation().length() - 1));
- }
- System.out.println("Location of bundle is: " + bundle.getLocation());
- } else {
- System.out.println("The BundleHost data is not of type BaseData");
- }
- } else {
- System.out.println("The bundle is not of type BundleHost");
- }
- }
-
- @Override
- protected String getProjectName() {
- return PROJECT_NAME;
- }
-
- protected AbstractPortletCreationTask getCreatePortletTask() {
- JavaPortletWizardPageFillingTask task = new JavaPortletWizardPageFillingTask();
- task.setProject(PROJECT_NAME);
- task.setPackageName(PACKAGE_NAME);
- task.setClassName(CLASS_NAME);
-
- JavaPortletCreationTask wizardTask = new JavaPortletCreationTask();
- wizardTask.addWizardPage(task);
- return wizardTask;
- }
-
- @Override
- protected List<String> getExpectedFiles() {
- return Arrays.asList(
- DEFAULT_OBJECTS_XML,
- PORTLET_INSTANCES_XML,
- CLASS_FILE);
- }
-
- @Override
- protected List<String> getNonExpectedFiles() {
- return Arrays.asList(
- JSF_FOLDER,
- JBOSS_APP_XML,
- JBOSS_PORTLET_XML);
- }
-
- @Override
- protected List<XMLNode> getExpectedXMLNodes() {
- return Arrays.asList(new XMLNode("portlet-app/portlet/portlet-class", FULL_CLASS_NAME));
- }
-}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletRuntime4x.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletRuntime4x.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletRuntime4x.java 2012-02-14 10:09:08 UTC (rev 38683)
@@ -0,0 +1,35 @@
+package org.jboss.tools.portlet.ui.bot.test.core;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.tools.portlet.ui.bot.test.template.CreateJavaPortletTemplate;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+
+/**
+ * Creates a new java portlet and checks if the right files are generated.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+@Require(clearWorkspace=false, clearProjects=false, server=@Server(version="4.3", state=ServerState.Present))
+public class CreateJavaPortletRuntime4x extends CreateJavaPortletTemplate {
+
+ @Override
+ protected List<String> getExpectedFiles() {
+ return Arrays.asList(
+ DEFAULT_OBJECTS_XML,
+ PORTLET_INSTANCES_XML,
+ CLASS_FILE);
+ }
+
+ @Override
+ protected List<String> getNonExpectedFiles() {
+ return Arrays.asList(
+ JSF_FOLDER,
+ JBOSS_APP_XML,
+ JBOSS_PORTLET_XML);
+ }
+}
Copied: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletRuntime5x.java (from rev 38107, trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java)
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletRuntime5x.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletRuntime5x.java 2012-02-14 10:09:08 UTC (rev 38683)
@@ -0,0 +1,34 @@
+package org.jboss.tools.portlet.ui.bot.test.core;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.tools.portlet.ui.bot.test.template.CreateJavaPortletTemplate;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+
+/**
+ * Creates a new java portlet and checks if the right files are generated.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+@Require(clearWorkspace=false, clearProjects=false, server=@Server(version="5.0", operator=">", state=ServerState.Present))
+public class CreateJavaPortletRuntime5x extends CreateJavaPortletTemplate {
+
+ @Override
+ protected List<String> getExpectedFiles() {
+ return Arrays.asList(CLASS_FILE);
+ }
+
+ @Override
+ protected List<String> getNonExpectedFiles() {
+ return Arrays.asList(
+ DEFAULT_OBJECTS_XML,
+ PORTLET_INSTANCES_XML,
+ JSF_FOLDER,
+ JBOSS_APP_XML,
+ JBOSS_PORTLET_XML);
+ }
+}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/JavaPortletTestSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/JavaPortletTestSuite.java 2012-02-14 10:08:46 UTC (rev 38682)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/JavaPortletTestSuite.java 2012-02-14 10:09:08 UTC (rev 38683)
@@ -9,7 +9,8 @@
@Suite.SuiteClasses({
GateinStartupFix.class,
CreateJavaPortletProject.class,
- CreateJavaPortlet.class,
+ CreateJavaPortletRuntime4x.class,
+ CreateJavaPortletRuntime5x.class,
RunJavaPortletOnServer.class,
LoadJavaPortletInBrowserRuntime4x.class
})
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/LoadJavaPortletInBrowserRuntime4x.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/LoadJavaPortletInBrowserRuntime4x.java 2012-02-14 10:08:46 UTC (rev 38682)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/LoadJavaPortletInBrowserRuntime4x.java 2012-02-14 10:09:08 UTC (rev 38683)
@@ -10,6 +10,6 @@
@Override
protected PortletDefinition getPortletDefinition() {
- return portlet(CreateJavaPortlet.CLASS_NAME);
+ return portlet(CreateJavaPortletRuntime5x.CLASS_NAME);
}
}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreateJavaPortletTemplate.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreateJavaPortletTemplate.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreateJavaPortletTemplate.java 2012-02-14 10:09:08 UTC (rev 38683)
@@ -0,0 +1,87 @@
+package org.jboss.tools.portlet.ui.bot.test.template;
+
+import static org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortletProject.PROJECT_NAME;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osgi.baseadaptor.BaseData;
+import org.eclipse.osgi.framework.internal.core.BundleHost;
+import org.jboss.tools.portlet.ui.bot.entity.XMLNode;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.AbstractPortletCreationTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JavaPortletCreationTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JavaPortletWizardPageFillingTask;
+import org.junit.Before;
+import org.osgi.framework.Bundle;
+
+/**
+ * Creates a new java portlet and checks if the right files are generated.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public abstract class CreateJavaPortletTemplate extends CreatePortletTemplate {
+
+ public static final String CLASS_NAME = "UITestingJavaPortlet";
+
+ protected static final String PACKAGE_NAME = "org.jboss.tools.tests.ui.portlet";
+
+ protected static final String SOURCE_FILE_NAME = "src";
+
+ protected static final String CLASS_FILE = SOURCE_FILE_NAME + "/" + PACKAGE_NAME + "/" + CLASS_NAME + ".java";
+
+ protected static final String FULL_CLASS_NAME = PACKAGE_NAME + "." + CLASS_NAME;
+
+ /**
+ * An ugly fix of Eclipse issue:
+ * ID: Bug 368436
+ * URL: https://bugs.eclipse.org/bugs/show_bug.cgi?id=368436
+ */
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ removeSlash("org.eclipse.jst.j2ee");
+ removeSlash("org.eclipse.jst.j2ee.web");
+ removeSlash("org.jboss.tools.portlet.ui");
+ }
+
+ private void removeSlash(String pluginName){
+ Bundle bundle = Platform.getBundle(pluginName);
+ if (bundle instanceof BundleHost){
+ BundleHost bundleHost = (BundleHost) bundle;
+ if (bundleHost.getBundleData() instanceof BaseData){
+ BaseData baseData = (BaseData) bundleHost.getBundleData();
+ if (baseData.getLocation().endsWith("/")){
+ baseData.setLocation(baseData.getLocation().substring(0, baseData.getLocation().length() - 1));
+ }
+ System.out.println("Location of bundle is: " + bundle.getLocation());
+ } else {
+ System.out.println("The BundleHost data is not of type BaseData");
+ }
+ } else {
+ System.out.println("The bundle is not of type BundleHost");
+ }
+ }
+
+ @Override
+ protected String getProjectName() {
+ return PROJECT_NAME;
+ }
+
+ protected AbstractPortletCreationTask getCreatePortletTask() {
+ JavaPortletWizardPageFillingTask task = new JavaPortletWizardPageFillingTask();
+ task.setProject(PROJECT_NAME);
+ task.setPackageName(PACKAGE_NAME);
+ task.setClassName(CLASS_NAME);
+
+ JavaPortletCreationTask wizardTask = new JavaPortletCreationTask();
+ wizardTask.addWizardPage(task);
+ return wizardTask;
+ }
+
+ @Override
+ protected List<XMLNode> getExpectedXMLNodes() {
+ return Arrays.asList(new XMLNode("portlet-app/portlet/portlet-class", FULL_CLASS_NAME));
+ }
+}
14 years, 1 month
JBoss Tools SVN: r38682 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-02-14 05:08:46 -0500 (Tue, 14 Feb 2012)
New Revision: 38682
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java
Log:
Created separated tests for EPP 4x and 5x
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java 2012-02-14 09:19:59 UTC (rev 38681)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java 2012-02-14 10:08:46 UTC (rev 38682)
@@ -1,7 +1,8 @@
package org.jboss.tools.portlet.ui.bot.test;
-import org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortlet;
import org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortletProject;
+import org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortletRuntime4x;
+import org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortletRuntime5x;
import org.jboss.tools.portlet.ui.bot.test.core.LoadJavaPortletInBrowserRuntime4x;
import org.jboss.tools.portlet.ui.bot.test.core.RunJavaPortletOnServer;
import org.jboss.tools.portlet.ui.bot.test.example.JSFPortletExampleRuntime4x;
@@ -27,7 +28,8 @@
@Suite.SuiteClasses({
GateinStartupFix.class,
CreateJavaPortletProject.class,
- CreateJavaPortlet.class,
+ CreateJavaPortletRuntime4x.class,
+ CreateJavaPortletRuntime5x.class,
RunJavaPortletOnServer.class,
LoadJavaPortletInBrowserRuntime4x.class,
CreateJSFPortletProject.class,
14 years, 1 month
JBoss Tools SVN: r38681 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/core/behaviour and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-14 04:19:59 -0500 (Tue, 14 Feb 2012)
New Revision: 38681
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/core/behaviour/ExpressBinaryPublishMethod.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.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/behaviour/ExpressWizardFragment.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
Log:
JBIDE-10480 - best effort thus far for hybrid server
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 09:16:11 UTC (rev 38680)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-14 09:19:59 UTC (rev 38681)
@@ -71,6 +71,7 @@
serverTypes="org.jboss.tools.openshift.express.openshift.server.type"
typeId="openshift">
</behaviour>
+ <!--
<behaviour
behaviourDelegate="org.jboss.tools.openshift.express.internal.core.behaviour.ExpressBinaryBehaviourDelegate"
launchDelegate="org.jboss.tools.openshift.express.internal.core.behaviour.ExpressLaunchDelegate"
@@ -79,6 +80,7 @@
serverTypes="org.jboss.ide.eclipse.as.70"
typeId="openshiftBinary">
</behaviour>
+ -->
</extension>
<extension
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java 2012-02-14 09:16:11 UTC (rev 38680)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java 2012-02-14 09:19:59 UTC (rev 38681)
@@ -11,16 +11,12 @@
package org.jboss.tools.openshift.express.internal.core.behaviour;
import org.eclipse.core.resources.IProject;
-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.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
@@ -29,7 +25,6 @@
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class ExpressBinaryPublishMethod extends ExpressPublishMethod {
@@ -42,7 +37,7 @@
if( outProject != null ) {
final IProject destProj = ResourcesPlugin.getWorkspace().getRoot().getProject(outProject);
if( destProj.exists() ) {
- refreshProject(destProj);
+ refreshProject(destProj,new NullProgressMonitor());
commitAndPushProject(destProj, behaviour, monitor);
}
}
@@ -50,11 +45,6 @@
return areAllPublished(behaviour) ? IServer.PUBLISH_STATE_NONE : IServer.PUBLISH_STATE_INCREMENTAL;
}
- private void refreshProject(final IProject project) throws CoreException {
- // Already inside a workspace scheduling rule
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
-
@Override
public int publishModule(DeployableServerBehavior behaviour, int kind,
int deltaKind, IModule[] module, IProgressMonitor monitor)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2012-02-14 09:16:11 UTC (rev 38680)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2012-02-14 09:19:59 UTC (rev 38681)
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.jboss.tools.openshift.express.internal.core.behaviour;
-import java.util.ArrayList;
-
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.egit.core.op.PushOperationResult;
@@ -29,17 +29,19 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.jboss.ide.eclipse.archives.webtools.modules.LocalZippedPublisherUtil;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.tools.openshift.egit.core.EGitUtils;
import org.jboss.tools.openshift.express.internal.ui.console.ConsoleUtils;
public class ExpressPublishMethod implements IJBossServerPublishMethod {
- private ArrayList<IProject> projectsLackingGitRepo = null;
-
public ExpressPublishMethod() {
// TODO Auto-generated constructor stub
}
@@ -54,11 +56,14 @@
@Override
public int publishFinish(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
- if( projectsLackingGitRepo != null ) {
- IProject[] projects = (IProject[]) projectsLackingGitRepo.toArray(new IProject[projectsLackingGitRepo.size()]);
- shareProjects(projects);
- projectsLackingGitRepo = null;
+ IProject destProj = ExpressServerUtils.findProjectForServersApplication(behaviour.getServer());
+ if( destProj != null ) {
+ if( destProj.exists() ) {
+ refreshProject(destProj, submon(monitor, 100));
+ commitAndPushProject(destProj, behaviour, submon(monitor, 100));
+ }
}
+
return areAllPublished(behaviour) ? IServer.PUBLISH_STATE_NONE : IServer.PUBLISH_STATE_INCREMENTAL;
}
@@ -85,24 +90,27 @@
if( s == null || !s.equals("user"))
return -1;
+ if( module.length > 1 )
+ return 0;
- int state = behaviour.getServer().getModulePublishState(module);
- IProject p = module[module.length-1].getProject();
+ IProject destProj = ExpressServerUtils.findProjectForServersApplication(behaviour.getServer());
+ IPath dest = destProj.getLocation().append("deployments");
- if( deltaKind == ServerBehaviourDelegate.REMOVED)
- return IServer.PUBLISH_STATE_NONE; // go ahead and remove it
-
- Repository repository = EGitUtils.getRepository(p);
- if (repository==null) {
- if( projectsLackingGitRepo == null )
- projectsLackingGitRepo = new ArrayList<IProject>();
- projectsLackingGitRepo.add(p);
- return IServer.PUBLISH_STATE_UNKNOWN;
+ if( module.length == 0 ) return IServer.PUBLISH_STATE_NONE;
+ int modulePublishState = behaviour.getServer().getModulePublishState(module);
+ int publishType = behaviour.getPublishType(kind, deltaKind, modulePublishState);
+
+ IModuleResourceDelta[] delta = new IModuleResourceDelta[]{};
+ if( deltaKind != ServerBehaviourDelegate.REMOVED)
+ delta = behaviour.getPublishedResourceDelta(module);
+
+ try {
+ LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
+ IStatus status = util.publishModule(behaviour.getServer(), dest.toString(), module, publishType, delta, monitor);
+ } catch( Exception e ) {
+ e.printStackTrace();
}
-
- commitAndPushProject(p, behaviour, monitor);
-
- return IServer.PUBLISH_STATE_NONE;
+ return 0;
}
protected PushOperationResult commitAndPushProject(IProject p,
@@ -205,10 +213,22 @@
return null;
}
- @Override
public String getPublishDefaultRootFolder(IServer server) {
- // TODO Auto-generated method stub
- return null;
+ IDeployableServer s = ServerConverter.getDeployableServer(server);
+ return s.getDeployFolder();
}
+ protected void refreshProject(final IProject project,IProgressMonitor monitor) throws CoreException {
+ // Already inside a workspace scheduling rule
+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ }
+
+ public static IProgressMonitor submon( final IProgressMonitor parent, final int ticks ) {
+ return submon( parent, ticks, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL );
+ }
+ public static IProgressMonitor submon( final IProgressMonitor parent,
+ final int ticks, final int style ) {
+ return ( parent == null ? new NullProgressMonitor() : new SubProgressMonitor( parent, ticks, style ) );
+ }
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java 2012-02-14 09:16:11 UTC (rev 38680)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java 2012-02-14 09:19:59 UTC (rev 38681)
@@ -12,48 +12,26 @@
import java.net.URL;
+import org.eclipse.core.resources.IProject;
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.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.model.IURLProvider;
-import org.eclipse.wst.server.core.model.ServerDelegate;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-public class ExpressServer extends ServerDelegate implements IURLProvider {
+public class ExpressServer extends DeployableServer implements IURLProvider {
public void setDefaults(IProgressMonitor monitor) {
- super.setDefaults(monitor);
+ getServerWorkingCopy().setName(ServerUtil.getDefaultServerName(getServer().getServerType().getName()));
setAttribute(IDeployableServer.SERVER_MODE, ExpressBehaviourDelegate.OPENSHIFT_ID);
}
- public IStatus canModifyModules(IModule[] add, IModule[] remove) {
- // safety
- add = add == null ? new IModule[0] : add;
- remove = remove == null ? new IModule[0] : remove;
-
- // Can only add a module if the server has zero, and even then, can only add 1.
- IModule[] mods = getServer().getModules();
- if( mods.length == 1 && add.length == 1 && add[0].equals(mods[0]))
- return Status.OK_STATUS;
-
-
- boolean canModify = mods.length == 0 && add.length == 1;
- canModify &= remove.length == 0;
-
- if(!canModify )
- return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID, ExpressMessages.cannotModifyModules);
-
- // Make sure if there's a requried mod, the one being added matches it
- String requiredMod = getAttribute(ExpressServerUtils.ATTRIBUTE_APPLICATION_NAME, (String)null);
- if( requiredMod != null && !requiredMod.equals(add[0].getName())) {
- return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- NLS.bind(ExpressMessages.additionNotRequiredModule, requiredMod));
- }
+ public IStatus canModifyModules(IModule[] add, IModule[] remove) {
return Status.OK_STATUS;
}
@@ -77,7 +55,9 @@
@Override
public URL getModuleRootURL(IModule module) {
- boolean shouldIgnore = ExpressServerUtils.getIgnoresContextRoot(getServer());
+ IProject appProj = ExpressServerUtils.findProjectForServersApplication(getServer());
+ IProject p =module.getProject();
+ boolean shouldIgnore = ExpressServerUtils.getIgnoresContextRoot(getServer()) && p.equals(appProj);
return JBossServer.getModuleRootURL(module, getServer().getHost(), 80, shouldIgnore);
}
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-14 09:16:11 UTC (rev 38680)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-02-14 09:19:59 UTC (rev 38681)
@@ -33,6 +33,7 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.ServerCreationUtils;
import org.jboss.tools.openshift.egit.core.EGitUtils;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import com.openshift.express.client.IApplication;
import com.openshift.express.client.IUser;
@@ -343,20 +344,46 @@
return null;
}
- public static IProject findProjectForApplication(IApplication application)
- throws OpenShiftException, CoreException {
- String gitUri = application.getGitUri();
+ public static IProject findProjectForApplication(IApplication application) {
+ if( application ==null )
+ return null;
+ String gitUri = null;
+ try {
+ gitUri = application.getGitUri();
+ } catch(OpenShiftException ose) {
+ return null;
+ }
+
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for( int i = 0; i < projects.length; i++ ) {
- List<URIish> uris = EGitUtils.getRemoteURIs(projects[i]);
- Iterator<URIish> it = uris.iterator();
- while(it.hasNext()) {
- String projURI = it.next().toPrivateString();
- if( projURI.equals(gitUri))
- return projects[i];
+ List<URIish> uris = null;
+ try {
+ uris = EGitUtils.getRemoteURIs(projects[i]);
+ Iterator<URIish> it = uris.iterator();
+ while(it.hasNext()) {
+ String projURI = it.next().toPrivateString();
+ if( projURI.equals(gitUri))
+ return projects[i];
+ }
+ } catch(CoreException ce) {
+ // Log? Not 100 required, just skip this project?
}
}
return null;
}
+ public static IProject findProjectForServersApplication(IServer server) {
+ try {
+ String user = ExpressServerUtils.getExpressUsername(server);
+ IUser user2 = UserModel.getDefault().findUser(user);
+ String appName = ExpressServerUtils.getExpressApplicationName(server);
+ IApplication app = user2.getApplicationByName(appName);
+ IProject destProj = ExpressServerUtils.findProjectForApplication(app);
+ return destProj;
+ } catch(OpenShiftException ose) {
+ //TODO log and throw core e
+ }
+ return null;
+ }
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java 2012-02-14 09:16:11 UTC (rev 38680)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java 2012-02-14 09:19:59 UTC (rev 38681)
@@ -126,15 +126,7 @@
}
public IUser findUser(String username) {
- try {
- for( int i = 0; i < allUsers.size(); i++ ) {
- if( allUsers.get(i).getUUID().equals(username))
- return allUsers.get(i);
- }
- } catch(OpenShiftException ose) {
-
- }
- return null;
+ return allUsers.get(username);
}
public IUser[] getUsers() {
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 09:16:11 UTC (rev 38680)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-02-14 09:19:59 UTC (rev 38681)
@@ -23,16 +23,20 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
@@ -45,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.OpenShiftExpressApplicationWizard;
import com.openshift.express.client.IApplication;
import com.openshift.express.client.IUser;
@@ -62,6 +67,7 @@
private ModifyListener nameModifyListener, remoteModifyListener,
appModifyListener, deployProjectModifyListener;
private ModifyListener passModifyListener;
+ private Link importLink;
protected Text userText, remoteText;
protected Text passText;
protected Combo appNameCombo, deployProjectCombo;
@@ -154,6 +160,11 @@
}
if( showVerify ) {
+ importLink = new Link(composite, SWT.DEFAULT);
+ importLink.setText("<a>Import this application</a>"); //$NON-NLS-1$
+ importLink.setEnabled(false);
+ GridData gd = GridDataFactory.fillDefaults().span(2, 1).create();
+ importLink.setLayoutData(gd);
verifyButton = new Button(composite, SWT.PUSH);
verifyButton.setText("Verify...");
}
@@ -228,6 +239,19 @@
}
if( verifyButton != null ) {
+ importLink.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ OpenShiftExpressApplicationWizard wizard = new OpenShiftExpressApplicationWizard();
+ wizard.setInitialUser(fuser);
+ wizard.setSelectedApplication(fapplication);
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+ dialog.create();
+ dialog.open();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
verifyButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
verifyPressed();
@@ -258,6 +282,7 @@
}
private void postLongRunningValidate() {
+ importLink.setEnabled(true);
if( appListNames == null ) {
appListNames = new String[0];
}
@@ -267,6 +292,13 @@
if( index != -1 )
appNameCombo.select(index);
}
+ if( error == null ) {
+ IProject p = ExpressServerUtils.findProjectForApplication(fapplication);
+ if( p == null ) {
+ error = "Your workspace does not have a project corresponding to " + app +". Please import one.";
+ importLink.setEnabled(true);
+ }
+ }
callback.setErrorMessage(error);
verifyButton.setEnabled(true);
}
@@ -340,7 +372,6 @@
private void verifyApplicationBinaryMode(CredentialsWizardPageModel model) {
- System.out.println(deployProject);
IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(deployProject);
try {
fuser = OpenShiftUIActivator.getDefault().getUser();
@@ -382,11 +413,16 @@
try {
ExpressDetailsComposite.this.fapplication = application;
ExpressDetailsComposite.this.fuser = user;
+ IProject p = ExpressServerUtils.findProjectForApplication(fapplication);
// update the values
IServerWorkingCopy wc = callback.getServer();
ExpressServerUtils.fillServerWithOpenShiftDetails(wc, application, fuser,
mode, remote);
+ wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_CUSTOM);
+ wc.setAttribute(IDeployableServer.ZIP_DEPLOYMENTS_PREF, true);
+ wc.setAttribute(IDeployableServer.DEPLOY_DIRECTORY, p.getFolder("deployments").getLocation().toString());
+ wc.setAttribute(IDeployableServer.TEMP_DEPLOY_DIRECTORY, p.getFolder("deployments").getLocation().toString());
} catch(CoreException ce) {
// TODO FIX HANDLE
}
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 09:16:11 UTC (rev 38680)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-02-14 09:19:59 UTC (rev 38681)
@@ -75,16 +75,15 @@
IUser user = composite.getUser();
UserModel.getDefault().addUser(user);
IApplication app = composite.getApplication();
- try {
- // Only clone and import if there's no project already in existence
- IProject p = ExpressServerUtils.findProjectForApplication(app);
- if( p == null ) {
- // clone and import
-
- // If we had to clone and import, we also need to add the module ??
- }
- } catch(OpenShiftException ose ) {
+
+ // Only clone and import if there's no project already in existence
+ IProject p = ExpressServerUtils.findProjectForApplication(app);
+ System.out.println(p);
+ if( p == null ) {
+ System.out.println(p);
+ // clone and import
- }
+ // If we had to clone and import, we also need to add the module ??
+ }
}
}
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 09:16:11 UTC (rev 38680)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-14 09:19:59 UTC (rev 38681)
@@ -104,6 +104,10 @@
IWizardPage[] pages = getPages();
return initialUser == null ? pages[0] : pages[1];
}
+
+ public void setInitialUser(IUser user) {
+ this.initialUser = user;
+ }
@Override
public boolean performFinish() {
14 years, 1 month
JBoss Tools SVN: r38680 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-14 04:16:11 -0500 (Tue, 14 Feb 2012)
New Revision: 38680
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleRestartSection.java
Log:
JBIDE-10894
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleRestartSection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleRestartSection.java 2012-02-14 09:02:44 UTC (rev 38679)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ModuleRestartSection.java 2012-02-14 09:16:11 UTC (rev 38680)
@@ -53,13 +53,13 @@
public void createSection(Composite parent) {
super.createSection(parent);
createUI(parent);
- addListeners();
DeployableServer ds = (DeployableServer)ServerConverter.getDeployableServer(server.getOriginal());
String defaultPattern = ds.getDefaultModuleRestartPattern();
String pattern = server.getAttribute(IDeployableServer.ORG_JBOSS_TOOLS_AS_RESTART_FILE_PATTERN, defaultPattern);
customizePattern.setSelection(!defaultPattern.equals(pattern));
restartPatternText.setEnabled(!defaultPattern.equals(pattern));
restartPatternText.setText(pattern == null ? defaultPattern : pattern);
+ addListeners();
}
protected void createUI(Composite parent) {
14 years, 1 month