Author: mareshkau
Date: 2009-05-27 04:13:55 -0400 (Wed, 27 May 2009)
New Revision: 15548
Added:
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/jbide3969.xhtml
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3969Test.java
Modified:
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
branches/jbosstools-3.0.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3969, fix applied to branch
Added:
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/jbide3969.xhtml
===================================================================
---
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/jbide3969.xhtml
(rev 0)
+++
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/jbide3969.xhtml 2009-05-27
08:13:55 UTC (rev 15548)
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core">
+
+<ui:composition template="">
+<h:selectOneMenu value="#{test.test}">
+<div>a<div>t</div></div>
+</h:selectOneMenu>
+</ui:composition>
+</html>
\ No newline at end of file
Modified:
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-05-27
06:43:21 UTC (rev 15547)
+++
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-05-27
08:13:55 UTC (rev 15548)
@@ -53,6 +53,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3632Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3650Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3734Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3969Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
@@ -131,6 +132,7 @@
suite.addTestSuite(JBIDE3482Test.class);
suite.addTestSuite(JBIDE3632Test.class);
suite.addTestSuite(JBIDE3650Test.class);
+ suite.addTestSuite(JBIDE3969Test.class);
// $JUnit-END$
// added by Max Areshkau
Added:
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3969Test.java
===================================================================
---
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3969Test.java
(rev 0)
+++
branches/jbosstools-3.0.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3969Test.java 2009-05-27
08:13:55 UTC (rev 15548)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE3969Test extends VpeTest{
+
+ public JBIDE3969Test(String name) {
+ super(name);
+ }
+
+ public void testCorrectCustomElements() throws Throwable {
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath("JBIDE/3969/jbide3969.xhtml",
+ JsfAllTests.IMPORT_PROJECT_NAME);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ checkSourceSelection(part);
+
+ // check exception
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+}
Modified:
branches/jbosstools-3.0.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
---
branches/jbosstools-3.0.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-05-27
06:43:21 UTC (rev 15547)
+++
branches/jbosstools-3.0.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-05-27
08:13:55 UTC (rev 15548)
@@ -383,7 +383,7 @@
}else {
getIFlasher().setColor(flasherHiddentElementColor);
}
- getIFlasher().drawElementOutline(element);
+ drawElementOutline(element);
}else {
getIFlasher().setColor(flasherHiddentElementColor);
@@ -391,7 +391,7 @@
if(domElement!=null) {
- getIFlasher().drawElementOutline(domElement);
+ drawElementOutline(domElement);
}
}
@@ -548,17 +548,17 @@
getIFlasher().setColor(flasherHiddentElementColor);
}
- getIFlasher().drawElementOutline(getLastSelectedElement());
+ drawElementOutline(getLastSelectedElement());
}else {
getIFlasher().setColor(flasherHiddentElementColor);
nsIDOMElement domElement = findVisbleParentElement(getLastSelectedElement());
if(domElement!=null) {
- getIFlasher().drawElementOutline(domElement);
+ drawElementOutline(domElement);
}
}
- } else
if(getIFlasher()!=null&&Platform.getOSArch().equals(Platform.OS_MACOSX)){
+ } else if(getIFlasher()!=null&&Platform.OS_MACOSX.equals(Platform.getOS())){
//Max Areshkau (bug on Mac OS X, when we switch to preview from other view, selection
rectangle doesn't disappear
//TODO Max Areshkau (may be exist passability not draw selection on resize event when
we switches to other view)
try {
@@ -641,6 +641,34 @@
return null;
}
+ /**
+ * Decorator
+ * @author mareshkau
+ * @param domElement arround which border will be shown
+ *
+ */
+ private void drawElementOutline(nsIDOMElement domElement) {
+ //fix for JBIDE-3969
+ if(Platform.OS_MACOSX.equals(Platform.getOS())&&hasSelectInParenNodes(domElement.getParentNode()))
{
+ return;
+ }
+ getIFlasher().drawElementOutline(domElement);
+ }
+ /**
+ * Checks if node has select in parent node, if has it's cause crash
+ * on OSX and xulrunner 1.8.1.3
+ * @param domElement
+ * @return
+ */
+ private boolean hasSelectInParenNodes(nsIDOMNode domNode){
+ if(domNode==null) {
+ return false;
+ }else if("select".equalsIgnoreCase(domNode.getNodeName())){
+ return true;
+ } else {
+ return hasSelectInParenNodes(domNode.getParentNode());
+ }
+ }
}