JBoss Tools SVN: r39079 - in trunk/documentation/whatsnew/cdi: images/3.3.0.Beta1 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-02-23 17:31:57 -0500 (Thu, 23 Feb 2012)
New Revision: 39079
Added:
trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/sw.png
Modified:
trunk/documentation/whatsnew/cdi/cdi-news-3.3.0.Beta1.html
Log:
https://issues.jboss.org/browse/JBIDE-11015 CDI Component N&N
Modified: trunk/documentation/whatsnew/cdi/cdi-news-3.3.0.Beta1.html
===================================================================
--- trunk/documentation/whatsnew/cdi/cdi-news-3.3.0.Beta1.html 2012-02-23 21:52:20 UTC (rev 39078)
+++ trunk/documentation/whatsnew/cdi/cdi-news-3.3.0.Beta1.html 2012-02-23 22:31:57 UTC (rev 39079)
@@ -93,8 +93,32 @@
<tr>
<td colspan="2">
<hr />
+ <h3>Validation</h3>
+ <hr />
</td>
</tr>
+ <tr>
+ <td valign="top" align="left">
+ <p><b>@SuppressWarnings</b></p>
+ </td>
+ <td align="top">
+ <p>
+ CDI Validator now supports @SuppressWarnings annotation. There is a quick fix available for every validation warning which adds the corresponding @SuppressWarnings.
+ You can find the full list of all the available warning names in <a href="https://issues.jboss.org/browse/JBIDE-10187?focusedCommentId=12659098&pag...">Jira</a>.
+ </p>
+ <img src="images/3.3.0.Beta1/sw.png"/><br/><br/>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-10187">Related Jira</a>
+ </small><br/>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
</table>
Added: trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/sw.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/sw.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
12 years, 4 months
JBoss Tools SVN: r39078 - in trunk/maven/plugins/org.jboss.tools.maven.jpa: src/org/jboss/tools/maven/jpa/configurators and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-23 16:52:20 -0500 (Thu, 23 Feb 2012)
New Revision: 39078
Modified:
trunk/maven/plugins/org.jboss.tools.maven.jpa/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/JpaProjectConfigurator.java
Log:
JBIDE-10976 : do not register the Maven resource locator to Dali, but call it directly in the JPA configurator to access persistence.xml
Modified: trunk/maven/plugins/org.jboss.tools.maven.jpa/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jpa/plugin.xml 2012-02-23 21:47:34 UTC (rev 39077)
+++ trunk/maven/plugins/org.jboss.tools.maven.jpa/plugin.xml 2012-02-23 21:52:20 UTC (rev 39078)
@@ -21,22 +21,4 @@
secondaryTo="org.maven.ide.eclipse.configuration.wtp.configurator"/>
</extension>
- <extension
- point="org.eclipse.jpt.common.core.resourceLocators">
- <resourceLocator
- class="org.jboss.tools.maven.jpa.configurators.MavenResourceLocator"
- id="mavenResourceLocator"
- priority="lowest"
- >
- <enablement>
- <with variable="project">
- <and>
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature" forcePluginActivation="true"/>
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.m2e.core.maven2Nature" forcePluginActivation="true"/>
- </and>
- </with>
- </enablement>
- </resourceLocator>
- </extension>
-
</plugin>
Modified: trunk/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/JpaProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/JpaProjectConfigurator.java 2012-02-23 21:47:34 UTC (rev 39077)
+++ trunk/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/JpaProjectConfigurator.java 2012-02-23 21:52:20 UTC (rev 39078)
@@ -16,10 +16,14 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jpt.common.core.resource.ResourceLocator;
import org.eclipse.jpt.jpa.core.JpaFacet;
import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
@@ -69,7 +73,7 @@
return;
}
- IFile persistenceXml = JptUtils.getPersistenceXml(project);
+ IFile persistenceXml = getPersistenceXml(project);
if (persistenceXml == null || !persistenceXml.exists()) {
//No persistence.xml => not a JPA project
return;
@@ -84,6 +88,16 @@
}
}
+ private IFile getPersistenceXml(IProject project) {
+ ResourceLocator resourceLocator = new MavenResourceLocator();
+ IPath path = resourceLocator.getResourcePath(project, new Path("META-INF/persistence.xml"));
+ IFile persistenceXml = null;
+ if (path != null) {
+ persistenceXml = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ }
+ return persistenceXml;
+ }
+
private void configureFacets(IProgressMonitor monitor, IProject project,
IFacetedProject facetedProject, IFile persistenceXml)
throws CoreException {
12 years, 4 months
JBoss Tools SVN: r39077 - in branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.jpa: src/org/jboss/tools/maven/jpa/configurators and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-23 16:47:34 -0500 (Thu, 23 Feb 2012)
New Revision: 39077
Modified:
branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.jpa/plugin.xml
branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/JpaProjectConfigurator.java
Log:
JBIDE-10976 : do not register the Maven resource locator to Dali, but call it directly in the JPA configurator to access persistence.xml
Modified: branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.jpa/plugin.xml
===================================================================
--- branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.jpa/plugin.xml 2012-02-23 21:41:05 UTC (rev 39076)
+++ branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.jpa/plugin.xml 2012-02-23 21:47:34 UTC (rev 39077)
@@ -21,22 +21,4 @@
secondaryTo="org.maven.ide.eclipse.configuration.wtp.configurator"/>
</extension>
- <extension
- point="org.eclipse.jpt.common.core.resourceLocators">
- <resourceLocator
- class="org.jboss.tools.maven.jpa.configurators.MavenResourceLocator"
- id="mavenResourceLocator"
- priority="lowest"
- >
- <enablement>
- <with variable="project">
- <and>
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature" forcePluginActivation="true"/>
- <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.m2e.core.maven2Nature" forcePluginActivation="true"/>
- </and>
- </with>
- </enablement>
- </resourceLocator>
- </extension>
-
</plugin>
Modified: branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/JpaProjectConfigurator.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/JpaProjectConfigurator.java 2012-02-23 21:41:05 UTC (rev 39076)
+++ branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.jpa/src/org/jboss/tools/maven/jpa/configurators/JpaProjectConfigurator.java 2012-02-23 21:47:34 UTC (rev 39077)
@@ -16,10 +16,14 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jpt.common.core.resource.ResourceLocator;
import org.eclipse.jpt.jpa.core.JpaFacet;
import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
@@ -69,7 +73,7 @@
return;
}
- IFile persistenceXml = JptUtils.getPersistenceXml(project);
+ IFile persistenceXml = getPersistenceXml(project);
if (persistenceXml == null || !persistenceXml.exists()) {
//No persistence.xml => not a JPA project
return;
@@ -84,6 +88,16 @@
}
}
+ private IFile getPersistenceXml(IProject project) {
+ ResourceLocator resourceLocator = new MavenResourceLocator();
+ IPath path = resourceLocator.getResourcePath(project, new Path("META-INF/persistence.xml"));
+ IFile persistenceXml = null;
+ if (path != null) {
+ persistenceXml = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ }
+ return persistenceXml;
+ }
+
private void configureFacets(IProgressMonitor monitor, IProject project,
IFacetedProject facetedProject, IFile persistenceXml)
throws CoreException {
12 years, 4 months
JBoss Tools SVN: r39076 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-02-23 16:41:05 -0500 (Thu, 23 Feb 2012)
New Revision: 39076
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
Log:
Fixes for maven integration
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2012-02-23 21:29:48 UTC (rev 39075)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2012-02-23 21:41:05 UTC (rev 39076)
@@ -1354,7 +1354,9 @@
LinkedList<SWTBotTreeItem> treeItems = new LinkedList<SWTBotTreeItem>();
if (parent != null){
- if (expand) {
+ if (expand
+ && parent.getItems() != null
+ && parent.getItems().length > 0) {
parent.expand();
bot.sleep(SWTEclipseExt.DEFAULT_UI_TIMEOUT);
}
12 years, 4 months
JBoss Tools SVN: r39075 - in trunk/documentation/whatsnew/cdi: images and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-02-23 16:29:48 -0500 (Thu, 23 Feb 2012)
New Revision: 39075
Added:
trunk/documentation/whatsnew/cdi/cdi-news-3.3.0.Beta1.html
trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/
trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/description.png
trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/named.png
Log:
https://issues.jboss.org/browse/JBIDE-11015 CDI Component N&N
Added: trunk/documentation/whatsnew/cdi/cdi-news-3.3.0.Beta1.html
===================================================================
--- trunk/documentation/whatsnew/cdi/cdi-news-3.3.0.Beta1.html (rev 0)
+++ trunk/documentation/whatsnew/cdi/cdi-news-3.3.0.Beta1.html 2012-02-23 21:29:48 UTC (rev 39075)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>CDI/Seam 3 tools 3.3.0.M5 What's New</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>CDI tools 3.3.0.Beta1 What's New</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a
+ href="../seam/seam-news-3.3.0.Beta1.html">Seam Tools News ></a></p>
+
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>Quick Fixes</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p><b>Quick Fix Description</b></p>
+ </td>
+ <td align="top">
+ <p>CDI Quick Fix proposals now have detailed description where you can see the code which is going to be added/removed/modified:</p>
+ <img src="images/3.3.0.Beta1/description.png"/><br/><br/>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-10636">Related Jira</a>
+ </small><br/>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p><b>Quick fix for @Named injected methods/parameters</b></p>
+ </td>
+ <td align="top">
+ <p>
+ A new quick fix is available for @Named injected methods/parameters that does not specify the value member:
+ </p>
+ <img src="images/3.3.0.Beta1/named.png"/><br/><br/>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-7638">Related Jira</a>
+ </small>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p><b>Multiple @Disposes/@Observes</b></p>
+ </td>
+ <td align="top">
+ <p>
+ There is also a new quick fix for problems with methods that have more than one parameter annotated @Disposes/@Observes.
+ </p>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-7670">Related Jira</a>
+ </small>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ </td>
+ </tr>
+
+</table>
+
+</body>
+
+</html>
\ No newline at end of file
Property changes on: trunk/documentation/whatsnew/cdi/cdi-news-3.3.0.Beta1.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/description.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/description.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/named.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/cdi/images/3.3.0.Beta1/named.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
12 years, 4 months
JBoss Tools SVN: r39074 - in branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-23 15:24:02 -0500 (Thu, 23 Feb 2012)
New Revision: 39074
Modified:
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
Log:
Fixed - JBIDE-10966
domain and appnames must only be lowercase
https://issues.jboss.org/browse/JBIDE-10966
Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java 2012-02-23 20:23:52 UTC (rev 39073)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java 2012-02-23 20:24:02 UTC (rev 39074)
@@ -53,7 +53,8 @@
public static boolean isAlphaNumeric(String value) {
for (int i = 0; i < value.length(); ++i) {
- if (!Character.isLetterOrDigit(value.charAt(i))) {
+ final char c = value.charAt(i);
+ if (!Character.isLowerCase(c) && !Character.isDigit(c)) {
return false;
}
}
Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-23 20:23:52 UTC (rev 39073)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-23 20:24:02 UTC (rev 39074)
@@ -348,14 +348,6 @@
}, newAppConfigurationGroup);
}
- private void resetExistingApplication() {
- try {
- pageModel.resetExistingApplication();
- } catch (OpenShiftException e) {
- OpenShiftUIActivator.log(e);
- }
- }
-
private void fillCartridgesCombo(DataBindingContext dbc, Combo cartridgesCombo) {
dbc.bindList(WidgetProperties.items().observe(cartridgesCombo),
BeanProperties.list(ApplicationConfigurationWizardPageModel.PROPERTY_CARTRIDGES).observe(pageModel),
@@ -796,7 +788,7 @@
}
if (!StringUtils.isAlphaNumeric(applicationName)) {
return ValidationStatus.error(
- "The name may only contain letters and numbers.");
+ "The name may only contain lower-case letters and digits.");
}
if (pageModel.isExistingApplication(applicationName)) {
return ValidationStatus.error(
Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-02-23 20:23:52 UTC (rev 39073)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-02-23 20:24:02 UTC (rev 39074)
@@ -11,7 +11,16 @@
package org.jboss.tools.openshift.express.internal.ui.wizard;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.validation.MultiValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
+import org.eclipse.jface.databinding.swt.ISWTObservableValue;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
@@ -19,19 +28,20 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-import org.jboss.tools.common.ui.databinding.DataBindingUtils;
import org.jboss.tools.common.ui.databinding.ParametrizableWizardPageSupport;
+import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
+import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
/**
* @author André Dietisheim
*/
public class EditDomainWizardPage extends AbstractOpenShiftWizardPage {
- private EditDomainWizardPageModel model;
+ private final EditDomainWizardPageModel pageModel;
- public EditDomainWizardPage(EditDomainWizardPageModel model, IWizard wizard) {
+ public EditDomainWizardPage(final EditDomainWizardPageModel pageModel, final IWizard wizard) {
super("OpenShift Domain Edition", "Rename your domain", "Domain Name Edition", wizard);
- this.model = model;
+ this.pageModel = pageModel;
}
protected void doCreateControls(Composite container, DataBindingContext dbc) {
@@ -48,13 +58,51 @@
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(namespaceLabel);
Text namespaceText = new Text(domainGroup, SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(namespaceText);
- DataBindingUtils.bindMandatoryTextField(namespaceText, "Domain", EditDomainWizardPageModel.PROPERTY_NAMESPACE,
- model, dbc);
- }
+ ISWTObservableValue namespaceTextObservable = WidgetProperties.text(SWT.Modify)
+ .observe(namespaceText);
+ final NamespaceValidator namespaceValidator = new NamespaceValidator(namespaceTextObservable);
+ dbc.addValidationStatusProvider(namespaceValidator);
+ ControlDecorationSupport.create(namespaceValidator, SWT.LEFT | SWT.TOP, null,
+ new CustomControlDecorationUpdater());
+ final IObservableValue namespaceModelObservable = BeanProperties.value(
+ EditDomainWizardPageModel.PROPERTY_NAMESPACE).observe(pageModel);
+ ValueBindingBuilder.bind(namespaceTextObservable).to(namespaceModelObservable).in(dbc);
+ }
+
@Override
protected void setupWizardPageSupport(DataBindingContext dbc) {
ParametrizableWizardPageSupport.create(IStatus.ERROR, this, dbc);
}
+
+ class NamespaceValidator extends MultiValidator {
+ private final ISWTObservableValue domainNameObservable;
+
+ public NamespaceValidator(ISWTObservableValue domainNameObservable) {
+ this.domainNameObservable = domainNameObservable;
+ }
+
+ @Override
+ protected IStatus validate() {
+ final String domainName = (String) domainNameObservable.getValue();
+ if (domainName.isEmpty()) {
+ return ValidationStatus.cancel(
+ "Select an alphanumerical name and a type for the domain to edit.");
+ }
+ if (!StringUtils.isAlphaNumeric(domainName)) {
+ return ValidationStatus.error(
+ "The name may only contain lower-case letters and digits.");
+ }
+ return ValidationStatus.ok();
+ }
+
+ @Override
+ public IObservableList getTargets() {
+ WritableList targets = new WritableList();
+ targets.add(domainNameObservable);
+ return targets;
+ }
+ }
+
}
Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java 2012-02-23 20:23:52 UTC (rev 39073)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java 2012-02-23 20:24:02 UTC (rev 39074)
@@ -13,7 +13,6 @@
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
-import com.openshift.express.client.IDomain;
import com.openshift.express.client.IUser;
import com.openshift.express.client.OpenShiftException;
@@ -24,14 +23,17 @@
public class EditDomainWizardPageModel extends ObservableUIPojo {
public static final String PROPERTY_NAMESPACE = "namespace";
- public static final String PROPERTY_DOMAIN = "domain";
private String namespace;
- private IDomain domain;
+ private final IUser user;
+
public EditDomainWizardPageModel(IUser user) {
+ this.user = user;
try {
- setDomain(user.getDomain());
+ if (user.getDomain() != null) {
+ setNamespace(user.getDomain().getNamespace());
+ }
} catch (OpenShiftException e) {
Logger.error("Fail to retrieve OpenShift domain", e);
}
@@ -42,25 +44,15 @@
}
public void setNamespace(String namespace) {
- firePropertyChange(PROPERTY_NAMESPACE, this.namespace, this.namespace = namespace);
+ firePropertyChange(PROPERTY_NAMESPACE, this.namespace,
+ this.namespace = namespace);
}
- public boolean hasDomain() {
- return domain != null;
- }
-
- public IDomain getDomain() {
- return domain;
- }
-
- public void setDomain(IDomain domain) {
- firePropertyChange(PROPERTY_DOMAIN, this.domain, this.domain = domain);
- if (domain != null) {
- setNamespace(domain.getNamespace());
+ public void renameDomain() throws OpenShiftException {
+ if (user.getDomain() != null) {
+ user.getDomain().setNamespace(namespace);
+ } else {
+ Logger.warn("Attempting to rename missing user domain...");
}
}
-
- public void renameDomain() throws OpenShiftException {
- domain.setNamespace(namespace);
- }
}
Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-02-23 20:23:52 UTC (rev 39073)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-02-23 20:24:02 UTC (rev 39074)
@@ -17,11 +17,16 @@
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.MultiValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
+import org.eclipse.jface.databinding.swt.ISWTObservableValue;
import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.ErrorDialog;
@@ -43,9 +48,9 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.common.ui.databinding.DataBindingUtils;
import org.jboss.tools.common.ui.databinding.MandatoryStringValidator;
import org.jboss.tools.common.ui.databinding.ParametrizableWizardPageSupport;
+import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.common.ui.ssh.SshPrivateKeysPreferences;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.utils.FileUtils;
@@ -61,11 +66,11 @@
private static final String FILTEREXPRESSION_PUBLIC_SSH_KEY = "*.pub";
private static final String FILTERNAME_PUBLIC_SSH_KEY = "Public ssh key file (*.pub)";
- private NewDomainWizardPageModel model;
+ private NewDomainWizardPageModel pageModel;
- public NewDomainWizardPage(NewDomainWizardPageModel model, IWizard wizard) {
+ public NewDomainWizardPage(NewDomainWizardPageModel pageModel, IWizard wizard) {
super("Domain Creation", "Create a new domain", "New Domain", wizard);
- this.model = model;
+ this.pageModel = pageModel;
}
protected void doCreateControls(Composite container, DataBindingContext dbc) {
@@ -78,9 +83,20 @@
Text namespaceText = new Text(container, SWT.BORDER);
GridDataFactory.fillDefaults()
.span(3, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(namespaceText);
- DataBindingUtils.bindMandatoryTextField(
+ ISWTObservableValue namespaceTextObservable = WidgetProperties.text(SWT.Modify)
+ .observe(namespaceText);
+ final NamespaceValidator namespaceValidator = new NamespaceValidator(namespaceTextObservable);
+ dbc.addValidationStatusProvider(namespaceValidator);
+ ControlDecorationSupport.create(namespaceValidator, SWT.LEFT | SWT.TOP, null,
+ new CustomControlDecorationUpdater());
+ final IObservableValue namespaceModelObservable = BeanProperties.value(
+ EditDomainWizardPageModel.PROPERTY_NAMESPACE).observe(pageModel);
+ ValueBindingBuilder.bind(namespaceTextObservable).to(namespaceModelObservable).in(dbc);
+
+ /*DataBindingUtils.bindMandatoryTextField(
namespaceText, "Domain name", NewDomainWizardPageModel.PROPERTY_NAMESPACE, model, dbc);
-
+ */
+
Label sshKeyLabel = new Label(container, SWT.NONE);
sshKeyLabel.setText("SSH Public Key");
GridDataFactory.fillDefaults()
@@ -90,13 +106,13 @@
.align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(sshKeyText);
Binding sshKeyTextBinding = dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(sshKeyText),
- BeanProperties.value(NewDomainWizardPageModel.PROPERTY_SSHKEY).observe(model),
+ BeanProperties.value(NewDomainWizardPageModel.PROPERTY_SSHKEY).observe(pageModel),
new UpdateValueStrategy().setAfterGetValidator(new MandatoryStringValidator(
"You have to select a ssh public key")),
new UpdateValueStrategy().setAfterGetValidator(new SSHKeyValidator()));
ControlDecorationSupport.create(sshKeyTextBinding, SWT.TOP | SWT.LEFT);
try {
- model.initSshKey();
+ pageModel.initSshKey();
} catch (OpenShiftException ex) {
IStatus status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
"Could check your ssh keys", ex);
@@ -134,10 +150,10 @@
public void widgetSelected(SelectionEvent e) {
try {
- if (model.libraPublicKeyExists()) {
+ if (pageModel.libraPublicKeyExists()) {
MessageDialog.openInformation(getShell(),
"Libra Key already present",
- "You already have a key at \"" + model.getLibraPublicKey() + "\". Please move it or use it.");
+ "You already have a key at \"" + pageModel.getLibraPublicKey() + "\". Please move it or use it.");
return;
}
@@ -145,7 +161,7 @@
if (Dialog.OK == dialog.open()) {
try {
String passPhrase = dialog.getValue();
- model.createLibraKeyPair(passPhrase);
+ pageModel.createLibraKeyPair(passPhrase);
} catch (FileNotFoundException ex) {
IStatus status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
"Could not read the ssh key folder", ex);
@@ -183,7 +199,7 @@
dialog.setFilterExtensions(new String[] { FILTEREXPRESSION_PUBLIC_SSH_KEY });
String sshKeyPath = dialog.open();
if (sshKeyPath != null) {
- model.setSshKey(sshKeyPath);
+ pageModel.setSshKey(sshKeyPath);
}
}
};
@@ -245,5 +261,35 @@
return false;
}
}
+
+ private class NamespaceValidator extends MultiValidator {
+ private final ISWTObservableValue domainNameObservable;
+
+ public NamespaceValidator(ISWTObservableValue domainNameObservable) {
+ this.domainNameObservable = domainNameObservable;
+ }
+
+ @Override
+ protected IStatus validate() {
+ final String domainName = (String) domainNameObservable.getValue();
+ if (domainName.isEmpty()) {
+ return ValidationStatus.cancel(
+ "Select an alphanumerical name and a type for the domain to edit.");
+ }
+ if (!StringUtils.isAlphaNumeric(domainName)) {
+ return ValidationStatus.error(
+ "The name may only contain lower-case letters and digits.");
+ }
+ return ValidationStatus.ok();
+ }
+
+ @Override
+ public IObservableList getTargets() {
+ WritableList targets = new WritableList();
+ targets.add(domainNameObservable);
+ return targets;
+ }
+ }
+
}
Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2012-02-23 20:23:52 UTC (rev 39073)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2012-02-23 20:24:02 UTC (rev 39074)
@@ -37,7 +37,6 @@
public static final String PROPERTY_NAMESPACE = "namespace";
public static final String PROPERTY_SSHKEY = "sshKey";
- public static final String PROPERTY_DOMAIN = "domain";
private String namespace;
private IDomain domain;
@@ -88,7 +87,6 @@
public void createDomain() throws OpenShiftException, IOException {
IDomain domain = user.createDomain(namespace, loadSshKey());
- setDomain(domain);
}
public String getSshKey() {
@@ -156,10 +154,4 @@
return domain;
}
- public void setDomain(IDomain domain) {
- firePropertyChange(PROPERTY_DOMAIN, this.domain, this.domain = domain);
- if (domain != null) {
- setNamespace(domain.getNamespace());
- }
- }
}
12 years, 4 months
JBoss Tools SVN: r39072 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-23 15:20:54 -0500 (Thu, 23 Feb 2012)
New Revision: 39072
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/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
Log:
Fixed - JBIDE-10966
domain and appnames must only be lowercase
https://issues.jboss.org/browse/JBIDE-10966
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-23 20:19:53 UTC (rev 39071)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java 2012-02-23 20:20:54 UTC (rev 39072)
@@ -53,7 +53,8 @@
public static boolean isAlphaNumeric(String value) {
for (int i = 0; i < value.length(); ++i) {
- if (!Character.isLetterOrDigit(value.charAt(i))) {
+ final char c = value.charAt(i);
+ if (!Character.isLowerCase(c) && !Character.isDigit(c)) {
return false;
}
}
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-23 20:19:53 UTC (rev 39071)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-23 20:20:54 UTC (rev 39072)
@@ -348,14 +348,6 @@
}, newAppConfigurationGroup);
}
- private void resetExistingApplication() {
- try {
- pageModel.resetExistingApplication();
- } catch (OpenShiftException e) {
- OpenShiftUIActivator.log(e);
- }
- }
-
private void fillCartridgesCombo(DataBindingContext dbc, Combo cartridgesCombo) {
dbc.bindList(WidgetProperties.items().observe(cartridgesCombo),
BeanProperties.list(ApplicationConfigurationWizardPageModel.PROPERTY_CARTRIDGES).observe(pageModel),
@@ -796,7 +788,7 @@
}
if (!StringUtils.isAlphaNumeric(applicationName)) {
return ValidationStatus.error(
- "The name may only contain letters and numbers.");
+ "The name may only contain lower-case letters and digits.");
}
if (pageModel.isExistingApplication(applicationName)) {
return ValidationStatus.error(
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-02-23 20:19:53 UTC (rev 39071)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-02-23 20:20:54 UTC (rev 39072)
@@ -11,7 +11,16 @@
package org.jboss.tools.openshift.express.internal.ui.wizard;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.validation.MultiValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
+import org.eclipse.jface.databinding.swt.ISWTObservableValue;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
@@ -21,17 +30,19 @@
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.ui.databinding.DataBindingUtils;
import org.jboss.tools.common.ui.databinding.ParametrizableWizardPageSupport;
+import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
+import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
/**
* @author André Dietisheim
*/
public class EditDomainWizardPage extends AbstractOpenShiftWizardPage {
- private EditDomainWizardPageModel model;
+ private EditDomainWizardPageModel pageModel;
public EditDomainWizardPage(EditDomainWizardPageModel model, IWizard wizard) {
super("OpenShift Domain Edition", "Rename your domain", "Domain Name Edition", wizard);
- this.model = model;
+ this.pageModel = model;
}
protected void doCreateControls(Composite container, DataBindingContext dbc) {
@@ -48,13 +59,51 @@
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(namespaceLabel);
Text namespaceText = new Text(domainGroup, SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(namespaceText);
- DataBindingUtils.bindMandatoryTextField(namespaceText, "Domain", EditDomainWizardPageModel.PROPERTY_NAMESPACE,
- model, dbc);
- }
+ ISWTObservableValue namespaceTextObservable = WidgetProperties.text(SWT.Modify)
+ .observe(namespaceText);
+ final NamespaceValidator namespaceValidator = new NamespaceValidator(namespaceTextObservable);
+ dbc.addValidationStatusProvider(namespaceValidator);
+ ControlDecorationSupport.create(namespaceValidator, SWT.LEFT | SWT.TOP, null,
+ new CustomControlDecorationUpdater());
+ final IObservableValue namespaceModelObservable = BeanProperties.value(
+ EditDomainWizardPageModel.PROPERTY_NAMESPACE).observe(pageModel);
+ ValueBindingBuilder.bind(namespaceTextObservable).to(namespaceModelObservable).in(dbc);
+ }
+
@Override
protected void setupWizardPageSupport(DataBindingContext dbc) {
ParametrizableWizardPageSupport.create(IStatus.ERROR, this, dbc);
}
+
+ class NamespaceValidator extends MultiValidator {
+ private final ISWTObservableValue domainNameObservable;
+
+ public NamespaceValidator(ISWTObservableValue domainNameObservable) {
+ this.domainNameObservable = domainNameObservable;
+ }
+
+ @Override
+ protected IStatus validate() {
+ final String domainName = (String) domainNameObservable.getValue();
+ if (domainName.isEmpty()) {
+ return ValidationStatus.cancel(
+ "Select an alphanumerical name and a type for the domain to edit.");
+ }
+ if (!StringUtils.isAlphaNumeric(domainName)) {
+ return ValidationStatus.error(
+ "The name may only contain lower-case letters and digits.");
+ }
+ return ValidationStatus.ok();
+ }
+
+ @Override
+ public IObservableList getTargets() {
+ WritableList targets = new WritableList();
+ targets.add(domainNameObservable);
+ return targets;
+ }
+ }
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java 2012-02-23 20:19:53 UTC (rev 39071)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java 2012-02-23 20:20:54 UTC (rev 39072)
@@ -13,7 +13,6 @@
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
-import com.openshift.express.client.IDomain;
import com.openshift.express.client.IUser;
import com.openshift.express.client.OpenShiftException;
@@ -24,14 +23,17 @@
public class EditDomainWizardPageModel extends ObservableUIPojo {
public static final String PROPERTY_NAMESPACE = "namespace";
- public static final String PROPERTY_DOMAIN = "domain";
private String namespace;
- private IDomain domain;
+ private final IUser user;
+
public EditDomainWizardPageModel(IUser user) {
+ this.user = user;
try {
- setDomain(user.getDomain());
+ if (user.getDomain() != null) {
+ setNamespace(user.getDomain().getNamespace());
+ }
} catch (OpenShiftException e) {
Logger.error("Fail to retrieve OpenShift domain", e);
}
@@ -42,25 +44,15 @@
}
public void setNamespace(String namespace) {
- firePropertyChange(PROPERTY_NAMESPACE, this.namespace, this.namespace = namespace);
+ firePropertyChange(PROPERTY_NAMESPACE, this.namespace,
+ this.namespace = namespace);
}
- public boolean hasDomain() {
- return domain != null;
- }
-
- public IDomain getDomain() {
- return domain;
- }
-
- public void setDomain(IDomain domain) {
- firePropertyChange(PROPERTY_DOMAIN, this.domain, this.domain = domain);
- if (domain != null) {
- setNamespace(domain.getNamespace());
+ public void renameDomain() throws OpenShiftException {
+ if (user.getDomain() != null) {
+ user.getDomain().setNamespace(namespace);
+ } else {
+ Logger.warn("Attempting to rename missing user domain...");
}
}
-
- public void renameDomain() throws OpenShiftException {
- domain.setNamespace(namespace);
- }
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-02-23 20:19:53 UTC (rev 39071)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-02-23 20:20:54 UTC (rev 39072)
@@ -17,11 +17,16 @@
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.MultiValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
+import org.eclipse.jface.databinding.swt.ISWTObservableValue;
import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.ErrorDialog;
@@ -43,9 +48,9 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.common.ui.databinding.DataBindingUtils;
import org.jboss.tools.common.ui.databinding.MandatoryStringValidator;
import org.jboss.tools.common.ui.databinding.ParametrizableWizardPageSupport;
+import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.common.ui.ssh.SshPrivateKeysPreferences;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.utils.FileUtils;
@@ -61,11 +66,11 @@
private static final String FILTEREXPRESSION_PUBLIC_SSH_KEY = "*.pub";
private static final String FILTERNAME_PUBLIC_SSH_KEY = "Public ssh key file (*.pub)";
- private NewDomainWizardPageModel model;
+ private NewDomainWizardPageModel pageModel;
- public NewDomainWizardPage(NewDomainWizardPageModel model, IWizard wizard) {
+ public NewDomainWizardPage(NewDomainWizardPageModel pageModel, IWizard wizard) {
super("Domain Creation", "Create a new domain", "New Domain", wizard);
- this.model = model;
+ this.pageModel = pageModel;
}
protected void doCreateControls(Composite container, DataBindingContext dbc) {
@@ -78,9 +83,20 @@
Text namespaceText = new Text(container, SWT.BORDER);
GridDataFactory.fillDefaults()
.span(3, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(namespaceText);
- DataBindingUtils.bindMandatoryTextField(
+ ISWTObservableValue namespaceTextObservable = WidgetProperties.text(SWT.Modify)
+ .observe(namespaceText);
+ final NamespaceValidator namespaceValidator = new NamespaceValidator(namespaceTextObservable);
+ dbc.addValidationStatusProvider(namespaceValidator);
+ ControlDecorationSupport.create(namespaceValidator, SWT.LEFT | SWT.TOP, null,
+ new CustomControlDecorationUpdater());
+ final IObservableValue namespaceModelObservable = BeanProperties.value(
+ EditDomainWizardPageModel.PROPERTY_NAMESPACE).observe(pageModel);
+ ValueBindingBuilder.bind(namespaceTextObservable).to(namespaceModelObservable).in(dbc);
+
+ /*DataBindingUtils.bindMandatoryTextField(
namespaceText, "Domain name", NewDomainWizardPageModel.PROPERTY_NAMESPACE, model, dbc);
-
+ */
+
Label sshKeyLabel = new Label(container, SWT.NONE);
sshKeyLabel.setText("SSH Public Key");
GridDataFactory.fillDefaults()
@@ -90,13 +106,13 @@
.align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(sshKeyText);
Binding sshKeyTextBinding = dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(sshKeyText),
- BeanProperties.value(NewDomainWizardPageModel.PROPERTY_SSHKEY).observe(model),
+ BeanProperties.value(NewDomainWizardPageModel.PROPERTY_SSHKEY).observe(pageModel),
new UpdateValueStrategy().setAfterGetValidator(new MandatoryStringValidator(
"You have to select a ssh public key")),
new UpdateValueStrategy().setAfterGetValidator(new SSHKeyValidator()));
ControlDecorationSupport.create(sshKeyTextBinding, SWT.TOP | SWT.LEFT);
try {
- model.initSshKey();
+ pageModel.initSshKey();
} catch (OpenShiftException ex) {
IStatus status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
"Could check your ssh keys", ex);
@@ -134,10 +150,10 @@
public void widgetSelected(SelectionEvent e) {
try {
- if (model.libraPublicKeyExists()) {
+ if (pageModel.libraPublicKeyExists()) {
MessageDialog.openInformation(getShell(),
"Libra Key already present",
- "You already have a key at \"" + model.getLibraPublicKey() + "\". Please move it or use it.");
+ "You already have a key at \"" + pageModel.getLibraPublicKey() + "\". Please move it or use it.");
return;
}
@@ -145,7 +161,7 @@
if (Dialog.OK == dialog.open()) {
try {
String passPhrase = dialog.getValue();
- model.createLibraKeyPair(passPhrase);
+ pageModel.createLibraKeyPair(passPhrase);
} catch (FileNotFoundException ex) {
IStatus status = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
"Could not read the ssh key folder", ex);
@@ -183,7 +199,7 @@
dialog.setFilterExtensions(new String[] { FILTEREXPRESSION_PUBLIC_SSH_KEY });
String sshKeyPath = dialog.open();
if (sshKeyPath != null) {
- model.setSshKey(sshKeyPath);
+ pageModel.setSshKey(sshKeyPath);
}
}
};
@@ -245,5 +261,35 @@
return false;
}
}
+
+ private class NamespaceValidator extends MultiValidator {
+ private final ISWTObservableValue domainNameObservable;
+
+ public NamespaceValidator(ISWTObservableValue domainNameObservable) {
+ this.domainNameObservable = domainNameObservable;
+ }
+
+ @Override
+ protected IStatus validate() {
+ final String domainName = (String) domainNameObservable.getValue();
+ if (domainName.isEmpty()) {
+ return ValidationStatus.cancel(
+ "Select an alphanumerical name and a type for the domain to edit.");
+ }
+ if (!StringUtils.isAlphaNumeric(domainName)) {
+ return ValidationStatus.error(
+ "The name may only contain lower-case letters and digits.");
+ }
+ return ValidationStatus.ok();
+ }
+
+ @Override
+ public IObservableList getTargets() {
+ WritableList targets = new WritableList();
+ targets.add(domainNameObservable);
+ return targets;
+ }
+ }
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2012-02-23 20:19:53 UTC (rev 39071)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2012-02-23 20:20:54 UTC (rev 39072)
@@ -37,7 +37,6 @@
public static final String PROPERTY_NAMESPACE = "namespace";
public static final String PROPERTY_SSHKEY = "sshKey";
- public static final String PROPERTY_DOMAIN = "domain";
private String namespace;
private IDomain domain;
@@ -88,7 +87,6 @@
public void createDomain() throws OpenShiftException, IOException {
IDomain domain = user.createDomain(namespace, loadSshKey());
- setDomain(domain);
}
public String getSshKey() {
@@ -156,10 +154,4 @@
return domain;
}
- public void setDomain(IDomain domain) {
- firePropertyChange(PROPERTY_DOMAIN, this.domain, this.domain = domain);
- if (domain != null) {
- setNamespace(domain.getNamespace());
- }
- }
}
12 years, 4 months
JBoss Tools SVN: r39071 - trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples.
by jbosstools-commits@lists.jboss.org
Author: ldimaggio
Date: 2012-02-23 15:19:53 -0500 (Thu, 23 Feb 2012)
New Revision: 39071
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceProducer.java
Log:
Temporary fix to workaround JBDS-2011 - examples/ESBExampleTest.java
Added http and socket tests to examples/WebServiceProducer.java
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2012-02-23 19:39:08 UTC (rev 39070)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/ESBExampleTest.java 2012-02-23 20:19:53 UTC (rev 39071)
@@ -49,7 +49,12 @@
fixExampleClientLibs();
}
openESBConfig();
- assertProblemsView();
+
+ /* Temporary fix to workaround JBDS-2011 */
+ System.out.println ("DEBUG - name = " + getExampleProjectName() );
+ if (!getExampleProjectName().equals("transform_CSV2XML")) {
+ assertProblemsView();
+ }
}
/**
* opens up ESB config file contained in example project in ESB Editor
@@ -149,6 +154,9 @@
protected void assertProblemsView() {
//bot.sleep(60000l);
SWTBotTreeItem errors = ProblemsView.getErrorsNode(bot);
+
+
+
assertNull("Project still contain problems :"+SWTEclipseExt.getFormattedTreeNode(errors),errors);
}
protected void fixLibrary(String project, String lib) {
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceProducer.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceProducer.java 2012-02-23 19:39:08 UTC (rev 39070)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/WebServiceProducer.java 2012-02-23 20:19:53 UTC (rev 39071)
@@ -18,10 +18,19 @@
@Override
protected void executeExample() {
super.executeExample();
+
String text = executeClientGetServerOutput("org.jboss.soa.esb.samples.quickstart.webserviceproducer.test.SendMessage","jms");
- SWTTestExt.servers.removeAllProjectsFromServer();
assertNotNull("Calling Send message failed, nothing appened to server log",text);
+ assertTrue("Calling Send message failed, unexpected server output :"+text,text.contains("Goodbye!!"));
+
+ text = executeClientGetServerOutput("org.jboss.soa.esb.samples.quickstart.webserviceproducer.test.SendMessage","http 8765");
+ assertNotNull("Calling Send message failed, nothing appened to server log",text);
assertTrue("Calling Send message failed, unexpected server output :"+text,text.contains("Goodbye!!"));
- fail("testing method http not yet implemented");
+
+ text = executeClientGetServerOutput("org.jboss.soa.esb.samples.quickstart.webserviceproducer.test.SendMessage","socket 8888");
+ assertNotNull("Calling Send message failed, nothing appened to server log",text);
+ assertTrue("Calling Send message failed, unexpected server output :"+text,text.contains("Goodbye!!"));
+
+ SWTTestExt.servers.removeAllProjectsFromServer();
}
}
12 years, 4 months