JBoss Tools SVN: r24972 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-09-17 01:12:27 -0400 (Fri, 17 Sep 2010)
New Revision: 24972
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
Log:
JBIDE-7069 - fixing small delay
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2010-09-16 22:45:10 UTC (rev 24971)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2010-09-17 05:12:27 UTC (rev 24972)
@@ -295,16 +295,15 @@
* @return <code>true</code> if it succeeds, <code>false</code> otherwise
*/
private boolean safeRename(File from, File to, int retrys) {
- boolean renamedSafely = false;
// make sure parent dir exists
File dir = to.getParentFile();
if (dir != null && !dir.exists())
dir.mkdirs();
int count = 0;
- while (count < retrys && !renamedSafely) {
+ while (count < retrys ) {
if (from.renameTo(to))
- renamedSafely = true;
+ return true;
count++;
// delay if we are going to try again
@@ -316,7 +315,7 @@
}
}
}
- return renamedSafely;
+ return false;
}
protected File getTempFolder() {
15 years, 7 months
JBoss Tools SVN: r24971 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-09-16 18:45:10 -0400 (Thu, 16 Sep 2010)
New Revision: 24971
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java
Log:
2010-09-16 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java (createControl): Remove
debugging print messages.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-09-16 20:11:05 UTC (rev 24970)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-09-16 22:45:10 UTC (rev 24971)
@@ -1,3 +1,8 @@
+2010-09-16 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java (createControl): Remove
+ debugging print messages.
+
2010-09-14 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/ImageView.java (createPartControl): For vertical
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java 2010-09-16 20:11:05 UTC (rev 24970)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java 2010-09-16 22:45:10 UTC (rev 24971)
@@ -341,12 +341,10 @@
Label urlLabel = new Label(container, SWT.NULL);
urlLabel.setText(WizardMessages.getString(URL_LABEL));
Point p1 = urlLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- System.out.println("p1 is x:" + p1.x + " y:" + p1.y);
-
+
urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
urlText.addModifyListener(textListener);
Point p2 = urlText.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- System.out.println("p2 text is x:" + p2.x + " y:" + p2.y);
int centering = (p2.y - p1.y + 1) / 2;
15 years, 7 months
JBoss Tools SVN: r24969 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-16 13:59:26 -0400 (Thu, 16 Sep 2010)
New Revision: 24969
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLSyntaxValidator.java
Log:
https://jira.jboss.org/browse/JBIDE-7021 Fixed XHTML syntax validator for xhtmls withot DOCTYPE
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLSyntaxValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLSyntaxValidator.java 2010-09-16 17:46:21 UTC (rev 24968)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLSyntaxValidator.java 2010-09-16 17:59:26 UTC (rev 24969)
@@ -228,10 +228,10 @@
{
XMLReader reader = super.createXMLReader(uri);
- reader.setFeature("http://xml.org/sax/features/namespaces", true);
+ reader.setFeature("http://xml.org/sax/features/namespaces", false);
reader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
- reader.setFeature("http://xml.org/sax/features/validation", true);
- reader.setFeature("http://apache.org/xml/features/validation/schema", true);
+ reader.setFeature("http://xml.org/sax/features/validation", false);
+ reader.setFeature("http://apache.org/xml/features/validation/schema", false);
reader.setFeature("http://apache.org/xml/features/validation/schema-full-checking", false);
reader.setFeature("http://apache.org/xml/features/validation/dynamic", false);
reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false);
15 years, 7 months
JBoss Tools SVN: r24968 - in trunk/vpe/plugins: org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-09-16 13:46:21 -0400 (Thu, 16 Sep 2010)
New Revision: 24968
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerHint.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerConstants.java
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerVpeResizer.java
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/XulRunnerVpeUtils.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
JBIDE-5970 https://jira.jboss.org/browse/JBIDE-5970:
Add text captions for Drag&Drop actions
- DnD hints are added
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-09-16 16:36:37 UTC (rev 24967)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-09-16 17:46:21 UTC (rev 24968)
@@ -13,6 +13,7 @@
import static org.jboss.tools.vpe.xulrunner.util.XPCOM.queryInterface;
+import java.text.MessageFormat;
import java.util.EnumSet;
import org.eclipse.core.resources.IFile;
@@ -43,8 +44,10 @@
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaSelectionListener;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.editor.util.VpeDndUtil;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.xulrunner.editor.IVpeSelectionListener;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerHint;
import org.jboss.tools.vpe.xulrunner.util.XPCOM;
import org.mozilla.interfaces.nsIComponentManager;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -85,6 +88,10 @@
private VpeController vpeController;
private DraggablePattern draggablePattern;
private DropableArea dropableArea;
+ private XulRunnerHint dropHint;
+
+ /** Offset of dropHint related to mouse cursor*/
+ private static final Point DROP_HINT_OFFSET = new Point(20, -10);
/** The Constant FLAVORS. */
private static final String[] FLAVORS = {
@@ -169,9 +176,10 @@
innerDrop(queryInterface(domEvent, nsIDOMMouseEvent.class));
} else {
//in this case it's is external drag
- externalDrop(queryInterface(domEvent, nsIDOMMouseEvent.class)); //$NON-NLS-1$
+ externalDrop(queryInterface(domEvent, nsIDOMMouseEvent.class));
}
disposeDropableArea();
+ disposeDropHint();
vpeController.onRefresh();
}
@@ -193,12 +201,14 @@
// of drawing the dropable area
if (targetNodeIsTemporary || eventTargetIsAscedantOfDropTarget) {
disposeDropableArea();
+ disposeDropHint();
}
}
}
public void dragEnd(nsIDOMEvent domEvent) {
disposeDropableArea();
+ disposeDropHint();
draggablePattern.closeSession();
}
@@ -368,6 +378,8 @@
}
}
+ Point mouseCoords = getPageCoords(event);
+
if (highlightedNode != null) {
if (dropableArea == null) {
dropableArea = new DropableArea(document);
@@ -376,13 +388,51 @@
dropableArea.setDropTargets(dropTargets);
dropableArea.setNode(
vpeController.getDomMapping().getNearVisualNode(highlightedNode));
- Point mouseCoords = getPageCoords(event);
dropableArea.setHighlightedDropTarget(mouseCoords.x, mouseCoords.y);
dropableArea.setVisible(true);
dropableArea.redraw();
} else {
disposeDropableArea();
+ disposeDropHint();
}
+
+ if (highlightedNode != null && dropableArea.getHighlightedDropTarget() != null) {
+ if (dropHint == null) {
+ dropHint = new XulRunnerHint(document);
+ }
+ String dropHintValue = null;
+ switch (dropableArea.getHighlightedDropTarget()) {
+ case BEFORE:
+ dropHintValue = MessageFormat.format(
+ VpeUIMessages.VpeDnD_PLACE_BEFORE_INSIDE,
+ highlightedNode.getNodeName(),
+ highlightedNode.getParentNode().getNodeName());
+ break;
+ case AFTER:
+ dropHintValue = MessageFormat.format(
+ VpeUIMessages.VpeDnD_PLACE_AFTER_INSIDE,
+ highlightedNode.getNodeName(),
+ highlightedNode.getParentNode().getNodeName());
+ break;
+ case BEGIN:
+ dropHintValue = MessageFormat.format(
+ VpeUIMessages.VpeDnD_PLACE_AT_THE_BEGINNING_OF,
+ highlightedNode.getNodeName());
+ break;
+ case END:
+ dropHintValue = MessageFormat.format(
+ VpeUIMessages.VpeDnD_PLACE_AT_THE_END_OF,
+ highlightedNode.getNodeName());
+ break;
+ }
+
+ dropHint.setHint(dropHintValue);
+ dropHint.setPosition(new Point(mouseCoords.x + DROP_HINT_OFFSET.x,
+ mouseCoords.y + DROP_HINT_OFFSET.y));
+ dropHint.redraw();
+ } else {
+ disposeDropHint();
+ }
}
private Point getClientCoords(nsIDOMEvent event) {
@@ -397,6 +447,13 @@
dropableArea = null;
}
}
+
+ private void disposeDropHint() {
+ if (dropHint != null) {
+ dropHint.dispose();
+ dropHint = null;
+ }
+ }
/**
* Starts drag session
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-09-16 16:36:37 UTC (rev 24967)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-09-16 17:46:21 UTC (rev 24968)
@@ -69,6 +69,10 @@
public static String CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE;
public static String VPE_UPDATE_JOB_TITLE;
public static String VPE_VISUAL_REFRESH_JOB;
+ public static String VpeDnD_PLACE_AFTER_INSIDE;
+ public static String VpeDnD_PLACE_AT_THE_BEGINNING_OF;
+ public static String VpeDnD_PLACE_AT_THE_END_OF;
+ public static String VpeDnD_PLACE_BEFORE_INSIDE;
public static String VpeExpressionBuilder_ClosingApostropheNotFound;
public static String VpeExpressionBuilder_ClosingBracketNotFound;
public static String VpeExpressionBuilder_FunctionNotFound;
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-09-16 16:36:37 UTC (rev 24967)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-09-16 17:46:21 UTC (rev 24968)
@@ -51,6 +51,13 @@
CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE=Always hide selection bar without prompt
VPE_UPDATE_JOB_TITLE=Visual Editor View Update
VPE_VISUAL_REFRESH_JOB=Visual Editor Refresh
+
+# VpeDnD messages
+VpeDnD_PLACE_AFTER_INSIDE=Place after <code>{0}</code> inside <code>{1}</code>
+VpeDnD_PLACE_AT_THE_BEGINNING_OF=Place at the beginning of <code>{0}</code>
+VpeDnD_PLACE_AT_THE_END_OF=Place at the end of <code>{0}</code>
+VpeDnD_PLACE_BEFORE_INSIDE=Place before <code>{0}</code> inside <code>{1}</code>
+
VpeExpressionBuilder_ClosingApostropheNotFound=Closing apostrophe is not found
VpeExpressionBuilder_ClosingBracketNotFound=Closing bracket is not found
VpeExpressionBuilder_FunctionNotFound=Function ''{0}'' is not found
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerConstants.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerConstants.java 2010-09-16 16:36:37 UTC (rev 24967)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerConstants.java 2010-09-16 17:46:21 UTC (rev 24968)
@@ -23,8 +23,7 @@
/** HTML attributes */
-
- /** HTML_ATTR_CLASS */
+ public static final String HTML_ATTR_STYLE = "style"; //$NON-NLS-1$
public static final String HTML_ATTR_CLASS = "class"; //$NON-NLS-1$
/** HTML_ATTR_ANONLOCATION */
@@ -47,6 +46,8 @@
/** HTML_VALUE_HIDDEN */
public static final String HTML_VALUE_HIDDEN = "hidden"; //$NON-NLS-1$
+
+ public static final String HTML_VALUE_VISIBILITY_HIDDEN = "visibility:hidden"; //$NON-NLS-1$
/** HTML_VALUE_TRUE */
public static final String HTML_VALUE_TRUE = "true"; //$NON-NLS-1$
Added: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerHint.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerHint.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerHint.java 2010-09-16 17:46:21 UTC (rev 24968)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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.vpe.xulrunner.editor;
+
+import static org.jboss.tools.vpe.xulrunner.util.XPCOM.queryInterface;
+
+import org.eclipse.swt.graphics.Point;
+import org.jboss.tools.vpe.xulrunner.util.XulRunnerVpeUtils;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNSHTMLElement;
+
+/**
+ * Shows a hint in a XulRunner document.
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class XulRunnerHint {
+ private Point position;
+ private nsIDOMDocument document;
+ private nsIDOMElement hintElement;
+ private String hint;
+
+ public XulRunnerHint(nsIDOMDocument document) {
+ this.document = document;
+ }
+
+ /**
+ * Hint to show. If {@code null} is passed, then hide.
+ */
+ public void setHint(String hint) {
+ this.hint = hint;
+ }
+
+ public void setPosition(Point position) {
+ this.position = position;
+ }
+
+ public void redraw() {
+
+ if (hintElement == null) {
+ nsIDOMElement parent = XulRunnerVpeUtils.getRootElement(document);
+ hintElement = XulRunnerVpeUtils.createAnonymousElement(document,
+ XulRunnerConstants.HTML_TAG_SPAN, parent,
+ XulRunnerConstants.VPE_CLASS_NAME_MOZ_RESIZING_INFO, false);
+ }
+
+ nsIDOMNSHTMLElement hintHtmlElement = queryInterface(hintElement,
+ nsIDOMNSHTMLElement.class);
+
+ if (hint == null) {
+ hintHtmlElement.setInnerHTML(""); //$NON-NLS-1$
+ hintElement.setAttribute(XulRunnerConstants.HTML_ATTR_STYLE,
+ XulRunnerConstants.HTML_VALUE_VISIBILITY_HIDDEN);
+ } else {
+ hintElement.setAttribute(XulRunnerConstants.HTML_ATTR_STYLE, ""); //$NON-NLS-1$
+ hintHtmlElement.setInnerHTML(hint);
+ XulRunnerVpeUtils.setElementPosition(hintElement, position.x, position.y);
+ }
+ }
+
+ public void dispose() {
+ if (hintElement != null && hintElement.getParentNode() != null) {
+ hintElement.getParentNode().removeChild(hintElement);
+ }
+ hintElement = null;
+ document = null;
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerVpeResizer.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerVpeResizer.java 2010-09-16 16:36:37 UTC (rev 24967)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerVpeResizer.java 2010-09-16 17:46:21 UTC (rev 24968)
@@ -18,15 +18,11 @@
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.jboss.tools.vpe.xulrunner.util.XulRunnerVpeUtils;
-import org.mozilla.interfaces.nsIDOMCSSStyleDeclaration;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMElementCSSInlineStyle;
import org.mozilla.interfaces.nsIDOMEvent;
import org.mozilla.interfaces.nsIDOMEventListener;
import org.mozilla.interfaces.nsIDOMEventTarget;
-import org.mozilla.interfaces.nsIDOMHTMLDocument;
-import org.mozilla.interfaces.nsIDOMHTMLElement;
import org.mozilla.interfaces.nsIDOMMouseEvent;
import org.mozilla.interfaces.nsIDOMNode;
@@ -95,7 +91,7 @@
/** resizingShadow */
private nsIDOMElement resizingShadow;
- private nsIDOMElement resizingInfo;
+ private XulRunnerHint resizingInfo;
/** domDocument */
private nsIDOMDocument domDocument;
@@ -161,7 +157,7 @@
(elementBounds.height <= 0) ||
(elementBounds.height > MAX_SIZE)) return;
- nsIDOMElement bodyElement = getRootElement();
+ nsIDOMElement bodyElement = XulRunnerVpeUtils.getRootElement(domDocument);
if (bodyElement == null ) return;
@@ -224,9 +220,9 @@
setAllResizersPosition();
resizingShadow = createShadow(bodyElement);
- setElementPosition(resizingShadow, elementBounds.x, elementBounds.y);
+ XulRunnerVpeUtils.setElementPosition(resizingShadow, elementBounds.x, elementBounds.y);
- resizingInfo = createResizingInfo(bodyElement);
+ resizingInfo = new XulRunnerHint(domDocument);
}
@@ -234,9 +230,12 @@
* @see org.jboss.vpe.mozilla.resizer.IVpeResizer#hide()
*/
public void hide() {
- nsIDOMElement bodyElement;
-
- bodyElement = getRootElement();
+ if (resizingInfo != null) {
+ resizingInfo.dispose();
+ resizingInfo = null;
+ }
+
+ nsIDOMElement bodyElement = XulRunnerVpeUtils.getRootElement(domDocument);
if ( bodyElement == null ) {
return;
}
@@ -280,17 +279,11 @@
parentNode.removeChild(markerBottomRight);
}
-
if ( resizingShadow != null ) {
parentNode.removeChild(resizingShadow);
resizingShadow = null;
}
- if (resizingInfo != null) {
- parentNode.removeChild(resizingInfo);
- resizingInfo = null;
- }
-
markerBottom = null;
markerTop = null;
markerLeft = null;
@@ -302,7 +295,6 @@
resizingObject = null;
}
-
/* (non-Javadoc)
* @see org.jboss.vpe.mozilla.resizer.IVpeResizer#mouseDown(int, int, org.mozilla.interfaces.nsIDOMElement)
@@ -347,19 +339,12 @@
Rectangle shadowBounds = new Rectangle(newX, newY, newWidth, newHeight);
- setElementBounds(resizingShadow, shadowBounds);
+ XulRunnerVpeUtils.setElementBounds(resizingShadow, shadowBounds);
redrawResizingInfo(shadowBounds);
}
}
private void redrawResizingInfo(Rectangle bounds) {
- while (resizingInfo.hasChildNodes()) {
- resizingInfo.removeChild(resizingInfo.getLastChild());
- }
-
- resizingInfo.appendChild(domDocument.createTextNode(
- String.format(RESIZING_INFO_FORMAT, bounds.width, bounds.height)));
-
Point position;
switch (usedResizeMarker) {
case RESIZER_MARKER_TOPLEFT:
@@ -400,7 +385,11 @@
position.x += RESIZING_INFO_OFFSET.x;
position.y += RESIZING_INFO_OFFSET.y;
- setElementPosition(resizingInfo, position.x, position.y);
+
+ resizingInfo.setHint(
+ String.format(RESIZING_INFO_FORMAT, bounds.width, bounds.height));
+ resizingInfo.setPosition(position);
+ resizingInfo.redraw();
}
@@ -449,49 +438,21 @@
}
/**
- * create a anonymous dom-element
*
- * @param aTag
- * a tag of dom element
- * @param aParentNode
- * @param aAnonClass
- * @param isCreatedHidden
- * @return
- */
- private nsIDOMElement createAnonymousElement(String aTag, nsIDOMNode aParentNode, String aAnonClass, boolean isCreatedHidden) {
- nsIDOMElement returnElement = null;
-
- returnElement = domDocument.createElement(aTag);
-
- // add the "hidden" class if needed
- if (isCreatedHidden) {
- returnElement.setAttribute(XulRunnerConstants.HTML_ATTR_CLASS, XulRunnerConstants.HTML_VALUE_HIDDEN);
- }
-
- // add an _moz_anonclass attribute if needed
- if ( aAnonClass.length() != 0 ) {
- returnElement.setAttribute(XulRunnerConstants.STRING_MOZ_ANONCLASS, aAnonClass);
- }
-
- aParentNode.appendChild(returnElement);
-
- return returnElement;
- }
-
- /**
- *
* @param parentNode
* @param originalObject
* @return
*/
private nsIDOMElement createShadow(nsIDOMNode parentNode) {
- return createAnonymousElement(XulRunnerConstants.HTML_TAG_SPAN,
+ return XulRunnerVpeUtils.createAnonymousElement(domDocument,
+ XulRunnerConstants.HTML_TAG_SPAN,
parentNode, XulRunnerConstants.VPE_CLASS_NAME_MOZ_RESIZING_SHADOW,
true);
}
private nsIDOMElement createResizingInfo(nsIDOMNode parentNode) {
- return createAnonymousElement(XulRunnerConstants.HTML_TAG_SPAN,
+ return XulRunnerVpeUtils.createAnonymousElement(domDocument,
+ XulRunnerConstants.HTML_TAG_SPAN,
parentNode, XulRunnerConstants.VPE_CLASS_NAME_MOZ_RESIZING_INFO,
true);
}
@@ -541,9 +502,8 @@
// make the shadow appear
resizingShadow.removeAttribute(XulRunnerConstants.HTML_ATTR_CLASS);
// position it
- setElementBounds(resizingShadow, elementBounds);
+ XulRunnerVpeUtils.setElementBounds(resizingShadow, elementBounds);
- resizingInfo.removeAttribute(XulRunnerConstants.HTML_ATTR_CLASS);
redrawResizingInfo(elementBounds);
@@ -650,37 +610,16 @@
return result;
}
-
/**
- * Get root element
- *
- * @return root element
- */
- private nsIDOMElement getRootElement() {
-
- nsIDOMElement bodyElement = null;
-
- nsIDOMHTMLDocument htmlDocument = queryInterface(domDocument, nsIDOMHTMLDocument.class);
-
- if ( htmlDocument != null ) {
- nsIDOMHTMLElement htmlBody = htmlDocument.getBody();
-
- if ( htmlBody != null ) {
- bodyElement = queryInterface(htmlBody, nsIDOMElement.class);
- } // if
- } // if
-
- return bodyElement;
- }
-
- /**
* Create a new resizer element
* @param resizerMarkerString
* @param parentNode
* @return a new resizer element
*/
private nsIDOMElement createResizer(String resizerMarkerString, nsIDOMNode parentNode) {
- nsIDOMElement aNewResizer = createAnonymousElement(XulRunnerConstants.HTML_TAG_SPAN, parentNode, XulRunnerConstants.VPE_CLASSNAME_MOZ_RESIZER, false );
+ nsIDOMElement aNewResizer = XulRunnerVpeUtils.createAnonymousElement(
+ domDocument, XulRunnerConstants.HTML_TAG_SPAN, parentNode,
+ XulRunnerConstants.VPE_CLASSNAME_MOZ_RESIZER, false);
nsIDOMEventTarget evtTarget = queryInterface(aNewResizer, nsIDOMEventTarget.class);
@@ -708,67 +647,49 @@
int rh = (int)((resizerHeight+ 1) / 2);
if (markerTopLeft != null) {
- setElementPosition(markerTopLeft, left-resizerWidth-2, top-resizerHeight-2);
+ XulRunnerVpeUtils.setElementPosition(
+ markerTopLeft, left-resizerWidth-2, top-resizerHeight-2);
}
if (markerTop != null) {
- setElementPosition(markerTop, left+width/2-rw, top-resizerHeight-2);
+ XulRunnerVpeUtils.setElementPosition(
+ markerTop, left+width/2-rw, top-resizerHeight-2);
}
if (markerTopRight != null) {
- setElementPosition(markerTopRight, left+width, top-resizerHeight-2);
+ XulRunnerVpeUtils.setElementPosition(
+ markerTopRight, left+width, top-resizerHeight-2);
}
if (markerLeft != null) {
- setElementPosition(markerLeft, left-resizerWidth-2, top+height/2-rh);
+ XulRunnerVpeUtils.setElementPosition(
+ markerLeft, left-resizerWidth-2, top+height/2-rh);
}
if (markerRight != null) {
- setElementPosition(markerRight, left+width, top+height/2-rh);
+ XulRunnerVpeUtils.setElementPosition(
+ markerRight, left+width, top+height/2-rh);
}
if (markerBottomLeft != null) {
- setElementPosition(markerBottomLeft, left-resizerWidth-2, top+height);
+ XulRunnerVpeUtils.setElementPosition(
+ markerBottomLeft, left-resizerWidth-2, top+height);
}
if (markerBottom != null) {
- setElementPosition(markerBottom, left+width/2-rw, top+height);
+ XulRunnerVpeUtils.setElementPosition(
+ markerBottom, left+width/2-rw, top+height);
}
if (markerBottomRight != null) {
- setElementPosition(markerBottomRight, left+width, top+height);
+ XulRunnerVpeUtils.setElementPosition(
+ markerBottomRight, left+width, top+height);
}
}
-
- private void setElementPosition(nsIDOMElement domElement, int left,int top) {
- setStylePropertyPixels(domElement,XulRunnerConstants.HTML_ATTR_LEFT, left);
- setStylePropertyPixels(domElement,XulRunnerConstants.HTML_ATTR_TOP, top);
- }
- private void setElementSize(nsIDOMElement domElement, int width,int height) {
- setStylePropertyPixels(domElement, XulRunnerConstants.HTML_ATTR_WIDTH, width);
- setStylePropertyPixels(domElement, XulRunnerConstants.HTML_ATTR_HEIGHT, height);
- }
-
- private void setElementBounds(nsIDOMElement domElement, Rectangle bounds) {
- setElementPosition(domElement, bounds.x, bounds.y);
- setElementSize(domElement, bounds.width, bounds.height);
- }
-
-
/**
*
- * @param aElement
- * @param aProperty
- * @param aValue
- */
- private void setStylePropertyPixels(nsIDOMElement aElement, String aProperty, int aValue) {
- setStyle(aElement, aProperty, aValue + "px"); //$NON-NLS-1$
- }
-
- /**
- *
* @param aX
* @param aY
* @param aW
@@ -783,38 +704,7 @@
// mPreserveRatio = aPreserveRatio;
}
-
/**
- * Set style for nsIDOMElement
- * @param domElement
- * @param cssPropertyName
- * @param cssPropertyValue
- */
- private void setStyle(nsIDOMElement domElement, String cssPropertyName, String cssPropertyValue) {
- nsIDOMElementCSSInlineStyle inlineStyles = queryInterface(domElement, nsIDOMElementCSSInlineStyle.class);
-
- if ( inlineStyles == null) {
- return;
- }
-
- nsIDOMCSSStyleDeclaration cssDecl = inlineStyles.getStyle();
-
- if ( cssDecl == null) {
- return;
- }
-
- if (cssPropertyValue.length() == 0 ) {
- // an empty value means we have to remove the property
- cssDecl.removeProperty(cssPropertyName);
- } else {
- // let's recreate the declaration as it was
- String priority = cssDecl.getPropertyPriority(cssPropertyName);
- cssDecl.setProperty(cssPropertyName, cssPropertyValue, priority);
- }
- }
-
-
- /**
*
* @param aClientX
* @param aClientY
@@ -827,7 +717,7 @@
if (resizingInfo == null) {
return;
}
- resizingInfo.setAttribute(XulRunnerConstants.HTML_ATTR_CLASS, XulRunnerConstants.HTML_VALUE_HIDDEN);
+ resizingInfo.dispose();
if( activeHandle != null) {
activeHandle.removeAttribute(XulRunnerConstants.STRING_MOZ_ACTIVATED);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/XulRunnerVpeUtils.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/XulRunnerVpeUtils.java 2010-09-16 16:36:37 UTC (rev 24967)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/XulRunnerVpeUtils.java 2010-09-16 17:46:21 UTC (rev 24968)
@@ -15,23 +15,130 @@
import org.eclipse.swt.graphics.Rectangle;
import org.jboss.tools.vpe.xulrunner.BrowserPlugin;
-//import org.mozilla.interfaces.nsIAccessNode;
-//import org.mozilla.interfaces.nsIAccessible;
-//import org.mozilla.interfaces.nsIAccessibleCoordinateType;
-//import org.mozilla.interfaces.nsIAccessibleRetrieval;
-//import org.mozilla.interfaces.nsIAccessibleText;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerConstants;
+import org.mozilla.interfaces.nsIDOMCSSStyleDeclaration;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMElementCSSInlineStyle;
+import org.mozilla.interfaces.nsIDOMHTMLDocument;
+import org.mozilla.interfaces.nsIDOMHTMLElement;
import org.mozilla.interfaces.nsIDOMNSElement;
import org.mozilla.interfaces.nsIDOMNSHTMLElement;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMText;
-import org.mozilla.xpcom.Mozilla;
import org.mozilla.xpcom.XPCOMException;
/**
* @author dsakovich(a)exadel.com
*/
public class XulRunnerVpeUtils {
+ /**
+ * Get root element
+ *
+ * @return root element
+ */
+ public static nsIDOMElement getRootElement(nsIDOMDocument domDocument) {
+
+ nsIDOMElement bodyElement = null;
+
+ nsIDOMHTMLDocument htmlDocument = queryInterface(domDocument, nsIDOMHTMLDocument.class);
+
+ if ( htmlDocument != null ) {
+ nsIDOMHTMLElement htmlBody = htmlDocument.getBody();
+
+ if ( htmlBody != null ) {
+ bodyElement = queryInterface(htmlBody, nsIDOMElement.class);
+ } // if
+ } // if
+
+ return bodyElement;
+ }
+
+ public static void setElementPosition(nsIDOMElement domElement, int left,int top) {
+ setStylePropertyPixels(domElement,XulRunnerConstants.HTML_ATTR_LEFT, left);
+ setStylePropertyPixels(domElement,XulRunnerConstants.HTML_ATTR_TOP, top);
+ }
+
+ public static void setElementSize(nsIDOMElement domElement, int width,int height) {
+ setStylePropertyPixels(domElement, XulRunnerConstants.HTML_ATTR_WIDTH, width);
+ setStylePropertyPixels(domElement, XulRunnerConstants.HTML_ATTR_HEIGHT, height);
+ }
+
+ public static void setElementBounds(nsIDOMElement domElement, Rectangle bounds) {
+ setElementPosition(domElement, bounds.x, bounds.y);
+ setElementSize(domElement, bounds.width, bounds.height);
+ }
+ /**
+ *
+ * @param aElement
+ * @param aProperty
+ * @param aValue
+ */
+ public static void setStylePropertyPixels(nsIDOMElement aElement, String aProperty, int aValue) {
+ setStyle(aElement, aProperty, aValue + "px"); //$NON-NLS-1$
+ }
+
+ /**
+ * Set style for nsIDOMElement
+ * @param domElement
+ * @param cssPropertyName
+ * @param cssPropertyValue
+ */
+ public static void setStyle(nsIDOMElement domElement, String cssPropertyName, String cssPropertyValue) {
+ nsIDOMElementCSSInlineStyle inlineStyles = queryInterface(domElement, nsIDOMElementCSSInlineStyle.class);
+
+ if ( inlineStyles == null) {
+ return;
+ }
+
+ nsIDOMCSSStyleDeclaration cssDecl = inlineStyles.getStyle();
+
+ if ( cssDecl == null) {
+ return;
+ }
+
+ if (cssPropertyValue.length() == 0 ) {
+ // an empty value means we have to remove the property
+ cssDecl.removeProperty(cssPropertyName);
+ } else {
+ // let's recreate the declaration as it was
+ String priority = cssDecl.getPropertyPriority(cssPropertyName);
+ cssDecl.setProperty(cssPropertyName, cssPropertyValue, priority);
+ }
+ }
+
+ /**
+ * create a anonymous dom-element
+ *
+ * @param aTag
+ * a tag of dom element
+ * @param aParentNode
+ * @param aAnonClass
+ * @param isCreatedHidden
+ * @return
+ */
+ public static nsIDOMElement createAnonymousElement(nsIDOMDocument domDocument,
+ String aTag, nsIDOMNode aParentNode, String aAnonClass, boolean isCreatedHidden) {
+ nsIDOMElement element = null;
+
+ element = domDocument.createElement(aTag);
+
+ // add the "hidden" class if needed
+ if (isCreatedHidden) {
+ element.setAttribute(XulRunnerConstants.HTML_ATTR_CLASS, XulRunnerConstants.HTML_VALUE_HIDDEN);
+ }
+
+ // add an _moz_anonclass attribute if needed
+ if ( aAnonClass.length() != 0 ) {
+ element.setAttribute(XulRunnerConstants.STRING_MOZ_ANONCLASS, aAnonClass);
+ }
+
+ aParentNode.appendChild(element);
+
+ return element;
+ }
+
private static int findPosX(nsIDOMNSHTMLElement boxObject) {
int curleft = 0;
15 years, 7 months
JBoss Tools SVN: r24967 - branches/jbosstools-3.2.0.M2/tests/features/org.jboss.tools.test.sdk.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-09-16 12:36:37 -0400 (Thu, 16 Sep 2010)
New Revision: 24967
Modified:
branches/jbosstools-3.2.0.M2/tests/features/org.jboss.tools.test.sdk.feature/feature.xml
Log:
remove jbpm convert plugin from test https://jira.jboss.org/browse/JBDS-1322
Modified: branches/jbosstools-3.2.0.M2/tests/features/org.jboss.tools.test.sdk.feature/feature.xml
===================================================================
--- branches/jbosstools-3.2.0.M2/tests/features/org.jboss.tools.test.sdk.feature/feature.xml 2010-09-16 16:31:30 UTC (rev 24966)
+++ branches/jbosstools-3.2.0.M2/tests/features/org.jboss.tools.test.sdk.feature/feature.xml 2010-09-16 16:36:37 UTC (rev 24967)
@@ -208,12 +208,6 @@
unpack="true"/>
<plugin
- id="org.jboss.tools.jbpm.convert.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
id="org.jboss.tools.jsf.ui.test"
download-size="0"
install-size="0"
15 years, 7 months
JBoss Tools SVN: r24966 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-09-16 12:31:30 -0400 (Thu, 16 Sep 2010)
New Revision: 24966
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
Log:
JBIDE-6981 https://jira.jboss.org/browse/JBIDE-6981:
VPE Selection Tag Bar: enhancement.
- Menu disposing is fixed.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2010-09-16 16:26:34 UTC (rev 24965)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2010-09-16 16:31:30 UTC (rev 24966)
@@ -11,8 +11,6 @@
package org.jboss.tools.vpe.selbar;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.compare.Splitter;
@@ -49,11 +47,6 @@
import org.eclipse.ui.internal.WorkbenchImages;
import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.jboss.tools.common.meta.XAttribute;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.ui.attribute.adapter.AdapterFactory;
-import org.jboss.tools.common.model.ui.attribute.adapter.IModelPropertyEditorAdapter;
-import org.jboss.tools.common.model.ui.util.ModelUtilities;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
import org.jboss.tools.vpe.editor.VpeController;
@@ -385,7 +378,12 @@
* Create DropDownMenu button
*/
item = new ToolItem(selBar, SWT.DROP_DOWN, 1);
- DropdownSelectionListener listenerOne = new DropdownSelectionListener(item);
+ final DropdownSelectionListener listenerOne = new DropdownSelectionListener(item);
+ item.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ listenerOne.disposeMenu();
+ }
+ });
for (Node node2 : list) {
listenerOne.add(node2);
}
@@ -622,8 +620,15 @@
*/
public DropdownSelectionListener(ToolItem dropdown) {
this.dropdown = dropdown;
- menu = new Menu(dropdown.getParent().getShell());
+ menu = new Menu(dropdown.getParent());
}
+
+ public void disposeMenu() {
+ if (menu != null) {
+ menu.dispose();
+ menu = null;
+ }
+ }
/**
* Adds an item to the dropdown list
15 years, 7 months
JBoss Tools SVN: r24965 - trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-09-16 12:26:34 -0400 (Thu, 16 Sep 2010)
New Revision: 24965
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-7075 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/plugin.xml 2010-09-16 16:26:12 UTC (rev 24964)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/plugin.xml 2010-09-16 16:26:34 UTC (rev 24965)
@@ -123,7 +123,7 @@
contributorClass="org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditorContributor"
icon="icons/hibernate_small_icon.gif"
id="org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor"
- name="Hibernate reverse engineering editor">
+ name="Hibernate Reverse Engineering Editor">
<contentTypeBinding contentTypeId="org.hibernate.eclipse.mapper.revengxmlsource"/>
</editor>
</extension>
15 years, 7 months
JBoss Tools SVN: r24964 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-09-16 12:26:12 -0400 (Thu, 16 Sep 2010)
New Revision: 24964
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
Log:
Fixed compilation error
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2010-09-16 16:12:06 UTC (rev 24963)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2010-09-16 16:26:12 UTC (rev 24964)
@@ -41,7 +41,8 @@
org.jboss.tools.jsf.text.ext,
org.jboss.tools.jsf.text.ext.facelets,
org.jboss.tools.jsf.text.ext.richfaces,
- org.jboss.tools.jst.text.ext
+ org.jboss.tools.jst.text.ext,
+ org.eclipse.wst.validation
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.jboss.tools.jsf.vpe.jsf.test
15 years, 7 months
JBoss Tools SVN: r24963 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test: src/org/hibernate/eclipse/console/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-09-16 12:12:06 -0400 (Thu, 16 Sep 2010)
New Revision: 24963
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6838 - fixed with some code refactoring
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-09-16 16:00:50 UTC (rev 24962)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-09-16 16:12:06 UTC (rev 24963)
@@ -16,34 +16,34 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <query>
- <hql>from testQuery</hql>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </query>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2dao/>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
<hbm2hbmxml>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2hbmxml>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
<hbmtemplate>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
+ <query>
+ <hql>from testQuery</hql>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
+ </query>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-09-16 16:00:50 UTC (rev 24962)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-09-16 16:12:06 UTC (rev 24963)
@@ -17,34 +17,34 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <query>
- <hql>from testQuery</hql>
- <property key="ejb3" value="true"/>
- <property key="jdk5" value="true"/>
- </query>
+ <hbm2cfgxml ejb3="true">
+ <property key="jdk5" value="true"/>
+ </hbm2cfgxml>
+ <hbm2dao ejb3="true" jdk5="true"/>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
+ </hbm2ddl>
<hbm2doc>
<property key="ejb3" value="true"/>
<property key="jdk5" value="true"/>
</hbm2doc>
- <hbm2cfgxml ejb3="true">
- <property key="jdk5" value="true"/>
- </hbm2cfgxml>
<hbm2hbmxml>
<property key="ejb3" value="true"/>
<property key="jdk5" value="true"/>
</hbm2hbmxml>
+ <hbm2java destdir="outputdir/test" ejb3="true" jdk5="true">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
<hbmtemplate>
<property key="ejb3" value="true"/>
<property key="jdk5" value="true"/>
</hbmtemplate>
- <hbm2java destdir="outputdir/test" ejb3="true" jdk5="true">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
+ <query>
+ <hql>from testQuery</hql>
<property key="ejb3" value="true"/>
<property key="jdk5" value="true"/>
- </hbm2ddl>
- <hbm2dao ejb3="true" jdk5="true"/>
+ </query>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml 2010-09-16 16:00:50 UTC (rev 24962)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenNullable_test1.xml 2010-09-16 16:12:06 UTC (rev 24963)
@@ -7,34 +7,34 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <query>
- <hql>from testQuery</hql>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </query>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2dao/>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
<hbm2hbmxml>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2hbmxml>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
<hbmtemplate>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
+ <query>
+ <hql>from testQuery</hql>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
+ </query>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml 2010-09-16 16:00:50 UTC (rev 24962)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml 2010-09-16 16:12:06 UTC (rev 24963)
@@ -8,34 +8,34 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <query>
- <hql>from testQuery</hql>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </query>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2dao/>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
<hbm2hbmxml>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2hbmxml>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
<hbmtemplate>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
+ <query>
+ <hql>from testQuery</hql>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
+ </query>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-09-16 16:00:50 UTC (rev 24962)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-09-16 16:12:06 UTC (rev 24963)
@@ -8,34 +8,34 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <query>
- <hql>from testQuery</hql>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </query>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2dao/>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
<hbm2hbmxml>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2hbmxml>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
<hbmtemplate>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
+ <query>
+ <hql>from testQuery</hql>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
+ </query>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-09-16 16:00:50 UTC (rev 24962)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-09-16 16:12:06 UTC (rev 24963)
@@ -10,34 +10,34 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <query>
- <hql>from testQuery</hql>
- <property key="ejb3" value="false"/>
- <property key="jdk5" value="false"/>
- </query>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2dao/>
+ <hbm2ddl export="false">
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
<hbm2doc>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2doc>
- <hbm2cfgxml>
- <property key="jdk5" value="false"/>
- </hbm2cfgxml>
<hbm2hbmxml>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbm2hbmxml>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
<hbmtemplate>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
</hbmtemplate>
- <hbm2java destdir="outputdir/test">
- <property key="keyXXX" value="valueYYY"/>
- </hbm2java>
- <hbm2ddl export="false">
+ <query>
+ <hql>from testQuery</hql>
<property key="ejb3" value="false"/>
<property key="jdk5" value="false"/>
- </hbm2ddl>
- <hbm2dao/>
+ </query>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-09-16 16:00:50 UTC (rev 24962)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-09-16 16:12:06 UTC (rev 24963)
@@ -24,6 +24,7 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.TreeMap;
import org.dom4j.Document;
import org.dom4j.DocumentException;
@@ -56,8 +57,8 @@
public static final String LN_1 = "\n"; //$NON-NLS-1$
public static final String LN_2 = "\r\n"; //$NON-NLS-1$
- public static final String SAMPLE_PATH = "res/sample/".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
- public static final String PROJECT_LIB_PATH = "res/project/lib/".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
+ public static final String SAMPLE_PATH = "res/sample/"; //$NON-NLS-1$
+ public static final String PROJECT_LIB_PATH = "res/project/lib/"; //$NON-NLS-1$
public static final String HBMTEMPLATE0 = "hbm2java"; //$NON-NLS-1$
public static final String HBMTEMPLATE0_PROPERTIES = HibernateLaunchConstants.ATTR_EXPORTERS
@@ -65,7 +66,7 @@
public static final String HBMTEMPLATE1 = "query"; //$NON-NLS-1$
public static final String HBMTEMPLATE1_PROPERTIES = HibernateLaunchConstants.ATTR_EXPORTERS
+ '.' + HBMTEMPLATE1 + ".properties"; //$NON-NLS-1$
- public static final String OUTDIR_PATH = "outputdir/test".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
+ public static final String OUTDIR_PATH = "outputdir/test"; //$NON-NLS-1$
public class TestConsoleConfigPref extends TestConsoleConfigurationPreferences {
public File getConfigXMLFile() {
@@ -79,7 +80,7 @@
}
}
- public class TestConsoleConfigPref2 extends TestConsoleConfigurationPreferences {
+ public class TestConsoleConfigPrefJpa extends TestConsoleConfigurationPreferences {
public File getConfigXMLFile() {
return null;
}
@@ -119,7 +120,7 @@
}
public String getConnectionProfileName() {
- return "jdbc:mysql://localhost:3306/jpa"; //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
}
public String getDialectName() {
@@ -136,74 +137,108 @@
return "testDialect"; //$NON-NLS-1$
}
}
-
- public enum ETestCase {
- simple,
- relative,
- jpa,
- properties,
- nullable,
- }
public class CodeGenXMLFactory4Test extends CodeGenXMLFactory {
-
- protected ETestCase testCase = ETestCase.simple;
-
- public CodeGenXMLFactory4Test(ILaunchConfiguration lc, ETestCase testCase) {
+ public CodeGenXMLFactory4Test(ILaunchConfiguration lc) {
super(lc);
- this.testCase = testCase;
}
public ConsoleConfigurationPreferences getConsoleConfigPreferences(String consoleConfigName) {
- ConsoleConfigurationPreferences pref = null;
- if (testCase == ETestCase.simple) {
- pref = new TestConsoleConfigPref();
- } else if (testCase == ETestCase.relative) {
- pref = new TestConsoleConfigPref();
- } else if (testCase == ETestCase.jpa) {
- pref = new TestConsoleConfigPref2();
- } else if (testCase == ETestCase.properties) {
- pref = new TestConsoleConfigPref3();
- }
- return pref;
+ return null;
}
public String getConnectionProfileDriverURL(String connectionProfile) {
return "test-driver-path.jar"; //$NON-NLS-1$
}
+ public IConnectionProfile getConnectionProfile(String connProfileName) {
+ return null;
+ }
+
+ public String getDriverClass(String connProfileName) {
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ public class CodeGenXMLFactory4TestNullable extends CodeGenXMLFactory4Test {
+ public CodeGenXMLFactory4TestNullable(ILaunchConfiguration lc) {
+ super(lc);
+ }
+
public String getResLocation(String path) {
- if (testCase == ETestCase.relative) {
- return super.getResLocation(path);
- }
return new Path("reslocation/test").toString(); //$NON-NLS-1$
}
+ }
+ public class CodeGenXMLFactory4TestSimple extends CodeGenXMLFactory4Test {
+ public CodeGenXMLFactory4TestSimple(ILaunchConfiguration lc) {
+ super(lc);
+ }
+
+ public ConsoleConfigurationPreferences getConsoleConfigPreferences(String consoleConfigName) {
+ return new TestConsoleConfigPref();
+ }
+
+ public String getResLocation(String path) {
+ return new Path("reslocation/test").toString(); //$NON-NLS-1$
+ }
+ }
+
+ public class CodeGenXMLFactory4TestRelative extends CodeGenXMLFactory4Test {
+ public CodeGenXMLFactory4TestRelative(ILaunchConfiguration lc) {
+ super(lc);
+ }
+
+ public ConsoleConfigurationPreferences getConsoleConfigPreferences(String consoleConfigName) {
+ return new TestConsoleConfigPref();
+ }
+ }
+
+ public class CodeGenXMLFactory4TestJpa extends CodeGenXMLFactory4Test {
+ public CodeGenXMLFactory4TestJpa(ILaunchConfiguration lc) {
+ super(lc);
+ }
+
+ public ConsoleConfigurationPreferences getConsoleConfigPreferences(String consoleConfigName) {
+ return new TestConsoleConfigPrefJpa();
+ }
+
+ public String getResLocation(String path) {
+ return new Path("reslocation/test").toString(); //$NON-NLS-1$
+ }
+ }
+
+ public class CodeGenXMLFactory4TestProperties extends CodeGenXMLFactory4Test {
+ public CodeGenXMLFactory4TestProperties(ILaunchConfiguration lc) {
+ super(lc);
+ }
+
+ public ConsoleConfigurationPreferences getConsoleConfigPreferences(String consoleConfigName) {
+ return new TestConsoleConfigPref3();
+ }
+
+ public String getResLocation(String path) {
+ return new Path("reslocation/test").toString(); //$NON-NLS-1$
+ }
+
public IConnectionProfile getConnectionProfile(String connProfileName) {
- IConnectionProfile profile = null;
- if (testCase == ETestCase.properties) {
- profile = new ConnectionProfile("testName", null, null) { //$NON-NLS-1$
- public Properties getProperties(String type) {
- Properties res = new Properties();
- res.setProperty("org.eclipse.datatools.connectivity.db.URL", "url"); //$NON-NLS-1$ //$NON-NLS-2$
- res.setProperty("org.eclipse.datatools.connectivity.db.username", "username"); //$NON-NLS-1$ //$NON-NLS-2$
- res.setProperty("org.eclipse.datatools.connectivity.db.password", "passw"); //$NON-NLS-1$ //$NON-NLS-2$
- return res;
- }
- };
- }
+ IConnectionProfile profile = new ConnectionProfile("testName", null, null) { //$NON-NLS-1$
+ public Properties getProperties(String type) {
+ Properties res = new Properties();
+ res.setProperty("org.eclipse.datatools.connectivity.db.URL", "url"); //$NON-NLS-1$ //$NON-NLS-2$
+ res.setProperty("org.eclipse.datatools.connectivity.db.username", "username"); //$NON-NLS-1$ //$NON-NLS-2$
+ res.setProperty("org.eclipse.datatools.connectivity.db.password", "passw"); //$NON-NLS-1$ //$NON-NLS-2$
+ return res;
+ }
+ };
return profile;
}
public String getDriverClass(String connProfileName) {
- String driverClass = ""; //$NON-NLS-1$
- if (testCase == ETestCase.properties) {
- driverClass = "driverClass"; //$NON-NLS-1$
- }
- return driverClass;
+ return "driverClass"; //$NON-NLS-1$
}
}
-
+
/**
* Parse, i.e. adjust xml text so attributes for same xml
* will be in one order.
@@ -227,7 +262,8 @@
}
public void testCodeGenXMLFactoryRevengAll() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(true, true, ETestCase.simple);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(true, true, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestSimple(testLaunchConfig);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
String sample = getSample("AntCodeGenReveng_test1.xml"); //$NON-NLS-1$
@@ -236,7 +272,8 @@
}
public void testCodeGenXMLFactoryRevengOne() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(true, false, ETestCase.simple);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(true, false, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestSimple(testLaunchConfig);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
String sample = getSample("AntCodeGenReveng_test2.xml"); //$NON-NLS-1$
@@ -245,9 +282,10 @@
}
public void testCodeGenXMLFactoryAll() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.relative);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestRelative(testLaunchConfig);
//
- String strPlace = "project/src".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
+ String strPlace = "project/src"; //$NON-NLS-1$
codeGenFactory.setPlace2Generate(strPlace);
codeGenFactory.setWorkspacePath(strPlace);
//
@@ -259,9 +297,10 @@
}
public void testCodeGenXMLFactoryOne() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.relative);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestRelative(testLaunchConfig);
//
- String strPlace = "project/src".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
+ String strPlace = "project/src"; //$NON-NLS-1$
codeGenFactory.setPlace2Generate(strPlace);
codeGenFactory.setWorkspacePath(strPlace);
//
@@ -273,7 +312,8 @@
}
public void testCodeGenXMLFactoryJpaAll() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.jpa);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, true);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestJpa(testLaunchConfig);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
@@ -283,7 +323,8 @@
}
public void testCodeGenXMLFactoryJpaOne() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.jpa);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, true);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestJpa(testLaunchConfig);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
@@ -293,7 +334,8 @@
}
public void testCodeGenXMLFactoryNullableAll() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.nullable);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestNullable(testLaunchConfig);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
@@ -303,7 +345,8 @@
}
public void testCodeGenXMLFactoryNullableOne() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.nullable);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestNullable(testLaunchConfig);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
@@ -313,7 +356,8 @@
}
public void testCodeGenXMLFactoryPropertiesAll() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.properties);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestProperties(testLaunchConfig);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
@@ -324,7 +368,8 @@
}
public void testCodeGenXMLFactoryPropertiesOne() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.properties);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestProperties(testLaunchConfig);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
@@ -335,7 +380,8 @@
}
public void testCodeGenXMLFactoryInternalPropertiesAll() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.properties);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestProperties(testLaunchConfig);
codeGenFactory.setExternalPropFile(false);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
@@ -347,7 +393,8 @@
}
public void testCodeGenXMLFactoryInternalPropertiesOne() {
- CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.properties);
+ TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, false);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestProperties(testLaunchConfig);
codeGenFactory.setExternalPropFile(false);
String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
@@ -369,15 +416,15 @@
}
return codeGen.replace(repl + IPath.SEPARATOR, ""); //$NON-NLS-1$
}
-
- public CodeGenXMLFactory codeGenXMLFactory(boolean reveng, boolean exportersAll, ETestCase testCase) {
+
+ public Map<String, Object> getTestLaunchConfigAttr(boolean reveng, boolean exportersAll, boolean jpa) {
Map<String, ExporterDefinition> exDefinitions = ExtensionManager.findExporterDefinitionsAsMap();
Map<String, Object> testLaunchConfigAttr = new HashMap<String, Object>();
String tmp = "12345678901234567890"; //$NON-NLS-1$
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, tmp);
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_OUTPUT_DIR, tmp);
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS, tmp);
- if (testCase == ETestCase.jpa) {
+ if (jpa) {
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_ENABLE_EJB3_ANNOTATIONS, true);
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_ENABLE_JDK5, true);
}
@@ -387,7 +434,9 @@
} else {
exportersList.add(HBMTEMPLATE0);
}
- for (Map.Entry<String, ExporterDefinition> exDef : exDefinitions.entrySet()) {
+ TreeMap<String, ExporterDefinition> exDefinitionsSorted = new TreeMap<String, ExporterDefinition>();
+ exDefinitionsSorted.putAll(exDefinitions);
+ for (Map.Entry<String, ExporterDefinition> exDef : exDefinitionsSorted.entrySet()) {
String tmp0 = exDef.getValue().getExporterTag();
String tmp1 = ExporterAttributes.getLaunchAttributePrefix(tmp0);
testLaunchConfigAttr.put(tmp1 + ".extension_id", //$NON-NLS-1$
@@ -413,11 +462,16 @@
testLaunchConfigAttr.put(HBMTEMPLATE1_PROPERTIES, expProps3);
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, reveng);
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_PREFER_BASIC_COMPOSITE_IDS, true);
+ return testLaunchConfigAttr;
+ }
+
+ public TestLaunchConfig createTestLaunchConfig(boolean reveng, boolean exportersAll, boolean jpa) {
+ Map<String, Object> testLaunchConfigAttr = getTestLaunchConfigAttr(reveng, exportersAll, jpa);
TestLaunchConfig testLaunchConfig = new TestLaunchConfig(testLaunchConfigAttr);
- CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4Test(testLaunchConfig, testCase);
- return codeGenFactory;
+ return testLaunchConfig;
}
+
public String getSample(String fileName) {
File resourceFile = null;
try {
15 years, 7 months