JBoss Tools SVN: r20129 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal: taglib and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-04 10:38:00 -0500 (Thu, 04 Feb 2010)
New Revision: 20129
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5765
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2010-02-04 15:18:54 UTC (rev 20128)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2010-02-04 15:38:00 UTC (rev 20129)
@@ -644,7 +644,14 @@
current = null;
}
if(current != null) {
+ boolean uriChanged = !stringsEqual(current.getURI(), loaded.getURI());
+ if(uriChanged) {
+ this.libraries.removeLibrary(current);
+ }
List<Change> changes = current.merge(loaded);
+ if(uriChanged) {
+ this.libraries.addLibrary(current);
+ }
fireChanges(changes);
continue;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2010-02-04 15:18:54 UTC (rev 20128)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2010-02-04 15:38:00 UTC (rev 20129)
@@ -483,7 +483,7 @@
}
t.addComponent(((AbstractComponent)c).clone());
}
- t.components.putAll(components);
+// t.components.putAll(components);
return t;
}
14 years, 4 months
JBoss Tools SVN: r20128 - in trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating: model/xml and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2010-02-04 10:18:54 -0500 (Thu, 04 Feb 2010)
New Revision: 20128
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/messages.properties
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/ModelBuilder.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/ModelNodeResolver.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XMLSampleModelBuilder.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XSDModelBuilder.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/TemplateBuilder.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/ValueMapping.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/CSVFreeMarkerTemplateBuilder.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/UnmappedCollectionNodeException.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/FreeMarkerUtil.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/XMLFreeMarkerTemplateBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5773
Externalize strings in org.jboss.tools.smooks.templating
Rolling back r20126 and r20118
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/Messages.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/Messages.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,44 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009, JBoss Inc.
- */
-package org.jboss.tools.smooks.templating.model;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.model.messages"; //$NON-NLS-1$
- public static String ModelBuilder_0;
- public static String ModelBuilder_1;
- public static String ModelNodeResolver_0;
- public static String ModelNodeResolver_1;
- public static String ModelNodeResolver_2;
- public static String ModelNodeResolver_3;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/ModelBuilder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/ModelBuilder.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/ModelBuilder.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -179,7 +179,7 @@
public static int getMinOccurs(Element element) {
String minOccurs = element.getAttributeNS(NAMESPACE, "minOccurs"); //$NON-NLS-1$
- if(minOccurs.equals(Messages.ModelBuilder_0)) {
+ if(minOccurs.equals("")) {
return 1;
}
@@ -189,7 +189,7 @@
public static int getMaxOccurs(Element element) {
String maxOccurs = element.getAttributeNS(NAMESPACE, "maxOccurs"); //$NON-NLS-1$
- if(maxOccurs.equals(Messages.ModelBuilder_1)) {
+ if(maxOccurs.equals("")) {
return 1;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/ModelNodeResolver.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/ModelNodeResolver.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/ModelNodeResolver.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -43,7 +43,7 @@
private Map<String, String> prefixMap = new HashMap<String, String>();
public ModelNodeResolver(Document model) {
- buildModelNodeMap(model.getDocumentElement(), Messages.ModelNodeResolver_0);
+ buildModelNodeMap(model.getDocumentElement(), "");
}
public Node resolveNodeMapping(Node node) {
@@ -62,7 +62,7 @@
String nodeNS = node.getNamespaceURI();
if(nodeNS != null && nodeNS.length() > 0) {
if(node.getNodeType() == Node.ATTRIBUTE_NODE) {
- pathBuilder.insert(0, "@" + getPrefix(nodeNS) + Messages.ModelNodeResolver_1 + ((Attr)node).getName()); //$NON-NLS-1$
+ pathBuilder.insert(0, "@" + getPrefix(nodeNS) + ":" + ((Attr)node).getName()); //$NON-NLS-1$
} else {
pathBuilder.insert(0, getPrefix(nodeNS) + ":" + DomUtils.getName((Element) node)); //$NON-NLS-1$
}
@@ -89,7 +89,7 @@
String elNS = element.getNamespaceURI();
if(parentPath.length() > 0) {
- parentPath += Messages.ModelNodeResolver_2;
+ parentPath += "/";
}
if(elNS != null && elNS.length() > 0) {
@@ -107,7 +107,7 @@
if(!ModelBuilder.isInReservedNamespace(attribute)) {
String attrNS = attribute.getNamespaceURI();
if(attrNS != null && attrNS.length() > 0) {
- modelNodeMap.put(elementPath + "/@" + getPrefix(attrNS) + Messages.ModelNodeResolver_3 + attribute.getName(), attribute); //$NON-NLS-1$
+ modelNodeMap.put(elementPath + "/@" + getPrefix(attrNS) + ":" + attribute.getName(), attribute); //$NON-NLS-1$
} else {
modelNodeMap.put(elementPath + "/@" + attribute.getName(), attribute); //$NON-NLS-1$
}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/messages.properties 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/messages.properties 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,6 +0,0 @@
-ModelBuilder_0=
-ModelBuilder_1=
-ModelNodeResolver_0=
-ModelNodeResolver_1=:
-ModelNodeResolver_2=/
-ModelNodeResolver_3=:
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/Messages.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/Messages.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,52 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009, JBoss Inc.
- */
-package org.jboss.tools.smooks.templating.model.xml;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.model.xml.messages"; //$NON-NLS-1$
- public static String XMLSampleModelBuilder_0;
- public static String XMLSampleModelBuilder_1;
- public static String XMLSampleModelBuilder_2;
- public static String XMLSampleModelBuilder_3;
- public static String XMLSampleModelBuilder_4;
- public static String XMLSampleModelBuilder_5;
- public static String XMLSampleModelBuilder_6;
- public static String XSDModelBuilder_0;
- public static String XSDModelBuilder_1;
- public static String XSDModelBuilder_2;
- public static String XSDModelBuilder_3;
- public static String XSDModelBuilder_4;
- public static String XSDModelBuilder_5;
- public static String XSDModelBuilder_6;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XMLSampleModelBuilder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XMLSampleModelBuilder.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XMLSampleModelBuilder.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -61,19 +61,19 @@
try {
docBuilder = docBuilderFactory.newDocumentBuilder();
} catch (ParserConfigurationException e) {
- throw new RuntimeException(Messages.XMLSampleModelBuilder_0, e);
+ throw new RuntimeException("Unexpectd XML exception. Unable to create DocumentBuilder instance.", e);
}
}
public XMLSampleModelBuilder(URI xmlSampleURI) throws IOException, ModelBuilderException {
- Assert.isNotNull(xmlSampleURI, Messages.XMLSampleModelBuilder_1);
+ Assert.isNotNull(xmlSampleURI, "Null 'xmlSampleURI' arg in method call.");
File xmlSampleFile = new File(xmlSampleURI.toFileString());
if(!xmlSampleFile.exists()) {
- throw new IOException("XML Sample '" + xmlSampleFile.getAbsolutePath() + Messages.XMLSampleModelBuilder_2); //$NON-NLS-1$
+ throw new IOException("XML Sample '" + xmlSampleFile.getAbsolutePath() + "' not found."); //$NON-NLS-1$
} else if(!xmlSampleFile.isFile()) {
- throw new IOException("XML Sample '" + xmlSampleFile.getAbsolutePath() + Messages.XMLSampleModelBuilder_3); //$NON-NLS-1$
+ throw new IOException("XML Sample '" + xmlSampleFile.getAbsolutePath() + "' is not a normal file. Might be a directory etc."); //$NON-NLS-1$
}
try {
@@ -123,7 +123,7 @@
if(child.getNodeType() == Node.ELEMENT_NODE) {
configureModelElementTypes((Element) child);
} else {
- throw new IllegalStateException(Messages.XMLSampleModelBuilder_4);
+ throw new IllegalStateException("The configureModelElementTypes method can only be called after the model has been trimed of non-model Nodes. Call trimNonModelNodes() before calling configureModelElementTypes().");
}
}
} else {
@@ -143,7 +143,7 @@
if(child.getNodeType() == Node.ELEMENT_NODE) {
Element childElement = (Element) child;
- String elementName = DomUtils.getName(childElement) + Messages.XMLSampleModelBuilder_5 + childElement.getNamespaceURI(); // Yes, namespace can be null, but that's OK.
+ String elementName = DomUtils.getName(childElement) + ":" + childElement.getNamespaceURI(); // Yes, namespace can be null, but that's OK.
Element earlierOccurance = childElementByNames.get(elementName);
// Mark every element as being optional and possibly being multiple...
@@ -164,7 +164,7 @@
configureModelElementCardinality(childElement);
} else {
- throw new IllegalStateException(Messages.XMLSampleModelBuilder_6);
+ throw new IllegalStateException("The configureModelElementTypes method can only be called after the model has been trimed of non-model Nodes. Call trimNonModelNodes() before calling configureModelElementTypes().");
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XSDModelBuilder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XSDModelBuilder.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XSDModelBuilder.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -85,7 +85,7 @@
XSDElementDeclaration rootElement = elements.get(rootElementName);
if(rootElement == null) {
- throw new IllegalArgumentException("Unknown root element '" + rootElementName + Messages.XSDModelBuilder_0); //$NON-NLS-1$
+ throw new IllegalArgumentException("Unknown root element '" + rootElementName + "'."); //$NON-NLS-1$
}
Document model = createModelInstance();
@@ -108,7 +108,7 @@
File schemaFile = new File(schemaPath);
if(!schemaFile.exists()) {
- throw new IOException("XSD '" + schemaFile.getAbsolutePath() + Messages.XSDModelBuilder_1); //$NON-NLS-1$
+ throw new IOException("XSD '" + schemaFile.getAbsolutePath() + "' not found."); //$NON-NLS-1$
}
xsdSources[i] = new StreamSource(new FileInputStream(schemaFile));
i++;
@@ -134,7 +134,7 @@
ResourceSet resourceSet = new ResourceSetImpl();
Resource resource;
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Messages.XSDModelBuilder_2, new XSDResourceFactoryImpl());
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xsd", new XSDResourceFactoryImpl());
resource = resourceSet.getResource(schemaURI, true);
Map<String, Object> options = new HashMap<String, Object>();
@@ -143,7 +143,7 @@
resource.load(options);
if(resource.getContents().isEmpty()) {
- throw new ModelBuilderException("Failed to load schema '" + schemaURI + Messages.XSDModelBuilder_3); //$NON-NLS-1$
+ throw new ModelBuilderException("Failed to load schema '" + schemaURI + "'."); //$NON-NLS-1$
}
XSDSchema schema = (XSDSchema) resource.getContents().get(0);
@@ -230,7 +230,7 @@
private String getPrefix(String elementNS) {
String nsPrefix = nsPrefixes.getProperty(elementNS);
if(nsPrefix == null) {
- nsPrefix = Messages.XSDModelBuilder_4 + nsPrefixes.size();
+ nsPrefix = "ns" + nsPrefixes.size();
nsPrefixes.setProperty(elementNS, nsPrefix);
}
return nsPrefix;
@@ -296,13 +296,13 @@
XSDSimpleTypeDefinition typeDef = attributeDecl.getTypeDefinition();
String name = attributeDecl.getName();
String attributeNS = attributeDecl.getTargetNamespace();
- String value = Messages.XSDModelBuilder_5;
+ String value = "";
XSDAttributeUseCategory use = attributeUse.getUse();
if(use == XSDAttributeUseCategory.REQUIRED_LITERAL) {
value = REQUIRED;
} else if(attributeUse.getValue() != null) {
- value = OPTIONAL + Messages.XSDModelBuilder_6 + attributeUse.getValue().toString();
+ value = OPTIONAL + "=" + attributeUse.getValue().toString();
} else {
value = OPTIONAL;
}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/messages.properties 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/messages.properties 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,14 +0,0 @@
-XMLSampleModelBuilder_0=Unexpectd XML exception. Unable to create DocumentBuilder instance.
-XMLSampleModelBuilder_1=Null 'xmlSampleURI' arg in method call.
-XMLSampleModelBuilder_2=' not found.
-XMLSampleModelBuilder_3=' is not a normal file. Might be a directory etc.
-XMLSampleModelBuilder_4=The configureModelElementTypes method can only be called after the model has been trimed of non-model Nodes. Call trimNonModelNodes() before calling configureModelElementTypes().
-XMLSampleModelBuilder_5=:
-XMLSampleModelBuilder_6=The configureModelElementTypes method can only be called after the model has been trimed of non-model Nodes. Call trimNonModelNodes() before calling configureModelElementTypes().
-XSDModelBuilder_0='.
-XSDModelBuilder_1=' not found.
-XSDModelBuilder_2=xsd
-XSDModelBuilder_3='.
-XSDModelBuilder_4=ns
-XSDModelBuilder_5=
-XSDModelBuilder_6==
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/Messages.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/Messages.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,45 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009, JBoss Inc.
- */
-package org.jboss.tools.smooks.templating.template;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.messages"; //$NON-NLS-1$
- public static String TemplateBuilder_0;
- public static String TemplateBuilder_1;
- public static String TemplateBuilder_2;
- public static String TemplateBuilder_3;
- public static String TemplateBuilder_4;
- public static String TemplateBuilder_5;
- public static String ValueMapping_0;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/TemplateBuilder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/TemplateBuilder.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/TemplateBuilder.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -266,11 +266,11 @@
}
if (ModelBuilder.NAMESPACE.equals(mappingNode.getNamespaceURI())) {
throw new InvalidMappingException(
- "Unsupported XML target node mapping. Cannot map to a reserved model node from the '" + ModelBuilder.NAMESPACE + Messages.TemplateBuilder_0); //$NON-NLS-1$
+ "Unsupported XML target node mapping. Cannot map to a reserved model node from the '" + ModelBuilder.NAMESPACE + "' namespace."); //$NON-NLS-1$
}
if (ModelBuilder.isHidden(mappingNode)) {
throw new InvalidMappingException(
- "Illegal XML target node mapping for node '" + mappingNode + Messages.TemplateBuilder_1); //$NON-NLS-1$
+ "Illegal XML target node mapping for node '" + mappingNode + "'. This node (or one of it's ancestors) is hidden."); //$NON-NLS-1$
}
}
@@ -414,7 +414,7 @@
}
throw new TemplateBuilderException(
- Messages.TemplateBuilder_2);
+ "Unexpected Exception. Invalid <smk:list> collection node. Has no child elements!");
}
protected void addValueMapping(Node modelNode, ModelNodeResolver modelNodeResolver, String dollarVariable) throws TemplateBuilderException, InvalidMappingException {
@@ -435,7 +435,7 @@
}
public static void writeListStart(StringWriter writer, String srcPath, String collectionItemName) {
- writer.write("<smk:list smk:srcPath=\"" + srcPath + Messages.TemplateBuilder_3 + collectionItemName + Messages.TemplateBuilder_4 + ModelBuilder.NAMESPACE + Messages.TemplateBuilder_5); //$NON-NLS-1$
+ writer.write("<smk:list smk:srcPath=\"" + srcPath + "\" smk:collectionItemName=\"" + collectionItemName + "\" xmlns:smk=\"" + ModelBuilder.NAMESPACE + "\">"); //$NON-NLS-1$
}
public static void writeListEnd(StringWriter writer) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/ValueMapping.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/ValueMapping.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/ValueMapping.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -30,7 +30,7 @@
*/
public class ValueMapping extends Mapping {
- public static final String RAW_FORMATING_KEY = ValueMapping.class.getName() + Messages.ValueMapping_0;
+ public static final String RAW_FORMATING_KEY = ValueMapping.class.getName() + "#RAW_FORMATING_KEY";
private Class<?> valueType;
private Properties encodeProperties;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/CSVFreeMarkerTemplateBuilder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/CSVFreeMarkerTemplateBuilder.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/CSVFreeMarkerTemplateBuilder.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -104,10 +104,10 @@
}
private TemplateElement findListNode(TemplateElement templateNode) throws TemplateBuilderException {
- if(templateNode.getNodeName().equals(Messages.CSVFreeMarkerTemplateBuilder_0)) {
+ if(templateNode.getNodeName().equals("IteratorBlock")) {
String description = templateNode.getDescription();
if(!description.startsWith("list")) { //$NON-NLS-1$
- throw new TemplateBuilderException ("Unsupported CSV template IteratorBlock type '" + description + Messages.CSVFreeMarkerTemplateBuilder_1); //$NON-NLS-1$
+ throw new TemplateBuilderException ("Unsupported CSV template IteratorBlock type '" + description + "'. Currently only support 'list' IteratorBlock nodes."); //$NON-NLS-1$
}
return templateNode;
} else {
@@ -196,7 +196,7 @@
template.append('\n');
}
- template.append("<#list " + collectionMapping.getSrcPath() + Messages.CSVFreeMarkerTemplateBuilder_2 + collectionMapping.getCollectionItemName() + Messages.CSVFreeMarkerTemplateBuilder_3); //$NON-NLS-1$
+ template.append("<#list " + collectionMapping.getSrcPath() + " as " + collectionMapping.getCollectionItemName() + ">\n"); //$NON-NLS-1$
int fieldIndex = 0;
for(int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/Messages.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/Messages.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,42 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009, JBoss Inc.
- */
-package org.jboss.tools.smooks.templating.template.csv;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.csv.messages"; //$NON-NLS-1$
- public static String CSVFreeMarkerTemplateBuilder_0;
- public static String CSVFreeMarkerTemplateBuilder_1;
- public static String CSVFreeMarkerTemplateBuilder_2;
- public static String CSVFreeMarkerTemplateBuilder_3;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/messages.properties 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/messages.properties 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,4 +0,0 @@
-CSVFreeMarkerTemplateBuilder_0=IteratorBlock
-CSVFreeMarkerTemplateBuilder_1='. Currently only support 'list' IteratorBlock nodes.
-CSVFreeMarkerTemplateBuilder_2=\ as
-CSVFreeMarkerTemplateBuilder_3=>\n
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/Messages.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/Messages.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,39 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009, JBoss Inc.
- */
-package org.jboss.tools.smooks.templating.template.exception;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.exception.messages"; //$NON-NLS-1$
- public static String UnmappedCollectionNodeException_0;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/UnmappedCollectionNodeException.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/UnmappedCollectionNodeException.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/UnmappedCollectionNodeException.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -31,7 +31,7 @@
private Element unmappedCollectionNode;
public UnmappedCollectionNodeException(Element unmappedCollectionNode) {
- super("Unmapped collection node '" + DomUtils.getName(unmappedCollectionNode) + Messages.UnmappedCollectionNodeException_0); //$NON-NLS-1$
+ super("Unmapped collection node '" + DomUtils.getName(unmappedCollectionNode) + "'."); //$NON-NLS-1$
this.unmappedCollectionNode = unmappedCollectionNode;
}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/messages.properties 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/messages.properties 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1 +0,0 @@
-UnmappedCollectionNodeException_0='.
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/messages.properties 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/messages.properties 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,7 +0,0 @@
-TemplateBuilder_0=' namespace.
-TemplateBuilder_1='. This node (or one of it's ancestors) is hidden.
-TemplateBuilder_2=Unexpected Exception. Invalid <smk:list> collection node. Has no child elements\!
-TemplateBuilder_3=" smk:collectionItemName="
-TemplateBuilder_4=" xmlns:smk="
-TemplateBuilder_5=">
-ValueMapping_0=\#RAW_FORMATING_KEY
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/FreeMarkerUtil.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/FreeMarkerUtil.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/FreeMarkerUtil.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -61,14 +61,14 @@
splitTokens[0] = splitTokens[0].substring(0, splitTokens[0].length() - 1);
}
} else {
- throw new TemplateBuilderException("Unsupported FreeMarker variable syntax '" + dollarVariable + Messages.FreeMarkerUtil_0); //$NON-NLS-1$
+ throw new TemplateBuilderException("Unsupported FreeMarker variable syntax '" + dollarVariable + "'."); //$NON-NLS-1$
}
return splitTokens;
}
public static boolean isDollarVariable(String variable) {
- return (variable.startsWith("${") && variable.endsWith(Messages.FreeMarkerUtil_1)); //$NON-NLS-1$
+ return (variable.startsWith("${") && variable.endsWith("}")); //$NON-NLS-1$
}
public static String toFreeMarkerVariable(ValueMapping mapping) {
@@ -80,12 +80,12 @@
encodeProperties = new Properties();
}
- builder.append(Messages.FreeMarkerUtil_2 + mapping.getSrcPath() + Messages.FreeMarkerUtil_3);
+ builder.append("${" + mapping.getSrcPath() + "!?");
rawFormatting = encodeProperties.getProperty(ValueMapping.RAW_FORMATING_KEY);
if(rawFormatting != null) {
builder.append(rawFormatting);
- builder.append(Messages.FreeMarkerUtil_4);
+ builder.append("}");
} else {
Class<?> valueType = mapping.getValueType();
if(valueType != null) {
@@ -93,19 +93,19 @@
if(valueType == java.util.Date.class) {
String format = encodeProperties.getProperty(DateDecoder.FORMAT);
if(format != null) {
- builder.append(Messages.FreeMarkerUtil_5 + format + Messages.FreeMarkerUtil_6);
+ builder.append("string('" + format + "')}");
} else {
- builder.append(Messages.FreeMarkerUtil_7);
+ builder.append("string.medium}");
}
} else if(Number.class.isAssignableFrom(valueType)) {
- builder.append(Messages.FreeMarkerUtil_8);
+ builder.append("c}");
} else if(valueType == Double.TYPE || valueType == Float.TYPE || valueType == Integer.TYPE || valueType == Long.TYPE || valueType == Short.TYPE) {
- builder.append(Messages.FreeMarkerUtil_9);
+ builder.append("c}");
} else {
- builder.append(Messages.FreeMarkerUtil_10);
+ builder.append("string}");
}
} else {
- builder.append(Messages.FreeMarkerUtil_11);
+ builder.append("string}");
}
}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/Messages.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/Messages.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,50 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009, JBoss Inc.
- */
-package org.jboss.tools.smooks.templating.template.util;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.util.messages"; //$NON-NLS-1$
- public static String FreeMarkerUtil_0;
- public static String FreeMarkerUtil_1;
- public static String FreeMarkerUtil_10;
- public static String FreeMarkerUtil_11;
- public static String FreeMarkerUtil_2;
- public static String FreeMarkerUtil_3;
- public static String FreeMarkerUtil_4;
- public static String FreeMarkerUtil_5;
- public static String FreeMarkerUtil_6;
- public static String FreeMarkerUtil_7;
- public static String FreeMarkerUtil_8;
- public static String FreeMarkerUtil_9;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/messages.properties 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/messages.properties 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,12 +0,0 @@
-FreeMarkerUtil_0='.
-FreeMarkerUtil_1=}
-FreeMarkerUtil_10=string}
-FreeMarkerUtil_11=string}
-FreeMarkerUtil_2=${
-FreeMarkerUtil_3=\!?
-FreeMarkerUtil_4=}
-FreeMarkerUtil_5=string('
-FreeMarkerUtil_6=')}
-FreeMarkerUtil_7=string.medium}
-FreeMarkerUtil_8=c}
-FreeMarkerUtil_9=c}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/Messages.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/Messages.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,43 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009, JBoss Inc.
- */
-package org.jboss.tools.smooks.templating.template.xml;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.xml.messages"; //$NON-NLS-1$
- public static String XMLFreeMarkerTemplateBuilder_0;
- public static String XMLFreeMarkerTemplateBuilder_1;
- public static String XMLFreeMarkerTemplateBuilder_2;
- public static String XMLFreeMarkerTemplateBuilder_3;
- public static String XMLFreeMarkerTemplateBuilder_4;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/XMLFreeMarkerTemplateBuilder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/XMLFreeMarkerTemplateBuilder.java 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/XMLFreeMarkerTemplateBuilder.java 2010-02-04 15:18:54 UTC (rev 20128)
@@ -138,7 +138,7 @@
if(mapping instanceof CollectionMapping) {
collectionMapping = (CollectionMapping) mapping;
TemplateBuilder.writeIndent(indent, templateWriter);
- templateWriter.write("<#list " + collectionMapping.getSrcPath() + Messages.XMLFreeMarkerTemplateBuilder_0 + collectionMapping.getCollectionItemName() + Messages.XMLFreeMarkerTemplateBuilder_1); //$NON-NLS-1$
+ templateWriter.write("<#list " + collectionMapping.getSrcPath() + " as " + collectionMapping.getCollectionItemName() + ">\n"); //$NON-NLS-1$
}
TemplateBuilder.writeIndent(indent, templateWriter);
@@ -334,11 +334,11 @@
// We need to rewrite the FreeMarker template so as to get rid of the FreeMarker constructs,
// such as <#list> etc. We convert these to XML elements in the ModelBuilder.NAMESPACE namespace.
- if(element.getNodeName().equals(Messages.XMLFreeMarkerTemplateBuilder_2)) {
+ if(element.getNodeName().equals("IteratorBlock")) {
String description = element.getDescription();
if(!description.startsWith("list")) { //$NON-NLS-1$
- throw new TemplateBuilderException ("Unsupported XML template IteratorBlock type '" + description + Messages.XMLFreeMarkerTemplateBuilder_3); //$NON-NLS-1$
+ throw new TemplateBuilderException ("Unsupported XML template IteratorBlock type '" + description + "'. Currently only support 'list' IteratorBlock nodes."); //$NON-NLS-1$
}
String[] tokens = description.split(" +?"); //$NON-NLS-1$
@@ -358,7 +358,7 @@
rewriteTemplateElement(children.nextElement(), templateRewriteBuffer);
}
} else {
- if(element.getClass().getSimpleName().equals(Messages.XMLFreeMarkerTemplateBuilder_4)) {
+ if(element.getClass().getSimpleName().equals("DollarVariable")) {
templateRewriteBuffer.append(element.toString());
} else {
templateRewriteBuffer.append(element.getCanonicalForm());
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/messages.properties 2010-02-04 15:17:43 UTC (rev 20127)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/messages.properties 2010-02-04 15:18:54 UTC (rev 20128)
@@ -1,5 +0,0 @@
-XMLFreeMarkerTemplateBuilder_0=\ as
-XMLFreeMarkerTemplateBuilder_1=>\n
-XMLFreeMarkerTemplateBuilder_2=IteratorBlock
-XMLFreeMarkerTemplateBuilder_3='. Currently only support 'list' IteratorBlock nodes.
-XMLFreeMarkerTemplateBuilder_4=DollarVariable
14 years, 4 months
JBoss Tools SVN: r20127 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh: ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-02-04 10:17:43 -0500 (Thu, 04 Feb 2010)
New Revision: 20127
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPublishUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/ui/wizard/SCPServerWizardFragment.java
Log:
JBIDE-5760 - defaulting ssh server's known_hosts
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPublishUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPublishUtil.java 2010-02-04 14:05:16 UTC (rev 20126)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPublishUtil.java 2010-02-04 15:17:43 UTC (rev 20127)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.ssh.server;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jsch.internal.core.JSchCorePlugin;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.internal.Server;
@@ -30,6 +33,10 @@
}
public static String getHostsFile(IServer server) {
- return ((Server)server).getAttribute(ISSHDeploymentConstants.HOSTS_FILE, (String)null);
+ Preferences jschPrefs = JSchCorePlugin.getPlugin().getPluginPreferences();
+ String sshHome = jschPrefs.getDefaultString(org.eclipse.jsch.internal.core.IConstants.KEY_SSH2HOME);
+ sshHome += Path.SEPARATOR + "known_hosts";
+ return ((Server)server).getAttribute(ISSHDeploymentConstants.HOSTS_FILE,
+ sshHome);
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/ui/wizard/SCPServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/ui/wizard/SCPServerWizardFragment.java 2010-02-04 14:05:16 UTC (rev 20126)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/ui/wizard/SCPServerWizardFragment.java 2010-02-04 15:17:43 UTC (rev 20127)
@@ -36,11 +36,10 @@
public class SCPServerWizardFragment extends WizardFragment {
private IWizardHandle handle;
- private Text userText, passText, deployText, hostsFileText;
+ private Text userText, passText, deployText;
private ModifyListener listener;
private SelectionListener browseHostsButtonListener;
- private Button browseHostsFileButton;
- private String user, pass, deploy, hostFile;
+ private String user, pass, deploy;
public SCPServerWizardFragment() {
super();
@@ -102,49 +101,13 @@
passText.addModifyListener(listener);
passText.setEnabled(true);
passText.setLayoutData(textData);
-
- Label hostsLabel = new Label(inner, SWT.NONE);
- hostsLabel.setText(Messages.HostsLabel);
- Composite hostsFileComposite = new Composite(inner, SWT.NONE);
- hostsFileComposite.setLayoutData(textData);
- hostsFileComposite.setLayout(new GridLayout(2,false));
-
- hostsFileText = new Text(hostsFileComposite, SWT.BORDER);
- hostsFileText.setText("/home/username/.ssh/known_hosts");
- hostsFileText.addModifyListener(listener);
- hostsFileText.setEnabled(true);
- GridData hostsFileData = new GridData(SWT.LEFT, SWT.CENTER, true, false);
- hostsFileData.widthHint = 200;
- hostsFileData.grabExcessHorizontalSpace = true;
- hostsFileText.setLayoutData(hostsFileData);
-
- browseHostsFileButton = new Button(hostsFileComposite, SWT.PUSH);
- browseHostsFileButton.setText(Messages.browse);
- browseHostsButtonListener = new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- browseForHostsSelected();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- };
- browseHostsFileButton.addSelectionListener(browseHostsButtonListener);
}
- protected void browseForHostsSelected() {
- FileDialog d = new FileDialog(new Shell());
- IPath p = ServerUtil.makeGlobal(null, new Path(hostsFileText.getText()));
- d.setFilterPath(p.toString());
- String x = d.open();
- if (x != null) {
- hostsFileText.setText(x);
- }
- }
protected void updateValues() {
user = userText.getText();
pass = passText.getText();
deploy = deployText.getText();
- hostFile = hostsFileText.getText();
validate();
}
@@ -157,10 +120,7 @@
}
protected void validate() {
- if( hostFile == null || !(new File(hostFile).exists()) || !(new File(hostFile).isFile()))
- handle.setMessage("Host file must exist", IMessageProvider.ERROR);
- else
- handle.setMessage(null, IMessageProvider.NONE);
+ handle.setMessage(null, IMessageProvider.NONE);
handle.update();
}
@@ -173,7 +133,7 @@
SSHServerDelegate server = (SSHServerDelegate)serverWC.loadAdapter(SSHServerDelegate.class, new NullProgressMonitor());
server.setUsername(user); //$NON-NLS-1$
server.setPassword(pass); //$NON-NLS-1$
- server.setHostsFile(hostFile);
+ server.setHostsFile(null);
server.setDeployFolder(deploy);
}
}
14 years, 4 months
JBoss Tools SVN: r20126 - in trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating: model/xml and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2010-02-04 09:05:16 -0500 (Thu, 04 Feb 2010)
New Revision: 20126
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-5773
Externalize strings in org.jboss.tools.smooks.templating
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/Messages.java 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,44 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2009, JBoss Inc.
+ */
+package org.jboss.tools.smooks.templating.model;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.model.messages"; //$NON-NLS-1$
+ public static String ModelBuilder_0;
+ public static String ModelBuilder_1;
+ public static String ModelNodeResolver_0;
+ public static String ModelNodeResolver_1;
+ public static String ModelNodeResolver_2;
+ public static String ModelNodeResolver_3;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/messages.properties 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,6 @@
+ModelBuilder_0=
+ModelBuilder_1=
+ModelNodeResolver_0=
+ModelNodeResolver_1=:
+ModelNodeResolver_2=/
+ModelNodeResolver_3=:
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/Messages.java 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,52 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2009, JBoss Inc.
+ */
+package org.jboss.tools.smooks.templating.model.xml;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.model.xml.messages"; //$NON-NLS-1$
+ public static String XMLSampleModelBuilder_0;
+ public static String XMLSampleModelBuilder_1;
+ public static String XMLSampleModelBuilder_2;
+ public static String XMLSampleModelBuilder_3;
+ public static String XMLSampleModelBuilder_4;
+ public static String XMLSampleModelBuilder_5;
+ public static String XMLSampleModelBuilder_6;
+ public static String XSDModelBuilder_0;
+ public static String XSDModelBuilder_1;
+ public static String XSDModelBuilder_2;
+ public static String XSDModelBuilder_3;
+ public static String XSDModelBuilder_4;
+ public static String XSDModelBuilder_5;
+ public static String XSDModelBuilder_6;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/messages.properties 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,14 @@
+XMLSampleModelBuilder_0=Unexpectd XML exception. Unable to create DocumentBuilder instance.
+XMLSampleModelBuilder_1=Null 'xmlSampleURI' arg in method call.
+XMLSampleModelBuilder_2=' not found.
+XMLSampleModelBuilder_3=' is not a normal file. Might be a directory etc.
+XMLSampleModelBuilder_4=The configureModelElementTypes method can only be called after the model has been trimed of non-model Nodes. Call trimNonModelNodes() before calling configureModelElementTypes().
+XMLSampleModelBuilder_5=:
+XMLSampleModelBuilder_6=The configureModelElementTypes method can only be called after the model has been trimed of non-model Nodes. Call trimNonModelNodes() before calling configureModelElementTypes().
+XSDModelBuilder_0='.
+XSDModelBuilder_1=' not found.
+XSDModelBuilder_2=xsd
+XSDModelBuilder_3='.
+XSDModelBuilder_4=ns
+XSDModelBuilder_5=
+XSDModelBuilder_6==
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/Messages.java 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,45 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2009, JBoss Inc.
+ */
+package org.jboss.tools.smooks.templating.template;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.messages"; //$NON-NLS-1$
+ public static String TemplateBuilder_0;
+ public static String TemplateBuilder_1;
+ public static String TemplateBuilder_2;
+ public static String TemplateBuilder_3;
+ public static String TemplateBuilder_4;
+ public static String TemplateBuilder_5;
+ public static String ValueMapping_0;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/Messages.java 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,42 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2009, JBoss Inc.
+ */
+package org.jboss.tools.smooks.templating.template.csv;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.csv.messages"; //$NON-NLS-1$
+ public static String CSVFreeMarkerTemplateBuilder_0;
+ public static String CSVFreeMarkerTemplateBuilder_1;
+ public static String CSVFreeMarkerTemplateBuilder_2;
+ public static String CSVFreeMarkerTemplateBuilder_3;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/csv/messages.properties 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,4 @@
+CSVFreeMarkerTemplateBuilder_0=IteratorBlock
+CSVFreeMarkerTemplateBuilder_1='. Currently only support 'list' IteratorBlock nodes.
+CSVFreeMarkerTemplateBuilder_2=\ as
+CSVFreeMarkerTemplateBuilder_3=>\n
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/Messages.java 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,39 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2009, JBoss Inc.
+ */
+package org.jboss.tools.smooks.templating.template.exception;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.exception.messages"; //$NON-NLS-1$
+ public static String UnmappedCollectionNodeException_0;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/exception/messages.properties 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1 @@
+UnmappedCollectionNodeException_0='.
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/messages.properties 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,7 @@
+TemplateBuilder_0=' namespace.
+TemplateBuilder_1='. This node (or one of it's ancestors) is hidden.
+TemplateBuilder_2=Unexpected Exception. Invalid <smk:list> collection node. Has no child elements\!
+TemplateBuilder_3=" smk:collectionItemName="
+TemplateBuilder_4=" xmlns:smk="
+TemplateBuilder_5=">
+ValueMapping_0=\#RAW_FORMATING_KEY
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/Messages.java 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,50 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2009, JBoss Inc.
+ */
+package org.jboss.tools.smooks.templating.template.util;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.util.messages"; //$NON-NLS-1$
+ public static String FreeMarkerUtil_0;
+ public static String FreeMarkerUtil_1;
+ public static String FreeMarkerUtil_10;
+ public static String FreeMarkerUtil_11;
+ public static String FreeMarkerUtil_2;
+ public static String FreeMarkerUtil_3;
+ public static String FreeMarkerUtil_4;
+ public static String FreeMarkerUtil_5;
+ public static String FreeMarkerUtil_6;
+ public static String FreeMarkerUtil_7;
+ public static String FreeMarkerUtil_8;
+ public static String FreeMarkerUtil_9;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/util/messages.properties 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,12 @@
+FreeMarkerUtil_0='.
+FreeMarkerUtil_1=}
+FreeMarkerUtil_10=string}
+FreeMarkerUtil_11=string}
+FreeMarkerUtil_2=${
+FreeMarkerUtil_3=\!?
+FreeMarkerUtil_4=}
+FreeMarkerUtil_5=string('
+FreeMarkerUtil_6=')}
+FreeMarkerUtil_7=string.medium}
+FreeMarkerUtil_8=c}
+FreeMarkerUtil_9=c}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/Messages.java 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,43 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2009, JBoss Inc.
+ */
+package org.jboss.tools.smooks.templating.template.xml;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ *
+ * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.templating.template.xml.messages"; //$NON-NLS-1$
+ public static String XMLFreeMarkerTemplateBuilder_0;
+ public static String XMLFreeMarkerTemplateBuilder_1;
+ public static String XMLFreeMarkerTemplateBuilder_2;
+ public static String XMLFreeMarkerTemplateBuilder_3;
+ public static String XMLFreeMarkerTemplateBuilder_4;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/template/xml/messages.properties 2010-02-04 14:05:16 UTC (rev 20126)
@@ -0,0 +1,5 @@
+XMLFreeMarkerTemplateBuilder_0=\ as
+XMLFreeMarkerTemplateBuilder_1=>\n
+XMLFreeMarkerTemplateBuilder_2=IteratorBlock
+XMLFreeMarkerTemplateBuilder_3='. Currently only support 'list' IteratorBlock nodes.
+XMLFreeMarkerTemplateBuilder_4=DollarVariable
14 years, 4 months
JBoss Tools SVN: r20125 - in branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse: lib/hibernate and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-02-04 07:27:28 -0500 (Thu, 04 Feb 2010)
New Revision: 20125
Added:
branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/lib/hibernate/hibernate-jmx.jar
Modified:
branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/.classpath
Log:
https://jira.jboss.org/jira/browse/JBIDE-5706 - add hibernate-jmx.jar (hibernate-jmx-3.3.2.GA.jar)
Modified: branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/.classpath
===================================================================
--- branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/.classpath 2010-02-04 12:07:19 UTC (rev 20124)
+++ branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/.classpath 2010-02-04 12:27:28 UTC (rev 20125)
@@ -37,5 +37,6 @@
<classpathentry exported="true" kind="lib" path="lib/annotations/hibernate-commons-annotations.jar"/>
<classpathentry exported="true" kind="lib" path="lib/annotations/hibernate-validator.jar"/>
<classpathentry exported="true" kind="lib" path="lib/hibernate/log4j-1.2.15.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate/hibernate-jmx.jar"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Added: branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/lib/hibernate/hibernate-jmx.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/lib/hibernate/hibernate-jmx.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 4 months
JBoss Tools SVN: r20124 - branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-02-04 07:07:19 -0500 (Thu, 04 Feb 2010)
New Revision: 20124
Added:
branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/Formatter.java
Modified:
branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/QLFormatHelper.java
Log:
in branch for JBIDE-5706 work
Had to copy Formatter.java from H3.2 to retain methods for reducing the spaces from 3 to 1 to avoid cluttering preview window.
Added: branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/Formatter.java
===================================================================
--- branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/Formatter.java (rev 0)
+++ branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/Formatter.java 2010-02-04 12:07:19 UTC (rev 20124)
@@ -0,0 +1,374 @@
+package org.hibernate.eclipse.console.utils;
+
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.hibernate.util.StringHelper;
+
+/**
+ * Old formatter from previous Hibernate versions which allowed a bit more control, i.e. we want *less* spaces not more.
+ * In here to simplify migration from 3.2 to 3.3 where this class changed.
+ *
+ */
+public class Formatter {
+
+ private static final Set BEGIN_CLAUSES = new HashSet();
+ private static final Set END_CLAUSES = new HashSet();
+ private static final Set LOGICAL = new HashSet();
+ private static final Set QUANTIFIERS = new HashSet();
+ private static final Set DML = new HashSet();
+ private static final Set MISC = new HashSet();
+ static {
+
+ BEGIN_CLAUSES.add("left");
+ BEGIN_CLAUSES.add("right");
+ BEGIN_CLAUSES.add("inner");
+ BEGIN_CLAUSES.add("outer");
+ BEGIN_CLAUSES.add("group");
+ BEGIN_CLAUSES.add("order");
+
+ END_CLAUSES.add("where");
+ END_CLAUSES.add("set");
+ END_CLAUSES.add("having");
+ END_CLAUSES.add("join");
+ END_CLAUSES.add("from");
+ END_CLAUSES.add("by");
+ END_CLAUSES.add("join");
+ END_CLAUSES.add("into");
+ END_CLAUSES.add("union");
+
+ LOGICAL.add("and");
+ LOGICAL.add("or");
+ LOGICAL.add("when");
+ LOGICAL.add("else");
+ LOGICAL.add("end");
+
+ QUANTIFIERS.add("in");
+ QUANTIFIERS.add("all");
+ QUANTIFIERS.add("exists");
+ QUANTIFIERS.add("some");
+ QUANTIFIERS.add("any");
+
+ DML.add("insert");
+ DML.add("update");
+ DML.add("delete");
+
+ MISC.add("select");
+ MISC.add("on");
+ //MISC.add("values");
+
+ }
+
+ String indentString = " ";
+ String initial = "\n ";
+
+ boolean beginLine = true;
+ boolean afterBeginBeforeEnd = false;
+ boolean afterByOrSetOrFromOrSelect = false;
+ boolean afterValues = false;
+ boolean afterOn = false;
+ boolean afterBetween = false;
+ boolean afterInsert = false;
+ int inFunction = 0;
+ int parensSinceSelect = 0;
+ private LinkedList parenCounts = new LinkedList();
+ private LinkedList afterByOrFromOrSelects = new LinkedList();
+
+ int indent = 1;
+
+ StringBuffer result = new StringBuffer();
+ StringTokenizer tokens;
+ String lastToken;
+ String token;
+ String lcToken;
+
+ public Formatter(String sql) {
+ tokens = new StringTokenizer(
+ sql,
+ "()+*/-=<>'`\"[]," + StringHelper.WHITESPACE,
+ true
+ );
+ }
+
+ public Formatter setInitialString(String initial) {
+ this.initial = initial;
+ return this;
+ }
+
+ public Formatter setIndentString(String indent) {
+ this.indentString = indent;
+ return this;
+ }
+
+ public String format() {
+
+ result.append(initial);
+
+ while ( tokens.hasMoreTokens() ) {
+ token = tokens.nextToken();
+ lcToken = token.toLowerCase();
+
+ if ( "'".equals(token) ) {
+ String t;
+ do {
+ t = tokens.nextToken();
+ token += t;
+ }
+ while ( !"'".equals(t) && tokens.hasMoreTokens() ); // cannot handle single quotes
+ }
+ else if ( "\"".equals(token) ) {
+ String t;
+ do {
+ t = tokens.nextToken();
+ token += t;
+ }
+ while ( !"\"".equals(t) );
+ }
+
+ if ( afterByOrSetOrFromOrSelect && ",".equals(token) ) {
+ commaAfterByOrFromOrSelect();
+ }
+ else if ( afterOn && ",".equals(token) ) {
+ commaAfterOn();
+ }
+
+ else if ( "(".equals(token) ) {
+ openParen();
+ }
+ else if ( ")".equals(token) ) {
+ closeParen();
+ }
+
+ else if ( BEGIN_CLAUSES.contains(lcToken) ) {
+ beginNewClause();
+ }
+
+ else if ( END_CLAUSES.contains(lcToken) ) {
+ endNewClause();
+ }
+
+ else if ( "select".equals(lcToken) ) {
+ select();
+ }
+
+ else if ( DML.contains(lcToken) ) {
+ updateOrInsertOrDelete();
+ }
+
+ else if ( "values".equals(lcToken) ) {
+ values();
+ }
+
+ else if ( "on".equals(lcToken) ) {
+ on();
+ }
+
+ else if ( afterBetween && lcToken.equals("and") ) {
+ misc();
+ afterBetween = false;
+ }
+
+ else if ( LOGICAL.contains(lcToken) ) {
+ logical();
+ }
+
+ else if ( isWhitespace(token) ) {
+ white();
+ }
+
+ else {
+ misc();
+ }
+
+ if ( !isWhitespace( token ) ) lastToken = lcToken;
+
+ }
+ return result.toString();
+ }
+
+ private void commaAfterOn() {
+ out();
+ indent--;
+ newline();
+ afterOn = false;
+ afterByOrSetOrFromOrSelect = true;
+ }
+
+ private void commaAfterByOrFromOrSelect() {
+ out();
+ newline();
+ }
+
+ private void logical() {
+ if ( "end".equals(lcToken) ) indent--;
+ newline();
+ out();
+ beginLine = false;
+ }
+
+ private void on() {
+ indent++;
+ afterOn = true;
+ newline();
+ out();
+ beginLine = false;
+ }
+
+ private void misc() {
+ out();
+ if ( "between".equals(lcToken) ) {
+ afterBetween = true;
+ }
+ if (afterInsert) {
+ newline();
+ afterInsert = false;
+ }
+ else {
+ beginLine = false;
+ if ( "case".equals(lcToken) ) {
+ indent++;
+ }
+ }
+ }
+
+ private void white() {
+ if ( !beginLine ) {
+ result.append(" ");
+ }
+ }
+
+ private void updateOrInsertOrDelete() {
+ out();
+ indent++;
+ beginLine = false;
+ if ( "update".equals(lcToken) ) newline();
+ if ( "insert".equals(lcToken) ) afterInsert = true;
+ }
+
+ private void select() {
+ out();
+ indent++;
+ newline();
+ parenCounts.addLast( new Integer(parensSinceSelect) );
+ afterByOrFromOrSelects.addLast( new Boolean(afterByOrSetOrFromOrSelect) );
+ parensSinceSelect = 0;
+ afterByOrSetOrFromOrSelect = true;
+ }
+
+ private void out() {
+ result.append(token);
+ }
+
+ private void endNewClause() {
+ if (!afterBeginBeforeEnd) {
+ indent--;
+ if (afterOn) {
+ indent--;
+ afterOn=false;
+ }
+ newline();
+ }
+ out();
+ if ( !"union".equals(lcToken) ) indent++;
+ newline();
+ afterBeginBeforeEnd = false;
+ afterByOrSetOrFromOrSelect = "by".equals(lcToken)
+ || "set".equals(lcToken)
+ || "from".equals(lcToken);
+ }
+
+ private void beginNewClause() {
+ if (!afterBeginBeforeEnd) {
+ if (afterOn) {
+ indent--;
+ afterOn=false;
+ }
+ indent--;
+ newline();
+ }
+ out();
+ beginLine = false;
+ afterBeginBeforeEnd = true;
+ }
+
+ private void values() {
+ indent--;
+ newline();
+ out();
+ indent++;
+ newline();
+ afterValues = true;
+ }
+
+ private void closeParen() {
+ parensSinceSelect--;
+ if (parensSinceSelect<0) {
+ indent--;
+ parensSinceSelect = ( (Integer) parenCounts.removeLast() ).intValue();
+ afterByOrSetOrFromOrSelect = ( (Boolean) afterByOrFromOrSelects.removeLast() ).booleanValue();
+ }
+ if ( inFunction>0 ) {
+ inFunction--;
+ out();
+ }
+ else {
+ if (!afterByOrSetOrFromOrSelect) {
+ indent--;
+ newline();
+ }
+ out();
+ }
+ beginLine = false;
+ }
+
+ private void openParen() {
+ if ( isFunctionName( lastToken ) || inFunction>0 ) {
+ inFunction++;
+ }
+ beginLine = false;
+ if ( inFunction>0 ) {
+ out();
+ }
+ else {
+ out();
+ if (!afterByOrSetOrFromOrSelect) {
+ indent++;
+ newline();
+ beginLine = true;
+ }
+ }
+ parensSinceSelect++;
+ }
+
+ private static boolean isFunctionName(String tok) {
+ final char begin = tok.charAt(0);
+ final boolean isIdentifier = Character.isJavaIdentifierStart( begin ) || '"'==begin;
+ return isIdentifier &&
+ !LOGICAL.contains(tok) &&
+ !END_CLAUSES.contains(tok) &&
+ !QUANTIFIERS.contains(tok) &&
+ !DML.contains(tok) &&
+ !MISC.contains(tok);
+ }
+
+ private static boolean isWhitespace(String token) {
+ return StringHelper.WHITESPACE.indexOf(token)>=0;
+ }
+
+ private void newline() {
+ result.append("\n");
+ for ( int i=0; i<indent; i++ ) {
+ result.append(indentString);
+ }
+ beginLine = true;
+ }
+
+ public static void main(String[] args) {
+ if ( args.length>0 ) System.out.println(
+ new Formatter( StringHelper.join(" ", args) ).format()
+ );
+ }
+
+}
Modified: branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/QLFormatHelper.java
===================================================================
--- branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/QLFormatHelper.java 2010-02-04 12:05:48 UTC (rev 20123)
+++ branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/QLFormatHelper.java 2010-02-04 12:07:19 UTC (rev 20124)
@@ -21,8 +21,6 @@
*/
package org.hibernate.eclipse.console.utils;
-import org.hibernate.pretty.Formatter;
-
public class QLFormatHelper {
static public String formatForScreen(String query) {
14 years, 4 months
JBoss Tools SVN: r20123 - in branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse: src/org/hibernate/console and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-02-04 07:05:48 -0500 (Thu, 04 Feb 2010)
New Revision: 20123
Modified:
branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF
branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeTransactionManagerLookup.java
Log:
In branch to try fixing JBIDE-5706 and others.
MANIFEST.MF added missing package, jmx not handled yet.
Using DialectFactory in new package is fine because its just internally.
FakeTransactionManagerLookup.java is worse, but since it is just a new method it should also work on previous hibernate jars - needs to be tested.
Modified: branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF 2010-02-04 11:39:53 UTC (rev 20122)
+++ branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF 2010-02-04 12:05:48 UTC (rev 20123)
@@ -306,6 +306,7 @@
org.hibernate.intercept.cglib,
org.hibernate.intercept.javassist,
org.hibernate.jdbc,
+ org.hibernate.jdbc.util,
org.hibernate.jmx,
org.hibernate.loader,
org.hibernate.loader.collection,
Modified: branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-02-04 11:39:53 UTC (rev 20122)
+++ branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-02-04 12:05:48 UTC (rev 20123)
@@ -64,7 +64,7 @@
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.DialectFactory;
+import org.hibernate.dialect.resolver.DialectFactory;
import org.hibernate.util.ConfigHelper;
import org.hibernate.util.ReflectHelper;
import org.hibernate.util.StringHelper;
@@ -370,11 +370,8 @@
Connection connection = null;
try {
connection = DriverManager.getConnection(url, user, pass);
- DatabaseMetaData meta = connection.getMetaData();
- String databaseName = meta.getDatabaseProductName();
- int databaseMajorVersion = meta.getDatabaseMajorVersion();
//SQL Dialect:
- Dialect dialect = DialectFactory.buildDialect( localCfg.getProperties(), databaseName, databaseMajorVersion );
+ Dialect dialect = DialectFactory.buildDialect( localCfg.getProperties(), connection );
localCfg.setProperty(Environment.DIALECT, dialect.toString());
} catch (SQLException e) {
//can't determine dialect
Modified: branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeTransactionManagerLookup.java
===================================================================
--- branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeTransactionManagerLookup.java 2010-02-04 11:39:53 UTC (rev 20122)
+++ branches/hibernatetools-switch-to-hibernate-core-3.3/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeTransactionManagerLookup.java 2010-02-04 12:05:48 UTC (rev 20123)
@@ -37,6 +37,10 @@
return null; //throw new UnsupportedOperationException();
}
+ public Object getTransactionIdentifier(Transaction transaction) {
+ return transaction;
+ }
+
}
class FakeTransactionManager implements TransactionManager {
14 years, 4 months
JBoss Tools SVN: r20122 - trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-04 06:39:53 -0500 (Thu, 04 Feb 2010)
New Revision: 20122
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5786
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java 2010-02-04 11:39:00 UTC (rev 20121)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java 2010-02-04 11:39:53 UTC (rev 20122)
@@ -32,7 +32,6 @@
XModelEntity e = meta.getEntity(c.getName());
if(e != null && e.getAttribute(ATTR_NAME) != null && e.getAttribute(ATTR_CLASS) != null) {
childEntities.add(c.getName());
- System.out.println(parentEntity + " " + c.getName());
}
}
}
14 years, 4 months
JBoss Tools SVN: r20121 - trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-04 06:39:00 -0500 (Thu, 04 Feb 2010)
New Revision: 20121
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5786
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java 2010-02-04 11:20:07 UTC (rev 20120)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java 2010-02-04 11:39:00 UTC (rev 20121)
@@ -10,27 +10,43 @@
******************************************************************************/
package org.jboss.tools.seam.xml.ui.editor.form;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.meta.XChild;
+import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.meta.XModelMetaData;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.ui.forms.*;
import org.jboss.tools.seam.xml.components.model.SeamComponentConstants;
public class SeamComponentsFileFormLayoutData implements SeamComponentConstants {
- static IFormData SEAM_COMPONENT_LIST_DEFINITION = new FormData(
- "Components", //$NON-NLS-1$
- SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
- new FormAttributeData[]{new FormAttributeData(ATTR_NAME, 40), new FormAttributeData("class", 60)}, //$NON-NLS-1$
- new String[]{ENT_SEAM_COMPONENT},
- FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddComponent") //$NON-NLS-1$
- );
-
- static IFormData SEAM_COMPONENT_20_LIST_DEFINITION = new FormData(
- "Components", //$NON-NLS-1$
- SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
- new FormAttributeData[]{new FormAttributeData(ATTR_NAME, 40), new FormAttributeData("class", 60)}, //$NON-NLS-1$
- new String[]{ENT_SEAM_COMPONENT_20},
- FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddComponent") //$NON-NLS-1$
- );
+ static IFormData createSeamComponentListDefinition(String parentEntity) {
+ XModelMetaData meta = PreferenceModelUtilities.getPreferenceModel().getMetaData();
+ XModelEntity entity = meta.getEntity(parentEntity);
+ List<String> childEntities = new ArrayList<String>();
+ if(entity != null) {
+ XChild[] cs = entity.getChildren();
+ for (XChild c: cs) {
+ XModelEntity e = meta.getEntity(c.getName());
+ if(e != null && e.getAttribute(ATTR_NAME) != null && e.getAttribute(ATTR_CLASS) != null) {
+ childEntities.add(c.getName());
+ System.out.println(parentEntity + " " + c.getName());
+ }
+ }
+ }
+ IFormData result = new FormData(
+ "Components", //$NON-NLS-1$
+ SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
+ new FormAttributeData[]{new FormAttributeData(ATTR_NAME, 40), new FormAttributeData(ATTR_CLASS, 60)}, //$NON-NLS-1$
+ childEntities.toArray(new String[0]),
+ FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddComponent") //$NON-NLS-1$
+ );
+ return result;
+ }
+
static IFormData getFactoryList(String entity) {
return new FormData(
"Factories", //$NON-NLS-1$
@@ -65,7 +81,7 @@
SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
FormLayoutDataUtil.createGeneralFormAttributeData(ENT_SEAM_COMPONENTS_11)
),
- SEAM_COMPONENT_LIST_DEFINITION,
+ createSeamComponentListDefinition(ENT_SEAM_COMPONENTS_11),
getFactoryList(ENT_SEAM_FACTORY),
getEventList(ENT_SEAM_EVENT)
};
@@ -76,7 +92,7 @@
SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
FormLayoutDataUtil.createGeneralFormAttributeData(ENT_SEAM_COMPONENTS_12)
),
- SEAM_COMPONENT_LIST_DEFINITION,
+ createSeamComponentListDefinition(ENT_SEAM_COMPONENTS_12),
getFactoryList(ENT_SEAM_FACTORY),
getEventList(ENT_SEAM_EVENT)
};
@@ -87,7 +103,7 @@
SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
FormLayoutDataUtil.createGeneralFormAttributeData(ENT_SEAM_COMPONENTS_20)
),
- SEAM_COMPONENT_20_LIST_DEFINITION,
+ createSeamComponentListDefinition(ENT_SEAM_COMPONENTS_20),
getFactoryList(ENT_SEAM_FACTORY_20),
getEventList(ENT_SEAM_EVENT_20),
SEAM_IMPORT_LIST_DEFINITION
@@ -99,7 +115,7 @@
SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
FormLayoutDataUtil.createGeneralFormAttributeData(ENT_SEAM_COMPONENTS_21)
),
- SEAM_COMPONENT_20_LIST_DEFINITION,
+ createSeamComponentListDefinition(ENT_SEAM_COMPONENTS_21),
getFactoryList(ENT_SEAM_FACTORY_20),
getEventList(ENT_SEAM_EVENT_20),
SEAM_IMPORT_LIST_DEFINITION
@@ -111,7 +127,7 @@
SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
FormLayoutDataUtil.createGeneralFormAttributeData(ENT_SEAM_COMPONENTS_22)
),
- SEAM_COMPONENT_20_LIST_DEFINITION,
+ createSeamComponentListDefinition(ENT_SEAM_COMPONENTS_22),
getFactoryList(ENT_SEAM_FACTORY_20),
getEventList(ENT_SEAM_EVENT_20),
SEAM_IMPORT_LIST_DEFINITION
14 years, 4 months
JBoss Tools SVN: r20120 - trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-04 06:20:07 -0500 (Thu, 04 Feb 2010)
New Revision: 20120
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentConstants.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5786
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentConstants.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentConstants.java 2010-02-04 10:50:13 UTC (rev 20119)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentConstants.java 2010-02-04 11:20:07 UTC (rev 20120)
@@ -52,5 +52,6 @@
public String ATTR_TYPE = "type"; //$NON-NLS-1$
public String ATTR_EXPR = "expression"; //$NON-NLS-1$
public String ATTR_EXEC = "execute"; //$NON-NLS-1$
+ public String ATTR_CLASS = "class"; //$NON-NLS-1$
}
14 years, 4 months