Author: mareshkau
Date: 2009-05-26 13:07:23 -0400 (Tue, 26 May 2009)
New Revision: 15518
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/jbide3969.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3969Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/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,check if element in parent have select item
or not has been added for mac os platform
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/jbide3969.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/jbide3969.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3969/jbide3969.xhtml 2009-05-26
17:07:23 UTC (rev 15518)
@@ -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:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-05-26
16:37:03 UTC (rev 15517)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-05-26
17:07:23 UTC (rev 15518)
@@ -55,6 +55,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.JBIDE4037Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE4373Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
@@ -140,6 +141,7 @@
suite.addTestSuite(JBIDE3197Test.class);
suite.addTestSuite(JBIDE4373Test.class);
suite.addTestSuite(JBIDE675Test.class);
+ suite.addTestSuite(JBIDE3969Test.class);
// $JUnit-END$
// added by Max Areshkau
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3969Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3969Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3969Test.java 2009-05-26
17:07:23 UTC (rev 15518)
@@ -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:
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-05-26
16:37:03 UTC (rev 15517)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-05-26
17:07:23 UTC (rev 15518)
@@ -396,7 +396,7 @@
}else {
getIFlasher().setColor(flasherHiddentElementColor);
}
- getIFlasher().drawElementOutline(element);
+ drawElementOutline(element);
}else {
getIFlasher().setColor(flasherHiddentElementColor);
@@ -404,7 +404,7 @@
if(domElement!=null) {
- getIFlasher().drawElementOutline(domElement);
+ drawElementOutline(domElement);
}
}
@@ -561,17 +561,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 {
@@ -653,6 +653,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());
+ }
+ }
}