Author: yzhishko
Date: 2009-11-04 09:42:41 -0500 (Wed, 04 Nov 2009)
New Revision: 18406
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3734Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageAllFacets.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithLayout.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithNestedLayouts.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidths.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsDifferent.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsEms.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsPixels.xhtml.xml
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.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/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/core/html.html.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4022,
https://jira.jboss.org/jira/browse/JBIDE-1546
For win and linux we use IFlasher to draw selection rectangle. Scroll and paint events
support was added for repainting. For Mac OS we add border 2px is style attribute of a
component. JUnit tests were fixed.
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3734Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3734Test.java 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3734Test.java 2009-11-04
14:42:41 UTC (rev 18406)
@@ -48,7 +48,7 @@
nsIDOMElement body = vpeController.getVisualBuilder().getContentArea();
assertEquals("bold", body.getAttribute(HTML.ATTR_CLASS));
//$NON-NLS-1$
- assertEquals("border: 2px solid red; background-color: black;",
body.getAttribute(HTML.ATTR_STYLE)); //$NON-NLS-1$
+ assertEquals("background-color: black;",
body.getAttribute(HTML.ATTR_STYLE)); //$NON-NLS-1$
if(getException()!=null) {
throw getException();
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageAllFacets.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageAllFacets.xhtml.xml 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageAllFacets.xhtml.xml 2009-11-04
14:42:41 UTC (rev 18406)
@@ -1,7 +1,7 @@
<tests>
<test id="id1">
- <DIV STYLE="border: 2px solid blue; background-color: white;"
CLASS="rich-page someClass">
+ <DIV STYLE="background-color: white;" CLASS="rich-page
someClass">
<DIV CLASS="rich-page-header">
<DIV CLASS="rich-page-header-content">
<SPAN STYLE="font-size: 2em;">
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithLayout.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithLayout.xhtml.xml 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithLayout.xhtml.xml 2009-11-04
14:42:41 UTC (rev 18406)
@@ -1,7 +1,7 @@
<tests>
<test id="id1">
- <DIV CLASS="rich-page styleClass" STYLE="border: 2px solid blue;
width: 1000px; background-color: white;">
+ <DIV CLASS="rich-page styleClass" STYLE="width: 1000px;
background-color: white;">
<DIV CLASS="rich-page-header headerClass">
<DIV CLASS="rich-page-header-content">
<SPAN STYLE="font-size: 2em;">
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithNestedLayouts.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithNestedLayouts.xhtml.xml 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithNestedLayouts.xhtml.xml 2009-11-04
14:42:41 UTC (rev 18406)
@@ -1,7 +1,7 @@
<tests>
<test id="id1">
- <DIV CLASS="rich-page someClass" STYLE="border: 2px solid blue;
width: 800px; background-color: white;">
+ <DIV CLASS="rich-page someClass" STYLE="width: 800px;
background-color: white;">
<DIV CLASS="rich-page-header">
<DIV CLASS="rich-page-header-content">
<SPAN STYLE="font-size: 2em;">
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidths.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidths.xhtml.xml 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidths.xhtml.xml 2009-11-04
14:42:41 UTC (rev 18406)
@@ -1,7 +1,7 @@
<tests>
<test id="id1">
- <DIV CLASS="rich-page styleClass" STYLE="border: 2px solid blue;
width: 1000px; background-color: white;">
+ <DIV CLASS="rich-page styleClass" STYLE="width: 1000px;
background-color: white;">
<DIV CLASS="rich-page-header headerClass">
<DIV CLASS="rich-page-header-content">
<SPAN STYLE="font-size: 2em;">
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsDifferent.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsDifferent.xhtml.xml 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsDifferent.xhtml.xml 2009-11-04
14:42:41 UTC (rev 18406)
@@ -1,7 +1,7 @@
<tests>
<test id="id1">
- <DIV CLASS="rich-page styleClass" STYLE="border: 2px solid blue;
width: 1000px; background-color: white;">
+ <DIV CLASS="rich-page styleClass" STYLE="width: 1000px;
background-color: white;">
<DIV CLASS="rich-page-header headerClass">
<DIV CLASS="rich-page-header-content">
<SPAN STYLE="font-size: 2em;">
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsEms.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsEms.xhtml.xml 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsEms.xhtml.xml 2009-11-04
14:42:41 UTC (rev 18406)
@@ -1,7 +1,7 @@
<tests>
<test id="id1">
- <DIV CLASS="rich-page styleClass" STYLE="border: 2px solid blue;
width: 1000px; background-color: white;">
+ <DIV CLASS="rich-page styleClass" STYLE="width: 1000px;
background-color: white;">
<DIV CLASS="rich-page-header headerClass">
<DIV CLASS="rich-page-header-content">
<SPAN STYLE="font-size: 2em;">
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsPixels.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsPixels.xhtml.xml 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/page/pageWithWidthsPixels.xhtml.xml 2009-11-04
14:42:41 UTC (rev 18406)
@@ -1,7 +1,7 @@
<tests>
<test id="id1">
- <DIV CLASS="rich-page styleClass" STYLE="border: 2px solid blue;
width: 1000px; background-color: white;">
+ <DIV CLASS="rich-page styleClass" STYLE="width: 1000px;
background-color: white;">
<DIV CLASS="rich-page-header headerClass">
<DIV CLASS="rich-page-header-content">
<SPAN STYLE="font-size: 2em;">
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-11-04
12:16:48 UTC (rev 18405)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java 2009-11-04
14:42:41 UTC (rev 18406)
@@ -33,6 +33,10 @@
private EditorDomEventListener editorDomEventListener;
//possible events
+ public static final String MOZAFTERPAINT = "MozAfterPaint"; //$NON-NLS-1$
+
+ public static final String SCROLL = "scroll"; //$NON-NLS-1$
+
public static final String MOUSEMOVEEVENTTYPE="mousemove"; //$NON-NLS-1$
public static final String MOUSEDOWNEVENTTYPE="mousedown"; //$NON-NLS-1$
@@ -57,6 +61,7 @@
public static final String DRAGEXITEVENT = "dragexit"; //$NON-NLS-1$
+
void setEditorDomEventListener(EditorDomEventListener listener) {
editorDomEventListener = listener;
}
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-11-04
12:16:48 UTC (rev 18405)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-11-04
14:42:41 UTC (rev 18406)
@@ -21,7 +21,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -35,8 +34,6 @@
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.graphics.Color;
@@ -47,7 +44,6 @@
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IFileEditorInput;
@@ -81,6 +77,7 @@
import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDOMWindow;
import org.mozilla.interfaces.nsIEditingSession;
import org.mozilla.interfaces.nsIEditor;
import org.mozilla.interfaces.nsIHTMLAbsPosEditor;
@@ -847,7 +844,6 @@
if (getContentAreaEventListener() != null) {
getContentAreaEventListener().setVisualEditor(xulRunnerEditor);
setContentAreaEventTarget((nsIDOMEventTarget)
contentArea.queryInterface(nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID));
-
//add mozilla event handlers
getContentAreaEventTarget().addEventListener(MozillaDomEventListener.CLICKEVENTTYPE,
getContentAreaEventListener(), false);
getContentAreaEventTarget().addEventListener(MozillaDomEventListener.MOUSEDOWNEVENTTYPE,
getContentAreaEventListener(), false);
@@ -862,6 +858,12 @@
getContentAreaEventTarget().addEventListener(MozillaDomEventListener.DBLCLICK,
getContentAreaEventListener(), false);
documentEventTarget = (nsIDOMEventTarget)
xulRunnerEditor.getDOMDocument().queryInterface(nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID);
documentEventTarget.addEventListener(MozillaDomEventListener.KEYPRESS,
getContentAreaEventListener(), false);
+ //as a fix of
https://jira.jboss.org/jira/browse/JBIDE-4022
+ //scroll event listener was added for selection border redrawing
+ documentEventTarget.addEventListener(MozillaDomEventListener.SCROLL,
getContentAreaEventListener(), false);
+ nsIDOMWindow window = xulRunnerEditor.getWebBrowser().getContentDOMWindow();
+ nsIDOMEventTarget eventTarget = (nsIDOMEventTarget)
window.queryInterface(nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID);
+ eventTarget.addEventListener(MozillaDomEventListener.MOZAFTERPAINT,
getContentAreaEventListener(), false);
} else {
//baseEventListener = new MozillaBaseEventListener();
}
@@ -884,7 +886,13 @@
if (xulRunnerEditor.getDOMDocument() != null && documentEventTarget != null)
{
documentEventTarget.removeEventListener(MozillaDomEventListener.KEYPRESS,
getContentAreaEventListener(), false);
+ documentEventTarget.removeEventListener(MozillaDomEventListener.SCROLL,
getContentAreaEventListener(), false);
}
+ if ((xulRunnerEditor!=null) && (xulRunnerEditor.getWebBrowser()!= null)) {
+ nsIDOMWindow window = xulRunnerEditor.getWebBrowser().getContentDOMWindow();
+ nsIDOMEventTarget eventTarget = (nsIDOMEventTarget)
window.queryInterface(nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID);
+ eventTarget.removeEventListener(MozillaDomEventListener.MOZAFTERPAINT,
getContentAreaEventListener(), false);
+ }
getContentAreaEventListener().setVisualEditor(null);
getContentAreaEventListener().setEditorDomEventListener(null);
setContentAreaEventTarget(null);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-11-04
14:42:41 UTC (rev 18406)
@@ -760,30 +760,31 @@
// {
// return;
// }
- // restore style for previously bordered element
- if (this.lastBorderedElement != null
- && this.lastBorderedElement.getAttribute(STYLE_ATTR) != null) {
- String style = this.lastBorderedElement
- .getAttribute(PREV_STYLE_ATTR_NAME);
- this.lastBorderedElement.removeAttribute(PREV_STYLE_ATTR_NAME);
- this.lastBorderedElement.setAttribute(STYLE_ATTR, style);
- }
+ if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ // restore style for previously bordered element
+ if (this.lastBorderedElement != null
+ && this.lastBorderedElement.getAttribute(STYLE_ATTR) != null) {
+ String style = this.lastBorderedElement
+ .getAttribute(PREV_STYLE_ATTR_NAME);
+ this.lastBorderedElement.removeAttribute(PREV_STYLE_ATTR_NAME);
+ this.lastBorderedElement.setAttribute(STYLE_ATTR, style);
+ }
- // save style for early bordered element
- String oldstyle = domElement.getAttribute(STYLE_ATTR);
- if (flasherHiddentElementColor.equals(getIFlasher().getColor())) {
- domElement.setAttribute(STYLE_ATTR, domElement
- .getAttribute(STYLE_ATTR)
- + ';' + XulRunnerEditor.INVISIBLE_ELEMENT_BORDER);
+ // save style for early bordered element
+ String oldstyle = domElement.getAttribute(STYLE_ATTR);
+ if (flasherHiddentElementColor.equals(getIFlasher().getColor())) {
+ domElement.setAttribute(STYLE_ATTR, domElement
+ .getAttribute(STYLE_ATTR)
+ + ';' + XulRunnerEditor.INVISIBLE_ELEMENT_BORDER);
+ } else {
+ domElement.setAttribute(STYLE_ATTR, domElement
+ .getAttribute(STYLE_ATTR)
+ + ';' + XulRunnerEditor.VISIBLE_ELEMENT_BORDER);
+ }
+ this.lastBorderedElement = domElement;
+ this.lastBorderedElement.setAttribute(PREV_STYLE_ATTR_NAME, oldstyle);
} else {
- domElement.setAttribute(STYLE_ATTR, domElement
- .getAttribute(STYLE_ATTR)
- + ';' + XulRunnerEditor.VISIBLE_ELEMENT_BORDER);
- }
- this.lastBorderedElement = domElement;
- this.lastBorderedElement.setAttribute(PREV_STYLE_ATTR_NAME, oldstyle);
- // under osx function drawElementOutline not works
- if (!Platform.OS_MACOSX.equals(Platform.getOS())) {
+ // under osx function drawElementOutline not works
getIFlasher().drawElementOutline(domElement);
}
}
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/core/html.html.xml
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/core/html.html.xml 2009-11-04
12:16:48 UTC (rev 18405)
+++
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/components/core/html.html.xml 2009-11-04
14:42:41 UTC (rev 18406)
@@ -1,6 +1,6 @@
<tests>
<test id="html">
- <DIV STYLE="border: 2px solid blue; -moz-user-modify: read-write;">
+ <DIV STYLE="-moz-user-modify: read-write;">
<DIV STYLE="display: none; -moz-user-modify: read-only;">
<BR VPE:PSEUDO-ELEMENT="yes"
STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"
/>