JBoss Tools SVN: r38729 - 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 17:11:14 -0500 (Tue, 14 Feb 2012)
New Revision: 38729
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUtils.java
Log:
[JBIDE-10901] fixing erroneous state when running wizard from console ("Import application")
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java 2012-02-14 22:10:59 UTC (rev 38728)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java 2012-02-14 22:11:14 UTC (rev 38729)
@@ -51,5 +51,13 @@
return System.getProperty(LINE_SEPARATOR_KEY);
}
+ public static boolean isAlphaNumeric(String value) {
+ for (int i = 0; i < value.length(); ++i) {
+ if (!Character.isLetterOrDigit(value.charAt(i))) {
+ return false;
+ }
+ }
+ return true;
+ }
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUtils.java 2012-02-14 22:10:59 UTC (rev 38728)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/UIUtils.java 2012-02-14 22:11:14 UTC (rev 38729)
@@ -16,12 +16,16 @@
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbenchActionConstants;
@@ -34,14 +38,47 @@
public class UIUtils {
public static void selectAllOnFocus(final Text text) {
- text.addFocusListener(new FocusAdapter() {
+ final FocusListener onFocus = new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
text.selectAll();
}
+ };
+ text.addFocusListener(onFocus);
+ text.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ text.removeFocusListener(onFocus);
+ }
});
+ }
+ /**
+ * Ensures that the given text gets the focus if the given control is
+ * selected.
+ *
+ * @param control
+ * @param text
+ */
+ public static void focusOnSelection(final Control control, final Text text) {
+ final Listener onSelect = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ text.selectAll();
+ text.setFocus();
+ }
+ };
+ control.addListener(SWT.Selection, onSelect);
+ control.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ control.removeListener(SWT.Selection, onSelect);
+ }
+ });
}
/**
14 years, 1 month
JBoss Tools SVN: r38728 - 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 17:10:59 -0500 (Tue, 14 Feb 2012)
New Revision: 38728
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/ApplicationConfigurationWizardPageModel.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/IOpenShiftExpressWizardModel.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
Log:
[JBIDE-10901] fixing erroneous state when running wizard from console ("Import application")
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 20:11:40 UTC (rev 38727)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-14 22:10:59 UTC (rev 38728)
@@ -36,6 +36,7 @@
import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.databinding.viewers.ViewerProperties;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
@@ -99,12 +100,18 @@
private Button useExistingAppBtn;
private Text existingAppNameText;
private Button browseAppsButton;
- private Text newApplicationNameText;
+ private Group appConfigurationGroup;
public ApplicationConfigurationWizardPage(IWizard wizard, OpenShiftExpressApplicationWizardModel wizardModel) {
super("Setup OpenShift Application", "Select an existing or create a new OpenShift Express Application.",
"Setup OpenShift Application", wizard);
- this.pageModel = new ApplicationConfigurationWizardPageModel(wizardModel);
+ try {
+ this.pageModel = new ApplicationConfigurationWizardPageModel(wizardModel);
+ } catch (OpenShiftException e) {
+ IStatus status = OpenShiftUIActivator.createErrorStatus(e.getMessage(), e);
+ OpenShiftUIActivator.log(status);
+ ErrorDialog.openError(getShell(), "Error", "Error initializing application configuration page", status);
+ }
}
@Override
@@ -127,38 +134,29 @@
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)
- .applyTo(useExistingAppBtn);
- final IObservableValue useExistingAppObservable = BeanProperties.value(
- ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION).observe(pageModel);
- final ISWTObservableValue useExistingAppBtnSelection = WidgetProperties.selection().observe(useExistingAppBtn);
+ GridDataFactory.fillDefaults()
+ .span(1, 1).align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(useExistingAppBtn);
+ IObservableValue useExistingAppObservable =
+ BeanProperties.value(ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION)
+ .observe(pageModel);
+ final IObservableValue useExistingAppBtnSelection =
+ WidgetProperties.selection().observe(useExistingAppBtn);
dbc.bindValue(useExistingAppBtnSelection, useExistingAppObservable);
// existing app name
this.existingAppNameText = new Text(existingAppSelectionGroup, SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false)
.applyTo(existingAppNameText);
- final IObservableValue existingAppNameModelObservable =
+ IObservableValue existingAppNameTextObservable =
+ WidgetProperties.text(SWT.Modify).observe(existingAppNameText);
+ IObservableValue existingAppNameModelObservable =
BeanProperties.value(
ApplicationConfigurationWizardPageModel.PROPERTY_EXISTING_APPLICATION_NAME).observe(pageModel);
- final ISWTObservableValue existingAppNameTextObservable =
- WidgetProperties.text(SWT.Modify).observe(existingAppNameText);
ValueBindingBuilder
.bind(existingAppNameTextObservable)
.to(existingAppNameModelObservable)
.in(dbc);
- if (pageModel.getExistingApplicationName() != null) {
- existingAppNameText.setText(pageModel.getExistingApplicationName());
- }
- // move focus to the project name text control when choosing the 'Use an
- // existing project' option.
- useExistingAppBtn.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- existingAppNameText.setFocus();
- existingAppNameText.selectAll();
- }
- });
+ UIUtils.focusOnSelection(useExistingAppBtn, existingAppNameText);
createContentAssist(existingAppNameText);
this.browseAppsButton = new Button(existingAppSelectionGroup, SWT.NONE);
@@ -177,7 +175,8 @@
new ApplicationToSelectNameValidator(
useExistingAppBtnSelection, existingAppNameTextObservable, existingAppsObservable);
dbc.addValidationStatusProvider(existingAppValidator);
- ControlDecorationSupport.create(existingAppValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater(false));
+ ControlDecorationSupport.create(
+ existingAppValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater(false));
return existingAppSelectionGroup;
}
@@ -223,22 +222,28 @@
}
private void createApplicationConfigurationGroup(Composite parent, DataBindingContext dbc) {
- Group container = new Group(parent, SWT.NONE);
- 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);
+ this.appConfigurationGroup = new Group(parent, SWT.NONE);
+ appConfigurationGroup.setText("New application");
+ GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).applyTo(appConfigurationGroup);
+ GridDataFactory.fillDefaults()
+ .grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(appConfigurationGroup);
IObservableValue useExistingApplication = BeanProperties
.value(ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION)
.observe(pageModel);
- enableApplicationWidgets(pageModel.isUseExistingApplication(), container, existingAppNameText, browseAppsButton);
+ enableApplicationWidgets(
+ pageModel.isUseExistingApplication()
+ , appConfigurationGroup
+ , existingAppNameText
+ , browseAppsButton);
+
useExistingApplication.addValueChangeListener(
- onUseExistingApplication(container, existingAppNameText, browseAppsButton));
+ onUseExistingApplication(appConfigurationGroup, existingAppNameText, browseAppsButton));
- Label applicationNameLabel = new Label(container, SWT.NONE);
+ Label applicationNameLabel = new Label(appConfigurationGroup, SWT.NONE);
applicationNameLabel.setText("Name:");
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(applicationNameLabel);
- this.newApplicationNameText = new Text(container, SWT.BORDER);
+ Text newApplicationNameText = new Text(appConfigurationGroup, SWT.BORDER);
GridDataFactory.fillDefaults()
.grab(true, false).align(SWT.FILL, SWT.FILL).applyTo(newApplicationNameText);
UIUtils.selectAllOnFocus(newApplicationNameText);
@@ -253,10 +258,10 @@
.to(applicationNameModelObservable)
.in(dbc);
- Label applicationTypeLabel = new Label(container, SWT.NONE);
+ Label applicationTypeLabel = new Label(appConfigurationGroup, SWT.NONE);
applicationTypeLabel.setText("Type:");
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).applyTo(applicationTypeLabel);
- Combo cartridgesCombo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
+ Combo cartridgesCombo = new Combo(appConfigurationGroup, SWT.BORDER | SWT.READ_ONLY);
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false).applyTo(cartridgesCombo);
fillCartridgesCombo(dbc, cartridgesCombo);
@@ -274,15 +279,17 @@
new NewApplicationNameValidator(
useExistingAppBtnSelection, applicationNameTextObservable);
dbc.addValidationStatusProvider(newApplicationNameValidator);
- ControlDecorationSupport.create(newApplicationNameValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater());
+ 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());
+ ControlDecorationSupport.create(newApplicationTypeValidator, SWT.LEFT | SWT.TOP, null,
+ new CustomControlDecorationUpdater());
// embeddable cartridges
- Group cartridgesGroup = new Group(container, SWT.NONE);
+ Group cartridgesGroup = new Group(appConfigurationGroup, SWT.NONE);
cartridgesGroup.setText("Embeddable Cartridges");
GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).span(2, 1).applyTo(cartridgesGroup);
GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).applyTo(cartridgesGroup);
@@ -309,7 +316,7 @@
uncheckAllButton.addSelectionListener(onUncheckAll());
// bottom filler
- Composite spacer = new Composite(container, SWT.NONE);
+ Composite spacer = new Composite(appConfigurationGroup, SWT.NONE);
GridDataFactory.fillDefaults()
.span(2, 1).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(spacer);
}
@@ -637,14 +644,19 @@
public void run() {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- onPageActivated2(dbc);
+ loadOpenshiftResources(dbc);
+ enableApplicationWidgets(
+ pageModel.isUseExistingApplication()
+ , appConfigurationGroup
+ , existingAppNameText
+ , browseAppsButton);
}
});
}
}.start();
}
- protected void onPageActivated2(final DataBindingContext dbc) {
+ protected void loadOpenshiftResources(final DataBindingContext dbc) {
try {
WizardUtils.runInWizard(new Job("Loading existing applications...") {
@Override
@@ -655,12 +667,11 @@
} catch (NotFoundOpenShiftException e) {
return Status.OK_STATUS;
} catch (Exception e) {
- return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID, "Could not load applications",
- e);
+ return OpenShiftUIActivator.createErrorStatus("Could not load applications", e);
}
}
- }, getContainer(), getDataBindingContext());
+ }, getContainer(), dbc);
WizardUtils.runInWizard(new Job("Loading application cartridges...") {
@Override
@@ -671,11 +682,10 @@
} catch (NotFoundOpenShiftException e) {
return Status.OK_STATUS;
} catch (Exception e) {
- return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "Could not load application cartridges", e);
+ return OpenShiftUIActivator.createErrorStatus("Could not load application cartridges", e);
}
}
- }, getContainer(), getDataBindingContext());
+ }, getContainer(), dbc);
WizardUtils.runInWizard(new Job("Loading embeddable cartridges...") {
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -685,11 +695,10 @@
} catch (NotFoundOpenShiftException e) {
return Status.OK_STATUS;
} catch (Exception e) {
- return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "Could not load embeddable cartridges", e);
+ return OpenShiftUIActivator.createErrorStatus("Could not load embeddable cartridges", e);
}
}
- }, getContainer(), getDataBindingContext());
+ }, getContainer(), dbc);
} catch (Exception ex) {
// ignore
}
@@ -697,12 +706,12 @@
class ApplicationToSelectNameValidator extends MultiValidator {
- private final ISWTObservableValue useExistingAppBtnbservable;
- private final ISWTObservableValue existingAppNameTextObservable;
+ private final IObservableValue useExistingAppBtnbservable;
+ private final IObservableValue existingAppNameTextObservable;
private final IObservableValue existingAppsObservable;
- public ApplicationToSelectNameValidator(ISWTObservableValue useExistingAppBtnbservable,
- ISWTObservableValue existingAppNameTextObservable, IObservableValue existingAppsObservable) {
+ public ApplicationToSelectNameValidator(IObservableValue useExistingAppBtnbservable,
+ IObservableValue existingAppNameTextObservable, IObservableValue existingAppsObservable) {
this.useExistingAppBtnbservable = useExistingAppBtnbservable;
this.existingAppNameTextObservable = existingAppNameTextObservable;
this.existingAppsObservable = existingAppsObservable;
@@ -717,7 +726,7 @@
if (!useExistingApp) {
return ValidationStatus.ok();
}
-
+
if (existingApps != null && appName != null && !appName.isEmpty()) {
for (IApplication application : pageModel.getExistingApplications()) {
if (application.getName().equalsIgnoreCase(appName)) {
@@ -760,23 +769,38 @@
return ValidationStatus.ok();
}
if (applicationName.isEmpty()) {
- return new Status(IStatus.CANCEL, OpenShiftUIActivator.PLUGIN_ID,
+ return OpenShiftUIActivator.createCancelStatus(
"Select an alphanumerical name and a type for the application to create.");
}
- 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.");
- }
+ if (!StringUtils.isAlphaNumeric(applicationName)) {
+ return OpenShiftUIActivator.createErrorStatus(
+ "The application name must not contain spaces.");
}
- final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(applicationName);
- if(project.exists()) {
- return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "A project with the same name already exists in the workspace.");
+ if (isExistingApplication(applicationName)) {
+ return OpenShiftUIActivator.createErrorStatus(
+ "An application with the same name already exists on OpenShift.");
}
+ if (isExistingProject(applicationName)) {
+ return OpenShiftUIActivator.createErrorStatus(
+ NLS.bind("A project {0} already exists in the workspace.", applicationName));
+ }
return ValidationStatus.ok();
}
+ private boolean isExistingApplication(final String applicationName) {
+ for (IApplication application : pageModel.getExistingApplications()) {
+ if (application.getName().equalsIgnoreCase(applicationName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isExistingProject(String name) {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
+ return project.exists();
+ }
+
@Override
public IObservableList getTargets() {
WritableList targets = new WritableList();
@@ -784,7 +808,7 @@
return targets;
}
}
-
+
class NewApplicationTypeValidator extends MultiValidator {
private final ISWTObservableValue useExistingAppBtnbservable;
@@ -799,12 +823,12 @@
@Override
protected IStatus validate() {
final boolean useExistingApp = (Boolean) useExistingAppBtnbservable.getValue();
- final String cartridge = (String) cartridgesComboObservable.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,
+ if (cartridge == null || cartridge.isEmpty()) {
+ return OpenShiftUIActivator.createCancelStatus(
"Select an alphanumerical name and a type for the application to create.");
}
return ValidationStatus.ok();
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-14 20:11:40 UTC (rev 38727)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-14 22:10:59 UTC (rev 38728)
@@ -50,15 +50,18 @@
private List<IApplication> existingApplications = null;
private List<ICartridge> cartridges = new ArrayList<ICartridge>();
private List<IEmbeddableCartridge> embeddableCartridges = new ArrayList<IEmbeddableCartridge>();
- private String applicationName;
+ // private String applicationName;
private ICartridge selectedCartridge;
- private String selectedApplicationName;
- private boolean useExistingApplication;
+ private String existingApplicationName;
- public ApplicationConfigurationWizardPageModel(OpenShiftExpressApplicationWizardModel wizardModel) {
+ // private boolean useExistingApplication;
+
+ public ApplicationConfigurationWizardPageModel(OpenShiftExpressApplicationWizardModel wizardModel) throws OpenShiftException {
this.wizardModel = wizardModel;
- setUseExistingApplication(wizardModel.isExistingApplication());
- setExistingApplicationName(wizardModel.getApplication() != null ? wizardModel.getApplication().getName() : null);
+ setExistingApplication(wizardModel.getApplication());
+ // setUseExistingApplication(wizardModel.isExistingApplication());
+ // setExistingApplicationName(wizardModel.getApplication() != null ?
+ // wizardModel.getApplication().getName() : null);
}
/**
@@ -70,7 +73,6 @@
public IUser getUser() {
return wizardModel.getUser();
-// return OpenShiftUIActivator.getDefault().getUser();
}
public List<IApplication> getApplications() throws OpenShiftException {
@@ -96,22 +98,23 @@
}
public boolean isUseExistingApplication() {
- return this.useExistingApplication;
+ return wizardModel.isUseExistingApplication();
}
public void setUseExistingApplication(boolean useExistingApplication) {
- wizardModel.setUseExistingApplication(useExistingApplication);
- firePropertyChange(PROPERTY_USE_EXISTING_APPLICATION, this.useExistingApplication,
- this.useExistingApplication = useExistingApplication);
+ firePropertyChange(PROPERTY_USE_EXISTING_APPLICATION
+ , wizardModel.isUseExistingApplication()
+ , wizardModel.setUseExistingApplication(useExistingApplication));
}
public String getExistingApplicationName() {
- return selectedApplicationName;
+ return existingApplicationName;
}
public void setExistingApplicationName(String applicationName) {
- firePropertyChange(PROPERTY_EXISTING_APPLICATION_NAME, this.selectedApplicationName,
- this.selectedApplicationName = applicationName);
+ firePropertyChange(PROPERTY_EXISTING_APPLICATION_NAME
+ , existingApplicationName
+ , this.existingApplicationName = applicationName);
}
public void loadExistingApplications() throws OpenShiftException {
@@ -139,7 +142,7 @@
public void loadCartridges() throws OpenShiftException {
setCartridges(getUser().getCartridges());
- //setCartridges(OpenShiftUIActivator.getDefault().getUser().getCartridges());
+ // setCartridges(OpenShiftUIActivator.getDefault().getUser().getCartridges());
}
public void setCartridges(List<ICartridge> cartridges) {
@@ -160,7 +163,8 @@
}
public List<IEmbeddableCartridge> loadEmbeddableCartridges() throws OpenShiftException {
-// List<IEmbeddableCartridge> cartridges = OpenShiftUIActivator.getDefault().getUser().getEmbeddableCartridges();
+ // List<IEmbeddableCartridge> cartridges =
+ // OpenShiftUIActivator.getDefault().getUser().getEmbeddableCartridges();
List<IEmbeddableCartridge> cartridges = getUser().getEmbeddableCartridges();
setEmbeddableCartridges(cartridges);
return cartridges;
@@ -189,11 +193,13 @@
public void setApplicationName(String applicationName) {
wizardModel.setApplicationName(applicationName);
- firePropertyChange(PROPERTY_APPLICATION_NAME, this.applicationName, this.applicationName = applicationName);
+ firePropertyChange(PROPERTY_APPLICATION_NAME
+ , wizardModel.getApplicationName()
+ , wizardModel.setApplicationName(applicationName));
}
public String getApplicationName() {
- return this.applicationName;
+ return wizardModel.getApplicationName();
}
public void setEmbeddableCartridges(List<IEmbeddableCartridge> cartridges) {
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 20:11:40 UTC (rev 38727)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-02-14 22:10:59 UTC (rev 38728)
@@ -39,7 +39,6 @@
public static final String PROPERTY_NEW_PROJECT = "newProject";
public static final String PROPERTY_CLONE_URI = "cloneUri";
- // public static final String PROPERTY_MERGE_URI = "mergeUri";
public static final String PROPERTY_APPLICATION_URL = "applicationUrl";
public static final String PROPERTY_REPO_PATH = "repositoryPath";
public static final String PROPERTY_REMOTE_NAME = "remoteName";
@@ -79,75 +78,6 @@
return wizardModel.isNewProject();
}
- // public void setMergeUri(String mergeUri) {
- // firePropertyChange(PROPERTY_MERGE_URI, wizardModel.getMergeUri(),
- // wizardModel.setMergeUri(mergeUri));
- // }
- //
- // public String getMergeUri() {
- // return wizardModel.getMergeUri();
- // }
-
- // public GitUri getKnownMergeUri(String uriOrLabel) {
- // GitUri gitUri = null;
- // if (isGitUri(uriOrLabel)) {
- // gitUri = getKnownMergeUriByUri(uriOrLabel);
- // } else {
- // gitUri = getKnownMergeUriByLabel(uriOrLabel);
- // }
- // return gitUri;
- // }
-
- // private boolean isGitUri(String gitUriString) {
- // try {
- // URIish uriish = new URIish(gitUriString);
- // return uriish.isRemote();
- // } catch (URISyntaxException e) {
- // return false;
- // }
- // }
-
- // private GitUri getKnownMergeUriByUri(String gitUriString) {
- // GitUri matchingGitUri = null;
- // for (GitUri gitUri : getMergeUris()) {
- // if (gitUri.getGitUri().equals(gitUriString)) {
- // matchingGitUri = gitUri;
- // break;
- // }
- // }
- // return matchingGitUri;
- // }
-
- // private GitUri getKnownMergeUriByLabel(String label) {
- // GitUri matchingGitUri = null;
- // for (GitUri gitUri : getMergeUris()) {
- // if (gitUri.getLabel().equals(label)) {
- // matchingGitUri = gitUri;
- // break;
- // }
- // }
- // return matchingGitUri;
- // }
-
- // public List<GitUri> getMergeUris() {
- // ArrayList<GitUri> mergeUris = new ArrayList<GitUri>();
- // mergeUris.add(new GitUri(
- // "seambooking-example",
- // "git://github.com/openshift/seambooking-example.git",
- // ICartridge.JBOSSAS_7));
- // mergeUris.add(new GitUri(
- // "tweetstream-example",
- // "git://github.com/openshift/tweetstream-example.git",
- // ICartridge.JBOSSAS_7));
- // mergeUris.add(new GitUri(
- // "sinatra-example", "git://github.com/openshift/sinatra-example.git",
- // new Cartridge("rack-1.1")));
- // mergeUris.add(new GitUri(
- // "sugarcrm-example", "git://github.com/openshift/sugarcrm-example.git",
- // new Cartridge("php-5.3")));
- // return mergeUris;
- // }
-
public void loadGitUri() throws OpenShiftException {
setLoading(true);
setCloneUri("Loading...");
Modified: 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/IOpenShiftExpressWizardModel.java 2012-02-14 20:11:40 UTC (rev 38727)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java 2012-02-14 22:10:59 UTC (rev 38728)
@@ -14,6 +14,7 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.URISyntaxException;
+import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -25,6 +26,7 @@
import com.openshift.express.client.IApplication;
import com.openshift.express.client.ICartridge;
+import com.openshift.express.client.IEmbeddableCartridge;
import com.openshift.express.client.OpenShiftException;
/**
@@ -37,7 +39,7 @@
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 USE_EXISTING_APPLICATION = "uswizardModel.getApplicationName()eExistingApplication";
public static final String REMOTE_NAME = "remoteName";
public static final String REPOSITORY_PATH = "repositoryPath";
public static final String PROJECT_NAME = "projectName";
@@ -62,7 +64,7 @@
* @throws InterruptedException
* @throws URISyntaxException
* @throws InvocationTargetException
- * @throws IOException
+ * @throws IOException
*/
public void importProject(IProgressMonitor monitor) throws OpenShiftException, CoreException, InterruptedException,
URISyntaxException, InvocationTargetException, IOException;
@@ -131,14 +133,14 @@
public Object getProperty(String key);
-// public void setUser(IUser user);
-//
-// public IUser getUser();
-
public IApplication getApplication();
+ public String setApplicationName(String name);
+
public String getApplicationName();
+ public void setApplicationCartridge(ICartridge cartridge);
+
public ICartridge getApplicationCartridge();
public void setApplication(IApplication application);
@@ -162,7 +164,7 @@
public String setProjectName(String projectName);
public IProject setProject(IProject project);
-
+
public boolean isGitSharedProject();
public Boolean setCreateServerAdapter(Boolean createServerAdapter);
@@ -183,8 +185,15 @@
public void setServerType(IServerType serverType);
- public boolean isExistingApplication();
+ public boolean isUseExistingApplication();
- public void setUseExistingApplication(boolean useExistingApplication);
-
+ public boolean setUseExistingApplication(boolean useExistingApplication);
+
+ public void addUserToModel();
+
+ public Set<IEmbeddableCartridge> setSelectedEmbeddableCartridges(
+ Set<IEmbeddableCartridge> selectedEmbeddableCartridges);
+
+ public Set<IEmbeddableCartridge> getSelectedEmbeddableCartridges();
+
}
\ 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/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 20:11:40 UTC (rev 38727)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-14 22:10:59 UTC (rev 38728)
@@ -58,8 +58,7 @@
private OpenShiftExpressApplicationWizardModel wizardModel;
/**
- * @see #getUser which calls UserModel#getRecentUser if no user present at
- * construction time
+ * @see #setUser called by CredentialsWizardPageModel#getValidityStatus
*/
public OpenShiftExpressApplicationWizard(String wizardTitle) {
this(null, null, null, wizardTitle);
@@ -156,7 +155,7 @@
@Override
public boolean performFinish() {
- boolean success = getWizardModel().isExistingApplication();
+ boolean success = getWizardModel().isUseExistingApplication();
if (!success) {
if (createApplication()) {
success = addRemoveCartridges(
@@ -187,8 +186,9 @@
private boolean createApplication() {
try {
+ final String applicationName = wizardModel.getApplicationName();
IStatus status = WizardUtils.runInWizard(
- new Job(NLS.bind("Creating application \"{0}\"...", getWizardModel().getApplicationName())) {
+ new Job(NLS.bind("Creating application \"{0}\"...", applicationName)) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
@@ -197,8 +197,7 @@
} catch (Exception e) {
// TODO: refresh user
return OpenShiftUIActivator.createErrorStatus(
- "Could not create application \"{0}\"", e, getWizardModel()
- .getApplicationName());
+ "Could not create application \"{0}\"", e, applicationName);
}
}
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 20:11:40 UTC (rev 38727)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-02-14 22:10:59 UTC (rev 38728)
@@ -57,7 +57,6 @@
setRemoteName(NEW_PROJECT_REMOTE_NAME_DEFAULT);
setServerType(ServerCore.findServerType(ExpressServerUtils.OPENSHIFT_SERVER_TYPE));
setPublicationMode(PUBLISH_SOURCE);
- setUseExistingApplication(false);
}
/**
@@ -190,18 +189,6 @@
return dataModel.get(key);
}
- // @Override
- // public void setUser(IUser user) {
- // setProperty(USER, user);
- // OpenShiftUIActivator.getDefault().setUser(user);
- // }
-
- // @Override
- // public IUser getUser() {
- // return (IUser) getProperty(USER);
- // return OpenShiftUIActivator.getDefault().getUser();
- // }
-
@Override
public IApplication getApplication() {
return (IApplication) getProperty(APPLICATION);
@@ -209,8 +196,8 @@
@Override
public void setApplication(IApplication application) {
- setUseExistingApplication(application != null);
setProperty(APPLICATION, application);
+ setUseExistingApplication(application);
setApplicationCartridge(application);
setApplicationName(application);
}
@@ -333,15 +320,19 @@
}
@Override
- public boolean isExistingApplication() {
+ public boolean isUseExistingApplication() {
return (Boolean) getProperty(USE_EXISTING_APPLICATION);
}
@Override
- public void setUseExistingApplication(boolean useExistingApplication) {
- setProperty(USE_EXISTING_APPLICATION, useExistingApplication);
+ public boolean setUseExistingApplication(boolean useExistingApplication) {
+ return (Boolean) setProperty(USE_EXISTING_APPLICATION, useExistingApplication);
}
+ protected void setUseExistingApplication(IApplication application) {
+ setUseExistingApplication(application != null);
+ }
+
private void waitForAccessible(IApplication application, IProgressMonitor monitor)
throws OpenShiftApplicationNotAvailableException, OpenShiftException {
// monitor.subTask("waiting for application to become accessible...");
@@ -351,7 +342,7 @@
}
}
- IApplication createApplication(String name, ICartridge cartridge, IProgressMonitor monitor)
+ protected IApplication createApplication(String name, ICartridge cartridge, IProgressMonitor monitor)
throws OpenShiftApplicationNotAvailableException, OpenShiftException {
IUser user = getUser();
if (user == null) {
@@ -366,9 +357,9 @@
OpenShiftException {
IApplication application = createApplication(getApplicationName(), getApplicationCartridge(), monitor);
setApplication(application);
-
}
+ @Override
public Set<IEmbeddableCartridge> getSelectedEmbeddableCartridges() {
@SuppressWarnings("unchecked")
Set<IEmbeddableCartridge> selectedEmbeddableCartridges =
@@ -380,12 +371,14 @@
return selectedEmbeddableCartridges;
}
+ @Override
public Set<IEmbeddableCartridge> setSelectedEmbeddableCartridges(
Set<IEmbeddableCartridge> selectedEmbeddableCartridges) {
dataModel.put(KEY_SELECTED_EMBEDDABLE_CARTRIDGES, selectedEmbeddableCartridges);
return selectedEmbeddableCartridges;
}
+ @Override
public void setApplicationCartridge(ICartridge cartridge) {
dataModel.put(APPLICATION_CARTRIDGE, cartridge);
}
@@ -397,12 +390,14 @@
dataModel.put(APPLICATION_CARTRIDGE, application.getCartridge());
}
+ @Override
public ICartridge getApplicationCartridge() {
return (ICartridge) dataModel.get(APPLICATION_CARTRIDGE);
}
- public void setApplicationName(String applicationName) {
- dataModel.put(APPLICATION_NAME, applicationName);
+ @Override
+ public String setApplicationName(String applicationName) {
+ return (String) dataModel.put(APPLICATION_NAME, applicationName);
}
protected void setApplicationName(IApplication application) {
@@ -417,15 +412,18 @@
return (String) dataModel.get(APPLICATION_NAME);
}
+ @Override
public IUser getUser() {
return (IUser) dataModel.get(USER);
}
+ @Override
public IUser setUser(IUser user) {
dataModel.put(USER, user);
return user;
}
+ @Override
public void addUserToModel() {
IUser user = getUser();
Assert.isNotNull(user);
14 years, 1 month
JBoss Tools SVN: r38727 - trunk/build/results.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-02-14 15:11:40 -0500 (Tue, 14 Feb 2012)
New Revision: 38727
Added:
trunk/build/results/collect-test-results.xml
Log:
JBIDE-10690 new, simpler 'collect test results' script replaces need for ~/trunk/build/build.xml
Added: trunk/build/results/collect-test-results.xml
===================================================================
--- trunk/build/results/collect-test-results.xml (rev 0)
+++ trunk/build/results/collect-test-results.xml 2012-02-14 20:11:40 UTC (rev 38727)
@@ -0,0 +1,226 @@
+<project default="collect.test.results.for.hudson" basedir="." name="Generate test results even when no tests were run. Prevents build from failing if tests are disabled.">
+ <!-- ****************************** Configuration ****************************** -->
+
+ <!-- override for local build -->
+ <condition property="isInHudson" value="true">
+ <or>
+ <contains string="${user.dir}" substring="hudson" />
+ <contains string="${user.name}" substring="hudson" />
+ <contains string="${user.home}" substring="hudson" />
+ </or>
+ </condition>
+ <target name="local" unless="isInHudson">
+ <property name="WORKINGDIR" value="${basedir}" />
+ <property name="COMMON_TOOLS" value="${java.io.tmpdir}" />
+ </target>
+
+ <target name="get.ant-contrib" unless="ant-contrib.jar.exists">
+ <property name="ANTCONTRIB_MIRROR" value="http://downloads.sourceforge.net/ant-contrib/" />
+ <get usetimestamp="true" dest="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip" src="${ANTCONTRIB_MIRROR}/ant-contrib-1.0b2-bin.zip" />
+ <touch file="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip" />
+ <mkdir dir="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_" />
+ <unzip src="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip" dest="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_" overwrite="true" />
+ <copy file="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_/ant-contrib/lib/ant-contrib.jar" tofile="${COMMON_TOOLS}/ant-contrib.jar" failonerror="true" />
+ <delete dir="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_" includeemptydirs="true" quiet="true" />
+ </target>
+
+ <target name="init" depends="local">
+ <!-- https://jira.jboss.org/jira/browse/JBQA-3313 Use static, shared space outside workspace, instead of working directly in the workspace -->
+ <condition property="WORKINGDIR" value="/home/hudson/static_build_env/jbds/tools/sources" else="${basedir}">
+ <available file="/home/hudson/static_build_env/jbds" type="dir" />
+ </condition>
+ <mkdir dir="${WORKINGDIR}" />
+ <echo level="info">WORKINGDIR = ${WORKINGDIR}</echo>
+
+ <condition property="COMMON_TOOLS" value="/home/hudson/static_build_env/jbds/tools" else="${WORKINGDIR}/../tools">
+ <available file="/home/hudson/static_build_env/jbds" type="dir" />
+ </condition>
+ <mkdir dir="${COMMON_TOOLS}" />
+ <echo level="info">COMMON_TOOLS = ${COMMON_TOOLS}</echo>
+
+ <available file="${COMMON_TOOLS}/ant-contrib.jar" type="file" property="ant-contrib.jar.exists" />
+ <antcall target="get.ant-contrib" />
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${COMMON_TOOLS}/ant-contrib.jar" />
+ </classpath>
+ </taskdef>
+
+ </target>
+
+ <!-- ***** The methods below are used in Hudson/Jenkins jobs to generate test results even when no tests were run. Prevents build from failing if tests are disabled. ***** -->
+
+ <!--
+ To run this after a maven build in Hudson, set these properties:
+ basedir=${WORKSPACE}/sources
+ WORKINGDIR=${WORKSPACE}/sources
+ COMPONENT=.
+ move.test.results=true
+ -->
+ <target name="collect.test.results.for.hudson" depends="init" if="isInHudson" description="collect test results after a pure maven build so Hudson has something to see">
+ <property name="basedir" value="${WORKSPACE}/sources" />
+ <property name="WORKINGDIR" value="${WORKSPACE}/sources" />
+ <property name="COMPONENT" value="." />
+ <property name="move.test.results" value="true" />
+ <var name="tests.results.found" value="false" />
+ <echo level="debug">basedir = ${basedir}
+WORKINGDIR = ${WORKINGDIR}
+COMPONENT = ${COMPONENT}</echo>
+ <delete dir="${basedir}/surefire-reports/NoTestsRun" includeemptydirs="true" />
+ <for param="test.xml.files" delimiter=",
+ ">
+ <path>
+ <fileset dir="${WORKINGDIR}" includes="**/target/surefire-reports/TEST-*.xml, **/**/target/surefire-reports/TEST-*.xml" excludes="**/TEST-*NoTestsRun.xml, **/**/TEST-*NoTestsRun.xml" />
+ </path>
+ <sequential>
+ <var name="tests.results.found" value="true" />
+ </sequential>
+ </for>
+ <if>
+ <equals arg1="${tests.results.found}" arg2="true" />
+ <then>
+ <antcall target="collect.test.results">
+ <param name="COMPONENT" value="." />
+ </antcall>
+ <antcall target="collect.all.test.results" />
+ </then>
+ <else>
+ <antcall target="create.empty.test.results.file" />
+ <property name="no.tests.run" value="true" />
+ </else>
+ </if>
+ </target>
+
+ <target name="create.empty.test.results.file">
+ <!-- create fake test result file to avoid Hudson failure -->
+ <delete dir="${basedir}/surefire-reports/NoTestsRun" includeemptydirs="true" />
+ <mkdir dir="${basedir}/surefire-reports/NoTestsRun" />
+ <echo file="${basedir}/surefire-reports/NoTestsRun/TEST-org.jboss.tools.NoTestsRun.xml"><?xml version="1.0" encoding="UTF-8" ?>
+<testsuite failures="0" time="0.001" errors="0" skipped="0" tests="1" name="org.jboss.tools.NoTestsRun">
+<testcase time="0.001" classname="org.jboss.tools.NoTestsRun" name="NoTestsRun"/>
+</testsuite>
+</echo>
+ </target>
+
+ <target name="collect.test.results">
+ <delete dir="${basedir}/surefire-reports/NoTestsRun" includeemptydirs="true" />
+ <property name="COMPONENT" value="" />
+ <!-- collect test results by copying ${WORKINGDIR}/${COMPONENT}/**/target/surefire-reports/*.xml into ${basedir}/surefire-reports/${COMPONENT} -->
+ <delete dir="${basedir}/surefire-reports/${COMPONENT}" includeemptydirs="true" />
+ <mkdir dir="${basedir}/surefire-reports/${COMPONENT}" />
+ <copy todir="${basedir}/surefire-reports/${COMPONENT}" flatten="true" preservelastmodified="true" overwrite="true">
+ <fileset dir="${WORKINGDIR}/${COMPONENT}" includes="**/target/surefire-reports/TEST-*.xml" />
+ </copy>
+ <if>
+ <isset property="move.test.results" />
+ <then>
+ <delete dir="${WORKINGDIR}/${COMPONENT}" includes="**/target/surefire-reports" />
+ </then>
+ </if>
+ </target>
+
+ <target name="collect.all.test.results" unless="no.tests.run">
+ <var name="test.results.all" value="" />
+ <var name="test.results.errors.failures.skipped" value="" />
+
+ <!-- Parse this: <testsuite errors="0" skipped="0" tests="10" time="0.042" failures="0" name="org.jboss.tools.jmx.ui.JMXUIAllTests"> -->
+ <for param="testresultfile" delimiter=",
+ ">
+ <path>
+ <fileset dir="${basedir}/surefire-reports/" includes="**/TEST-*.xml" />
+ </path>
+ <sequential>
+ <var name="testsuite.name" unset="true" />
+ <var name="testsuite.tests" unset="true" />
+ <var name="testsuite.time" unset="true" />
+ <var name="testsuite.skipped" unset="true" />
+ <var name="testsuite.errors" unset="true" />
+ <var name="testsuite.failures" unset="true" />
+ <xmlproperty file="@{testresultfile}" keepRoot="true" collapseAttributes="true" />
+ <for param="ts" list="testsuite.skipped, testsuite.errors, testsuite.failures" delimiter=", ">
+ <sequential>
+ <propertyregex override="true"
+ property="ts.label"
+ defaultvalue="@{ts}"
+ input="@{ts}"
+ regexp="testsuite\.(.+)"
+ replace="\1"
+ />
+ <if>
+ <isset property="@{ts}" />
+ <then>
+ <if>
+ <equals arg1="${@{ts}}" arg2="0" />
+ <then>
+ <var name="@{ts}" value="" />
+ </then>
+ <else>
+ <var name="@{ts}" value="; ${@{ts}} ${ts.label}" />
+ </else>
+ </if>
+ </then>
+ </if>
+
+ </sequential>
+ </for>
+ <if>
+ <or>
+ <not>
+ <equals arg1="${testsuite.skipped}" arg2="" />
+ </not>
+ <not>
+ <equals arg1="${testsuite.errors}" arg2="" />
+ </not>
+ <not>
+ <equals arg1="${testsuite.failures}" arg2="" />
+ </not>
+ </or>
+ <then>
+ <var name="test.results.errors.failures.skipped"
+ value="${test.results.errors.failures.skipped}${testsuite.name} ran ${testsuite.tests} tests in ${testsuite.time}s${testsuite.skipped}${testsuite.errors}${testsuite.failures}${line.separator}"
+ />
+ </then>
+ </if>
+ <if>
+ <isset property="testsuite.name" />
+ <then>
+ <var name="test.results.all"
+ value="${test.results.all}${testsuite.name} ran ${testsuite.tests} tests in ${testsuite.time}s${testsuite.skipped}${testsuite.errors}${testsuite.failures}${line.separator}"
+ />
+ </then>
+ </if>
+ <var name="testsuite.name" unset="true" />
+ <var name="testsuite.tests" unset="true" />
+ <var name="testsuite.time" unset="true" />
+ <var name="testsuite.skipped" unset="true" />
+ <var name="testsuite.errors" unset="true" />
+ <var name="testsuite.failures" unset="true" />
+ </sequential>
+ </for>
+ <echo level="verbose">-------------------------------------------------------
+ A L L T E S T R E S U L T S
+-------------------------------------------------------
+${test.results.all}
+-------------------------------------------------------
+
+</echo>
+ <if>
+ <and>
+ <isset property="test.results.errors.failures.skipped" />
+ <not>
+ <equals arg1="${test.results.errors.failures.skipped}" arg2="" />
+ </not>
+ </and>
+ <then>
+ <echo level="error">-------------------------------------------------------
+ T E S T R E S U L T S
+-------------------------------------------------------
+${test.results.errors.failures.skipped}
+-------------------------------------------------------
+
+</echo>
+ </then>
+ </if>
+ </target>
+
+</project>
14 years, 1 month
JBoss Tools SVN: r38726 - trunk/build/results.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-02-14 14:55:56 -0500 (Tue, 14 Feb 2012)
New Revision: 38726
Modified:
trunk/build/results/build.xml
Log:
build/results/build.xml should not depend on build/build.xml (which is deprecated) [JBIDE-10690]
Modified: trunk/build/results/build.xml
===================================================================
--- trunk/build/results/build.xml 2012-02-14 19:36:11 UTC (rev 38725)
+++ trunk/build/results/build.xml 2012-02-14 19:55:56 UTC (rev 38726)
@@ -26,22 +26,15 @@
</condition>
<mkdir dir="${COMMON_TOOLS}" />
- <condition property="build.xml" value="/home/hudson/static_build_env/jbds/tools/sources/build/build.xml">
- <available file="/home/hudson/static_build_env/jbds/tools/sources/build/build.xml" type="file" />
- </condition>
- <condition property="build.xml" value="${basedir}/../../build/build.xml">
- <available file="${basedir}/../../build/build.xml" type="file" />
- </condition>
- <condition property="build.xml" value="${basedir}/../../build.xml">
- <available file="${basedir}/../../build.xml" type="file" />
- </condition>
- <condition property="build.xml" value="${basedir}/../../sources/build.xml">
- <available file="${basedir}/../../sources/build.xml" type="file" />
- </condition>
- <condition property="build.xml" value="${basedir}/../build.xml">
- <available file="${basedir}/../build.xml" type="file" />
- </condition>
- <!-- if can't calculate where build/build.xml is located, must pass in path from parent when calling this script -->
+ <target name="get.ant-contrib" unless="ant-contrib.jar.exists">
+ <property name="ANTCONTRIB_MIRROR" value="http://downloads.sourceforge.net/ant-contrib/" />
+ <get usetimestamp="true" dest="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip" src="${ANTCONTRIB_MIRROR}/ant-contrib-1.0b2-bin.zip" />
+ <touch file="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip" />
+ <mkdir dir="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_" />
+ <unzip src="${COMMON_TOOLS}/ant-contrib-1.0b2-bin.zip" dest="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_" overwrite="true" />
+ <copy file="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_/ant-contrib/lib/ant-contrib.jar" tofile="${COMMON_TOOLS}/ant-contrib.jar" failonerror="true" />
+ <delete dir="${java.io.tmpdir}/ant-contrib-1.0b2-bin.zip_" includeemptydirs="true" quiet="true" />
+ </target>
<target name="get.saxon" unless="saxon.jar.exists">
<!-- or use http://downloads.sourceforge.net/saxon/saxonhe9-3-0-4j.zip ? -->
@@ -54,26 +47,21 @@
</target>
<target name="init">
- <ant antfile="${build.xml}" target="init" />
+ <available file="${COMMON_TOOLS}/ant-contrib.jar" type="file" property="ant-contrib.jar.exists" />
+ <antcall target="get.ant-contrib" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${COMMON_TOOLS}/ant-contrib.jar" />
</classpath>
</taskdef>
+ <available file="${COMMON_TOOLS}/saxon.jar" type="file" property="saxon.jar.exists" />
+ <antcall target="get.saxon" />
+
<condition property="aggregate_site_build.xml" value="${basedir}/../aggregate/build.xml">
<available file="${basedir}/../aggregate/build.xml" type="file" />
</condition>
- <condition property="aggregate_site_build.xml" value="${basedir}/../aggregate/site/build.xml">
- <available file="${basedir}/../aggregate/site/build.xml" type="file" />
- </condition>
- <condition property="aggregate_site_build.xml" value="${basedir}/../aggregate/site/site/build.xml">
- <available file="${basedir}/../aggregate/site/site/build.xml" type="file" />
- </condition>
- <available file="${COMMON_TOOLS}/saxon.jar" type="file" property="saxon.jar.exists" />
- <antcall target="get.saxon" />
-
<macrodef name="get.size">
<attribute name="file" />
<attribute name="property" />
14 years, 1 month
JBoss Tools SVN: r38725 - trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2012-02-14 14:36:11 -0500 (Tue, 14 Feb 2012)
New Revision: 38725
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
Log:
[JBIDE-10902] Fixing issue Xavier found with the sample WS creation wizards
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2012-02-14 18:46:45 UTC (rev 38724)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2012-02-14 19:36:11 UTC (rev 38725)
@@ -418,6 +418,9 @@
throws JavaModelException {
IJavaProject javaProject = JavaCore.create(project);
IResource[] rs = getJavaSourceRoots(javaProject);
+ if (rs == null || rs.length == 0) {
+ rs = getJavaSourceRoots(javaProject, false);
+ }
String src = ""; //$NON-NLS-1$
if (rs == null || rs.length == 0)
return src;
@@ -447,7 +450,11 @@
return null;
}
- public static IResource[] getJavaSourceRoots(IJavaProject javaProject)
+ public static IResource[] getJavaSourceRoots(IJavaProject javaProject) throws JavaModelException {
+ return getJavaSourceRoots(javaProject, true);
+ }
+
+ public static IResource[] getJavaSourceRoots(IJavaProject javaProject, boolean outputLocationIsNull)
throws JavaModelException {
if (javaProject == null)
return null;
@@ -460,8 +467,10 @@
.findMember(es[i].getPath());
if (findMember != null && findMember.exists()) {
// JBIDE-8642: if the output location is null, this is the default source path
- if (outputLocation == null) {
+ if (outputLocationIsNull && outputLocation == null) {
resources.add(findMember);
+ } else {
+ resources.add(findMember);
}
}
}
14 years, 1 month
JBoss Tools SVN: r38724 - trunk/as/plugins/org.jboss.ide.eclipse.as.dmr.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-14 13:46:45 -0500 (Tue, 14 Feb 2012)
New Revision: 38724
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/target/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.dmr/
Log:
ignore target folder
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.dmr
___________________________________________________________________
Added: svn:ignore
+ target
14 years, 1 month
JBoss Tools SVN: r38723 - trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2012-02-14 13:29:32 -0500 (Tue, 14 Feb 2012)
New Revision: 38723
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistory.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistoryEntry.java
Log:
[JBIDE-10883] Fully implemented the test history url drop-down so it persists the state of things like headers, parameters, body text, result headers, and result text. Now if you select a previously used URL, it will re-populate the controls with the settings/feedback last used/returned.
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2012-02-14 18:03:41 UTC (rev 38722)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2012-02-14 18:29:32 UTC (rev 38723)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
+ * Copyright (c) 2011-2012 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -187,6 +187,7 @@
private TestHistory history = new TestHistory();
private TestHistoryEntry currentHistoryEntry = null;
private Button useBasicAuthCB;
+ private boolean restoringFromHistoryEntry = false;
/**
* The constructor.
@@ -560,9 +561,20 @@
urlCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- setControlsForSelectedURL();
- getCurrentHistoryEntry().setUrl(urlCombo.getText());
- getCurrentHistoryEntry().setAction(null);
+ if (e.getSource().equals(urlCombo)) {
+ String newURL = urlCombo.getText();
+ String oldURL = null;
+ if (getCurrentHistoryEntry() != null && getCurrentHistoryEntry().getUrl() != null && getCurrentHistoryEntry().getUrl().trim().length() > 0) {
+ oldURL = getCurrentHistoryEntry().getUrl();
+ }
+ if (newURL != null && oldURL != null && newURL.contentEquals(oldURL)) {
+ // ignore it - they're the same
+ } else if (newURL != null && oldURL == null) {
+ setControlsForSelectedURL();
+ getCurrentHistoryEntry().setUrl(newURL);
+ getCurrentHistoryEntry().setAction(null);
+ }
+ }
}
});
urlCombo.addKeyListener(new KeyListener() {
@@ -583,9 +595,24 @@
widgetSelected(e);
}
public void widgetSelected(SelectionEvent e) {
- getCurrentHistoryEntry().setUrl(urlCombo.getText());
- getCurrentHistoryEntry().setAction(null);
- setControlsForSelectedURL();
+ String testURL = urlCombo.getText();
+ TestHistoryEntry entry = history.findEntryByURL(testURL);
+// System.out.println(new Timestamp(System.currentTimeMillis()));
+// System.out.println(history.toString());
+ if (entry != null) {
+ try {
+ currentHistoryEntry = (TestHistoryEntry) entry.clone();
+// currentHistoryEntry = entry;
+ getCurrentHistoryEntry().setAction(null);
+ setControlsForSelectedEntry(entry);
+ } catch (CloneNotSupportedException e1) {
+ e1.printStackTrace();
+ }
+ } else {
+ getCurrentHistoryEntry().setUrl(urlCombo.getText());
+ getCurrentHistoryEntry().setAction(null);
+ setControlsForSelectedURL();
+ }
}
});
@@ -713,7 +740,8 @@
bodyText = toolkit.createText(ec5, EMPTY_STRING, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
bodyText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- getCurrentHistoryEntry().setBody(bodyText.getText());
+ if (!restoringFromHistoryEntry)
+ getCurrentHistoryEntry().setBody(bodyText.getText());
// getCurrentHistoryEntry().setAction(null);
}
});
@@ -1080,6 +1108,56 @@
}
}
+ private void setControlsForSelectedEntry ( TestHistoryEntry entry ) {
+ if (entry != null) {
+ restoringFromHistoryEntry = true;
+ if (entry.getWsTech() != null) {
+ setControlsForWSType(entry.getWsTech());
+ if (entry.getWsTech().equalsIgnoreCase(JAX_WS))
+ methodCombo.setText(JAX_WS);
+ }
+ if (entry.getMethod() != null && entry.getWsTech().equalsIgnoreCase(JAX_RS)) {
+ methodCombo.setText(entry.getMethod());
+ setControlsForMethodType(entry.getMethod());
+ }
+ if (bodyText.isEnabled()) {
+ bodyText.setText(entry.getBody());
+ }
+ if (dlsList.isEnabled()) {
+ dlsList.setSelection(entry.getHeaders());
+ }
+ if (parmsList.isEnabled()) {
+ parmsList.setSelection(entry.getParms());
+ }
+ if (resultHeadersList.isEnabled()) {
+ resultHeadersList.removeAll();
+ String[] headers = entry.getResultHeadersList();
+ if (headers != null && headers.length > 0) {
+ for (int i = 0; i < headers.length; i++) {
+ resultHeadersList.add(headers[i]);
+ }
+ }
+ }
+ if (resultsText.isEnabled() && resultsBrowser.isEnabled()) {
+ resultsText.setText(entry.getResultText());
+ resultsBrowser.setText(entry.getResultText());
+ }
+ if (entry.getUrl().trim().length() > 0) {
+ String urlText = entry.getUrl();
+ try {
+ new URL(urlText);
+ startToolItem.setEnabled(true);
+ } catch (MalformedURLException mue) {
+ startToolItem.setEnabled(false);
+ return;
+ }
+ } else {
+ startToolItem.setEnabled(false);
+ }
+ restoringFromHistoryEntry = false;
+ }
+ }
+
private void setControlsForSelectedURL() {
if (urlCombo.getText().trim().length() > 0) {
String urlText = urlCombo.getText();
@@ -1280,12 +1358,24 @@
getCurrentHistoryEntry().setResultHeadersList(headers);
if (JAXRSWSTestView2.this.resultsText.getText().trim().length() == 0) {
if (headers != null && headers.length > 0) {
+ getCurrentHistoryEntry().setResultText(
+ JBossWSUIMessages.JAXRSWSTestView2_Msg_No_Results_Check_Headers);
JAXRSWSTestView2.this.resultsText.setText(
JBossWSUIMessages.JAXRSWSTestView2_Msg_No_Results_Check_Headers);
JAXRSWSTestView2.this.form.reflow(true);
}
}
- history.getEntries().add(getCurrentHistoryEntry());
+ TestHistoryEntry oldEntry = history.findEntryByURL(getCurrentHistoryEntry().getUrl());
+ if (oldEntry != null) {
+ history.replaceEntry(oldEntry, getCurrentHistoryEntry());
+ } else {
+ try {
+ history.addEntry((TestHistoryEntry) getCurrentHistoryEntry().clone());
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ }
+ }
+// System.out.println("Replaced or added entry\n" + history.toString());
}
});
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistory.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistory.java 2012-02-14 18:03:41 UTC (rev 38722)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistory.java 2012-02-14 18:29:32 UTC (rev 38723)
@@ -1,5 +1,6 @@
package org.jboss.tools.ws.ui.views;
+import java.util.Iterator;
import java.util.Stack;
public class TestHistory {
@@ -13,4 +14,42 @@
public Stack<TestHistoryEntry> getEntries() {
return entries;
}
+
+ public TestHistoryEntry findEntryByURL ( String urlStr ) {
+ Iterator<TestHistoryEntry> entryIter = entries.iterator();
+ while (entryIter.hasNext()) {
+ TestHistoryEntry entry = entryIter.next();
+ if (entry.getUrl().contentEquals(urlStr)) {
+ return entry;
+ }
+ }
+ return null;
+ }
+
+ public void addEntry (TestHistoryEntry newEntry ) {
+ this.entries.push(newEntry);
+ }
+
+ public void replaceEntry ( TestHistoryEntry oldEntry, TestHistoryEntry newEntry) {
+ boolean found = entries.remove(oldEntry);
+ if (found) {
+ addEntry(newEntry);
+ }
+ }
+
+ @Override
+ public String toString() {
+ String result = "TestHistory [entries= \n"; //$NON-NLS-1$
+ Iterator<TestHistoryEntry> entryIter = entries.iterator();
+ while (entryIter.hasNext()) {
+ TestHistoryEntry entry = entryIter.next();
+ result = result + entry.toString();
+ if (entryIter.hasNext()) {
+ result = result + '\n';
+ }
+ }
+ result = result + "]"; //$NON-NLS-1$
+ return result;
+ }
+
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistoryEntry.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistoryEntry.java 2012-02-14 18:03:41 UTC (rev 38722)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/TestHistoryEntry.java 2012-02-14 18:29:32 UTC (rev 38723)
@@ -2,6 +2,7 @@
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Arrays;
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
@@ -9,7 +10,7 @@
import org.jboss.tools.ws.ui.JBossWSUIPlugin;
import org.jboss.tools.ws.ui.utils.TesterWSDLUtils;
-public class TestHistoryEntry {
+public class TestHistoryEntry implements Cloneable{
private String url;
private String action;
@@ -162,4 +163,49 @@
return isSOAP12;
}
+ @Override
+ public String toString() {
+ return "TestHistoryEntry [url=" + url //$NON-NLS-1$
+ + ", action=" + action //$NON-NLS-1$
+ + ", body=" + body //$NON-NLS-1$
+ + ", method=" + method //$NON-NLS-1$
+ + ", headers=" + headers //$NON-NLS-1$
+ + ", parms=" + parms //$NON-NLS-1$
+ + ", resultHeadersList=" + Arrays.toString(resultHeadersList) //$NON-NLS-1$
+ + ", resultText=" + resultText //$NON-NLS-1$
+ + ", wsTech=" + wsTech //$NON-NLS-1$
+ + ", serviceName=" + serviceName //$NON-NLS-1$
+ + ", portName=" + portName //$NON-NLS-1$
+ + ", bindingName=" + bindingName //$NON-NLS-1$
+ + ", operationName=" + operationName //$NON-NLS-1$
+ + ", wsdlDef=" + wsdlDef //$NON-NLS-1$
+ + ", serviceNSMessage=" + Arrays.toString(serviceNSMessage) //$NON-NLS-1$
+ + ", isSOAP12=" + isSOAP12 //$NON-NLS-1$
+ + "]"; //$NON-NLS-1$
+ }
+
+ @Override
+ protected Object clone() throws CloneNotSupportedException {
+ TestHistoryEntry newEntry = new TestHistoryEntry();
+ newEntry.setAction(this.getAction());
+ newEntry.setBindingName(this.getBindingName());
+ newEntry.setBody(this.getBody());
+ newEntry.setHeaders(this.getHeaders());
+ newEntry.setMethod(this.getMethod());
+ newEntry.setOperationName(this.getOperationName());
+ newEntry.setParms(this.getParms());
+ newEntry.setPortName(this.getPortName());
+ newEntry.setResultHeadersList(this.getResultHeadersList());
+ newEntry.setResultText(this.getResultText());
+ newEntry.setServiceName(this.getServiceName());
+ newEntry.setServiceNSMessage(this.getServiceNSMessage());
+ newEntry.setSOAP12(this.isSOAP12());
+ newEntry.setUrl(this.getUrl());
+// if (this.getWsdlDef() != null)
+// newEntry.setWsdlDef(this.getWsdlDef().);
+ newEntry.setWsTech(this.getWsTech());
+ return newEntry;
+ }
+
+
}
14 years, 1 month
JBoss Tools SVN: r38722 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-02-14 13:03:41 -0500 (Tue, 14 Feb 2012)
New Revision: 38722
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java
Log:
Wizard 'Specify CDI Bean for the Injection Point' does not compute correctly condition 'can finish' https://issues.jboss.org/browse/JBIDE-10637
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java 2012-02-14 17:57:28 UTC (rev 38721)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/ValuedQualifier.java 2012-02-14 18:03:41 UTC (rev 38722)
@@ -51,7 +51,9 @@
pair.name = method.getElementName();
if(mvp != null && mvp.getValue() != null){
pair.value = mvp.getValue();
+ pair.required = false;
}else{
+ pair.required = true;
if(pair.type.equals("boolean")){
pair.value = "false";
}else if(pair.type.equals("int") || pair.type.equals("short") || pair.type.equals("long")){
@@ -125,6 +127,8 @@
String text = "";
boolean first = true;
for(Pair pair : pairs){
+ if(!pair.required)
+ continue;
if(!first){
text += ", ";
}
@@ -147,6 +151,7 @@
for(Pair pair : pairs){
if(pair.name.equals(name)){
pair.value = value;
+ pair.required = true;
}
}
}
@@ -172,6 +177,7 @@
}
private static class Pair{
+ public boolean required = true;
public String type="";
public String name="";
public Object value;
14 years, 1 month
JBoss Tools SVN: r38721 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard: xpl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-02-14 12:57:28 -0500 (Tue, 14 Feb 2012)
New Revision: 38721
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
Log:
Wizard 'Specify CDI Bean for the Injection Point' does not compute correctly condition 'can finish' https://issues.jboss.org/browse/JBIDE-10637
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java 2012-02-14 17:42:16 UTC (rev 38720)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/AddQualifiersToBeanWizardPage.java 2012-02-14 17:57:28 UTC (rev 38721)
@@ -16,7 +16,6 @@
import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
-import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IQualifier;
import org.jboss.tools.cdi.internal.core.refactoring.AddQualifiersToBeanProcessor;
import org.jboss.tools.cdi.internal.core.refactoring.ValuedQualifier;
@@ -46,9 +45,9 @@
return composite.getAvailableQualifiers();
}
- public void init(IBean bean){
- composite.init(bean);
- setTitle(NLS.bind(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE, bean.getElementName()));
+ public void init(){
+ composite.init();
+ setTitle(NLS.bind(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_TITLE, ((AddQualifiersToBeanProcessor)((ProcessorBasedRefactoring)getRefactoring()).getProcessor()).getSelectedBean().getElementName()));
}
public void deploy(ValuedQualifier qualifier){
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java 2012-02-14 17:42:16 UTC (rev 38720)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/SelectBeanWizard.java 2012-02-14 17:57:28 UTC (rev 38721)
@@ -75,8 +75,8 @@
return addQualifiersPage.getAvailableQualifiers();
}
- public void init(IBean bean){
- addQualifiersPage.init(bean);
+ public void init(){
+ addQualifiersPage.init();
}
public void deploy(ValuedQualifier qualifier){
@@ -152,10 +152,10 @@
public void selectionChanged(SelectionChangedEvent event) {
IBean bean = getSelection();
if(bean != null){
- setPageComplete(true);
- addQualifiersPage.init(bean);
setSelectedBean(bean);
+ addQualifiersPage.init();
addQualifiersPage.setDeployedQualifiers(addQualifiersPage.getDeployedQualifiers());
+ setPageComplete(true);
}else
setPageComplete(false);
}
@@ -177,8 +177,8 @@
IBean defaultBean = (IBean)tableViewer.getTable().getItem(0).getData();
tableViewer.setSelection(new StructuredSelection(defaultBean));
tableViewer.getTable().select(0);
- addQualifiersPage.init(defaultBean);
setSelectedBean(defaultBean);
+ addQualifiersPage.init();
addQualifiersPage.setDeployedQualifiers(addQualifiersPage.getDeployedQualifiers());
setPageComplete(true);
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2012-02-14 17:42:16 UTC (rev 38720)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2012-02-14 17:57:28 UTC (rev 38721)
@@ -87,7 +87,7 @@
public class AddQualifiersToBeanComposite extends Composite {
private static Font font;
private IInjectionPoint injectionPoint;
- private IBean bean;
+ private IBean selectedBean;
private java.util.List<IBean> beans;
private AddQualifiersToBeanWizardPage page;
private Text pattern;
@@ -121,24 +121,24 @@
super(parent, SWT.NONE);
this.page = page;
this.injectionPoint = ((AbstractModifyInjectionPointWizard)page.getWizard()).getInjectionPoint();
- this.bean = ((AbstractModifyInjectionPointWizard)page.getWizard()).getSelectedBean();
+ this.selectedBean = ((AbstractModifyInjectionPointWizard)page.getWizard()).getSelectedBean();
this.beans = ((AbstractModifyInjectionPointWizard)page.getWizard()).getBeans();
createControl();
- if(bean != null)
- init(bean);
+ if(selectedBean != null)
+ init();
page.setDeployedQualifiers(getDeployedQualifiers());
}
- public void init(IBean bean){
- this.bean = bean;
- String beanName = CDIMarkerResolutionUtils.getELName(bean);
+ public void init(){
+ this.selectedBean = ((AbstractModifyInjectionPointWizard)page.getWizard()).getSelectedBean();
+ String beanName = CDIMarkerResolutionUtils.getELName(selectedBean);
originalQualifiers.clear();
deployed.clear();
- for(IQualifier q : bean.getQualifiers()){
+ for(IQualifier q : selectedBean.getQualifiers()){
- IQualifierDeclaration declaration = CDIMarkerResolutionUtils.findQualifierDeclaration(bean, q);
+ IQualifierDeclaration declaration = CDIMarkerResolutionUtils.findQualifierDeclaration(selectedBean, q);
if(declaration != null){
//String value = CDIMarkerResolutionUtils.findQualifierValue(bean, declaration);
ValuedQualifier vq = new ValuedQualifier(q, declaration);
@@ -148,8 +148,8 @@
}
}
- defaultQualifier = new ValuedQualifier(bean.getCDIProject().getQualifier(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME));
- namedQualifier = new ValuedQualifier(bean.getCDIProject().getQualifier(CDIConstants.NAMED_QUALIFIER_TYPE_NAME));
+ defaultQualifier = new ValuedQualifier(selectedBean.getCDIProject().getQualifier(CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME));
+ namedQualifier = new ValuedQualifier(selectedBean.getCDIProject().getQualifier(CDIConstants.NAMED_QUALIFIER_TYPE_NAME));
namedQualifier.setValue("value", beanName);
for(ValuedQualifier q : originalQualifiers){
@@ -172,17 +172,17 @@
availableTableViewer.setInput(qualifiers);
if(nLabel != null)
nLabel.setText(MessageFormat.format(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE,
- new Object[]{bean.getElementName(), injectionPoint.getElementName()}));
+ new Object[]{selectedBean.getElementName(), injectionPoint.getElementName()}));
refresh();
}
private ValuedQualifier loadAvailableQualifiers(){
- String beanName = CDIMarkerResolutionUtils.getELName(bean);
+ String beanName = CDIMarkerResolutionUtils.getELName(selectedBean);
ValuedQualifier lastQualifier = null;
- String beanTypeName = bean.getBeanClass().getFullyQualifiedName();
+ String beanTypeName = selectedBean.getBeanClass().getFullyQualifiedName();
String beanPackage = beanTypeName.substring(0,beanTypeName.lastIndexOf(CDIMarkerResolutionUtils.DOT));
- IJavaProject beanJavaProject = bean.getBeanClass().getJavaProject();
+ IJavaProject beanJavaProject = selectedBean.getBeanClass().getJavaProject();
String injectionPointTypeName = injectionPoint.getClassBean().getBeanClass().getFullyQualifiedName();
String injectionPointPackage = injectionPointTypeName.substring(0,injectionPointTypeName.lastIndexOf(CDIMarkerResolutionUtils.DOT));
@@ -190,7 +190,7 @@
boolean samePackage = beanPackage.equals(injectionPointPackage);
- IQualifier[] qs = bean.getCDIProject().getQualifiers();
+ IQualifier[] qs = selectedBean.getCDIProject().getQualifiers();
for(IQualifier q : qs){
ValuedQualifier vq = new ValuedQualifier(q);
@@ -246,9 +246,9 @@
HashSet<ValuedQualifier> qfs = new HashSet<ValuedQualifier>(total);
for(IBean b: beans){
- if(b.equals(bean))
+ if(b.equals(selectedBean))
continue;
- if(CDIMarkerResolutionUtils.checkValuedQualifiers(bean, b, qfs))
+ if(CDIMarkerResolutionUtils.checkValuedQualifiers(selectedBean, b, qfs))
return false;
}
@@ -280,9 +280,9 @@
GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
data.horizontalSpan = 3;
nLabel.setLayoutData(data);
- if(bean != null)
+ if(selectedBean != null)
nLabel.setText(MessageFormat.format(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_MESSAGE,
- new Object[]{bean.getElementName(), injectionPoint.getElementName()}));
+ new Object[]{selectedBean.getElementName(), injectionPoint.getElementName()}));
Label label = new Label(this, SWT.NONE);
label.setText(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_ENTER_QUALIFIER_NAME);
@@ -459,7 +459,7 @@
@Override
public void run(){
NewQualifierCreationWizard wizard = new NewQualifierCreationWizard();
- StructuredSelection selection = new StructuredSelection(new Object[]{bean.getBeanClass()});
+ StructuredSelection selection = new StructuredSelection(new Object[]{selectedBean.getBeanClass()});
wizard.init(PlatformUI.getWorkbench(), selection);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
@@ -500,8 +500,6 @@
}
});
- setEnablement();
-
Dialog.applyDialogFont(this);
}
@@ -579,7 +577,7 @@
if(isComplete)
page.setMessage("");
else
- page.setMessage(NLS.bind(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_SET_IS_NOT_UNIQUE, bean.getElementName(), injectionPoint.getElementName()), IMessageProvider.ERROR);
+ page.setMessage(NLS.bind(CDIUIMessages.ADD_QUALIFIERS_TO_BEAN_WIZARD_SET_IS_NOT_UNIQUE, selectedBean.getElementName(), injectionPoint.getElementName()), IMessageProvider.ERROR);
page.setPageComplete(isComplete);
}
14 years, 1 month
JBoss Tools SVN: r38720 - trunk/build/aggregate/soa-site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-02-14 12:42:16 -0500 (Tue, 14 Feb 2012)
New Revision: 38720
Modified:
trunk/build/aggregate/soa-site/site.xml
Log:
JBDS-2012 jBPM4 is only in JBT
Modified: trunk/build/aggregate/soa-site/site.xml
===================================================================
--- trunk/build/aggregate/soa-site/site.xml 2012-02-14 17:31:38 UTC (rev 38719)
+++ trunk/build/aggregate/soa-site/site.xml 2012-02-14 17:42:16 UTC (rev 38720)
@@ -37,6 +37,7 @@
<category name="AbridgedTools" />
<category name="SOATools" />
</feature>
+ <!-- jBPM4 is only in JBT -->
<feature url="features/org.jboss.tools.jbpm4.feature_0.0.0.jar" id="org.jboss.tools.jbpm4.feature" version="0.0.0">
<category name="AbridgedTools" />
<category name="SOATools" />
@@ -69,7 +70,7 @@
<description>
Contains most of the JBoss Tools - SOA Tooling features.
Excluded are those related to integration with 3rd party
- plugins. Selecting this category will give you all tools
+ plugins. Selecting this category will give you all tools
needed for SOA Development.
</description>
</category-def>
14 years, 1 month