Author: nickboldt
Date: 2009-10-09 21:53:01 -0400 (Fri, 09 Oct 2009)
New Revision: 18029
Modified:
trunk/vpe/features/org.jboss.tools.xulrunner.feature/feature.xml
trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java
Log:
apply
https://anonsvn.jboss.org/repos/jbosstools/workspace/mareshkau/xulrunner1...
patch to make VPE work with XulRunner 1.9
Modified: trunk/vpe/features/org.jboss.tools.xulrunner.feature/feature.xml
===================================================================
--- trunk/vpe/features/org.jboss.tools.xulrunner.feature/feature.xml 2009-10-10 00:23:50
UTC (rev 18028)
+++ trunk/vpe/features/org.jboss.tools.xulrunner.feature/feature.xml 2009-10-10 01:53:01
UTC (rev 18029)
@@ -2,10 +2,9 @@
<feature
id="org.jboss.tools.xulrunner.feature"
label="%featureName"
- version="1.8.1.3-20070904"
+ version="1.9.1.2_v20091009-2100"
provider-name="%providerName"
plugin="org.jboss.tools.xulrunner">
-
<description>
%description
</description>
@@ -27,7 +26,7 @@
id="org.mozilla.xpcom"
download-size="0"
install-size="0"
- version="1.8.1.3-20070904"/>
+ version="0.0.0"/>
<plugin
id="org.mozilla.xulrunner.carbon.macosx"
@@ -35,7 +34,7 @@
ws="carbon"
download-size="0"
install-size="0"
- version="1.8.1.3-20070904"/>
+ version="0.0.0"/>
<plugin
id="org.mozilla.xulrunner.gtk.linux.x86"
@@ -44,7 +43,7 @@
arch="x86"
download-size="0"
install-size="0"
- version="1.8.1.3-20070904"/>
+ version="0.0.0"/>
<plugin
id="org.mozilla.xulrunner.gtk.linux.x86_64"
@@ -53,7 +52,7 @@
arch="x86_64"
download-size="0"
install-size="0"
- version="1.8.1.4-20080112"/>
+ version="0.0.0"/>
<plugin
id="org.mozilla.xulrunner.win32.win32.x86"
@@ -62,7 +61,7 @@
arch="x86"
download-size="0"
install-size="0"
- version="1.8.1.3-20070904"/>
+ version="0.0.0"/>
<plugin
id="org.jboss.tools.xulrunner.initializer"
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-10-10
00:23:50 UTC (rev 18028)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-10-10
01:53:01 UTC (rev 18029)
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.MenuManager;
@@ -129,6 +130,7 @@
import org.jboss.tools.vpe.resref.core.TaglibReferenceList;
import org.jboss.tools.vpe.selbar.SelectionBar;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerVpeUtils;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMEvent;
@@ -179,7 +181,7 @@
private VpePageContext pageContext;
private BundleMap bundle;
private VpeEditorPart editPart;
- private static final int LEFT_BUTTON = 0;
+ public static final int LEFT_BUTTON = 0;
private CSSReferenceList cssReferenceListListener;
private TaglibReferenceList taglibReferenceListListener;
@@ -1096,8 +1098,16 @@
// }
// selection will be set only if press left button
- if (mouseEvent.getButton() == LEFT_BUTTON)
+ if (mouseEvent.getButton() == LEFT_BUTTON) {
selectionManager.setSelection(mouseEvent);
+ //drag gesture isn't generated in XR 1.9 for Linux Platforms, so we start
it's manually
+ //mareshkau
+ nsIDOMElement selectedElement = getXulRunnerEditor().getLastSelectedElement();
+ if
(VpeVisualDomBuilder.inDragArea(XulRunnerVpeUtils.getElementBounds(selectedElement),
VisualDomUtil
+ .getMousePoint(mouseEvent))) {
+ dragGesture(mouseEvent);
+ }
+ }
} finally {
switcher.stopActiveEditor();
}
@@ -1313,6 +1323,7 @@
boolean canDragFlag = canInnerDrag(mouseEvent);
// start drag sessionvpe-element
if (canDragFlag) {
+
startDragSession(domEvent);
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-10-10
00:23:50 UTC (rev 18028)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-10-10
01:53:01 UTC (rev 18029)
@@ -2031,6 +2031,8 @@
styleClasses = ATTR_DRAG_AVAILABLE_CLASS + " " //$NON-NLS-1$
+ styleClasses;
}
+ //if mouse in drag area, and left button is pressed than we should
+ //start drag session manually.
} else {
// change cursor style to normal
if (styleClasses != null) {
@@ -2043,7 +2045,7 @@
}
}
- private boolean inDragArea(Rectangle dragArea, Point mousePoint) {
+ public static boolean inDragArea(Rectangle dragArea, Point mousePoint) {
// TODO add drag and drop support
return dragArea.contains(mousePoint)
&& mousePoint.x < (dragArea.x + DRAG_AREA_WIDTH)
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java 2009-10-10
00:23:50 UTC (rev 18028)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java 2009-10-10
01:53:01 UTC (rev 18029)
@@ -166,6 +166,7 @@
} else if(DRAGOVEREVENT.equals(eventType)) {
getEditorDomEventListener().dragOver(domEvent);
}
+
getEditorDomEventListener().onRefresh();
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-10-10
00:23:50 UTC (rev 18028)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-10-10
01:53:01 UTC (rev 18029)
@@ -1040,7 +1040,7 @@
nsIEditingSession iEditingSession = (nsIEditingSession) getXulRunnerEditor().
getComponentManager().createInstanceByContractID(XPCOM.NS_EDITINGSESSION_CONTRACTID,
null, nsIEditingSession.NS_IEDITINGSESSION_IID);
//make window editable
- iEditingSession.makeWindowEditable(getXulRunnerEditor().getWebBrowser().getContentDOMWindow(),
"html", true); //$NON-NLS-1$
+ iEditingSession.makeWindowEditable(getXulRunnerEditor().getWebBrowser().getContentDOMWindow(),
"html", true,true,true); //$NON-NLS-1$
//here we setup editor for window
iEditingSession.setupEditorOnWindow(getXulRunnerEditor().getWebBrowser().getContentDOMWindow());
//getting some editor to disable some actions
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2009-10-10
00:23:50 UTC (rev 18028)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2009-10-10
01:53:01 UTC (rev 18029)
@@ -10,18 +10,14 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.util;
-import java.lang.ref.Reference;
-import java.lang.ref.SoftReference;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
-import org.mozilla.interfaces.nsIAccessibilityService;
import org.mozilla.interfaces.nsIAccessible;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -33,7 +29,6 @@
import org.mozilla.interfaces.nsIDOMNodeList;
import org.mozilla.interfaces.nsIDOMRange;
import org.mozilla.interfaces.nsISelection;
-import org.mozilla.xpcom.Mozilla;
import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -50,7 +45,7 @@
public static String FACELETS_URI = "http://java.sun.com/jsf/facelets";
//$NON-NLS-1$
private static final String ACCESSIBILITY_SERVICE_CONTRACT_ID =
"(a)mozilla.org/accessibilityService;1"; //$NON-NLS-1$
- private static Reference<nsIAccessibilityService> accessibilityServiceCache =
null;
+// private static Reference<nsIAccessibilityService> accessibilityServiceCache =
null;
private static Set<String> escapedTags;
@@ -236,23 +231,23 @@
*
* @author yradtsevich
*/
- public static nsIAccessibilityService getAccessibilityService() {
- nsIAccessibilityService accessibilityService = null;
- if (accessibilityServiceCache != null) {
- // get accessibilityService from cache
- accessibilityService = accessibilityServiceCache.get();
- }
- if (accessibilityService == null) {
- accessibilityService = (nsIAccessibilityService) Mozilla.getInstance()
- .getServiceManager()
- .getServiceByContractID(ACCESSIBILITY_SERVICE_CONTRACT_ID,
- nsIAccessibilityService.NS_IACCESSIBILITYSERVICE_IID);
-
- // cache accessibilityService
- accessibilityServiceCache = new
SoftReference<nsIAccessibilityService>(accessibilityService);
- }
- return accessibilityService;
- }
+// public static nsIAccessibilityService getAccessibilityService() {
+// nsIAccessibilityService accessibilityService = null;
+// if (accessibilityServiceCache != null) {
+// // get accessibilityService from cache
+// accessibilityService = accessibilityServiceCache.get();
+// }
+// if (accessibilityService == null) {
+// accessibilityService = (nsIAccessibilityService) Mozilla.getInstance()
+// .getServiceManager()
+// .getServiceByContractID(ACCESSIBILITY_SERVICE_CONTRACT_ID,
+// nsIAccessibilityService.NS_IACCESSIBILITYSERVICE_IID);
+//
+// // cache accessibilityService
+// accessibilityServiceCache = new
SoftReference<nsIAccessibilityService>(accessibilityService);
+// }
+// return accessibilityService;
+// }
/**
* Returns on screen bounds of the {@code node}
@@ -264,8 +259,8 @@
*/
public static Rectangle getBounds(nsIDOMNode node) {
Rectangle bounds = null;
-
- nsIAccessible accessible = getAccessibilityService().getAccessibleFor(node);
+
+ nsIAccessible accessible = (nsIAccessible)
node.queryInterface(nsIAccessible.NS_IACCESSIBLE_IID);
if (accessible != null) {
int[] xArray = new int[1]; // Left hand corner of the node
int[] yArray = new int[1]; // Top corner of the node
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java 2009-10-10
00:23:50 UTC (rev 18028)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlTextTemplate.java 2009-10-10
01:53:01 UTC (rev 18029)
@@ -19,14 +19,12 @@
import org.jboss.tools.vpe.editor.mapping.VpeElementData;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
-import org.jboss.tools.vpe.editor.util.NodesManagingUtil;
import org.jboss.tools.vpe.editor.util.TextUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Node;
-import org.w3c.dom.ranges.RangeException;
/**
* @author mareshkau
@@ -42,7 +40,7 @@
String sourceText = sourceNode.getNodeValue();
if (sourceText.trim().length() <= 0) {
- return new VpeCreationData(visualDocument.createTextNode(sourceText));
+ return new VpeCreationData(visualDocument.createTextNode(""));
//$NON-NLS-1$
}
String visualText = TextUtil.visualText(sourceText);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2009-10-10
00:23:50 UTC (rev 18028)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2009-10-10
01:53:01 UTC (rev 18029)
@@ -50,8 +50,8 @@
public class XulRunnerBrowser implements nsIWebBrowserChrome,
nsIWebProgressListener, nsITooltipListener {
- private static final String XULRUNNER_LOWER_VERSION = "1.8.1.2";
//$NON-NLS-1$
- private static final String XULRUNNER_HIGHER_VERSION = "1.8.1.9";
//$NON-NLS-1$
+ private static final String XULRUNNER_LOWER_VERSION = "1.9.1.0";
//$NON-NLS-1$
+ private static final String XULRUNNER_HIGHER_VERSION = "1.9.1.9";
//$NON-NLS-1$
// TODO Sergey Vasilyev Think. May be XULRUNNER_BUNDLE shouldn't be final?
private static final String XULRUNNER_BUNDLE;
private static final String XULRUNNER_ENTRY = "/xulrunner"; //$NON-NLS-1$
@@ -82,7 +82,7 @@
}
public XulRunnerBrowser(Composite parent) throws XulRunnerException {
- initXulRunner();
+// initXulRunner();
browser = new Browser(parent, SWT.MOZILLA);