JBoss Tools SVN: r40507 - trunk/jsf/docs/userguide/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-04-25 20:13:56 -0400 (Wed, 25 Apr 2012)
New Revision: 40507
Modified:
trunk/jsf/docs/userguide/en-US/Book_Info.xml
trunk/jsf/docs/userguide/en-US/browsers.xml
Log:
updated with system requirement info from emails
Modified: trunk/jsf/docs/userguide/en-US/Book_Info.xml
===================================================================
--- trunk/jsf/docs/userguide/en-US/Book_Info.xml 2012-04-26 00:09:47 UTC (rev 40506)
+++ trunk/jsf/docs/userguide/en-US/Book_Info.xml 2012-04-26 00:13:56 UTC (rev 40507)
@@ -5,9 +5,9 @@
<title>Visual Web Tools Reference Guide</title>
<subtitle>Provides information relating to the Visual Web Tools module.</subtitle>
<productname>JBoss Developer Studio</productname>
-<productnumber>5.0</productnumber>
+<productnumber>5.0.Beta</productnumber>
<edition>5.0.0</edition>
-<pubsnumber>9</pubsnumber>
+<pubsnumber>10</pubsnumber>
<abstract>
<para>The Visual Web Tools Reference Guide explains extensive collection of specialized wizards, editors and views that can be used in various scenarios while developing Web applications.</para>
</abstract>
Modified: trunk/jsf/docs/userguide/en-US/browsers.xml
===================================================================
--- trunk/jsf/docs/userguide/en-US/browsers.xml 2012-04-26 00:09:47 UTC (rev 40506)
+++ trunk/jsf/docs/userguide/en-US/browsers.xml 2012-04-26 00:13:56 UTC (rev 40507)
@@ -34,6 +34,42 @@
<para>
<guilabel>BrowserSim</guilabel> simulates a mobile web browser so you can see how your web page or site will be viewable on mobile devices.
</para>
+ <section>
+ <title>System requirements</title>
+ <para>
+ To run the mobile browser simulator you will require certain configurations depending on your operating system.
+ </para>
+ <para>
+ Linux distributions:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ WebKitGTK 1.2.0 or newer must be installed and available within the library load path. This is setup by default on Red Hat Enterprise Linux and Ubuntu. For other distributions you may need to install the <filename>libwebkitgtk</filename> package.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Windows operating systems:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ 32-bit version of JBoss tooling.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Apple Safari.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ There are no specific requirements for Red Hat Enterprise Linux and Macintosh operating systems.
+ </para>
+ </section>
+ <section>
+ <title>Using BrowserSim</title>
<para>
To test your page or site using <guilabel>BrowserSim</guilabel>, right-click on your <filename>HTML</filename>, <filename>XHTML</filename> or other web page extention file and navigate through the context menu to <menuchoice><guimenuitem>Open With</guimenuitem><guimenuitem>BrowserSim</guimenuitem></menuchoice>.
</para>
@@ -135,4 +171,5 @@
</mediaobject>
</figure>
</section>
+ </section>
</chapter>
12 years, 8 months
JBoss Tools SVN: r40506 - trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-04-25 20:09:47 -0400 (Wed, 25 Apr 2012)
New Revision: 40506
Modified:
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java
Log:
Auto-discover all the modules and add them to the configuration on GWT project import https://issues.jboss.org/browse/JBIDE-11244
Modified: trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java 2012-04-25 23:17:31 UTC (rev 40505)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java 2012-04-26 00:09:47 UTC (rev 40506)
@@ -83,17 +83,20 @@
@Override
public void mavenProjectChanged(MavenProjectChangedEvent event, IProgressMonitor monitor) throws CoreException {
- Plugin newConfig = event.getMavenProject().getMavenProject().getPlugin(GWT_WAR_MAVEN_PLUGIN_KEY);
- IJavaProject javaProject = JavaCore.create(event.getMavenProject().getProject());
-
- List<String> modNames = findModules(newConfig, javaProject);
-
- try {
- GWTProjectProperties.setEntryPointModules(event.getMavenProject().getProject(), modNames);
- } catch (BackingStoreException e) {
- logError("Exception in Maven GWT Configurator, cannot set entry point modules", e);
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ boolean configureGWT = store.getBoolean(Activator.CONFIGURE_GWT);
+ if(configureGWT){
+ Plugin newConfig = event.getMavenProject().getMavenProject().getPlugin(GWT_WAR_MAVEN_PLUGIN_KEY);
+ IJavaProject javaProject = JavaCore.create(event.getMavenProject().getProject());
+
+ List<String> modNames = findModules(newConfig, javaProject);
+
+ try {
+ GWTProjectProperties.setEntryPointModules(event.getMavenProject().getProject(), modNames);
+ } catch (BackingStoreException e) {
+ logError("Exception in Maven GWT Configurator, cannot set entry point modules", e);
+ }
}
-
}
private List<String> findModules(Plugin pluginConfig, IJavaProject javaProject){
12 years, 8 months
JBoss Tools SVN: r40505 - trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-04-25 19:17:31 -0400 (Wed, 25 Apr 2012)
New Revision: 40505
Modified:
trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java
Log:
Auto-discover all the modules and add them to the configuration on GWT project import https://issues.jboss.org/browse/JBIDE-11244
Modified: trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java 2012-04-25 22:52:36 UTC (rev 40504)
+++ trunk/maven/plugins/org.jboss.tools.maven.gwt/src/org/jboss/tools/maven/gwt/GWTProjectConfigurator.java 2012-04-25 23:17:31 UTC (rev 40505)
@@ -15,7 +15,6 @@
import java.util.List;
import org.apache.maven.model.Plugin;
-import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -23,10 +22,10 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
import org.jboss.tools.common.model.project.ProjectHome;
@@ -57,42 +56,9 @@
if(javaProject!=null) {
log.debug("Configure Entry Point Modules for GWT Project {}", projectName);
- List<String> modNames = new ArrayList<String>();
-
Plugin pluginConfig = projectConfig.getMavenProject().getPlugin(GWT_WAR_MAVEN_PLUGIN_KEY);
- Xpp3Dom gwtConfig = (Xpp3Dom)pluginConfig.getConfiguration();
-
- if (gwtConfig!=null) {
- Xpp3Dom[] moduleNodes = gwtConfig.getChildren("module");
- if (moduleNodes.length > 0) {
- String moduleQNameTrimmed = null;
- for (Xpp3Dom mNode : moduleNodes) {
- moduleQNameTrimmed = mNode.getValue().trim();
- }
- if(moduleQNameTrimmed != null){
- modNames.add(moduleQNameTrimmed);
- }
- } else {
- Xpp3Dom modulesNode = gwtConfig.getChild("modules");
- if (modulesNode != null) {
- moduleNodes = modulesNode.getChildren("module");
- for (Xpp3Dom mNode : moduleNodes) {
- String moduleQNameTrimmed = mNode.getValue().trim();
- modNames.add(moduleQNameTrimmed);
- }
- }
- }
- }
-
- if(modNames.size() == 0){
- IModule[] modules = ModuleUtils.findAllModules(javaProject,false);
- modNames = new ArrayList<String>();
- for (IModule iModule : modules) {
- modNames.add(iModule.getQualifiedName());
- log.debug("\t{}",iModule.getQualifiedName());
- }
- }
+ List<String> modNames = findModules(pluginConfig, javaProject);
try {
GWTProjectProperties.setEntryPointModules(projectConfig.getProject(), modNames);
@@ -114,6 +80,57 @@
}
}
}
+
+ @Override
+ public void mavenProjectChanged(MavenProjectChangedEvent event, IProgressMonitor monitor) throws CoreException {
+ Plugin newConfig = event.getMavenProject().getMavenProject().getPlugin(GWT_WAR_MAVEN_PLUGIN_KEY);
+ IJavaProject javaProject = JavaCore.create(event.getMavenProject().getProject());
+
+ List<String> modNames = findModules(newConfig, javaProject);
+
+ try {
+ GWTProjectProperties.setEntryPointModules(event.getMavenProject().getProject(), modNames);
+ } catch (BackingStoreException e) {
+ logError("Exception in Maven GWT Configurator, cannot set entry point modules", e);
+ }
+
+ }
+
+ private List<String> findModules(Plugin pluginConfig, IJavaProject javaProject){
+ List<String> modNames = new ArrayList<String>();
+ Xpp3Dom gwtConfig = (Xpp3Dom)pluginConfig.getConfiguration();
+
+ if (gwtConfig!=null) {
+ Xpp3Dom[] moduleNodes = gwtConfig.getChildren("module");
+ if (moduleNodes.length > 0) {
+ String moduleQNameTrimmed = null;
+ for (Xpp3Dom mNode : moduleNodes) {
+ moduleQNameTrimmed = mNode.getValue().trim();
+ }
+ if(moduleQNameTrimmed != null){
+ modNames.add(moduleQNameTrimmed);
+ }
+ } else {
+ Xpp3Dom modulesNode = gwtConfig.getChild("modules");
+ if (modulesNode != null) {
+ moduleNodes = modulesNode.getChildren("module");
+ for (Xpp3Dom mNode : moduleNodes) {
+ String moduleQNameTrimmed = mNode.getValue().trim();
+ modNames.add(moduleQNameTrimmed);
+ }
+ }
+ }
+ }
+ if(modNames.size() == 0){
+ IModule[] modules = ModuleUtils.findAllModules(javaProject,false);
+ modNames = new ArrayList<String>();
+ for (IModule iModule : modules) {
+ modNames.add(iModule.getQualifiedName());
+ log.debug("\t{}",iModule.getQualifiedName());
+ }
+ }
+ return modNames;
+ }
/**
* Report error in logger and eclipse user interface
12 years, 8 months
JBoss Tools SVN: r40504 - trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-04-25 18:52:36 -0400 (Wed, 25 Apr 2012)
New Revision: 40504
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
Log:
JBIDE-11539
https://issues.jboss.org/browse/JBIDE-11539
A constant is made static.
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2012-04-25 22:17:27 UTC (rev 40503)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2012-04-25 22:52:36 UTC (rev 40504)
@@ -198,7 +198,7 @@
el = exps.toArray(new ELExpression[0]);
}
- private IMarker[] EMPTY_MARKER_ARRAY = new IMarker[0];
+ private static final IMarker[] EMPTY_MARKER_ARRAY = new IMarker[0];
private void initMarkers() {
if(markers==null) {
12 years, 8 months
JBoss Tools SVN: r40502 - trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-04-25 17:29:52 -0400 (Wed, 25 Apr 2012)
New Revision: 40502
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
Log:
https://issues.jboss.org/browse/JBIDE-11653 Errors running builder 'JAX-RS Builder' on project 'ticket-monster'
https://issues.jboss.org/browse/JBIDE-11576 ClassCastException in JavaMethodSignaturesVisitor
fixed by using getAdapter(IType.class) for IJavaElement instance
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-04-25 20:39:45 UTC (rev 40501)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-04-25 21:29:52 UTC (rev 40502)
@@ -85,7 +85,7 @@
Logger.warn("Could not resolve bindings form method " + method.getElementName());
} else {
final IType returnedType = methodBinding.getReturnType() != null ? (IType) methodBinding
- .getReturnType().getJavaElement() : null;
+ .getReturnType().getJavaElement().getAdapter(IType.class) : null;
List<JavaMethodParameter> methodParameters = new ArrayList<JavaMethodParameter>();
@SuppressWarnings("unchecked")
List<SingleVariableDeclaration> parameters = declaration.parameters();
12 years, 8 months
JBoss Tools SVN: r40501 - in trunk/modeshape: tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2012-04-25 16:39:45 -0400 (Wed, 25 Apr 2012)
New Revision: 40501
Added:
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/commentsTest.cnd
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndImporter.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndImporterTest.java
trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/aircraft.cnd
Log:
JBIDE-11586 ModeShape Tools JCR CND Editor Deletes Comments And Vendor Extensions. Corrected some instances where comments were not getting assigned to the right CND elements.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndImporter.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndImporter.java 2012-04-25 20:03:22 UTC (rev 40500)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndImporter.java 2012-04-25 20:39:45 UTC (rev 40501)
@@ -14,6 +14,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.NoSuchElementException;
import java.util.Stack;
import org.eclipse.osgi.util.NLS;
@@ -63,10 +64,12 @@
private final boolean jcr170 = true;
- private final Stack<CndElement> cndElements = new Stack<CndElement>();
+ private final Stack<CommentedCndElement> cndElements = new Stack<CommentedCndElement>();
private String currentComment;
+ private CommentedCndElement previousElement;
+
/**
* Import the CND content from the supplied stream, placing the content into the importer's destination.
*
@@ -129,8 +132,6 @@
final CompactNodeTypeDefinition cnd = new CompactNodeTypeDefinition();
- // start processing CND
- push(cnd);
final Tokenizer tokenizer = new CndTokenizer();
final TokenStream tokens = new TokenStream(content, tokenizer, false);
tokens.start();
@@ -155,9 +156,6 @@
}
}
- // finished processing CND
- final CndElement cndElement = pop();
- assert (cnd == cndElement) : "CND Element not the expected CND: " + cndElement.toCndNotation(NotationType.LONG); //$NON-NLS-1$
return cnd;
}
@@ -209,16 +207,67 @@
assert (childNodeDefn == cndElement) : "Element not expected child node: " + cndElement.toCndNotation(NotationType.LONG); //$NON-NLS-1$
}
- private void parseComment( final TokenStream tokens ) {
+ private boolean parseComment( final TokenStream tokens ) {
if (tokens.matches(CndTokenizer.COMMENT)) {
- final String newComment = CommentedCndElement.Helper.removeCommentCharacters(tokens.consume());
+ do {
+ boolean sameLine = false;
- if (Utils.isEmpty(this.currentComment)) {
- this.currentComment = newComment;
- } else {
- this.currentComment += '\n' + newComment;
- }
+ try {
+ sameLine = tokens.nextPosition().getLine() == tokens.previousPosition().getLine();
+ } catch (NoSuchElementException e) {
+ // ignore
+ }
+
+ String newComment = CommentedCndElement.Helper.removeCommentCharacters(tokens.consume());
+
+ // same line comment
+ if (sameLine || (!Utils.isEmpty(this.currentComment) && !this.cndElements.isEmpty())) {
+ // concatenate this comment with existing comment
+ if (Utils.isEmpty(this.currentComment)) {
+ this.currentComment = Utils.EMPTY_STRING;
+ } else if (!this.currentComment.endsWith("\n")) { //$NON-NLS-1$
+ this.currentComment += '\n';
+ }
+
+ this.currentComment += newComment;
+
+ CommentedCndElement cndElement = null;
+
+ if (this.cndElements.isEmpty()) {
+ cndElement = this.previousElement;
+ } else {
+ cndElement = this.cndElements.peek();
+ }
+
+ String comment = cndElement.getComment();
+
+ if (Utils.isEmpty(comment)) {
+ comment = this.currentComment;
+ } else {
+ if (!comment.endsWith("\n")) { //$NON-NLS-1$
+ comment += '\n';
+ }
+
+ comment += this.currentComment;
+ }
+
+ cndElement.setComment(comment);
+ this.currentComment = null;
+ } else {
+ if (this.currentComment == null) {
+ this.currentComment = Utils.EMPTY_STRING;
+ } else if (!this.currentComment.endsWith("\n")) { //$NON-NLS-1$
+ this.currentComment += '\n';
+ }
+
+ this.currentComment += newComment;
+ }
+ } while (tokens.matches(CndTokenizer.COMMENT));
+
+ return true;
}
+
+ return false;
}
/**
@@ -233,9 +282,6 @@
assert (tokens != null) : "tokens is null"; //$NON-NLS-1$
assert (defaultType != null) : "defaultType is null"; //$NON-NLS-1$
- // start processing default type
- push(defaultType);
-
if (tokens.canConsume(DefaultType.NOTATION)) {
if (tokens.canConsume(AttributeState.VARIANT_CHAR)) {
defaultType.set(Value.VARIANT);
@@ -247,10 +293,6 @@
}
}
}
-
- // finished processing default type
- final CndElement cndElement = pop();
- assert (defaultType == cndElement) : "Element not expected default type: " + cndElement.toCndNotation(NotationType.LONG); //$NON-NLS-1$
}
/**
@@ -265,6 +307,8 @@
assert (tokens != null) : "tokens is null"; //$NON-NLS-1$
assert (propDefn != null) : "propDefn is null"; //$NON-NLS-1$
+ parseComment(tokens);
+
if (tokens.canConsume(DefaultValues.NOTATION_PREFIX)) {
final List<String> values = parseStringList(tokens);
@@ -308,9 +352,22 @@
names.add(AttributeState.VARIANT_STRING);
} else {
// Read names until we see a ','
+ boolean foundComma = false;
+ boolean saveComma = false;
+
do {
- names.add(parseName(tokens));
- } while (tokens.canConsume(','));
+ if (tokens.matches(CndTokenizer.COMMENT)) {
+ parseComment(tokens);
+ saveComma = true;
+ } else {
+ names.add(parseName(tokens));
+ saveComma = false;
+ }
+
+ if (!saveComma) {
+ foundComma = tokens.matches(',');
+ }
+ } while (tokens.canConsume(',') || tokens.matches(CndTokenizer.COMMENT) || foundComma);
}
return names;
@@ -415,6 +472,8 @@
} else if (tokens.matchesAnyOf(Utils.toUpperCase(OnParentVersion.toArray()))) {
final String opv = tokens.consume();
childNodeDefn.setOnParentVersion(opv);
+ } else if (tokens.matches(CndTokenizer.COMMENT)) {
+ parseComment(tokens);
} else if (tokens.canConsumeAnyOf("PRIMARYITEM", "PRIMARY", "PRI", "!")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
if (!this.jcr170) {
final Position pos = tokens.previousPosition();
@@ -493,6 +552,8 @@
} else {
nodeTypeDefn.setPrimaryItemName(removeQuotes(tokens.consume()));
}
+ } else if (tokens.matches(CndTokenizer.COMMENT)) {
+ parseComment(tokens);
} else {
// No more valid options on the stream, so stop ...
break;
@@ -524,6 +585,8 @@
nodeType.setName(name);
}
+ parseComment(tokens); // comment before supertypes
+
// supertypes
final List<String> superTypes = parseSupertypes(tokens);
@@ -642,6 +705,8 @@
QueryOperators.NOTATION[NotationType.COMPRESSED_INDEX].toUpperCase(),
QueryOperators.NOTATION[NotationType.COMPACT_INDEX].toUpperCase())) {
parseQueryOperators(tokens, propDefn);
+ } else if (tokens.matches(CndTokenizer.COMMENT)) {
+ parseComment(tokens);
} else if (tokens.canConsumeAnyOf("PRIMARY", "PRI", "!")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// these keywords are no longer property attributes in JCR 2.0
if (!this.jcr170) {
@@ -731,7 +796,18 @@
} else if (tokens.matches(ChildNodeDefinition.NOTATION_PREFIX)) {
parseChildNodeDefinition(tokens, nodeTypeDefn);
} else if (tokens.matches(CndTokenizer.COMMENT)) {
- parseComment(tokens);
+ if (parseComment(tokens) && (this.previousElement != null)) {
+ String comment = this.previousElement.getComment();
+
+ if (comment == null) {
+ comment = Utils.EMPTY_STRING;
+ } else if (!comment.endsWith("\n")) { //$NON-NLS-1$
+ comment += '\n';
+ }
+
+ this.previousElement.setComment(comment + this.currentComment);
+ this.currentComment = null;
+ }
} else {
// The next token does not signal either one of these, so stop ...
break;
@@ -751,6 +827,8 @@
assert (tokens != null) : "tokens is null"; //$NON-NLS-1$
assert (propDefn != null) : "propDefn is null"; //$NON-NLS-1$
+ parseComment(tokens);
+
if (tokens.canConsume(PropertyType.NOTATION_PREFIX)) {
// Parse the (optional) property type ...
if (tokens.matchesAnyOf(Utils.toUpperCase(PropertyType.validValues()))) {
@@ -777,6 +855,8 @@
if (tokens.canConsume(AttributeState.VARIANT_CHAR)) {
propDefn.changeState(PropertyDefinition.PropertyName.QUERY_OPS, Value.VARIANT);
} else {
+ parseComment(tokens);
+
// The query operators are expected to be enclosed in a single quote, so therefore will be a single token ...
final String operatorList = removeQuotes(tokens.consume());
final List<String> operators = new ArrayList<String>();
@@ -811,6 +891,8 @@
assert (tokens != null) : "tokens is null"; //$NON-NLS-1$
assert (childNodeDefn != null) : "childNodeDefn is null"; //$NON-NLS-1$
+ parseComment(tokens);
+
if (tokens.canConsume(RequiredTypes.NOTATION_PREFIX)) {
final List<String> requiredTypeNames = parseNameList(tokens);
@@ -845,9 +927,25 @@
strings.add(AttributeState.VARIANT_STRING);
} else {
// Read names until we see a ','
+ boolean foundComma = false;
+ boolean saveComma = false;
+ boolean firstTime = true;
+
do {
- strings.add(removeQuotes(tokens.consume()));
- } while (tokens.canConsume(','));
+ if (tokens.matches(CndTokenizer.COMMENT)) {
+ parseComment(tokens);
+ saveComma = true;
+ } else if (firstTime || foundComma) {
+ strings.add(removeQuotes(tokens.consume()));
+ saveComma = false;
+ }
+
+ if (!saveComma) {
+ foundComma = tokens.matches(',');
+ }
+
+ firstTime = false;
+ } while (tokens.canConsume(',') || parseComment(tokens) || foundComma);
}
return strings;
@@ -863,6 +961,8 @@
private List<String> parseSupertypes( final TokenStream tokens ) {
assert (tokens != null) : "tokens is null"; //$NON-NLS-1$
+ parseComment(tokens);
+
if (tokens.canConsume(SuperTypes.NOTATION_PREFIX)) {
// There is at least one supertype ...
return parseNameList(tokens);
@@ -899,40 +999,26 @@
}
private CndElement pop() {
- return this.cndElements.pop();
+ this.previousElement = this.cndElements.pop();
+ return this.previousElement;
}
- private void push( final CndElement cndElement ) {
+ private void push( final CommentedCndElement commentedElement ) {
// set comment if one exists
if (!Utils.isEmpty(this.currentComment)) {
- CommentedCndElement commentedElement = null;
+ String cndElementComment = commentedElement.getComment();
- if (cndElement instanceof CommentedCndElement) {
- commentedElement = (CommentedCndElement)cndElement;
- } else if (!this.cndElements.isEmpty()) {
- // this should probably look back in the stack until it finds a CommentedCndElement
- CndElement top = this.cndElements.peek();
-
- if (top instanceof CommentedCndElement) {
- commentedElement = (CommentedCndElement)top;
- }
+ if (cndElementComment == null) {
+ cndElementComment = Utils.EMPTY_STRING;
+ } else if (!cndElementComment.endsWith("\n")) { //$NON-NLS-1$
+ cndElementComment += '\n';
}
- if (commentedElement != null) {
- String cndElementComment = commentedElement.getComment();
-
- if (cndElementComment == null) {
- cndElementComment = Utils.EMPTY_STRING;
- } else if (!cndElementComment.endsWith("\n")) { //$NON-NLS-1$
- cndElementComment += '\n';
- }
-
- commentedElement.setComment(cndElementComment + this.currentComment);
- this.currentComment = null;
- }
+ commentedElement.setComment(cndElementComment + this.currentComment);
+ this.currentComment = null;
}
- this.cndElements.push(cndElement);
+ this.cndElements.push(commentedElement);
}
private final String removeQuotes( final String text ) {
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndImporterTest.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndImporterTest.java 2012-04-25 20:03:22 UTC (rev 40500)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/src/org/jboss/tools/modeshape/jcr/cnd/CndImporterTest.java 2012-04-25 20:39:45 UTC (rev 40501)
@@ -26,6 +26,7 @@
import javax.jcr.nodetype.NodeDefinition;
import javax.jcr.version.OnParentVersionAction;
+import org.jboss.tools.modeshape.jcr.ChildNodeDefinition;
import org.jboss.tools.modeshape.jcr.NamespaceMapping;
import org.jboss.tools.modeshape.jcr.NodeTypeDefinition;
import org.jboss.tools.modeshape.jcr.PropertyDefinition;
@@ -388,6 +389,75 @@
}
@Test
+ public void shouldImportCndForCommentsTest() throws Exception {
+ final CompactNodeTypeDefinition cnd = this.importer.importFrom(openCndFile("commentsTest.cnd"), this.problems); //$NON-NLS-1$
+ final NodeTypeDefinition nodeType = cnd.getNodeTypeDefinitions().get(0);
+
+ if (this.problems.size() != 0) {
+ printProblems();
+ }
+
+ assertEquals(0, this.problems.size());
+
+ { // check node type comments
+ final String expected = "comment above node type\n" + "comment same line as node type name\n" + "comment above supertypes\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ + "comment same line as first supertype\n" + "comment between 2 supertypes\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment same line as last supertype\n" + "comment above node type attributes\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment same line as abstract node type attribute\n" //$NON-NLS-1$
+ + "comment between abstract and orderable node type attributes\n" //$NON-NLS-1$
+ + "comment same line as orderable node type attribute\n" //$NON-NLS-1$
+ + "comment between orderable and mixin node type attributes\n" //$NON-NLS-1$
+ + "comment same line as mixin node type attribute\n" //$NON-NLS-1$
+ + "comment between mixin and noquery node type attributes\n" //$NON-NLS-1$
+ + "comment same line as noquery node type attribute\n" //$NON-NLS-1$
+ + "comment between noquery and primaryitem node type attributes\n" //$NON-NLS-1$
+ + "comment same line as primaryitem node type attribute"; //$NON-NLS-1$
+ assertEquals(expected, nodeType.getComment());
+ }
+
+ { // check property comments
+ final PropertyDefinition property = nodeType.getPropertyDefinitions().get(0);
+ final String expected = "comment above property\n" + "comment same line as property name\n" + "comment above property type\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ + "comment above default values\n" + "comment same line as first default value\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment between default values\n" + "comment same line as last default value\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment above property attributes\n" + "comment same line as mandatory property attribute\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment between mandatory and autocreated property attributes\n" //$NON-NLS-1$
+ + "comment same line as autocreated property attribute\n" //$NON-NLS-1$
+ + "comment between autocreated and protected property attributes\n" //$NON-NLS-1$
+ + "comment same line as protected property attribute\n" //$NON-NLS-1$
+ + "comment between protected and multiple property attributes\n" //$NON-NLS-1$
+ + "comment same line as multiple property attribute\n" //$NON-NLS-1$
+ + "comment between multiple and VERSION property attributes\n" //$NON-NLS-1$
+ + "comment same line as VERSION property attribute\n" //$NON-NLS-1$
+ + "comment between VERSION and queryops property attributes\n" //$NON-NLS-1$
+ + "comment same line as queryops property attribute\n" //$NON-NLS-1$
+ + "comment between queryops and nofulltext property attributes\n" //$NON-NLS-1$
+ + "comment same line as nofulltext property attribute\n" //$NON-NLS-1$
+ + "comment between nofulltext and noqueryorder property attributes\n" //$NON-NLS-1$
+ + "comment same line as noqueryorder property attribute\n" + "comment above value constraints\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment same line as first value constraint\n" + "comment between value constraints\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment same line as last value constraint"; //$NON-NLS-1$
+ assertEquals(expected, property.getComment());
+ }
+
+ { // check child node comments
+ final ChildNodeDefinition childNode = nodeType.getChildNodeDefinitions().get(0);
+ final String expected = "comment above child node\n" + "comment same line as child node name\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment above required types\n" + "comment same line as required types\n" + "comment above default type\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ + "comment same line as default type\n" + "comment above child node attributes\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment same line as mandatory child node attribute\n" //$NON-NLS-1$
+ + "comment between mandatory and autocreated child node attributes\n" //$NON-NLS-1$
+ + "comment same line as autocreated child node attribute\n" //$NON-NLS-1$
+ + "comment between autocreated and protected child node attributes\n" //$NON-NLS-1$
+ + "comment same line as protected child node attribute\n" //$NON-NLS-1$
+ + "comment between protected and sns child node attributes\n" //$NON-NLS-1$
+ + "comment same line as sns child node attribute\n" + "comment between sns and version child node attributes\n" //$NON-NLS-1$ //$NON-NLS-2$
+ + "comment same line as version child node attribute"; //$NON-NLS-1$
+ assertEquals(expected, childNode.getComment());
+ }
+ }
+
+ @Test
public void shouldImportCndForImageSequencer() throws Exception {
this.importer.importFrom(openCndFile("images.cnd"), this.problems); //$NON-NLS-1$
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/aircraft.cnd
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/aircraft.cnd 2012-04-25 20:03:22 UTC (rev 40500)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/aircraft.cnd 2012-04-25 20:39:45 UTC (rev 40501)
@@ -59,6 +59,6 @@
< '\d{1,3}(,?\d{3})*\s*(lb|kg|gal|L)' // followed by 'lb', 'kg', 'gal', or 'L'
- air:crew (long) < '[0,)' // any non-negative value
- air:numberBuilt (string) // any integer (with optional ',' every 1000s place)
- < '\d{1,3}(,?\d{3})*\s*[+]?' ,
- '([<>]\s*)?\d{1,3}(,?\d{3})*' // optionally followed by '+' or prefixed by '<' or '>'
+ < '\d{1,3}(,?\d{3})*\s*[+]?' , // optionally followed by '+'
+ '([<>]\s*)?\d{1,3}(,?\d{3})*' // or prefixed by '<' or '>'
- air:url (string)
\ No newline at end of file
Added: trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/commentsTest.cnd
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/commentsTest.cnd (rev 0)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.jcr.test/testdata/commentsTest.cnd 2012-04-25 20:39:45 UTC (rev 40501)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+ *
+ * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+ */
+<ex = 'http://namespace.com/ns'>
+
+// comment above node type
+[ex:NodeType] // comment same line as node type name
+
+// comment above supertypes
+> ex:ParentType1, // comment same line as first supertype
+
+// comment between 2 supertypes
+ex:ParentType2 // comment same line as last supertype
+
+// comment above node type attributes
+abstract // comment same line as abstract node type attribute
+// comment between abstract and orderable node type attributes
+orderable // comment same line as orderable node type attribute
+// comment between orderable and mixin node type attributes
+mixin // comment same line as mixin node type attribute
+// comment between mixin and noquery node type attributes
+noquery // comment same line as noquery node type attribute
+// comment between noquery and primaryitem node type attributes
+primaryitem ex:property // comment same line as primaryitem node type attribute
+
+// comment above property
+- ex:property // comment same line as property name
+
+// comment above property type
+(STRING)
+
+// comment above default values
+= 'default1', // comment same line as first default value
+
+// comment between default values
+'default2' // comment same line as last default value
+
+// comment above property attributes
+mandatory // comment same line as mandatory property attribute
+// comment between mandatory and autocreated property attributes
+autocreated // comment same line as autocreated property attribute
+// comment between autocreated and protected property attributes
+protected // comment same line as protected property attribute
+// comment between protected and multiple property attributes
+multiple // comment same line as multiple property attribute
+// comment between multiple and VERSION property attributes
+VERSION // comment same line as VERSION property attribute
+// comment between VERSION and queryops property attributes
+queryops '=, <>, <, <=, >, >=, LIKE' // comment same line as queryops property attribute
+// comment between queryops and nofulltext property attributes
+nofulltext // comment same line as nofulltext property attribute
+// comment between nofulltext and noqueryorder property attributes
+noqueryorder // comment same line as noqueryorder property attribute
+
+// comment above value constraints
+< 'constraint1', // comment same line as first value constraint
+
+// comment between value constraints
+'constraint2' // comment same line as last value constraint
+
+// comment above child node
++ ex:node // comment same line as child node name
+
+// comment above required types
+(ex:reqType1, ex:reqType2) // comment same line as required types
+
+// comment above default type
+= ex:defaultType // comment same line as default type
+
+// comment above child node attributes
+mandatory // comment same line as mandatory child node attribute
+// comment between mandatory and autocreated child node attributes
+autocreated // comment same line as autocreated child node attribute
+// comment between autocreated and protected child node attributes
+protected // comment same line as protected child node attribute
+// comment between protected and sns child node attributes
+sns // comment same line as sns child node attribute
+// comment between sns and version child node attributes
+version // comment same line as version child node attribute
+
\ No newline at end of file
12 years, 8 months
JBoss Tools SVN: r40500 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-04-25 16:03:22 -0400 (Wed, 25 Apr 2012)
New Revision: 40500
Modified:
trunk/build/parent/pom.xml
Log:
add macosx:cocoa:x86_64 and win32:win32:x86_64 environments to both target-platform-configuration and tycho-packaging-plugin, since we now have distros for those platforms (more or less)
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2012-04-25 19:55:08 UTC (rev 40499)
+++ trunk/build/parent/pom.xml 2012-04-25 20:03:22 UTC (rev 40500)
@@ -144,11 +144,21 @@
<arch>x86</arch>
</environment>
<environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86_64</arch>
+ </environment>
+ <environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
12 years, 8 months
JBoss Tools SVN: r40498 - trunk/build/aggregate/soa-site/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-04-25 15:07:39 -0400 (Wed, 25 Apr 2012)
New Revision: 40498
Modified:
trunk/build/aggregate/soa-site/site/site.xml
Log:
JBDS-2049 hide jbpm.common feature from JBT/JBDS SOA Tooling site
Modified: trunk/build/aggregate/soa-site/site/site.xml
===================================================================
--- trunk/build/aggregate/soa-site/site/site.xml 2012-04-25 17:50:15 UTC (rev 40497)
+++ trunk/build/aggregate/soa-site/site/site.xml 2012-04-25 19:07:39 UTC (rev 40498)
@@ -49,8 +49,6 @@
<category name="SOATools" />
</feature>
<feature url="features/org.jboss.tools.jbpm.common.feature_0.0.0.jar" id="org.jboss.tools.jbpm.common.feature" version="0.0.0">
- <category name="SOAPTools" />
- <category name="SOATools" />
</feature>
<feature url="features/org.jboss.tools.jbpm3.feature_0.0.0.jar" id="org.jboss.tools.jbpm3.feature" version="0.0.0">
<category name="SOAPTools" />
12 years, 8 months
JBoss Tools SVN: r40497 - in trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui: messages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2012-04-25 13:50:15 -0400 (Wed, 25 Apr 2012)
New Revision: 40497
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/dialogs/WSTesterURLInputsDialog.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
Log:
JBIDE-11635 - Updating parms dialog to handle types better and validation
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/dialogs/WSTesterURLInputsDialog.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/dialogs/WSTesterURLInputsDialog.java 2012-04-25 17:40:30 UTC (rev 40496)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/dialogs/WSTesterURLInputsDialog.java 2012-04-25 17:50:15 UTC (rev 40497)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.ws.ui.dialogs;
+import java.util.ArrayList;
import java.util.StringTokenizer;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -49,11 +50,17 @@
private TreeViewer treeRequestBody;
private static final String NAME_COLUMN = "name";//$NON-NLS-1$
private static final String VALUE_COLUMN = "value";//$NON-NLS-1$
- private static final String[] TREE_COLUMNS = new String[] { NAME_COLUMN, VALUE_COLUMN };
+ private static final String TYPE_COLUMN = "type";//$NON-NLS-1$
+ private static final String[] TREE_COLUMNS = new String[] { NAME_COLUMN, VALUE_COLUMN, TYPE_COLUMN };
private String stashedURL;
private Parameter[] parms;
private Button mOKButton = null;
-
+ private ArrayList<String> supportedTypes = null;
+ private static final String INT_TYPE = "int";//$NON-NLS-1$
+ private static final String STRING_TYPE = "java.lang.String";//$NON-NLS-1$
+ private static final String STRING_LIST_TYPE = "java.util.List<java.lang.String>";//$NON-NLS-1$
+ private static final String STRING_SET_TYPE = "java.util.Set<java.lang.String>";//$NON-NLS-1$
+
/**
* Constructor
* @param parentShell
@@ -62,6 +69,11 @@
public WSTesterURLInputsDialog(Shell parentShell, String url) {
super(parentShell);
stashedURL = url;
+ supportedTypes = new ArrayList<String>();
+ supportedTypes.add(INT_TYPE);
+ supportedTypes.add(STRING_TYPE);
+ supportedTypes.add(STRING_LIST_TYPE);
+ supportedTypes.add(STRING_SET_TYPE);
parms = parseURLParms(stashedURL);
}
@@ -82,10 +94,11 @@
String modified = stashedURL;
for (int i = 0; i < parms.length; i++) {
Parameter parm = parms[i];
- if (parm.value != null && parm.value.trim().length() > 0) {
+ if (parm.value != null) {
modified = modified.replace(parm.originalString, parm.value);
}
}
+ modified = modified.replace("//", "/"); //$NON-NLS-1$ //$NON-NLS-2$
return modified;
}
return stashedURL;
@@ -128,6 +141,9 @@
TreeColumn valueColumn = new TreeColumn(treeRequestBody.getTree(), SWT.LEFT);
valueColumn.setText(JBossWSUIMessages.JAXRSWSTestView2_Value_column);
valueColumn.setWidth(200);
+ TreeColumn typeColumn = new TreeColumn(treeRequestBody.getTree(), SWT.LEFT);
+ typeColumn.setText(JBossWSUIMessages.WSTesterURLInputsDialog_Type_Column);
+ typeColumn.setWidth(200);
treeRequestBody.setColumnProperties(TREE_COLUMNS);
@@ -147,6 +163,8 @@
return true;
} else if (element instanceof Parameter && property.equalsIgnoreCase(VALUE_COLUMN)) {
return true;
+ } else if (element instanceof Parameter && property.equalsIgnoreCase(TYPE_COLUMN)) {
+ return true;
}
return false;
}
@@ -167,6 +185,12 @@
} else if (element instanceof Parameter && columnIndex == 1) {
Parameter tp = (Parameter) element;
return tp.value;
+ } else if (element instanceof Parameter && columnIndex == 2) {
+ Parameter tp = (Parameter) element;
+ if (tp.regEx != null && !tp.regEx.trim().isEmpty())
+ return tp.regEx;
+ else if (tp.datatype != null && !tp.datatype.trim().isEmpty())
+ return tp.datatype;
}
return null;
}
@@ -257,7 +281,7 @@
}
});
- treeRequestBody.setCellEditors(new CellEditor[] { null, new TextCellEditor(treeRequestBody.getTree()) });
+ treeRequestBody.setCellEditors(new CellEditor[] { null, new TextCellEditor(treeRequestBody.getTree()), null });
treeRequestBody.setInput(parms);
return area;
@@ -271,6 +295,7 @@
String value = ""; //$NON-NLS-1$
String regEx;
String originalString;
+ String datatype;
}
/*
@@ -279,8 +304,50 @@
* @return
*/
private Parameter[] parseURLParms ( String url ) {
+ // Need to handle three types of parms:
+ // /rest/members/{id}
+ // /rest/members?start={int}&size={int}
+ // /rest/members/{id:[0-9][0-9]*}
+ //
+ // plus Set and List
+ // /rest/members/query?from={from:int}&to={to:int}&orderBy={orderBy:java.util.List<java.lang.String>}
+ // parsing a url like:
+ // http://localhost:8080/jboss-as-kitchensink/rest/members/user/{id}/
+ // {encoding:(/encoding/[^/]+?)?};matrix={java.lang.String}?start={start:int}
+ // would look something like this at resolution time
+ // http://localhost:8080/jboss-as-kitchensink/rest/members/user/3/format/pdf...
+
if (url != null && url.trim().length() > 0 && url.endsWith("}")) { //$NON-NLS-1$
- String[] parsed = parseString(url.substring(url.indexOf('{')), "{"); //$NON-NLS-1$
+
+ CharSequence parmsPortion = url.substring(url.indexOf('{'));
+ int curlyBracketCount = 0;
+ int count = 0;
+ int lastFirstBracketPosition = -1;
+ int lastLastBracketPosition = -1;
+ ArrayList<Integer> parmPositions = new ArrayList<Integer>();
+ ArrayList<String> parmStrings = new ArrayList<String>();
+ while (count < parmsPortion.length()) {
+ char charToCheck = parmsPortion.charAt(count);
+ if (charToCheck == '{') {
+ curlyBracketCount++;
+ if (lastFirstBracketPosition == -1) {
+ parmPositions.add(new Integer(0));
+ lastFirstBracketPosition = 0;
+ } else {
+ lastFirstBracketPosition = count;
+ parmPositions.add(new Integer(lastFirstBracketPosition));
+ }
+ } else if (charToCheck == '}') {
+ lastLastBracketPosition = count;
+ curlyBracketCount--;
+ if (curlyBracketCount == 0) {
+ parmStrings.add((String) parmsPortion.subSequence(lastFirstBracketPosition, lastLastBracketPosition) + '}');
+ }
+ }
+ count++;
+ }
+
+ String[] parsed = parmStrings.toArray(new String[parmStrings.size()]);
if (parsed != null && parsed.length > 0) {
Parameter[] parms = new Parameter[parsed.length];
for (int i = 0; i < parsed.length; i++) {
@@ -295,11 +362,77 @@
} else {
parmName = temp;
}
+ if (parmName.startsWith("{")) { //$NON-NLS-1$
+ parmName = parmName.substring(1);
+ }
parms[i] = new Parameter();
parms[i].name = parmName;
- parms[i].regEx = regEx;
- parms[i].originalString = '{' + parsed[i];
+ if (supportedTypes.contains(regEx)) {
+ parms[i].datatype = regEx;
+ } else {
+ parms[i].regEx = regEx;
+ }
+
+// if (regEx != null && !regEx.trim().isEmpty()) {
+// try {
+// Pattern.compile(regEx);
+// parms[i].value = regEx;
+// } catch (PatternSyntaxException exception) {
+// // ignore exception - means not a regEx, set as value
+// parms[i].value = regEx;
+// }
+// }
+
+ parms[i].originalString = parsed[i];
}
+
+ int oldpos = 0;
+
+ // now handle the parm={type} cases
+ for (int i = 0; i < parms.length; i++) {
+ String name = parms[i].name;
+ String regEx = parms[i].regEx;
+ String datatype = parms[i].datatype;
+
+ if (datatype != null && !datatype.trim().isEmpty() &&
+ supportedTypes.contains(datatype) && name != null && !name.trim().isEmpty()) {
+ if (parms[i].regEx != null && !parms[i].regEx.trim().isEmpty()) {
+ parms[i].regEx = null;
+ }
+ continue;
+ } else if (regEx == null && name != null && !name.trim().isEmpty() ) {
+ if (!supportedTypes.contains(name))
+ continue;
+ } else if (regEx != null && !regEx.trim().isEmpty() && name != null && !name.trim().isEmpty() ) {
+ continue;
+ }
+ String search = parms[i].originalString;
+ try {
+ int pos = url.indexOf(search, oldpos);
+ if (pos > 0) {
+ oldpos = pos + search.length();
+ char toCheck = url.charAt(pos-1);
+ if (toCheck == '=') {
+ int namePos = pos-2;
+ toCheck = url.charAt(namePos);
+ String buildname = ""; //$NON-NLS-1$
+ while (toCheck != '&' && toCheck != '?' && toCheck != ';') {
+ buildname = toCheck + buildname;
+ namePos--;
+ toCheck = url.charAt(namePos);
+ }
+ parms[i].datatype = parms[i].name;
+ parms[i].name = buildname;
+ parms[i].value = "";//$NON-NLS-1$
+// parms[i].value = parms[i].datatype;
+ } else {
+ // move on
+ }
+ }
+ } catch (IndexOutOfBoundsException ie) {
+ // ignore, move on
+ }
+ }
return parms;
}
}
@@ -347,6 +480,25 @@
{ parm.name, parm.value, parm.regEx });
break;
}
+ } else if (parm.datatype != null && !parm.datatype.isEmpty()) {
+ String parmType = parm.datatype;
+ if (parmType.contentEquals(INT_TYPE)) {
+ try {
+ Integer.parseInt(parm.value);
+ } catch (NumberFormatException nfe) {
+ errorMessage = JBossWSUIMessages.WSTesterURLInputsDialog_Int_Validation_Error_String;
+ errorMessage = NLS.bind(errorMessage, new String[]
+ { parm.name });
+ break;
+ }
+ }
+ } else if ((parm.regEx == null || parm.regEx.trim().isEmpty()) && (parm.datatype == null || parm.datatype.trim().isEmpty() )) {
+ if (parm.value.trim().isEmpty()) {
+ errorMessage = JBossWSUIMessages.WSTesterURLInputsDialog_Required_Parm_Value_Validation_String;
+ errorMessage = NLS.bind(errorMessage, new String[]
+ { parm.name });
+ break;
+ }
}
}
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2012-04-25 17:40:30 UTC (rev 40496)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2012-04-25 17:50:15 UTC (rev 40497)
@@ -183,6 +183,9 @@
WSDLBrowseDialog_WSDL_URL_Prompt=Type the URL for the WSDL:
WSTesterURLInputsDialog_DialogMessage=Specify a valid value for each parameter required by the url.
WSTesterURLInputsDialog_DialogTitle=Specify URL Parameters
+WSTesterURLInputsDialog_Int_Validation_Error_String=The integer value for {0} is invalid.
+WSTesterURLInputsDialog_Required_Parm_Value_Validation_String=The value for {0} should not be empty.
+WSTesterURLInputsDialog_Type_Column=Type
WSTesterURLInputsDialog_URLParms_Label=URL Parameters:
WSTesterURLInputsDialog_Validation_Error_String={0}'s value of "{1}" is not valid based on the regular expression "{2}".
WSTesterURLInputsDialog_Window_Title=WS Tester: URL Parameters
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2012-04-25 17:40:30 UTC (rev 40496)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2012-04-25 17:50:15 UTC (rev 40497)
@@ -222,6 +222,9 @@
public static String WSTesterURLInputsDialog_DialogMessage;
public static String WSTesterURLInputsDialog_DialogTitle;
+ public static String WSTesterURLInputsDialog_Int_Validation_Error_String;
+ public static String WSTesterURLInputsDialog_Required_Parm_Value_Validation_String;
+ public static String WSTesterURLInputsDialog_Type_Column;
public static String WSTesterURLInputsDialog_URLParms_Label;
public static String WSTesterURLInputsDialog_Validation_Error_String;
public static String WSTesterURLInputsDialog_Window_Title;
12 years, 8 months