JBoss Tools SVN: r23385 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: messages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-07-13 11:08:59 -0400 (Tue, 13 Jul 2010)
New Revision: 23385
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6599 , message was corrected, field names were corrected.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2010-07-13 13:33:55 UTC (rev 23384)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2010-07-13 15:08:59 UTC (rev 23385)
@@ -13,6 +13,7 @@
import java.io.IOException;
import java.net.URL;
import java.text.MessageFormat;
+import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -336,11 +337,24 @@
*/
private IMessageProvider validateTagName() {
Message message = null;
- if (tagName.getText().indexOf(":") < 0) { //$NON-NLS-1$
+ String[] parts = tagName.getText().split(":"); //$NON-NLS-1$
+ if (parts.length != 2 || tagName.getText().startsWith(":") //$NON-NLS-1$
+ || tagName.getText().endsWith(":")) { //$NON-NLS-1$
message = new Message(
MessageFormat.format(VpeUIMessages.TAG_NAME_IS_NOT_VALID,
- tagName.getText().trim()),
- IMessageProvider.ERROR);
+ tagName.getText().trim()), IMessageProvider.ERROR);
+ } else {
+ /*
+ * Matcher will accept only word characters with optional numbers.
+ */
+ Pattern p = Pattern.compile("([a-zA-Z]+\\d*)+"); //$NON-NLS-1$
+ if ((parts[0].length() == 0) || (parts[1].length() == 0)
+ || (!p.matcher(parts[0]).matches())
+ || (!p.matcher(parts[1]).matches())) {
+ message = new Message(
+ MessageFormat.format(VpeUIMessages.TAG_NAME_IS_NOT_VALID,
+ tagName.getText().trim()), IMessageProvider.ERROR);
+ }
}
return message;
}
@@ -356,9 +370,13 @@
try {
xmlDocument.createElement(txtTagForDisplay.getText());
} catch (DOMException e) {
+ /*
+ * https://jira.jboss.org/browse/JBIDE-6599
+ * Changing warning message.
+ */
return new Message(
MessageFormat.format(VpeUIMessages.TAG_FOR_DISPLAY_IS_NOT_VALID,
- e.getMessage()),
+ txtTagForDisplay.getText()),
IMessageProvider.ERROR);
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-07-13 13:33:55 UTC (rev 23384)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-07-13 15:08:59 UTC (rev 23385)
@@ -20,14 +20,14 @@
TEMPLATE=Unknown tag template
UNKNOWN_TAGS_DIALOG_DESCRIPTION=Set up parameters for the unknown tag
TAG_ATTRIBUTES=Set up tag attributes
-TAG_NAME=Tag Name:
+TAG_NAME=Tag name:
TAG_URI=Tag URI:
-TAG_FOR_DISPLAY=Tag For Display:
+TAG_FOR_DISPLAY=Tag for display:
TAG_STYLE=Tag style:
CHILDREN=Allow tag children:
VALUE=Value:
TAG_NAME_IS_NOT_VALID=Tag name ({0}) is not valid. The pattern is "taglib:tag"
-TAG_FOR_DISPLAY_IS_NOT_VALID=Tag for display is not valid ({0}).
+TAG_FOR_DISPLAY_IS_NOT_VALID=Incorrect tag with name ({0}).
VALUE_IS_NOT_VALID=Value is not valid ({0}).
BACKGROUND_COLOR=Background Color
15 years, 9 months
JBoss Tools SVN: r23384 - trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-07-13 09:33:55 -0400 (Tue, 13 Jul 2010)
New Revision: 23384
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
Log:
Added functionality to use JBoss EAP 5.0 as target Server Runtime.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2010-07-13 13:16:31 UTC (rev 23383)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2010-07-13 13:33:55 UTC (rev 23384)
@@ -17,6 +17,7 @@
import org.jboss.tools.test.TestProperties;
import org.jboss.tools.vpe.ui.bot.test.Activator;
import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.test.JBTSWTBotTestCase;
import org.jboss.tools.ui.bot.test.SWTBotJSPMultiPageEditor;
import org.jboss.tools.ui.bot.test.WidgetVariables;
@@ -25,9 +26,7 @@
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -42,8 +41,10 @@
* Variable defines JBoss EAP 4.3 server location on a file system
*/
- protected static String JBOSS_EAP_HOME;
- protected static String JBT_TEST_PROJECT_NAME;
+ protected final static String JBOSS_EAP_HOME;
+ protected final static String JBT_TEST_PROJECT_NAME;
+ protected final static String JBOSS_SERVER_GROUP;
+ protected final static String JBOSS_SERVER_RUNTIME_TYPE;
/* (non-Javadoc)
* This static block read properties from
@@ -69,7 +70,17 @@
Activator.getDefault().getLog().log(status);
e.printStackTrace();
}
- JBOSS_EAP_HOME = projectProperties.getProperty("JBossEap4.3"); //$NON-NLS-1$
+ if (projectProperties.containsKey("JBossEap5.0")){
+ JBOSS_EAP_HOME = projectProperties.getProperty("JBossEap5.0"); //$NON-NLS-1$
+ JBOSS_SERVER_GROUP = IDELabel.ServerGroup.JBOSS_EAP_5_0;
+ JBOSS_SERVER_RUNTIME_TYPE = IDELabel.ServerRuntimeType.JBOSS_EAP_5_0;
+
+ }
+ else {
+ JBOSS_EAP_HOME = projectProperties.getProperty("JBossEap4.3"); //$NON-NLS-1$
+ JBOSS_SERVER_GROUP = IDELabel.ServerGroup.JBOSS_EAP_4_3;
+ JBOSS_SERVER_RUNTIME_TYPE = IDELabel.ServerRuntimeType.JBOSS_EAP_4_3;
+ }
JBT_TEST_PROJECT_NAME = projectProperties.getProperty("JSFProjectName"); //$NON-NLS-1$
}
@@ -132,7 +143,7 @@
bot.button(0).click();
SWTBotTree innerTree = bot.tree();
delay();
- innerTree.expandNode("JBoss Enterprise Middleware").select("JBoss Enterprise Application Platform 4.3 Runtime"); //$NON-NLS-1$ //$NON-NLS-2$
+ innerTree.expandNode(JBOSS_SERVER_GROUP).select(JBOSS_SERVER_RUNTIME_TYPE); //$NON-NLS-1$ //$NON-NLS-2$
delay();
bot.button("Next >").click(); //$NON-NLS-1$
bot.textWithLabel("Home Directory").setText(JBOSS_EAP_HOME); //$NON-NLS-1$
@@ -322,45 +333,7 @@
Node testBodyNode = xmlTestDocument.getElementsByTagName("BODY").item(0); //$NON-NLS-1$
TestDomUtil.compareNodes(visualBodyNode, testBodyNode);
}
- /**
- * For debug purposes. Displays formatted node
- * @param node
- */
- @SuppressWarnings("unused")
- private void displaynsIDOMNode(nsIDOMNode node) {
- System.out.println("");
- System.out.print("<" + node.getNodeName() + " ");
- // compare node's attributes
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- nsIDOMNamedNodeMap modelAttributes = node.getAttributes();
- for (int i = 0; i < modelAttributes.getLength(); i++) {
- nsIDOMNode modelAttr = modelAttributes.item(i);
- System.out.print(modelAttr.getNodeName() + "=" + modelAttr.getNodeValue() + " ");
- }
- }
- System.out.println(">");
- if (node.getNodeValue() != null){
- System.out.println(node.getNodeValue());
- }
- // compare children
- nsIDOMNodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
-
- nsIDOMNode child = children.item(i);
-
- // leave out empty text nodes in test dom model
- if ((child.getNodeType() == Node.TEXT_NODE)
- && ((child.getNodeValue() == null) || (child.getNodeValue().trim()
- .length() == 0)))
- continue;
-
- displaynsIDOMNode(child);
-
- }
- System.out.println("<" + node.getNodeName() + "/>");
- }
-
/**
* Try to close all unnecessary dialogs, that could prevent next tests fails
*/
15 years, 9 months
JBoss Tools SVN: r23383 - in trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test: jsf2/refactor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-07-13 09:16:31 -0400 (Tue, 13 Jul 2010)
New Revision: 23383
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/CSSSelectorJBIDE3288.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/CssFileParser.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AbstractRefactorTest.java
Log:
Fix changed UI labels and support CSS at keywords.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/CSSSelectorJBIDE3288.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/CSSSelectorJBIDE3288.java 2010-07-13 09:07:26 UTC (rev 23382)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/CSSSelectorJBIDE3288.java 2010-07-13 13:16:31 UTC (rev 23383)
@@ -8,6 +8,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.test.WidgetVariables;
public class CSSSelectorJBIDE3288 extends JSFAutoTestCase{
@@ -60,9 +61,9 @@
bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$ //$NON-NLS-2$
} catch (WidgetNotFoundException e) {
tree.expandNode(projectProperties.getProperty("JSFProjectName")).expandNode("WebContent").getNode("pages").select(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- bot.menu("File").menu("New").menu("CSS File").click(); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ open.newObject(ActionItem.NewObject.WebCSS.LABEL);
bot.shell("New CSS File").activate(); //$NON-NLS-1$
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.textWithLabel("File name:").setText(CSS_FILE_NAME); //$NON-NLS-1$
bot.button("Finish").click(); //$NON-NLS-1$
}
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/CssFileParser.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/CssFileParser.java 2010-07-13 09:07:26 UTC (rev 23382)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/CssFileParser.java 2010-07-13 13:16:31 UTC (rev 23383)
@@ -19,6 +19,7 @@
*/
public class CssFileParser {
private LinkedList<Properties> cssClasses = new LinkedList<Properties>();
+ private Properties atKeywords = new Properties();
private LinkedList<String> fileLines = new LinkedList<String>();
private boolean parsed = false;
@@ -40,6 +41,11 @@
public LinkedList<Properties> getCssClasses() {
return cssClasses;
}
+
+ public Properties getAtKeywords() {
+ return atKeywords;
+ }
+
/**
* Adds only non empty lines. Do not change it because parser doesn't
* check for empy lines
@@ -72,10 +78,14 @@
line = line.trim();
// inside Css Class Definition
if (parserStatus.equals(ParserStatus.IN_CLASS_DEFINTION)){
- if (line.equals("}")){
+ if (line.startsWith("}")){
parserStatus = ParserStatus.OUT_OF_CLASS_DEFINITION;
cssClasses.add(classProperties);
classProperties = null;
+ // parse atKeywords
+ if (line.length() > 1){
+ parseAtKeywords(line.substring(1).trim());
+ }
}
else{
String[] styleLineParts = line.split(":");
@@ -101,8 +111,12 @@
+ line);
}
}
- else{
- throw new CssFileParserException("Line should starts with 'cssclass' string but is: "
+ else if (line.startsWith("@")){
+ parseAtKeywords(line);
+ }
+ // This is exception for this issue https://jira.jboss.org/browse/JBIDE-6604
+ else if (!line.trim().equals("}")){
+ throw new CssFileParserException("Line should starts with 'cssclass' or '@' string but is: "
+ line);
}
}
@@ -122,35 +136,76 @@
}
// Compare CSS Files Contents
boolean propertiesAreEqual = true;
+ boolean atKeywordsAreEqual = true;
if (this.getCssClasses().size() == cssFileParser.getCssClasses().size()){
Iterator<Properties> itThisProperties = this.getCssClasses().iterator();
Iterator<Properties> cssFileProperties = cssFileParser.getCssClasses().iterator();
while (propertiesAreEqual && itThisProperties.hasNext()){
- Properties propsThis = (Properties)itThisProperties.next().clone();
- Properties propsCssFile = (Properties)cssFileProperties.next().clone();
- boolean styleAttributesAreEqual = true;
- Iterator<Object> itThisPropertyName = propsThis.keySet().iterator();
- while (styleAttributesAreEqual && itThisPropertyName.hasNext()){
- String propertyName = (String)itThisPropertyName.next();
- if (propsCssFile.containsKey(propertyName)){
- styleAttributesAreEqual = propsThis.getProperty(propertyName).trim()
- .equals(propsCssFile.getProperty(propertyName).trim());
- // Remove checked property from CSS file properties
- propsCssFile.remove(propertyName);
- }
- else{
- styleAttributesAreEqual = false;
- }
- }
- // If there are left properties in CSS file then files are not equal
- propertiesAreEqual = styleAttributesAreEqual && propsCssFile.size() == 0;
+ propertiesAreEqual = compareProperties(itThisProperties.next(), cssFileProperties.next());
}
- result = propertiesAreEqual;
+ // Compare At Keywords
+ if (propertiesAreEqual){
+ atKeywordsAreEqual = compareProperties(getAtKeywords(),cssFileParser.getAtKeywords());
+ }
+ result = propertiesAreEqual && atKeywordsAreEqual;
}
}
return result;
}
+ /**
+ * Parse At Keywords
+ * @param line
+ */
+ private void parseAtKeywords(String line) {
+ if (line.length() > 0) {
+ if (line.startsWith("@")) {
+ if (line.length() > 1) {
+ String[] splitLine = line.split(" ");
+ atKeywords
+ .put(splitLine[0], splitLine.length > 1 ? splitLine[1] : "");
+ } else {
+ throw new CssFileParserException(
+ "Style Definition Line within CSS File has wrong format. At Keyword is empty. Line: "
+ + line);
+ }
+ } else {
+ throw new CssFileParserException(
+ "Style Definition Line within CSS File has wrong format. At Keyword is expected but line content is "
+ + line);
+ }
+ }
+ }
+ /**
+ * Compare two sets of properties
+ * @param props1
+ * @param props2
+ * @return
+ */
+ private boolean compareProperties (Properties props1 , Properties props2){
+ boolean propertiesAreEqual = true;
+ Properties props2Clone = (Properties)props2.clone();
+ Iterator<Object> itProps1Name = props1.keySet().iterator();
+ while (propertiesAreEqual && itProps1Name.hasNext()){
+ String propertyName = (String)itProps1Name.next();
+ if (props2Clone.containsKey(propertyName)){
+ propertiesAreEqual = props1.getProperty(propertyName).trim()
+ .equals(props2Clone.getProperty(propertyName).trim());
+ // Remove checked property from props2Clone properties
+ props2Clone.remove(propertyName);
+ }
+ else{
+ propertiesAreEqual = false;
+ }
+ }
+ // If there are left properties in CSS file then files are not equal
+ if (props2Clone.size() > 0){
+ propertiesAreEqual = false;
+ }
+
+ return propertiesAreEqual;
+
+ }
// TODO: Remove It
public static void main (String[] args){
CssFileParser parser1 = new CssFileParser(
@@ -165,7 +220,7 @@
"background-color: red;",
"font-weight: lighter;",
"text-decoration: overline",
- "}");
+ "}@CHARSET \"UTF-8\"");
CssFileParser parser2 = new CssFileParser(
"cssclass{",
@@ -179,6 +234,7 @@
"background-color: red;",
"text-decoration: overline",
"font-weight: lighter;",
+ "}@CHARSET \"UTF-8\";",
"}");
System.out.println(parser1.compare(parser2));
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java 2010-07-13 09:07:26 UTC (rev 23382)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java 2010-07-13 13:16:31 UTC (rev 23383)
@@ -5,6 +5,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.test.WidgetVariables;
public class JBIDE3148and4441Test extends JSFAutoTestCase{
@@ -26,9 +27,9 @@
bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$ //$NON-NLS-2$
} catch (WidgetNotFoundException e) {
tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select(); //$NON-NLS-1$
- bot.menu("File").menu("New").menu("CSS File").click(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ open.newObject(ActionItem.NewObject.WebCSS.LABEL);
bot.shell("New CSS File").activate(); //$NON-NLS-1$
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.textWithLabel("File name:").setText(CSS_FILE_NAME); //$NON-NLS-1$
bot.button("Finish").click(); //$NON-NLS-1$
}
SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
@@ -71,7 +72,7 @@
"background-color: red;", //$NON-NLS-1$
"font-weight: lighter;", //$NON-NLS-1$
"text-decoration: overline", //$NON-NLS-1$
- "}")); //$NON-NLS-1$
+ "}@CHARSET \"UTF-8\";")); //$NON-NLS-1$
bot.editorByTitle(CSS_FILE_NAME+".css").close(); //$NON-NLS-1$
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java 2010-07-13 09:07:26 UTC (rev 23382)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java 2010-07-13 13:16:31 UTC (rev 23383)
@@ -5,6 +5,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.test.WidgetVariables;
public class JBIDE3577Test extends JSFAutoTestCase{
@@ -26,9 +27,9 @@
bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$//$NON-NLS-2$
} catch (WidgetNotFoundException e) {
tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select(); //$NON-NLS-1$
- bot.menu("File").menu("New").menu("CSS File").click(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ open.newObject(ActionItem.NewObject.WebCSS.LABEL);
bot.shell("New CSS File").activate(); //$NON-NLS-1$
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.textWithLabel("File name:").setText(CSS_FILE_NAME); //$NON-NLS-1$
bot.button("Finish").click(); //$NON-NLS-1$
}
SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
@@ -46,7 +47,7 @@
bot.button("Clear").click(); //$NON-NLS-1$
bot.button("Apply").click(); //$NON-NLS-1$
bot.button("OK").click(); //$NON-NLS-1$
- assertEquals("cssclass{\r\t\r}", bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("cssclass{\r\t\r}@CHARSET \"UTF-8\";\n}", bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText()); //$NON-NLS-1$ //$NON-NLS-2$
bot.editorByTitle(CSS_FILE_NAME+".css").close(); //$NON-NLS-1$
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java 2010-07-13 09:07:26 UTC (rev 23382)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java 2010-07-13 13:16:31 UTC (rev 23383)
@@ -5,6 +5,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.test.WidgetVariables;
public class JBIDE3579Test extends JSFAutoTestCase{
@@ -26,9 +27,9 @@
bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$ //$NON-NLS-2$
} catch (WidgetNotFoundException e) {
tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select(); //$NON-NLS-1$
- bot.menu("File").menu("New").menu("CSS File").click(); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ open.newObject(ActionItem.NewObject.WebCSS.LABEL); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
bot.shell("New CSS File").activate(); //$NON-NLS-1$
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.textWithLabel("File name:").setText(CSS_FILE_NAME); //$NON-NLS-1$
bot.button("Finish").click(); //$NON-NLS-1$
}
SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java 2010-07-13 09:07:26 UTC (rev 23382)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java 2010-07-13 13:16:31 UTC (rev 23383)
@@ -5,6 +5,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.test.WidgetVariables;
public class JBIDE3920Test extends JSFAutoTestCase{
@@ -23,9 +24,9 @@
bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$ //$NON-NLS-2$
} catch (WidgetNotFoundException e) {
tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select(); //$NON-NLS-1$
- bot.menu("File").menu("New").menu("CSS File").click(); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ open.newObject(ActionItem.NewObject.WebCSS.LABEL); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
bot.shell("New CSS File").activate(); //$NON-NLS-1$
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.textWithLabel("File name:").setText(CSS_FILE_NAME); //$NON-NLS-1$
bot.button("Finish").click(); //$NON-NLS-1$
}
SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java 2010-07-13 09:07:26 UTC (rev 23382)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java 2010-07-13 13:16:31 UTC (rev 23383)
@@ -5,6 +5,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.test.WidgetVariables;
public class JBIDE4391Test extends JSFAutoTestCase{
@@ -26,9 +27,9 @@
bot.menu("Edit").menu("Delete").click(); //$NON-NLS-1$ //$NON-NLS-2$
} catch (WidgetNotFoundException e) {
tree.getTreeItem(projectProperties.getProperty("JSFProjectName")).select(); //$NON-NLS-1$
- bot.menu("File").menu("New").menu("CSS File").click(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ open.newObject(ActionItem.NewObject.WebCSS.LABEL);; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
bot.shell("New CSS File").activate(); //$NON-NLS-1$
- bot.textWithLabel("Name*").setText(CSS_FILE_NAME); //$NON-NLS-1$
+ bot.textWithLabel("File name:").setText(CSS_FILE_NAME); //$NON-NLS-1$
bot.button("Finish").click(); //$NON-NLS-1$
}
SWTBotEclipseEditor eclipseEditor = bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor(); //$NON-NLS-1$
@@ -47,7 +48,7 @@
bot.comboBoxWithLabel("Font Weight:").setSelection("bold"); //$NON-NLS-1$ //$NON-NLS-2$
bot.button("Cancel").click(); //$NON-NLS-1$
assertEquals("cssclass{\r\tcolor:red;\r\t" + //$NON-NLS-1$
- "background-color:green;\r}", bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText()); //$NON-NLS-1$ //$NON-NLS-2$
+ "background-color:green;\r}@CHARSET \"UTF-8\";", bot.editorByTitle(CSS_FILE_NAME+".css").toTextEditor().getText()); //$NON-NLS-1$ //$NON-NLS-2$
bot.editorByTitle(CSS_FILE_NAME+".css").close(); //$NON-NLS-1$
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AbstractRefactorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AbstractRefactorTest.java 2010-07-13 09:07:26 UTC (rev 23382)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AbstractRefactorTest.java 2010-07-13 13:16:31 UTC (rev 23383)
@@ -46,9 +46,9 @@
bot.menu("File").menu("New").menu("Other...").click(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
bot.shell("New").activate(); //$NON-NLS-1$
tree = bot.tree();
- tree.expandNode("JBoss Tools Web").select("XHTML File"); //$NON-NLS-1$ //$NON-NLS-2$
+ tree.expandNode("JBoss Tools Web").select("XHTML Page"); //$NON-NLS-1$ //$NON-NLS-2$
bot.button("Next >").click(); //$NON-NLS-1$
- bot.textWithLabel("Name*").setText("echo"); //$NON-NLS-1$ //$NON-NLS-2$
+ bot.textWithLabel("File name:").setText("echo"); //$NON-NLS-1$ //$NON-NLS-2$
bot.button("Finish").click(); //$NON-NLS-1$
bot.sleep(2000);
SWTBotEclipseEditor editor = bot
@@ -74,9 +74,9 @@
bot.menu("File").menu("New").menu("Other...").click(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
bot.shell("New").activate(); //$NON-NLS-1$
tree = bot.tree();
- tree.expandNode("JBoss Tools Web").select("XHTML File"); //$NON-NLS-1$ //$NON-NLS-2$
+ tree.expandNode("JBoss Tools Web").select("XHTML Page"); //$NON-NLS-1$ //$NON-NLS-2$
bot.button("Next >").click(); //$NON-NLS-1$
- bot.textWithLabel("Name*").setText(JSF2_Test_Page_Name); //$NON-NLS-1$
+ bot.textWithLabel("File name:").setText(JSF2_Test_Page_Name); //$NON-NLS-1$
bot.button("Finish").click(); //$NON-NLS-1$
}
SWTBotEclipseEditor editor = bot.editorByTitle(
15 years, 9 months
JBoss Tools SVN: r23382 - in trunk/hibernatetools/plugins: org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-07-13 05:07:26 -0400 (Tue, 13 Jul 2010)
New Revision: 23382
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceUnitPropertiesBuilder.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernatePersistenceUnitProperties.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceXmlContextNodeFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlContextNodeFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlDefinition.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/plugin.xml
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpa2_0PlatformUiProvider.java
Log:
https://jira.jboss.org/browse/JBIDE-6473
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2010-07-13 09:07:26 UTC (rev 23382)
@@ -31,7 +31,7 @@
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernatePersistenceUnitProperties;
-import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceXmlContextNodeFactory;
+import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceUnitPropertiesBuilder;
/**
* @author Dmitry Geraskov
@@ -52,14 +52,10 @@
}
@Override
- public HibernatePersistenceXmlContextNodeFactory getContextNodeFactory() {
- return (HibernatePersistenceXmlContextNodeFactory) super.getContextNodeFactory();
- }
-
- @Override
protected void initializeProperties() {
super.initializeProperties();
- this.hibernateProperties = this.getContextNodeFactory().buildHibernatePersistenceUnitProperties(this);
+ this.hibernateProperties = ((HibernatePersistenceUnitPropertiesBuilder)this.getContextNodeFactory())
+ .buildHibernatePersistenceUnitProperties(this);
}
@Override
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernatePersistenceUnitProperties.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernatePersistenceUnitProperties.java 2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernatePersistenceUnitProperties.java 2010-07-13 09:07:26 UTC (rev 23382)
@@ -82,21 +82,21 @@
}
public void propertyRemoved(String propertyName) {
- if (propertyName.equals(CONFIG_FILE_PROPERTY)) {
+ if (propertyName.equals(HIBERNATE_CONFIG_FILE)) {
this.configurationFileChanged(null);
- } else if (propertyName.equals(DIALECT_PROPERTY)) {
+ } else if (propertyName.equals(HIBERNATE_DIALECT)) {
this.dialectChanged(null);
- } else if (propertyName.equals(DRIVER_PROPERTY)) {
+ } else if (propertyName.equals(HIBERNATE_DRIVER)) {
this.driverChanged(null);
- } else if (propertyName.equals(URL_PROPERTY)) {
+ } else if (propertyName.equals(HIBERNATE_URL)) {
this.urlChanged(null);
- } else if (propertyName.equals(SCHEMA_DEFAULT_PROPERTY)) {
+ } else if (propertyName.equals(HIBERNATE_SCHEMA_DEFAULT)) {
this.schemaDefaultChanged(null);
- } else if (propertyName.equals(CATALOG_DEFAULT_PROPERTY)) {
+ } else if (propertyName.equals(HIBERNATE_CATALOG)) {
this.catalogDefaultChanged(null);
- } else if (propertyName.equals(USERNAME_PROPERTY)) {
+ } else if (propertyName.equals(HIBERNATE_USERNAME)) {
this.usernameChanged(null);
- } else if (propertyName.equals(PASSWORD_PROPERTY)) {
+ } else if (propertyName.equals(HIBERNATE_PASSWORD)) {
this.passwordChanged(null);
}
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceUnitPropertiesBuilder.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceUnitPropertiesBuilder.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceUnitPropertiesBuilder.java 2010-07-13 09:07:26 UTC (rev 23382)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context.persistence;
+
+import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernatePersistenceUnitProperties;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface HibernatePersistenceUnitPropertiesBuilder {
+
+ public HibernatePersistenceUnitProperties buildHibernatePersistenceUnitProperties(PersistenceUnit parent);
+
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceXmlContextNodeFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceXmlContextNodeFactory.java 2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceXmlContextNodeFactory.java 2010-07-13 09:07:26 UTC (rev 23382)
@@ -22,7 +22,7 @@
*
*/
public class HibernatePersistenceXmlContextNodeFactory extends
- GenericPersistenceXmlContextNodeFactory {
+ GenericPersistenceXmlContextNodeFactory implements HibernatePersistenceUnitPropertiesBuilder {
public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
return new HibernatePersistenceUnit(parent, xmlPersistenceUnit);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlContextNodeFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlContextNodeFactory.java 2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlContextNodeFactory.java 2010-07-13 09:07:26 UTC (rev 23382)
@@ -12,17 +12,18 @@
import org.eclipse.jpt.core.context.persistence.Persistence;
import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistenceXmlContextNodeFactory;
+import org.eclipse.jpt.core.internal.jpa2.context.persistence.Generic2_0PersistenceXmlContextNodeFactory;
import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernatePersistenceUnitProperties;
+import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceUnitPropertiesBuilder;
/**
* @author Dmitry Geraskov
*
*/
public class Hibernate2_0PersistenceXmlContextNodeFactory extends
- GenericPersistenceXmlContextNodeFactory {
+ Generic2_0PersistenceXmlContextNodeFactory implements HibernatePersistenceUnitPropertiesBuilder {
public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
return new HibernatePersistenceUnit(parent, xmlPersistenceUnit);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlDefinition.java 2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlDefinition.java 2010-07-13 09:07:26 UTC (rev 23382)
@@ -56,7 +56,7 @@
}
public JpaResourceType getResourceType() {
- return JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
+ return JptCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java 2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java 2010-07-13 09:07:26 UTC (rev 23382)
@@ -36,7 +36,9 @@
import org.eclipse.jpt.core.internal.context.java.JavaOneToOneMappingDefinition;
import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingDefinition;
import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.context.orm.HibernateOrmXmlDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.context.orm.jpa2.HibernateOrmXml2_0Definition;
+import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceXmlDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.jpa2.Hibernate2_0PersistenceXmlDefinition;
/**
@@ -143,7 +145,9 @@
@Override
protected ResourceDefinition[] buildResourceDefinitions() {
return new ResourceDefinition[] {
+ HibernatePersistenceXmlDefinition.instance(),
Hibernate2_0PersistenceXmlDefinition.instance(),
+ HibernateOrmXmlDefinition.instance(),
HibernateOrmXml2_0Definition.instance()};
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/plugin.xml 2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/plugin.xml 2010-07-13 09:07:26 UTC (rev 23382)
@@ -14,7 +14,7 @@
id="org.jboss.tools.hibernate2_0.jpt"
point="org.eclipse.jpt.ui.jpaPlatformUis">
<jpaPlatformUi
- factoryClass="org.jboss.tools.hibernate.jpt.ui.internal.platform.HibernateJpaPlatformUiFactory"
+ factoryClass="org.jboss.tools.hibernate.jpt.ui.internal.platform.HibernateJpa2_0PlatformUiFactory"
jpaPlatform="hibernate2_0"
id="hibernate2_0">
</jpaPlatformUi>
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpa2_0PlatformUiProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpa2_0PlatformUiProvider.java 2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpa2_0PlatformUiProvider.java 2010-07-13 09:07:26 UTC (rev 23382)
@@ -12,7 +12,6 @@
import java.util.List;
-import org.eclipse.jpt.ui.JpaPlatformUi;
import org.eclipse.jpt.ui.JpaPlatformUiProvider;
import org.eclipse.jpt.ui.ResourceUiDefinition;
import org.eclipse.jpt.ui.details.JpaDetailsProvider;
@@ -23,13 +22,11 @@
import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
import org.eclipse.jpt.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.ui.internal.platform.generic.GenericNavigatorProvider;
import org.jboss.tools.hibernate.jpt.ui.internal.jpa2.mapping.details.orm.Hibernate2_0OrmXmlUiDefinition;
import org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.java.Hibernate2_0JavaResourceUiDefinition;
import org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.orm.HibernateOrmXmlUiDefinition;
import org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.HibernatePersistenceXmlUiDefinition;
import org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.jpa2.HibernatePersistenceXml2_0UiDefinition;
-import org.jboss.tools.hibernate.jpt.ui.internal.platform.HibernateJpaPlatformUi;
/**
* @author Dmitry Geraskov
@@ -55,11 +52,6 @@
super();
}
- public JpaPlatformUi buildJpaPlatformUi() {
- return new HibernateJpaPlatformUi(new GenericNavigatorProvider(),
- HibernateJpa2_0PlatformUiProvider.instance());
- }
-
// ********** details providers **********
@Override
15 years, 9 months
JBoss Tools SVN: r23381 - in branches/smooks-dmb: tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-07-13 03:32:12 -0400 (Tue, 13 Jul 2010)
New Revision: 23381
Added:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/CompositeCommand.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/ISmooksCommandStackChangeListener.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SmooksCommandStackEvent.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/UnSetCommand.java
branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/CommandTest.java
Removed:
branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java
Modified:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/AddCommand.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/Command.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/ICommand.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/RemoveCommand.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SetCommand.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SmooksCommandStack.java
Log:
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/AddCommand.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/AddCommand.java 2010-07-13 06:46:00 UTC (rev 23380)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/AddCommand.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -25,6 +25,7 @@
@Override
public void execute() {
+ if(!canExecute()) return;
try {
Object v = getPropertyValue();
if(!(v instanceof Collection)){
@@ -38,13 +39,13 @@
}
@Override
- public boolean canExecute() {
- return ( host!=null && value!=null && !added && propertyName != null);
+ public String getCommandLabel() {
+ return "AddCommand";
}
@Override
- public boolean canRedo() {
- return super.canRedo();
+ public boolean canExecute() {
+ return ( host!=null && value!=null && !added && propertyName != null);
}
@Override
@@ -54,6 +55,7 @@
@Override
public void undo() {
+ if(!canUndo()) return;
try {
Object v = getPropertyValue();
if(!(v instanceof Collection)){
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/Command.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/Command.java 2010-07-13 06:46:00 UTC (rev 23380)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/Command.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -13,30 +13,29 @@
*
*/
public class Command implements ICommand {
-
+
protected Object host;
protected String propertyName;
-
+
protected Object value;
-
+
protected Object oldValue;
-
- protected boolean execued = false;
-
- protected boolean redoed = false;
-
- protected boolean undoed = false;
-
- public Command(){
-
+
+
+ public Command() {
+
}
-
- public Command(Object host , Object value , String propertyName ){
+
+ public Command(Object host, Object value, String propertyName) {
this.host = host;
this.propertyName = propertyName;
this.value = value;
}
+
+ public String getCommandLabel(){
+ return null;
+ }
public Object getValue() {
return value;
@@ -62,20 +61,31 @@
this.propertyName = propertyName;
}
-
- protected Object getPropertyValue() throws IllegalAccessException, InvocationTargetException, NoSuchMethodException{
+ protected Object getPropertyValue() throws IllegalAccessException,
+ InvocationTargetException, NoSuchMethodException {
return PropertyUtils.getProperty(host, propertyName);
}
-
- protected Method getSetterMethod() throws SecurityException, NoSuchMethodException{
+
+ protected Method getSetterMethod() throws SecurityException,
+ NoSuchMethodException {
char sc = propertyName.toCharArray()[0];
- String us = new String(new char[]{sc});
+ String us = new String(new char[] { sc });
us = us.toUpperCase();
String n = propertyName.substring(1);
- n = ("set" +us + n);
- return host.getClass().getMethod(n, value.getClass());
+ n = ("set" + us + n);
+ if (value != null) {
+ return host.getClass().getMethod(n, value.getClass());
+ }else{
+ Method[] ms = host.getClass().getMethods();
+ for (int i = 0; i < ms.length; i++) {
+ Method m = ms[i];
+ if(m.getName().equals(n)){
+ return m;
+ }
+ }
+ }
+ return null;
}
-
/*
* (non-Javadoc)
@@ -83,12 +93,12 @@
* @see org.jboss.tools.smooks.model.command.ICommand#execute()
*/
public void execute() {
-// if(!canExecute()) return;
+ // if(!canExecute()) return;
try {
oldValue = getPropertyValue();
} catch (Exception e) {
e.printStackTrace();
- }
+ }
}
/*
@@ -97,7 +107,7 @@
* @see org.jboss.tools.smooks.model.command.ICommand#canExecute()
*/
public boolean canExecute() {
- return ( host!=null && value!=null && !execued && propertyName != null);
+ return true;
}
/*
@@ -106,7 +116,7 @@
* @see org.jboss.tools.smooks.model.command.ICommand#canRedo()
*/
public boolean canRedo() {
- return ( host!=null && value!=null && execued && propertyName != null);
+ return true;
}
/*
@@ -115,7 +125,7 @@
* @see org.jboss.tools.smooks.model.command.ICommand#canUndo()
*/
public boolean canUndo() {
- return ( host!=null && execued && propertyName != null);
+ return true;
}
/*
@@ -133,12 +143,15 @@
* @see org.jboss.tools.smooks.model.command.ICommand#undo()
*/
public void undo() {
-// if(!canUndo()) return;
+ // if(!canUndo()) return;
try {
value = getPropertyValue();
} catch (Exception e) {
e.printStackTrace();
- }
+ }
}
+ public void dispose() {
+ }
+
}
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/CompositeCommand.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/CompositeCommand.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/CompositeCommand.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -0,0 +1,116 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.model.command;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author Dart
+ *
+ */
+public class CompositeCommand extends Command {
+
+ private List<ICommand> commandList = null;
+
+
+ public List<ICommand> getCommandList() {
+ if(commandList == null) commandList = new ArrayList<ICommand>();
+ return commandList;
+ }
+
+ public void appendCommand(ICommand command){
+ getCommandList().add(command);
+ }
+
+ public void removeCommand(ICommand command){
+ getCommandList().remove(command);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.model.command.ICommand#execute()
+ */
+ public void execute() {
+ List<ICommand> l = getCommandList();
+ for (Iterator<?> iterator = l.iterator(); iterator.hasNext();) {
+ ICommand iCommand = (ICommand) iterator.next();
+ iCommand.execute();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.model.command.ICommand#canExecute()
+ */
+ public boolean canExecute() {
+ List<ICommand> l = getCommandList();
+ for (Iterator<?> iterator = l.iterator(); iterator.hasNext();) {
+ ICommand iCommand = (ICommand) iterator.next();
+ if(!iCommand.canExecute()) return false;
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.model.command.ICommand#canRedo()
+ */
+ public boolean canRedo() {
+ List<ICommand> l = getCommandList();
+ for (Iterator<?> iterator = l.iterator(); iterator.hasNext();) {
+ ICommand iCommand = (ICommand) iterator.next();
+ if(!iCommand.canRedo()) return false;
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.model.command.ICommand#canUndo()
+ */
+ public boolean canUndo() {
+ List<ICommand> l = getCommandList();
+ for (Iterator<?> iterator = l.iterator(); iterator.hasNext();) {
+ ICommand iCommand = (ICommand) iterator.next();
+ if(!iCommand.canUndo()) return false;
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.model.command.ICommand#redo()
+ */
+ public void redo() {
+ List<ICommand> l = getCommandList();
+ for (Iterator<?> iterator = l.iterator(); iterator.hasNext();) {
+ ICommand iCommand = (ICommand) iterator.next();
+ iCommand.redo();
+ }
+
+ }
+
+ @Override
+ public String getCommandLabel() {
+ return "CompositeCommand";
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.model.command.ICommand#undo()
+ */
+ public void undo() {
+ List<ICommand> l = getCommandList();
+ for (Iterator<?> iterator = l.iterator(); iterator.hasNext();) {
+ ICommand iCommand = (ICommand) iterator.next();
+ iCommand.undo();
+ }
+
+ }
+
+ public void dispose() {
+ List<ICommand> l = getCommandList();
+ for (Iterator<?> iterator = l.iterator(); iterator.hasNext();) {
+ ICommand iCommand = (ICommand) iterator.next();
+ iCommand.dispose();
+ }
+ }
+
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/CompositeCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/ICommand.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/ICommand.java 2010-07-13 06:46:00 UTC (rev 23380)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/ICommand.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -12,4 +12,8 @@
void redo();
void undo();
+
+ void dispose();
+
+ String getCommandLabel();
}
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/ISmooksCommandStackChangeListener.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/ISmooksCommandStackChangeListener.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/ISmooksCommandStackChangeListener.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -0,0 +1,14 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.model.command;
+
+/**
+ * @author Dart
+ *
+ */
+public interface ISmooksCommandStackChangeListener {
+
+ void stackChanged(SmooksCommandStackEvent event);
+
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/ISmooksCommandStackChangeListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/RemoveCommand.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/RemoveCommand.java 2010-07-13 06:46:00 UTC (rev 23380)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/RemoveCommand.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -3,11 +3,15 @@
*/
package org.jboss.tools.smooks.model.command;
+import java.util.Collection;
+
/**
* @author Dart
*
*/
public class RemoveCommand extends Command {
+
+ private boolean removed=false;
public RemoveCommand() {
super();
@@ -19,4 +23,54 @@
// TODO Auto-generated constructor stub
}
+ @Override
+ public void execute() {
+ if(!canExecute()) return;
+ try {
+ Object v = getPropertyValue();
+ if(!(v instanceof Collection)){
+ throw new RuntimeException("Value's type isn't Collection , please check the " + "'" + propertyName + "'");
+ }
+ ((Collection<?>)v).remove(value);
+ removed = true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ @Override
+ public boolean canExecute() {
+ return (host != null && !removed && propertyName != null);
+ }
+
+ @Override
+ public boolean canRedo() {
+ return canExecute();
+ }
+
+ @Override
+ public boolean canUndo() {
+ return (host != null && removed && propertyName != null);
+ }
+
+ public void undo() {
+ if(!canUndo()) return;
+ try {
+ Object v = getPropertyValue();
+ if(!(v instanceof Collection)){
+ throw new RuntimeException("Value's type isn't Collection , please check the " + "'" + propertyName + "'");
+ }
+ ((Collection)v).add(value);
+ removed = false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public String getCommandLabel() {
+ return "RemoveCommand";
+ }
}
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SetCommand.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SetCommand.java 2010-07-13 06:46:00 UTC (rev 23380)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SetCommand.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -11,6 +11,8 @@
*/
public class SetCommand extends Command {
+ private boolean executed = false;
+
public SetCommand() {
super();
// TODO Auto-generated constructor stub
@@ -30,6 +32,7 @@
@Override
public void execute() {
+ if(!canExecute()) return;
super.execute();
try {
Method setter = getSetterMethod();
@@ -37,14 +40,30 @@
// PropertyDescriptor pd = PropertyUtils.getPropertyDescriptor(host, propertyName);
// pd.getWriteMethod().invoke(host, value);
value = null;
- execued = true;
+ executed = true;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
+ public boolean canExecute() {
+ return (host != null && !executed && propertyName != null);
+ }
+
+ @Override
+ public boolean canRedo() {
+ return super.canExecute();
+ }
+
+ @Override
+ public boolean canUndo() {
+ return (host != null && executed && propertyName != null);
+ }
+
+ @Override
public void undo() {
+ if(!canUndo()) return;
super.undo();
try {
Method setter = getSetterMethod();
@@ -52,8 +71,13 @@
// PropertyDescriptor pd = PropertyUtils.getPropertyDescriptor(host, propertyName);
// pd.setValue(propertyName, oldValue);
oldValue = null;
+ executed = false;
} catch (Exception e) {
e.printStackTrace();
}
}
+ @Override
+ public String getCommandLabel() {
+ return "SetCommand";
+ }
}
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SmooksCommandStack.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SmooksCommandStack.java 2010-07-13 06:46:00 UTC (rev 23380)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SmooksCommandStack.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -4,62 +4,331 @@
package org.jboss.tools.smooks.model.command;
import java.util.ArrayList;
+import java.util.EventObject;
import java.util.List;
import java.util.Properties;
+import java.util.Stack;
/**
* @author Dart
*
*/
public class SmooksCommandStack {
- private List<ICommand> executedCommands = null;
+ /**
+ * Constant indicating notification after a command has been executed (value
+ * is 8).
+ */
+ public static final int POST_EXECUTE = 8;
+ /**
+ * Constant indicating notification after a command has been redone (value
+ * is 16).
+ */
+ public static final int POST_REDO = 16;
+ /**
+ * Constant indicating notification after a command has been undone (value
+ * is 32).
+ */
+ public static final int POST_UNDO = 32;
+
+ /**
+ * A bit-mask indicating notification after a command has done something.
+ * Currently this includes after a command has been undone, redone, or
+ * executed. This will include new events should they be introduced in the
+ * future.
+ * <P>
+ * Usage<BR/>
+ *
+ * <PRE>
+ * if ((commandStackEvent.getDetail() & CommandStack.POST_MASK) != 0) {
+ * // Do something, like:
+ * stopBatchingChanges();
+ * }
+ * </PRE>
+ */
+ public static final int POST_MASK = new Integer(POST_EXECUTE | POST_UNDO
+ | POST_REDO).intValue();
+
+ /**
+ * Constant indicating notification prior to executing a command (value is
+ * 1).
+ */
+ public static final int PRE_EXECUTE = 1;
+
+ /**
+ * Constant indicating notification prior to redoing a command (value is 2).
+ */
+ public static final int PRE_REDO = 2;
+
+ /**
+ * Constant indicating notification prior to undoing a command (value is 4).
+ */
+ public static final int PRE_UNDO = 4;
+
+ /**
+ * A bit-mask indicating notification before a command makes a change.
+ * Currently this includes before a command has been undone, redone, or
+ * executed. This will include new events should they be introduced in the
+ * future.
+ * <P>
+ * Usage<BR/>
+ *
+ * <PRE>
+ * if ((commandStackEvent.getDetail() & CommandStack.PRE_MASK) != 0) {
+ * // Do something, like:
+ * startBatchingChanges();
+ * }
+ * </PRE>
+ */
+ static final int PRE_MASK = new Integer(PRE_EXECUTE | PRE_UNDO | PRE_REDO)
+ .intValue();
+
+ private List<ISmooksCommandStackChangeListener> eventListeners = new ArrayList<ISmooksCommandStackChangeListener>();
+
+
+ private Stack<ICommand> redoable = new Stack<ICommand>();
+
+ private int saveLocation = 0;
+
+ private Stack<ICommand> undoable = new Stack<ICommand>();
+
+ private int undoLimit = 0;
+
+ /**
+ * Constructs a new command stack. By default, there is no undo limit, and
+ * isDirty() will return <code>false</code>.
+ */
+ public SmooksCommandStack() {
+ }
+
+ /**
+ * Appends the listener to the list of command stack listeners. Multiple
+ * adds result in multiple notifications.
+ *
+ * @since 3.1
+ * @param listener
+ * the event listener
+ */
+ public void addCommandStackEventListener(ISmooksCommandStackChangeListener listener) {
+ eventListeners.add(listener);
+ }
+
- private List<ICommand> undoedCommands = null;
-
- private ICommand currentExecuteCommand = null;
- public List<ICommand> getExecutedCommands() {
-
- if(executedCommands == null){
- executedCommands = new ArrayList<ICommand>();
+ /**
+ * @return <code>true</code> if it is appropriate to call {@link #redo()}.
+ */
+ public boolean canRedo() {
+ return !redoable.isEmpty();
+ }
+
+ /**
+ * @return <code>true</code> if {@link #undo()} can be called
+ */
+ public boolean canUndo() {
+ if (undoable.size() == 0)
+ return false;
+ return ((Command) undoable.lastElement()).canUndo();
+ }
+
+ /**
+ * This will <code>dispose()</code> all the commands in both the undo and
+ * redo stack. Both stacks will be empty afterwards.
+ */
+ public void dispose() {
+ flushUndo();
+ flushRedo();
+ }
+
+ /**
+ * Executes the specified Command if possible. Prior to executing the
+ * command, a CommandStackEvent for {@link #PRE_EXECUTE} will be fired to
+ * event listeners. Similarly, after attempting to execute the command, an
+ * event for {@link #POST_EXECUTE} will be fired. If the execution of the
+ * command completely normally, stack listeners will receive
+ * {@link CommandStackListener#commandStackChanged(EventObject)
+ * stackChanged} notification.
+ * <P>
+ * If the command is <code>null</code> or cannot be executed, nothing
+ * happens.
+ *
+ * @param command
+ * the Command to execute
+ * @see CommandStackEventListener
+ */
+ public void execute(ICommand command) {
+ if (command == null || !command.canExecute())
+ return;
+ flushRedo();
+ notifyListeners(command, PRE_EXECUTE);
+ try {
+ command.execute();
+ if (getUndoLimit() > 0) {
+ while (undoable.size() >= getUndoLimit()) {
+ ((ICommand) undoable.remove(0)).dispose();
+ if (saveLocation > -1)
+ saveLocation--;
+ }
+ }
+ if (saveLocation > undoable.size())
+ saveLocation = -1; // The save point was somewhere in the redo
+ // stack
+ undoable.push(command);
+ } finally {
+ notifyListeners(command, POST_EXECUTE);
}
- return executedCommands;
}
-
-
- public List<ICommand> getUndoedCommands() {
- if(undoedCommands == null){
- undoedCommands = new ArrayList<ICommand>();
+
+ /**
+ * Flushes the entire stack and resets the save location to zero. This
+ * method might be called when performing "revert to saved".
+ */
+ public void flush() {
+ flushRedo();
+ flushUndo();
+ saveLocation = 0;
+ }
+
+ private void flushRedo() {
+ while (!redoable.isEmpty())
+ ((Command) redoable.pop()).dispose();
+ }
+
+ private void flushUndo() {
+ while (!undoable.isEmpty())
+ ((Command) undoable.pop()).dispose();
+ }
+
+ /**
+ * @return an array containing all commands in the order they were executed
+ */
+ public Object[] getCommands() {
+ List<ICommand> commands = new ArrayList<ICommand>(undoable);
+ for (int i = redoable.size() - 1; i >= 0; i--) {
+ commands.add(redoable.get(i));
}
- return undoedCommands;
+ return commands.toArray();
}
+ /**
+ * Peeks at the top of the <i>redo</i> stack. This is useful for describing
+ * to the User what will be redone. The returned <code>Command</code> has a
+ * label describing it.
+ *
+ * @return the top of the <i>redo</i> stack, which may be <code>null</code>
+ */
+ public Command getRedoCommand() {
+ return redoable.isEmpty() ? null : (Command) redoable.peek();
+ }
- public void execute(ICommand c){
- c.execute();
- addExecutedCommand(c);
+ /**
+ * Peeks at the top of the <i>undo</i> stack. This is useful for describing
+ * to the User what will be undone. The returned <code>Command</code> has a
+ * label describing it.
+ *
+ * @return the top of the <i>undo</i> stack, which may be <code>null</code>
+ */
+ public Command getUndoCommand() {
+ return undoable.isEmpty() ? null : (Command) undoable.peek();
}
-
- public void undo(){
- if(getExecutedCommands().size() > 0){
-
+
+ /**
+ * Returns the undo limit. The undo limit is the maximum number of atomic
+ * operations that the User can undo. <code>-1</code> is used to indicate no
+ * limit.
+ *
+ * @return the undo limit
+ */
+ public int getUndoLimit() {
+ return undoLimit;
+ }
+
+ /**
+ * Returns true if the stack is dirty. The stack is dirty whenever the last
+ * executed or redone command is different than the command that was at the
+ * top of the undo stack when {@link #markSaveLocation()} was last called.
+ *
+ * @return <code>true</code> if the stack is dirty
+ */
+ public boolean isDirty() {
+ return undoable.size() != saveLocation;
+ }
+
+
+ /**
+ * Notifies command stack event listeners that the command stack has changed
+ * to the specified state.
+ *
+ * @param command
+ * the command
+ * @param state
+ * the current stack state
+ * @since 3.2
+ */
+ protected void notifyListeners(ICommand command, int state) {
+ SmooksCommandStackEvent event = new SmooksCommandStackEvent(this, command, state);
+ for (int i = 0; i < eventListeners.size(); i++)
+ ((ISmooksCommandStackChangeListener) eventListeners.get(i))
+ .stackChanged(event);
+ }
+
+ /**
+ * Calls redo on the Command at the top of the <i>redo</i> stack, and pushes
+ * that Command onto the <i>undo</i> stack. This method should only be
+ * called when {@link #canUndo()} returns <code>true</code>.
+ */
+ public void redo() {
+ // Assert.isTrue(canRedo())
+ if (!canRedo())
+ return;
+ Command command = (Command) redoable.pop();
+ notifyListeners(command, PRE_REDO);
+ try {
+ command.redo();
+ undoable.push(command);
+ } finally {
+ notifyListeners(command, POST_REDO);
}
}
-
- public void addExecutedCommand(ICommand c){
- getExecutedCommands().add(c);
+
+ /**
+ * Removes the first occurrence of the specified listener.
+ *
+ * @param listener
+ * the listener
+ */
+ public void removeCommandStackEventListener(
+ ISmooksCommandStackChangeListener listener) {
+ eventListeners.remove(listener);
}
+
- public void removeCommand(ICommand c){
- getExecutedCommands().remove(c);
+
+ /**
+ * Sets the undo limit. The undo limit is the maximum number of atomic
+ * operations that the User can undo. <code>-1</code> is used to indicate no
+ * limit.
+ *
+ * @param undoLimit
+ * the undo limit
+ */
+ public void setUndoLimit(int undoLimit) {
+ this.undoLimit = undoLimit;
}
-
-// public boolean isDirty(){
-//
-// }
-
- public void cleanStack(){
- getExecutedCommands().clear();
- currentExecuteCommand = null;
+
+ /**
+ * Undoes the most recently executed (or redone) Command. The Command is
+ * popped from the undo stack to and pushed onto the redo stack. This method
+ * should only be called when {@link #canUndo()} returns <code>true</code>.
+ */
+ public void undo() {
+ // Assert.isTrue(canUndo());
+ Command command = (Command) undoable.pop();
+ notifyListeners(command, PRE_UNDO);
+ try {
+ command.undo();
+ redoable.push(command);
+ } finally {
+ notifyListeners(command, POST_UNDO);
+ }
}
}
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SmooksCommandStackEvent.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SmooksCommandStackEvent.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SmooksCommandStackEvent.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -0,0 +1,58 @@
+package org.jboss.tools.smooks.model.command;
+
+import java.util.EventObject;
+
+public class SmooksCommandStackEvent extends EventObject {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2132661251732718650L;
+
+ private final ICommand command;
+ private final int detail;
+
+ public SmooksCommandStackEvent(SmooksCommandStack smooksCommandStack,
+ ICommand command, int state) {
+ super(smooksCommandStack);
+ this.command = command;
+ this.detail = state;
+ }
+
+
+ public ICommand getCommand() {
+ return command;
+ }
+
+ /**
+ * Returns <code>true</code> if this event is fired prior to the stack
+ * changing.
+ *
+ * @return <code>true</code> if pre-change event
+ * @since 3.2
+ */
+ public final boolean isPreChangeEvent() {
+ return 0 != (getDetail() & SmooksCommandStack.PRE_MASK);
+ }
+
+ /**
+ * Returns <code>true</code> if this event is fired after the stack having
+ * changed.
+ *
+ * @return <code>true</code> if post-change event
+ * @since 3.2
+ */
+ public final boolean isPostChangeEvent() {
+ return 0 != (getDetail() & SmooksCommandStack.POST_MASK);
+ }
+
+ /**
+ * Returns an integer identifying the type of event which has occurred.
+ *
+ * @since 3.1
+ * @return the detail of the event
+ */
+ public int getDetail() {
+ return detail;
+ }
+
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/SmooksCommandStackEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/UnSetCommand.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/UnSetCommand.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/UnSetCommand.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -0,0 +1,83 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.model.command;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author Dart
+ *
+ */
+public class UnSetCommand extends Command {
+
+ private boolean executed = false;
+
+ public UnSetCommand() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public UnSetCommand(Object host, String propertyName) {
+ super(host, null, propertyName);
+ // TODO Auto-generated constructor stub
+ }
+
+ public void execute(Object host , Object value , String propertyName){
+ this.host = host;
+ this.value = value;
+ this.propertyName = propertyName;
+ execute();
+ }
+
+ @Override
+ public boolean canExecute() {
+ return (host != null && !executed && propertyName != null);
+ }
+
+ @Override
+ public boolean canRedo() {
+ return super.canExecute();
+ }
+
+ @Override
+ public boolean canUndo() {
+ return (host != null && executed && propertyName != null);
+ }
+
+ @Override
+ public void execute() {
+ if(!canExecute()) return;
+ super.execute();
+ try {
+ Method setter = getSetterMethod();
+ setter.invoke(host, new Object[]{null});
+// PropertyDescriptor pd = PropertyUtils.getPropertyDescriptor(host, propertyName);
+// pd.getWriteMethod().invoke(host, value);
+ executed = true;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public String getCommandLabel() {
+ return "UnSetCommand";
+ }
+
+ @Override
+ public void undo() {
+ if(!canUndo()) return;
+ super.undo();
+ try {
+ Method setter = getSetterMethod();
+ setter.invoke(host, oldValue);
+// PropertyDescriptor pd = PropertyUtils.getPropertyDescriptor(host, propertyName);
+// pd.setValue(propertyName, oldValue);
+ executed = false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.model/src/org/jboss/tools/smooks/model/command/UnSetCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/CommandTest.java (from rev 23369, branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java)
===================================================================
--- branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/CommandTest.java (rev 0)
+++ branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/CommandTest.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -0,0 +1,213 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.model.command;
+
+import junit.framework.TestCase;
+
+import org.jboss.tools.smooks.model.csv.CSVReader;
+import org.jboss.tools.smooks.model.javabean.Bean;
+import org.jboss.tools.smooks.model.javabean.Wiring;
+import org.junit.Assert;
+
+/**
+ * @author Dart
+ *
+ */
+public class CommandTest extends TestCase {
+ public void testSetCommand() {
+ CSVReader reader = new CSVReader();
+
+ SetCommand command1 = new SetCommand(reader, "name,address,age", "fields");
+ SetCommand command2 = new SetCommand(reader, "people", "rootElementName");
+ SetCommand command3 = new SetCommand(reader, "person", "recordElementName");
+ SetCommand command4 = new SetCommand(reader, true, "indent");
+
+
+ command1.execute();
+ command2.execute();
+ command3.execute();
+ command4.execute();
+
+ Assert.assertSame(reader.getFields(), "name,address,age");
+ Assert.assertSame(reader.getRecordElementName(), "person");
+ Assert.assertSame(reader.getRootElementName(), "people");
+ Assert.assertSame(reader.getIndent(),true);
+
+
+
+ command1.undo();
+ command2.undo();
+ command3.undo();
+ command4.undo();
+
+ Assert.assertSame(reader.getFields(), null);
+ Assert.assertSame(reader.getRecordElementName(), null);
+ Assert.assertSame(reader.getRootElementName(),null);
+// Assert.assertSame(reader.getIndent(),true);
+
+ command1.redo();
+ command2.redo();
+ command3.redo();
+ command4.redo();
+
+ Assert.assertSame(reader.getFields(), "name,address,age");
+ Assert.assertSame(reader.getRecordElementName(), "person");
+ Assert.assertSame(reader.getRootElementName(), "people");
+ Assert.assertSame(reader.getIndent(),true);
+
+// reader.setFields("name,address,age");
+// reader.setRootElementName("people");
+// reader.setRecordElementName("person");
+// reader.setIndent(true);
+
+ }
+
+ public void testAddCommand(){
+ Bean people = new Bean();
+ Wiring w = new Wiring();
+
+ Assert.assertTrue(people.getWireBindings().isEmpty());
+
+ AddCommand c = new AddCommand(people, w, "wireBindings");
+
+ c.execute();
+
+ Assert.assertTrue(people.getWireBindings().get(0) == w);
+
+ c.undo();
+
+ Assert.assertTrue(people.getWireBindings().isEmpty());
+
+ c.redo();
+
+ Assert.assertTrue(people.getWireBindings().get(0) == w);
+ }
+
+ public void testRemoveCommand(){
+ Bean people = new Bean();
+ Wiring w = new Wiring();
+ AddCommand c = new AddCommand(people, w, "wireBindings");
+ c.execute();
+
+ Assert.assertTrue(people.getWireBindings().get(0) == w);
+ RemoveCommand rc = new RemoveCommand(people, w, "wireBindings");
+ rc.execute();
+ Assert.assertTrue(people.getWireBindings().isEmpty());
+
+ rc.undo();
+ Assert.assertTrue(people.getWireBindings().get(0) == w);
+
+ rc.redo();
+ Assert.assertTrue(people.getWireBindings().isEmpty());
+ }
+
+ public void testUnSetCommand(){
+ Bean people = new Bean();
+ SetCommand c1 = new SetCommand(people, "people", "beanId");
+ SetCommand c2 = new SetCommand(people, "java.util.ArrayList", "beanClass");
+
+ CompositeCommand cc = new CompositeCommand();
+ cc.appendCommand(c1);
+ cc.appendCommand(c2);
+ cc.execute();
+ Assert.assertTrue(people.getBeanId().equals("people"));
+ Assert.assertTrue(people.getBeanClass().equals("java.util.ArrayList"));
+
+ UnSetCommand us = new UnSetCommand(people, "beanId");
+ UnSetCommand us1 = new UnSetCommand(people, "beanClass");
+
+ us.execute();
+ us1.execute();
+ Assert.assertTrue(people.getBeanId() == null);
+ Assert.assertTrue(people.getBeanClass() == null);
+
+ us.undo();
+ us1.undo();
+ Assert.assertTrue(people.getBeanId().equals("people"));
+ Assert.assertTrue(people.getBeanClass().equals("java.util.ArrayList"));
+
+ us.redo();
+ us1.redo();
+ Assert.assertTrue(people.getBeanId() == null);
+ Assert.assertTrue(people.getBeanClass() == null);
+ }
+
+ public void testCompositeCommand(){
+ Bean people = new Bean();
+ Wiring w = new Wiring();
+ AddCommand c = new AddCommand(people, w, "wireBindings");
+ SetCommand c1 = new SetCommand(people, "people", "beanId");
+ SetCommand c2 = new SetCommand(people, "java.util.ArrayList", "beanClass");
+
+ CompositeCommand cc = new CompositeCommand();
+ cc.appendCommand(c);
+ cc.appendCommand(c1);
+ cc.appendCommand(c2);
+
+ cc.execute();
+ Assert.assertTrue(people.getWireBindings().get(0) == w);
+ Assert.assertTrue(people.getBeanId().equals("people"));
+ Assert.assertTrue(people.getBeanClass().equals("java.util.ArrayList"));
+
+ cc.undo();
+ Assert.assertTrue(people.getWireBindings().isEmpty());
+ Assert.assertTrue(people.getBeanId() == null);
+ Assert.assertTrue(people.getBeanClass() == null);
+
+ cc.redo();
+ Assert.assertTrue(people.getWireBindings().get(0) == w);
+ Assert.assertTrue(people.getBeanId().equals("people"));
+ Assert.assertTrue(people.getBeanClass().equals("java.util.ArrayList"));
+ }
+
+ public void testCommandStatck(){
+ SmooksCommandStack stack = new SmooksCommandStack();
+ ISmooksCommandStackChangeListener listener = new ISmooksCommandStackChangeListener() {
+
+ public void stackChanged(SmooksCommandStackEvent event) {
+ if(event.getDetail() == SmooksCommandStack.PRE_EXECUTE){
+ System.out.println("pre execute " + event.getCommand().getCommandLabel());
+ }
+ if(event.getDetail() == SmooksCommandStack.POST_EXECUTE){
+ System.out.println("post execute " + event.getCommand().getCommandLabel());
+ }
+ if(event.getDetail() == SmooksCommandStack.PRE_REDO){
+ System.out.println("pre redo " + event.getCommand().getCommandLabel());
+ }
+ if(event.getDetail() == SmooksCommandStack.POST_REDO){
+ System.out.println("post redo " + event.getCommand().getCommandLabel());
+ }
+ if(event.getDetail() == SmooksCommandStack.PRE_UNDO){
+ System.out.println("pre undo " + event.getCommand().getCommandLabel());
+ }
+ if(event.getDetail() == SmooksCommandStack.POST_UNDO){
+ System.out.println("post undo " + event.getCommand().getCommandLabel());
+ }
+ }
+ };
+
+ stack.addCommandStackEventListener(listener);
+
+ Bean people = new Bean();
+ Wiring w = new Wiring();
+
+ Assert.assertTrue(people.getWireBindings().isEmpty());
+
+ SetCommand c1 = new SetCommand(people, "people", "beanId");
+ AddCommand c = new AddCommand(people, w, "wireBindings");
+
+
+ Assert.assertTrue(!stack.canRedo()&&!stack.canUndo());
+ stack.execute(c);
+
+
+ Assert.assertTrue(people.getWireBindings().get(0) == w);
+ Assert.assertTrue(!stack.canRedo());
+ stack.undo();
+ stack.execute(c1);
+ stack.undo();
+ Assert.assertTrue(people.getBeanId()==null);
+
+ }
+}
Property changes on: branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/CommandTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java
===================================================================
--- branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java 2010-07-13 06:46:00 UTC (rev 23380)
+++ branches/smooks-dmb/tests/org.jboss.tools.smooks.model.test/src/org/jboss/tools/smooks/model/command/SetCommandTest.java 2010-07-13 07:32:12 UTC (rev 23381)
@@ -1,63 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.model.command;
-
-import junit.framework.TestCase;
-
-import org.jboss.tools.smooks.model.csv.CSVReader;
-import org.junit.Assert;
-
-/**
- * @author Dart
- *
- */
-public class SetCommandTest extends TestCase {
- public void testCSVReaderSet() {
- CSVReader reader = new CSVReader();
-
- SetCommand command1 = new SetCommand(reader, "name,address,age", "fields");
- SetCommand command2 = new SetCommand(reader, "people", "rootElementName");
- SetCommand command3 = new SetCommand(reader, "person", "recordElementName");
- SetCommand command4 = new SetCommand(reader, true, "indent");
-
-
- command1.execute();
- command2.execute();
- command3.execute();
- command4.execute();
-
- Assert.assertSame(reader.getFields(), "name,address,age");
- Assert.assertSame(reader.getRecordElementName(), "person");
- Assert.assertSame(reader.getRootElementName(), "people");
- Assert.assertSame(reader.getIndent(),true);
-
-
-
- command1.undo();
- command2.undo();
- command3.undo();
- command4.undo();
-
- Assert.assertSame(reader.getFields(), null);
- Assert.assertSame(reader.getRecordElementName(), null);
- Assert.assertSame(reader.getRootElementName(),null);
-// Assert.assertSame(reader.getIndent(),true);
-
- command1.redo();
- command2.redo();
- command3.redo();
- command4.redo();
-
- Assert.assertSame(reader.getFields(), "name,address,age");
- Assert.assertSame(reader.getRecordElementName(), "person");
- Assert.assertSame(reader.getRootElementName(), "people");
- Assert.assertSame(reader.getIndent(),true);
-
-// reader.setFields("name,address,age");
-// reader.setRootElementName("people");
-// reader.setRecordElementName("person");
-// reader.setIndent(true);
-
- }
-}
15 years, 9 months
JBoss Tools SVN: r23380 - workspace/Denny/esb-example.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2010-07-13 02:46:00 -0400 (Tue, 13 Jul 2010)
New Revision: 23380
Modified:
workspace/Denny/esb-example/helloworld_action_all.zip
workspace/Denny/esb-example/helloworld_all.zip
workspace/Denny/esb-example/helloworld_file_action_all.zip
workspace/Denny/esb-example/transform_CSV2XML_all.zip
workspace/Denny/esb-example/transform_XML2POJO_all.zip
workspace/Denny/esb-example/transform_XML2XML_date_manipulation_all.zip
workspace/Denny/esb-example/transform_XML2XML_simple_all.zip
workspace/Denny/esb-example/webservice_consumer1_all.zip
workspace/Denny/esb-example/webservice_producer_all.zip
Log:
fix jre issue
Modified: workspace/Denny/esb-example/helloworld_action_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example/helloworld_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example/helloworld_file_action_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example/transform_CSV2XML_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example/transform_XML2POJO_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example/transform_XML2XML_date_manipulation_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example/transform_XML2XML_simple_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example/webservice_consumer1_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example/webservice_producer_all.zip
===================================================================
(Binary files differ)
15 years, 9 months
JBoss Tools SVN: r23379 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-12 18:01:47 -0400 (Mon, 12 Jul 2010)
New Revision: 23379
Modified:
trunk/build/publish.sh
Log:
generating source zip w/ Ant is fail; reverting to simple shell approach w/ excludes
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2010-07-12 20:05:28 UTC (rev 23378)
+++ trunk/build/publish.sh 2010-07-12 22:01:47 UTC (rev 23379)
@@ -77,6 +77,13 @@
# get sources zip
if [[ -f ${WORKSPACE}/sources/build/sources/target/sources.zip ]]; then
rsync -aq ${WORKSPACE}/sources/build/sources/target/sources.zip ${WORKSPACE}/site/${JOB_NAME}/${SRCSNAME}
+else
+ # create sources zip
+ pushd ${WORKSPACE}/sources
+ zip ${WORKSPACE}/site/{JOB_NAME}/${SRCSNAME} -q -r * -x documentation\* -x download.jboss.org\* -x requirements\* \
+ -x workingset\* -x labs\* -x build\* -x \*test\* -x \*target\* -x \*.class -x \*.svn\* -x \*classes\* -x \*bin\* -x \*.zip \
+ -x \*docs\* -x \*reference\* -x \*releng\*
+ popd
fi
# generate HTML snippet for inclusion on jboss.org
15 years, 9 months
JBoss Tools SVN: r23378 - workspace/dgolovin/experimental-build.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-12 16:05:28 -0400 (Mon, 12 Jul 2010)
New Revision: 23378
Added:
workspace/dgolovin/experimental-build/e36-wtp32.target
Log:
experimental target without errors. Can be used in eclipse.
Added: workspace/dgolovin/experimental-build/e36-wtp32.target
===================================================================
--- workspace/dgolovin/experimental-build/e36-wtp32.target (rev 0)
+++ workspace/dgolovin/experimental-build/e36-wtp32.target 2010-07-12 20:05:28 UTC (rev 23378)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.6"?>
+
+<target includeMode="feature" name="e36-wtp32-thirdparty">
+<locations>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.maven.ide.eclipse.feature.feature.group" version="0.10.2.20100623-1649"/>
+<repository location="http://m2eclipse.sonatype.org/sites/m2e/"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.maven.ide.eclipse.sdk.feature.feature.group" version="0.10.0.20100209-0800"/>
+<unit id="org.maven.ide.eclipse.wtp.feature.feature.group" version="0.10.0.20100209-0800"/>
+<repository location="http://m2eclipse.sonatype.org/sites/m2e-extras/"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.platform.ide" version="3.6.0.I20100608-0911"/>
+<repository location="http://download.eclipse.org/eclipse/updates/3.6"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.0.568-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.gef.feature.group" version="2.0.0.568-dev-e36"/>
+<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.0.568-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.0.568-dev-e36"/>
+<unit id="org.eclipse.swtbot.feature.group" version="2.0.0.568-dev-e36"/>
+<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.birt.feature.group" version="2.6.0.v20100617-9gF727DGKb0yl9AwWxpmbo35PwQ_"/>
+<unit id="org.eclipse.zest.sdk.feature.group" version="1.2.0.v20100519-2050-679-8COKLDAKOXIEU_VWSfZdM9XR"/>
+<unit id="org.eclipse.wst.xml_ui.feature.feature.group" version="3.2.0.v201005241510-7H7AFUIDxumQGOb7ocjUR2Pvz-28"/>
+<unit id="org.eclipse.tptp.monitoring.runtime.feature.group" version="4.5.0.v201005271900-7T7X-7r1WNos_vYhsZicqkbMM"/>
+<unit id="org.eclipse.tptp.platform.runtime.feature.group" version="4.7.0.v201005032111-7u84-8ksiNsksbQ6UTB7dcy3RUlT"/>
+<unit id="org.eclipse.tptp.wtp.feature.group" version="4.5.0.v201005032111-54-78I8G0BlG8C88S8WCW88"/>
+<unit id="org.eclipse.tptp.test.runtime.feature.group" version="4.5.0.v201005032111-7H7I-7VtKAvYv6f6qonS7y600vRQ"/>
+<unit id="org.eclipse.tptp.trace.runtime.feature.group" version="4.4.0.v201005032111-7H7C-7XbK_J3E9NJPSTgdcXb94"/>
+<unit id="org.eclipse.jpt.feature.feature.group" version="2.3.0.v201005260000-7N7UEwFD3wTgbU_dxVnWV"/>
+<unit id="org.eclipse.wst.common.fproj.feature.group" version="3.2.0.v201005290030-377A78s73533D5L355B"/>
+<unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.2.0.v201005241530-7b7GHTYFSK2W9kPaFClvz0O_NQmN"/>
+<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.2.0.v201005241510-7O7CFb3EMf84nP-FHuc10NTz--M3"/>
+<unit id="org.eclipse.wst.xsl.feature.feature.group" version="1.1.0.v201005241600-7S7WFAKFIpS---NRIS1pbfYBUIQ"/>
+<unit id="org.eclipse.jsf.feature.feature.group" version="3.2.0.v20100526-7E7I-F9JgLWLMBYy3114"/>
+<unit id="org.eclipse.jst.ws.jaxws.dom.feature.feature.group" version="1.0.0.v201005241530-5--AkF7B77NBZBgBg"/>
+<unit id="org.eclipse.jst.ws.jaxws.feature.feature.group" version="1.0.0.v201005241530-7E777BF8NcJSSJxUETx_l"/>
+<unit id="org.eclipse.jst.server_adapters.ext.feature.feature.group" version="3.2.0.v201005241530-777HFGPCcNBDiBgIc4BA8"/>
+<unit id="org.eclipse.jst.server_adapters.feature.feature.group" version="3.2.0.v201005241530-208Z7w31211419"/>
+<unit id="org.eclipse.jst.server_ui.feature.feature.group" version="3.2.0.v201005241530-7A5FEh9xFc7RCGLRBAIOJC43A"/>
+<unit id="org.eclipse.jst.web_ui.feature.feature.group" version="3.2.0.v201005250611-7F77FJJC25Skdw1pheuO_q6p-Idh"/>
+<unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.0.v201005241510-51EoAkF77g8HBSc"/>
+<repository location="http://download.eclipse.org/releases/helios/"/>
+</location>
+</locations>
+<includeBundles>
+<feature id="org.eclipse.tptp.platform.probekit"/>
+<feature id="org.eclipse.jpt.feature"/>
+<feature id="org.eclipse.jst.web_ui.feature"/>
+<feature id="org.eclipse.swtbot.eclipse"/>
+<feature id="org.eclipse.emf.databinding"/>
+<feature id="org.eclipse.wst.common_core.feature"/>
+<feature id="org.eclipse.datatools.enablement.hsqldb.feature"/>
+<feature id="org.eclipse.wst.ws_ui.feature"/>
+<feature id="org.eclipse.wst.ws_userdoc.feature"/>
+<feature id="org.eclipse.datatools.enablement.feature"/>
+<feature id="org.eclipse.tptp.platform.probekit.doc.user"/>
+<feature id="org.eclipse.jst.ws.jaxws.dom.feature"/>
+<feature id="org.eclipse.emf.mapping.ecore"/>
+<feature id="org.eclipse.jst.server_adapters.ext.feature"/>
+<feature id="org.eclipse.emf.codegen.ecore"/>
+<feature id="org.eclipse.jsf.feature"/>
+<plugin id="org.eclipse.jst.common.project.facet.core"/>
+<feature id="org.eclipse.swtbot.eclipse.test.junit4"/>
+<feature id="org.eclipse.emf.mapping"/>
+<feature id="org.eclipse.jst.server_ui.feature"/>
+<feature id="org.eclipse.tptp.platform.batik.pdf"/>
+<feature id="org.eclipse.datatools.enablement.sap.feature"/>
+<feature id="org.eclipse.tptp.platform.core.doc.user"/>
+<feature id="org.eclipse.tptp.trace.jvmti"/>
+<feature id="org.eclipse.emf.databinding.edit"/>
+<feature id="org.eclipse.rcp"/>
+<feature id="org.eclipse.wst.server_userdoc.feature"/>
+<feature id="org.eclipse.datatools.enablement.postgresql.feature"/>
+<plugin id="org.eclipse.xsd.edit"/>
+<feature id="org.eclipse.datatools.sqldevtools.sqlbuilder.feature"/>
+<feature id="org.eclipse.datatools.connectivity.feature"/>
+<feature id="org.eclipse.datatools.modelbase.feature"/>
+<feature id="org.eclipse.wst.web_userdoc.feature"/>
+<feature id="org.eclipse.wst.server_adapters.feature"/>
+<feature id="org.eclipse.datatools.enablement.sybase.feature"/>
+<feature id="org.eclipse.datatools.enablement.apache.derby.feature"/>
+<feature id="org.eclipse.swtbot"/>
+<feature id="org.eclipse.platform"/>
+<feature id="org.eclipse.emf.ecore"/>
+<feature id="org.eclipse.wst.ws_wsdl15.feature"/>
+<feature id="org.eclipse.tptp.platform.core"/>
+<plugin id="org.eclipse.equinox.concurrent"/>
+<feature id="org.eclipse.datatools.doc.user"/>
+<feature id="org.eclipse.wst.xml_userdoc.feature"/>
+<feature id="org.eclipse.jst.enterprise_core.feature"/>
+<feature id="org.eclipse.datatools.sqldevtools.ddl.feature"/>
+<feature id="org.eclipse.datatools.sqldevtools.results.feature"/>
+<plugin id="org.eclipse.jst.common.project.facet.ui"/>
+<feature id="org.eclipse.datatools.connectivity.oda.feature"/>
+<feature id="org.eclipse.tptp.platform.doc.user"/>
+<feature id="org.eclipse.wst.server_ui.feature"/>
+<feature id="org.eclipse.jst.ws.jaxws.feature"/>
+<feature id="org.eclipse.birt.report.designer.editor.xml.wtp"/>
+<feature id="org.eclipse.datatools.enablement.oda.feature"/>
+<feature id="org.eclipse.tptp.platform.samples"/>
+<feature id="org.eclipse.tptp.platform.xerces"/>
+<feature id="org.eclipse.datatools.sqldevtools.feature"/>
+<feature id="org.eclipse.wst.common.fproj"/>
+<feature id="org.eclipse.tptp.platform.integration.pde"/>
+<feature id="org.eclipse.jst.web_userdoc.feature"/>
+<feature id="org.eclipse.emf.codegen"/>
+<feature id="org.eclipse.datatools.enablement.jdbc.feature"/>
+<feature id="org.eclipse.tptp.trace.arm"/>
+<feature id="org.eclipse.swtbot.ide"/>
+<feature id="org.eclipse.wst.web_ui.feature"/>
+<feature id="org.eclipse.gef"/>
+<feature id="org.eclipse.zest"/>
+<feature id="org.eclipse.datatools.enablement.ingres.feature"/>
+<feature id="org.eclipse.wst.server_core.feature"/>
+<feature id="org.eclipse.datatools.enablement.ibm.feature"/>
+<feature id="org.eclipse.tptp.platform.profile.server"/>
+<feature id="org.eclipse.emf.codegen.ui"/>
+<feature id="org.eclipse.wst.xml.xpath2.processor.feature"/>
+<feature id="org.eclipse.wst.xml_core.feature"/>
+<feature id="org.eclipse.datatools.enablement.sqlite.feature"/>
+<feature id="org.eclipse.swtbot.eclipse.gef"/>
+<feature id="org.eclipse.tptp.platform.jakarta.log4j"/>
+<feature id="org.eclipse.emf.edit.ui"/>
+<plugin id="org.eclipse.xsd"/>
+<feature id="org.eclipse.jst.server_core.feature"/>
+<feature id="org.eclipse.emf.edit"/>
+<feature id="org.eclipse.jst.enterprise_userdoc.feature"/>
+<feature id="org.eclipse.emf.common.ui"/>
+<feature id="org.eclipse.tptp.platform.jvmti"/>
+<feature id="org.eclipse.draw2d"/>
+<feature id="org.eclipse.tptp.trace"/>
+<feature id="org.eclipse.tptp.platform.batik"/>
+<feature id="org.eclipse.tptp.platform.trace"/>
+<feature id="org.eclipse.datatools.connectivity.oda.designer.feature"/>
+<feature id="org.eclipse.jst.enterprise_ui.feature"/>
+<feature id="org.eclipse.jdt"/>
+<feature id="org.eclipse.jst.server_adapters.feature"/>
+<feature id="org.eclipse.emf.common"/>
+<feature id="org.eclipse.datatools.enablement.jdt.feature"/>
+<feature id="org.eclipse.datatools.enablement.msft.feature"/>
+<feature id="org.maven.ide.eclipse.wtp.feature"/>
+<feature id="org.eclipse.datatools.enablement.oda.designer.feature"/>
+<feature id="org.eclipse.datatools.sqldevtools.schemaobjecteditor.feature"/>
+<feature id="org.eclipse.datatools.sqldevtools.ddlgen.feature"/>
+<feature id="org.eclipse.wst.jsdt.feature"/>
+<feature id="org.eclipse.emf.codegen.ecore.ui"/>
+<feature id="org.eclipse.pde"/>
+<feature id="org.eclipse.jst.web_core.feature"/>
+<feature id="org.eclipse.birt"/>
+<feature id="org.eclipse.wst.xml_ui.feature"/>
+<feature id="org.eclipse.emf.ecore.edit"/>
+<feature id="org.maven.ide.eclipse.feature"/>
+<feature id="org.eclipse.emf.ecore.editor"/>
+<feature id="org.eclipse.tptp.trace.runtime"/>
+<feature id="org.eclipse.wst.ws_core.feature"/>
+<feature id="org.eclipse.datatools.connectivity.oda.designer.core.feature"/>
+<feature id="org.eclipse.wst.web_core.feature"/>
+<feature id="org.eclipse.wst.common_ui.feature"/>
+<feature id="org.eclipse.help"/>
+<feature id="org.eclipse.emf.converter"/>
+<feature id="org.eclipse.emf"/>
+<feature id="org.eclipse.datatools.sqldevtools.data.feature"/>
+<feature id="org.eclipse.datatools.sqldevtools.parsers.feature"/>
+<feature id="org.eclipse.tptp.platform.commons.logging"/>
+<feature id="org.eclipse.equinox.p2.user.ui"/>
+<feature id="org.eclipse.emf.mapping.ui"/>
+<feature id="org.eclipse.tptp.platform.runtime"/>
+<feature id="org.eclipse.tptp.platform.report"/>
+<feature id="org.eclipse.tptp.trace.arm.ui"/>
+<feature id="org.eclipse.emf.mapping.ecore.editor"/>
+<feature id="org.eclipse.tptp.platform.instrumentation.ui"/>
+<feature id="org.eclipse.jst.server_userdoc.feature"/>
+<feature id="org.eclipse.wst.xsl.feature"/>
+<feature id="org.eclipse.datatools.enablement.mysql.feature"/>
+<feature id="org.eclipse.datatools.enablement.oracle.feature"/>
+</includeBundles>
+</target>
15 years, 9 months
JBoss Tools SVN: r23377 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-12 16:04:00 -0400 (Mon, 12 Jul 2010)
New Revision: 23377
Modified:
trunk/build/publish.sh
Log:
only generate snippet for release builds (otherwise not needed)
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2010-07-12 20:02:59 UTC (rev 23376)
+++ trunk/build/publish.sh 2010-07-12 20:04:00 UTC (rev 23377)
@@ -79,6 +79,11 @@
rsync -aq ${WORKSPACE}/sources/build/sources/target/sources.zip ${WORKSPACE}/site/${JOB_NAME}/${SRCSNAME}
fi
+# generate HTML snippet for inclusion on jboss.org
+if [[ ${RELEASE} == "Yes" ]]; then
+ ant -f ${WORKSPACE}/build/results/build.xml "-DZIPSUFFIX=${ZIPSUFFIX} -DJOB_NAME=${JOB_NAME}"
+fi
+
# get full build log and filter out Maven test failures
bl=${WORKSPACE}/site/${JOB_NAME}/BUILDLOG.txt
wget -q http://hudson.qa.jboss.com/hudson/job/${JOB_NAME}/${BUILD_NUMBER}/console... -O ${bl}
@@ -106,9 +111,6 @@
rsync -arzq ${WORKSPACE}/site/${JOB_NAME}/*LOG.txt $DESTINATION/${JOB_NAME}/
date
-# generate HTML snippet for inclusion on jboss.org
-ant -f ${WORKSPACE}/build/results/build.xml "-DZIPSUFFIX=${ZIPSUFFIX} -DJOB_NAME=${JOB_NAME}"
-
# publish to download.jboss.org, unless errors found - avoid destroying last-good update site
if [[ $ec == "0" ]] && [[ $fc == "0" ]]; then
date
15 years, 9 months
JBoss Tools SVN: r23376 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-12 16:02:59 -0400 (Mon, 12 Jul 2010)
New Revision: 23376
Modified:
trunk/build/publish.sh
Log:
add ant task for generating html snippet; fix check for sources
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2010-07-12 20:02:33 UTC (rev 23375)
+++ trunk/build/publish.sh 2010-07-12 20:02:59 UTC (rev 23376)
@@ -75,7 +75,7 @@
fi
# get sources zip
-if [[ ! -f ${WORKSPACE}/sources/build/sources/target/sources.zip ]]; then
+if [[ -f ${WORKSPACE}/sources/build/sources/target/sources.zip ]]; then
rsync -aq ${WORKSPACE}/sources/build/sources/target/sources.zip ${WORKSPACE}/site/${JOB_NAME}/${SRCSNAME}
fi
@@ -106,6 +106,9 @@
rsync -arzq ${WORKSPACE}/site/${JOB_NAME}/*LOG.txt $DESTINATION/${JOB_NAME}/
date
+# generate HTML snippet for inclusion on jboss.org
+ant -f ${WORKSPACE}/build/results/build.xml "-DZIPSUFFIX=${ZIPSUFFIX} -DJOB_NAME=${JOB_NAME}"
+
# publish to download.jboss.org, unless errors found - avoid destroying last-good update site
if [[ $ec == "0" ]] && [[ $fc == "0" ]]; then
date
15 years, 9 months