JBoss Tools SVN: r8653 - branches/jbosstools-2.1.x/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-06-09 17:58:44 -0400 (Mon, 09 Jun 2008)
New Revision: 8653
Modified:
branches/jbosstools-2.1.x/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
Log:
this was broken. off by one error
Modified: branches/jbosstools-2.1.x/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
===================================================================
--- branches/jbosstools-2.1.x/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-06-09 20:26:40 UTC (rev 8652)
+++ branches/jbosstools-2.1.x/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-06-09 21:58:44 UTC (rev 8653)
@@ -62,7 +62,7 @@
if(projectPath == null) {
projectPath = "/projects/" + name;
} else if(name == null) {
- name = projectPath.substring(projectPath.lastIndexOf('/'));
+ name = projectPath.substring(projectPath.lastIndexOf('/')+1);
}
this.makeCopy = makeCopy;
init(bundleName, projectPath, name);
17 years, 10 months
JBoss Tools SVN: r8652 - trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1/JavaSource/demo.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-09 16:26:40 -0400 (Mon, 09 Jun 2008)
New Revision: 8652
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1/JavaSource/demo/BaseBean.java
Log:
cleanup the code
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1/JavaSource/demo/BaseBean.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1/JavaSource/demo/BaseBean.java 2008-06-09 19:08:56 UTC (rev 8651)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1/JavaSource/demo/BaseBean.java 2008-06-09 20:26:40 UTC (rev 8652)
@@ -6,6 +6,8 @@
return "";
}
- public void fuck() {}
+ public void action1() {
+
+ }
}
17 years, 10 months
JBoss Tools SVN: r8651 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: resources/jsfTest/WebContent/pages/JBIDE/2297 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-06-09 15:08:56 -0400 (Mon, 09 Jun 2008)
New Revision: 8651
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2297/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2297/JBIDE-2297.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2297Test.java
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
junit for http://jira.jboss.com/jira/browse/JBIDE-2297, also was made some code adjustment
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2297/JBIDE-2297.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2297/JBIDE-2297.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2297/JBIDE-2297.xhtml 2008-06-09 19:08:56 UTC (rev 8651)
@@ -0,0 +1,11 @@
+<!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:graphicImage value=" %= request.getContextPath()%/images/logos/banner.png"/>ffffff
+ </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 2008-06-09 18:46:31 UTC (rev 8650)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-06-09 19:08:56 UTC (rev 8651)
@@ -20,11 +20,12 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1460Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1479Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1484Test;
-import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1494;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1494Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1615Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1720Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1730Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1744Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2297Test;
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.JsfJbide1467Test;
@@ -63,7 +64,8 @@
suite.addTestSuite(JBIDE1720Test.class);
suite.addTestSuite(JsfJbide1718Test.class);
suite.addTestSuite(JBIDE1730Test.class);
- suite.addTestSuite(JBIDE1494.class);
+ suite.addTestSuite(JBIDE1494Test.class);
+ suite.addTestSuite(JBIDE2297Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494.java 2008-06-09 18:46:31 UTC (rev 8650)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494.java 2008-06-09 19:08:56 UTC (rev 8651)
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.jsf.test.jbide;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.vpe.editor.VpeController;
-import org.jboss.tools.vpe.editor.template.VpeTemplate;
-import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
-import org.jboss.tools.vpe.ui.test.TestUtil;
-import org.jboss.tools.vpe.ui.test.VpeTest;
-import org.w3c.dom.Node;
-
-/**
- * @author mareshkau
- *
- */
-public class JBIDE1494 extends VpeTest{
-
- public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
- private static final String TEST_PAGE_NAME = "JBIDE/1494/JBIDE-1494.xhtml"; //$NON-NLS-1$
-
- public JBIDE1494(String name) {
- super(name);
- }
-
- public void testJBIDE1494() throws Throwable {
- // wait
- TestUtil.waitForJobs();
- // set exception
- setException(null);
- // Tests CA
- // get test page path
- IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
- assertNotNull("Could not open specified file " + TEST_PAGE_NAME, file); //$NON-NLS-1$
-
- IEditorInput input = new FileEditorInput(file);
-
- assertNotNull("Editor input is null", input); //$NON-NLS-1$
-
- // open and get editor
- JSPMultiPageEditor part = openEditor(input);
-
- StyledText styledText = part.getSourceEditor().getTextViewer()
- .getTextWidget();
-
- styledText.setCaretOffset(424);
- Node h_outputText = (Node) ContentAssistUtils.getNodeAt(part
- .getSourceEditor().getTextViewer(), 424);
-
- assertNotNull(h_outputText);
-
- VpeController vpeController = getVpeController(part);
-
- VpeTemplateManager templateManager= vpeController.getPageContext().getVisualBuilder().getTemplateManager();
- assertNotNull(templateManager);
- Set<?> dependencySet = new HashSet();
- VpeTemplate h_output_template = templateManager.getTemplate(vpeController.getPageContext(),h_outputText, dependencySet);
-
- assertNotNull(h_output_template.getTextFormatingData());
- //text formating for h:output
- assertEquals(7,h_output_template.getTextFormatingData().getAllFormatData().length);
-
- Node h_dataTable = (Node) ContentAssistUtils.getNodeAt(part
- .getSourceEditor().getTextViewer(), 473);
-
- assertNotNull(h_dataTable);
-
- dependencySet=new HashSet();
-
- VpeTemplate h_data_Table = templateManager.getTemplate(vpeController.getPageContext(),h_dataTable , dependencySet);
-
- assertNotNull(h_data_Table.getTextFormatingData());
-
- assertEquals(8,h_data_Table.getTextFormatingData().getAllFormatData().length);
-
- Node span =(Node) ContentAssistUtils.getNodeAt(part
- .getSourceEditor().getTextViewer(), 615);
-
- dependencySet=new HashSet();
-
- VpeTemplate spanTemplate = templateManager.getTemplate(vpeController.getPageContext(),span, dependencySet);
-
- assertNotNull(spanTemplate);
- assertEquals(10,spanTemplate.getTextFormatingData().getAllFormatData().length);
- }
-
-
-}
Copied: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494Test.java (from rev 8646, trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494.java)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494Test.java 2008-06-09 19:08:56 UTC (rev 8651)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.template.VpeTemplate;
+import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.w3c.dom.Node;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE1494Test extends VpeTest{
+
+ public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
+
+ private static final String TEST_PAGE_NAME = "JBIDE/1494/JBIDE-1494.xhtml"; //$NON-NLS-1$
+
+ public JBIDE1494Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE1494() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ // Tests CA
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
+ IMPORT_PROJECT_NAME);
+ assertNotNull("Could not open specified file " + TEST_PAGE_NAME, file); //$NON-NLS-1$
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ StyledText styledText = part.getSourceEditor().getTextViewer()
+ .getTextWidget();
+
+ styledText.setCaretOffset(424);
+ Node h_outputText = (Node) ContentAssistUtils.getNodeAt(part
+ .getSourceEditor().getTextViewer(), 424);
+
+ assertNotNull(h_outputText);
+
+ VpeController vpeController = getVpeController(part);
+
+ VpeTemplateManager templateManager= vpeController.getPageContext().getVisualBuilder().getTemplateManager();
+ assertNotNull(templateManager);
+ Set<?> dependencySet = new HashSet();
+ VpeTemplate h_output_template = templateManager.getTemplate(vpeController.getPageContext(),h_outputText, dependencySet);
+
+ assertNotNull(h_output_template.getTextFormatingData());
+ //text formating for h:output
+ assertEquals(7,h_output_template.getTextFormatingData().getAllFormatData().length);
+
+ Node h_dataTable = (Node) ContentAssistUtils.getNodeAt(part
+ .getSourceEditor().getTextViewer(), 473);
+
+ assertNotNull(h_dataTable);
+
+ dependencySet=new HashSet();
+
+ VpeTemplate h_data_Table = templateManager.getTemplate(vpeController.getPageContext(),h_dataTable , dependencySet);
+
+ assertNotNull(h_data_Table.getTextFormatingData());
+
+ assertEquals(8,h_data_Table.getTextFormatingData().getAllFormatData().length);
+
+ Node span =(Node) ContentAssistUtils.getNodeAt(part
+ .getSourceEditor().getTextViewer(), 615);
+
+ dependencySet=new HashSet();
+
+ VpeTemplate spanTemplate = templateManager.getTemplate(vpeController.getPageContext(),span, dependencySet);
+
+ assertNotNull(spanTemplate);
+ assertEquals(10,spanTemplate.getTextFormatingData().getAllFormatData().length);
+ }
+
+
+}
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2297Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2297Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2297Test.java 2008-06-09 19:08:56 UTC (rev 8651)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * Test case for
+ *
+ * @author mareshkau
+ *
+ */
+public class JBIDE2297Test extends VpeTest{
+
+ public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
+
+ private static final String TEST_PAGE_NAME = "JBIDE/2297/JBIDE-2297.xhtml"; //$NON-NLS-1$
+
+ public JBIDE2297Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE2297() throws Throwable {
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,IMPORT_PROJECT_NAME));
+ }
+}
17 years, 10 months
JBoss Tools SVN: r8650 - trunk/jsf/tests/org.jboss.tools.jsf.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-09 14:46:31 -0400 (Mon, 09 Jun 2008)
New Revision: 8650
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/build.properties
Log:
restore jsf component tests
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/build.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/build.properties 2008-06-09 18:45:17 UTC (rev 8649)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/build.properties 2008-06-09 18:46:31 UTC (rev 8650)
@@ -5,9 +5,8 @@
jsf-tests.jar,\
standard/,\
META-INF/,\
- lib/,\
- lib/xmlunit1.0.jar,\
- projects/
+ projects/,\
+ lib/
src.includes = standard/,\
src/,\
test.xml,\
17 years, 10 months
JBoss Tools SVN: r8649 - trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-09 14:45:17 -0400 (Mon, 09 Jun 2008)
New Revision: 8649
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1/testCases.xml
Log:
restore jsf component tests
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1/testCases.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1/testCases.xml 2008-06-09 18:12:44 UTC (rev 8648)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStart1/testCases.xml 2008-06-09 18:45:17 UTC (rev 8649)
@@ -359,41 +359,41 @@
<!-- Test Managed Beans -->
<test name="JSFModelTest:testPaths:attribute">
- <property name="path" value="/faces-config.xml/Managed Beans/nameBean"/>
+ <property name="path" value="/faces-config.xml/Managed Beans/user"/>
<property name="attributeName" value="element type"/>
<property name="attributeValue" value="managed-bean"/>
</test>
<test name="JSFModelTest:testPaths:attribute">
- <property name="path" value="/faces-config.xml/Managed Beans/nameBean"/>
+ <property name="path" value="/faces-config.xml/Managed Beans/user"/>
<property name="attributeName" value="managed-bean-class"/>
- <property name="attributeValue" value="demo.NameBean"/>
+ <property name="attributeValue" value="demo.User"/>
</test>
<test name="JSFModelTest:testPaths:attribute">
- <property name="path" value="/faces-config.xml/Managed Beans/nameBean"/>
+ <property name="path" value="/faces-config.xml/Managed Beans/user"/>
<property name="attributeName" value="managed-bean-scope"/>
<property name="attributeValue" value="session"/>
</test>
<test name="JSFModelTest:testPaths:attribute">
- <property name="path" value="/faces-config.xml/Managed Beans/nameBean"/>
+ <property name="path" value="/faces-config.xml/Managed Beans/user"/>
<property name="attributeName" value="description"/>
<property name="attributeValue" value="Input Value Holder"/>
</test>
<!-- Test Managed Property -->
<test name="JSFModelTest:testPaths:attribute">
- <property name="path" value="/faces-config.xml/Managed Beans/nameBean/userName"/>
+ <property name="path" value="/faces-config.xml/Managed Beans/user/name"/>
<property name="attributeName" value="element type"/>
<property name="attributeValue" value="managed-property"/>
</test>
<!-- Test list-values -->
<test name="JSFModelTest:testPaths:attribute">
- <property name="path" value="/faces-config.xml/Managed Beans/nameBean/aliases/Entries"/>
+ <property name="path" value="/faces-config.xml/Managed Beans/user/aliases/Entries"/>
<property name="attributeName" value="element type"/>
<property name="attributeValue" value="list-entries"/>
</test>
<test name="JSFModelTest:testPaths:attribute">
- <property name="path" value="/faces-config.xml/Managed Beans/nameBean/aliases/Entries"/>
+ <property name="path" value="/faces-config.xml/Managed Beans/user/aliases/Entries"/>
<property name="attributeName" value="value-class"/>
<property name="attributeValue" value="java.lang.String"/>
</test>
17 years, 10 months
JBoss Tools SVN: r8648 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-06-09 14:12:44 -0400 (Mon, 09 Jun 2008)
New Revision: 8648
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2297
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-06-09 16:56:16 UTC (rev 8647)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-06-09 18:12:44 UTC (rev 8648)
@@ -57,8 +57,15 @@
try {
tagValue = URLDecoder.decode(tagValue, "UTF-8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+
+ VpePlugin.getPluginLog().logError(e);
+ } catch (IllegalArgumentException ex) {
+ //if user enter invalid URL, for example " % sss",
+ //illegal argument exception will be throwed,
+ //brouser will not processed this url, so we just slow this exeption
+ //You can check it's by inserting next code
+ //<h:graphicImage value=" %= request.getContextPath()%/images/logos/banner.png"/>
+ tagValue="";
}
IPath tagPath = new Path(tagValue);
17 years, 10 months
JBoss Tools SVN: r8647 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-06-09 12:56:16 -0400 (Mon, 09 Jun 2008)
New Revision: 8647
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesProgressBarTemplateTestCase.java
Log:
Change testcases.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java 2008-06-09 16:07:59 UTC (rev 8646)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java 2008-06-09 16:56:16 UTC (rev 8647)
@@ -95,7 +95,7 @@
* @throws Throwable the throwable
*/
public void testInplaceInputWithoutAttributes() throws CoreException, Throwable {
- baseCheck(TEMPLATE_WITH_EMPTY_TAG, NULL, RICH_INPLACE_VIEW);
+ baseCheck(TEMPLATE_WITH_EMPTY_TAG, null, RICH_INPLACE_VIEW);
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesProgressBarTemplateTestCase.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesProgressBarTemplateTestCase.java 2008-06-09 16:07:59 UTC (rev 8646)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesProgressBarTemplateTestCase.java 2008-06-09 16:56:16 UTC (rev 8647)
@@ -101,7 +101,7 @@
* Test simple.
*/
public void testSimple() {
- baseTest(SIMPLE_PAGE, CHECK_BASE_STYLE, "height: 13px; text-align: left;", STYLE_CLASS_2,"height: 13px; width: 60%;d");
+ baseTest(SIMPLE_PAGE, CHECK_BASE_STYLE, "height: 13px; text-align: left;", STYLE_CLASS_2,"height: 13px; width: 60%;");
}
/**
17 years, 10 months
JBoss Tools SVN: r8646 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-06-09 12:07:59 -0400 (Mon, 09 Jun 2008)
New Revision: 8646
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FaceletUtil.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlBodyTemplate.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/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaPreview.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
JBIDE-2170
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2008-06-09 15:53:50 UTC (rev 8645)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -87,7 +87,7 @@
// FIX for JBIDE-1213 (Max Areshkau)
if(data.getNode()!=null) {
String bodyClass = ((Element)sourceNode).getAttribute("bodyClass");
- applyStylesToTable(data.getNode(), bodyClass);
+ //applyStylesToTable(data.getNode(), bodyClass);
}
}
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 2008-06-09 15:53:50 UTC (rev 8645)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -20,7 +20,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
@@ -137,10 +136,10 @@
import org.jboss.tools.vpe.editor.template.VpeTemplateListener;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.toolbar.format.FormatControllerManager;
+import org.jboss.tools.vpe.editor.util.DocTypeUtil;
import org.jboss.tools.vpe.editor.util.TemplateManagingUtil;
import org.jboss.tools.vpe.editor.util.TextUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
-import org.jboss.tools.vpe.editor.util.VpeDebugUtil;
import org.jboss.tools.vpe.editor.util.VpeDndUtil;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.selbar.SelectionBar;
@@ -1454,16 +1453,28 @@
}
void visualRefreshImpl() {
- visualEditor.hideResizer();
- visualBuilder.setSelectionRectangle(null);
- IDOMModel sourceModel = (IDOMModel) getModel();
- if (sourceModel != null) {
- IDOMDocument sourceDocument = sourceModel.getDocument();
- visualBuilder.rebuildDom(sourceDocument);
- } else {
- visualBuilder.rebuildDom(null);
+
+ visualEditor.hideResizer();
+
+ String currentDoctype = DocTypeUtil.getDoctype(visualEditor
+ .getEditorInput());
+
+ if (!visualEditor.getDoctype().equals(currentDoctype)) {
+
+ visualEditor.reload();
+
+ }else {
+
+ visualBuilder.setSelectionRectangle(null);
+ IDOMModel sourceModel = (IDOMModel) getModel();
+ if (sourceModel != null) {
+ IDOMDocument sourceDocument = sourceModel.getDocument();
+ visualBuilder.rebuildDom(sourceDocument);
+ } else {
+ visualBuilder.rebuildDom(null);
+ }
+ }
}
- }
public void preLongOperation() {
switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL);
@@ -2919,5 +2930,22 @@
}
return changeEvents;
}
+
+ public void reinit() {
+ visualBuilder.setSelectionRectangle(null);
+ visualEditor.setEditorDomEventListener(this);
+ IDOMModel sourceModel = (IDOMModel) getModel();
+ if (sourceModel != null) {
+ IDOMDocument sourceDocument = sourceModel.getDocument();
+ visualBuilder.rebuildDom(sourceDocument);
+ } else {
+ visualBuilder.rebuildDom(null);
+ }
+
+ visualSelectionController.setSelection(xulRunnerEditor
+ .getSelection());
+
+ }
+
}
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 2008-06-09 15:53:50 UTC (rev 8645)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -67,6 +67,7 @@
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.jboss.tools.vpe.editor.template.dnd.VpeDnd;
+import org.jboss.tools.vpe.editor.util.FaceletUtil;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.TextUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
@@ -115,10 +116,12 @@
private MozillaEditor visualEditor;
private XulRunnerEditor xulRunnerEditor;
private nsIDOMDocument visualDocument;
- private nsIDOMElement visualContentArea;
+ // JBIDE-2170 Sergey Dzmitrovich
+ // private nsIDOMElement visualContentArea;
private VpePageContext pageContext;
private VpeDnD dnd;
- private nsIDOMNode headNode;
+ // JBIDE-2170 Sergey Dzmitrovich
+ // private nsIDOMNode headNode;
private List includeStack;
// TODO Max Areshkau JBIDE-1457
// boolean rebuildFlag = false;
@@ -167,18 +170,6 @@
private Map<IFile, Document> includeDocuments = new HashMap<IFile, Document>();
-
- /**
- * facelet elements, if there are these elements on a page then other
- * elements are deleted
- */
- static private HashSet<String> faceletRootElements = new HashSet<String>();
-
- static {
- faceletRootElements.add("composition"); //$NON-NLS-1$
- faceletRootElements.add("component"); //$NON-NLS-1$
- }
-
public VpeVisualDomBuilder(VpeDomMapping domMapping,
INodeAdapter sorceAdapter, VpeTemplateManager templateManager,
MozillaEditor visualEditor, VpePageContext pageContext) {
@@ -186,10 +177,10 @@
this.visualEditor = visualEditor;
xulRunnerEditor = visualEditor.getXulRunnerEditor();
this.visualDocument = visualEditor.getDomDocument();
- this.visualContentArea = visualEditor.getContentArea();
+// this.visualContentArea = visualEditor.getContentArea();
this.dnd = new VpeDnD();
this.pageContext = pageContext;
- this.headNode = visualEditor.getHeadNode();
+// this.headNode = visualEditor.getHeadNode();
dropper = new VpeDnd();
dropper.setDndData(false, true);
@@ -219,77 +210,35 @@
pageContext.refreshConnector();
pageContext.installIncludeElements();
if (isFacelet()) {
- Element root = getRootElement(sourceDocument);
- if(root != null)
- {
- addNode(root, null, visualContentArea);
+ Element root = FaceletUtil.getRootFaceletElement(sourceDocument);
+ if (root != null) {
+ addNode(root, null, getContentArea());
}
} else {
- addChildren(null, sourceDocument, visualContentArea);
+ addChildren(null, sourceDocument, getContentArea());
}
/*
* Fixes http://jira.jboss.com/jira/browse/JBIDE-2126.
* To provide appropriate context menu functionality
* visual content area should be mapped in any case.
*/
- registerNodes(new VpeNodeMapping(sourceDocument, visualContentArea));
+ registerNodes(new VpeNodeMapping(sourceDocument, getContentArea()));
}
- private Element getRootElement(Document sourceDocument) {
-
- NodeList nodeList = sourceDocument.getChildNodes();
- Element root = null;
-
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node child = nodeList.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- root = (Element) child;
- break;
- }
- }
-
- if (root != null) {
- Element trimmedElement = findFaceletRootElement(root);
- if (trimmedElement != null)
- root = trimmedElement;
- }
- return root;
- }
-
- private Element findFaceletRootElement(Element element) {
-
- NodeList children = element.getChildNodes();
-
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
-
- Element trimmedElement = findFaceletRootElement((Element) child);
- if (trimmedElement != null)
- return trimmedElement;
-
- }
- }
-
- if (faceletRootElements.contains(element.getLocalName()))
- return element;
- return null;
- }
-
public void rebuildDom(Document sourceDocument) {
// clearIncludeDocuments();
cleanHead();
- domMapping.clear(visualContentArea);
+ domMapping.clear(getContentArea());
super.dispose();
pageContext.clearAll();
refreshExternalLinks();
pageContext.getBundle().refreshRegisteredBundles();
- nsIDOMNodeList children = visualContentArea.getChildNodes();
+ nsIDOMNodeList children = getContentArea().getChildNodes();
long len = children.getLength();
for (long i = len - 1; i >= 0; i--) {
- visualContentArea.removeChild(children.item(i));
+ getContentArea().removeChild(children.item(i));
}
if (sourceDocument != null) {
@@ -663,7 +612,7 @@
nsIDOMText newText = visualDocument.createTextNode(styleText);
newStyle.appendChild(newText);
}
- headNode.appendChild(newStyle);
+ getHeadNode().appendChild(newStyle);
return newStyle;
}
@@ -677,12 +626,12 @@
newStyle.appendChild(newText);
}
- headNode.replaceChild(newStyle, oldStyleNode);
+ getHeadNode().replaceChild(newStyle, oldStyleNode);
return newStyle;
}
public void removeStyleNodeFromHead(nsIDOMNode oldStyleNode) {
- headNode.removeChild(oldStyleNode);
+ getHeadNode().removeChild(oldStyleNode);
}
void addExternalLinks() {
@@ -704,7 +653,7 @@
}
void removeExternalLinks() {
- nsIDOMNodeList childs = headNode.getChildNodes();
+ nsIDOMNodeList childs = getHeadNode().getChildNodes();
long length = childs.getLength();
for (long i = length - 1; i >= 0; i--) {
nsIDOMNode node = childs.item(i);
@@ -721,7 +670,7 @@
.equalsIgnoreCase(element.getAttribute(ATTR_VPE))))
&& YES_STRING.equalsIgnoreCase(element
.getAttribute(VpeTemplateManager.ATTR_LINK_EXT))) {
- headNode.removeChild(node);
+ getHeadNode().removeChild(node);
}
}
}
@@ -850,7 +799,7 @@
}
public boolean isEmptyDocument() {
- nsIDOMNodeList visualNodes = visualContentArea.getChildNodes();
+ nsIDOMNodeList visualNodes = getContentArea().getChildNodes();
long len = visualNodes.getLength();
if ((len == 0)
|| (len == 1 && (isEmptyText(visualNodes.item(0)) || isPseudoElement(visualNodes
@@ -1291,11 +1240,11 @@
}
boolean isContentArea(nsIDOMNode visualNode) {
- return visualContentArea.equals(visualNode);
+ return getContentArea().equals(visualNode);
}
nsIDOMElement getContentArea() {
- return visualContentArea;
+ return visualEditor.getContentArea();
}
public void setSelectionRectangle(nsIDOMElement visualElement) {
@@ -1314,8 +1263,8 @@
//TODO Dzmitry Sakovich
// Fix priority CSS classes JBIDE-1713
- nsIDOMNode firstNode = headNode.getFirstChild();
- headNode.insertBefore(newNode, firstNode);
+ nsIDOMNode firstNode = getHeadNode().getFirstChild();
+ getHeadNode().insertBefore(newNode, firstNode);
return newNode;
}
@@ -1323,7 +1272,7 @@
String href_val, String ext_val) {
nsIDOMNode newNode = createLinkNode(href_val,
ATTR_REL_STYLESHEET_VALUE, ext_val);
- headNode.replaceChild(newNode, oldNode);
+ getHeadNode().replaceChild(newNode, oldNode);
return newNode;
}
@@ -1337,7 +1286,7 @@
}
public void removeLinkNodeFromHead(nsIDOMNode node) {
- headNode.removeChild(node);
+ getHeadNode().removeChild(node);
}
private nsIDOMElement createLinkNode(String href_val, String rel_val,
@@ -1401,7 +1350,7 @@
}
private nsIDOMNode getLinkNode(String href_val, String ext_val) {
- nsIDOMNodeList children = headNode.getChildNodes();
+ nsIDOMNodeList children = getHeadNode().getChildNodes();
long len = children.getLength();
for (long i = len - 1; i >= 0; i--) {
nsIDOMNode node = children.item(i);
@@ -1424,7 +1373,7 @@
}
private void cleanHead() {
- nsIDOMNodeList children = headNode.getChildNodes();
+ nsIDOMNodeList children = getHeadNode().getChildNodes();
long len = children.getLength();
for (long i = len - 1; i >= 0; i--) {
nsIDOMNode node = children.item(i);
@@ -1444,14 +1393,14 @@
// nsIStyleSheetLinkingElement linkingElement = new
// nsIStyleSheetLinkingElement(linkAddress);
// linkingElement.removeStyleSheet();
- node = headNode.removeChild(node);
+ node = getHeadNode().removeChild(node);
}
} else if (HTML.TAG_STYLE.equalsIgnoreCase(node.getNodeName())
&& (!YES_STRING
.equalsIgnoreCase(((nsIDOMElement) node
.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))
.getAttribute(ATTR_VPE)))) {
- node = headNode.removeChild(node);
+ node = getHeadNode().removeChild(node);
}
}
}
@@ -1580,7 +1529,7 @@
}
if (sourceDropContainer == null) {
sourceDropContainer = domMapping
- .getNearSourceNode(visualContentArea);
+ .getNearSourceNode(getContentArea());
sourceDropOffset = sourceDropContainer.getChildNodes()
.getLength();
}
@@ -2144,7 +2093,7 @@
clearIncludeDocuments();
includeDocuments = null;
cleanHead();
- domMapping.clear(visualContentArea);
+ domMapping.clear(getContentArea());
pageContext.dispose();
super.dispose();
}
@@ -2364,4 +2313,8 @@
public Map<IFile, Document> getIncludeDocuments() {
return includeDocuments;
}
+
+ public nsIDOMNode getHeadNode() {
+ return visualEditor.getHeadNode();
+ }
}
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 2008-06-09 15:53:50 UTC (rev 8645)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -56,6 +56,7 @@
import org.jboss.tools.vpe.editor.toolbar.VpeToolBarManager;
import org.jboss.tools.vpe.editor.toolbar.format.FormatControllerManager;
import org.jboss.tools.vpe.editor.toolbar.format.TextFormattingToolBar;
+import org.jboss.tools.vpe.editor.util.DocTypeUtil;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
@@ -67,7 +68,7 @@
import org.mozilla.interfaces.nsIDOMNodeList;
public class MozillaEditor extends EditorPart implements IReusableEditor {
- protected static final String INIT_URL = "file://" + (new File(VpePlugin.getDefault().getResourcePath("ve"), "init.html")).getAbsolutePath(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ protected static final String INIT_URL = /*"file://" +*/ (new File(VpePlugin.getDefault().getResourcePath("ve"), "init.html")).getAbsolutePath(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// private static final String INIT_URL = "chrome://vpe/content/init.html"; //$NON-NLS-1$
private static final String CONTENT_AREA_ID = "__content__area__"; //$NON-NLS-1$
@@ -86,7 +87,9 @@
private FormatControllerManager formatControllerManager = new FormatControllerManager();
private VpeController controller;
private Link link = null;
- private boolean loaded;
+ private boolean loaded;
+ private boolean loadPage;
+ private String doctype;
public void doSave(IProgressMonitor monitor) {
}
@@ -212,10 +215,20 @@
cmpEd.setBackground(buttonDarker);
try {
+ loadPage = true;
xulRunnerEditor = new XulRunnerEditor(cmpEd) {
public void onLoadWindow() {
- super.onLoadWindow();
- MozillaEditor.this.onLoadWindow();
+ // if the first load page
+ if (loadPage) {
+ super.onLoadWindow();
+ MozillaEditor.this.onLoadWindow();
+ loadPage = false;
+ }
+ // if only refresh page
+ else {
+ MozillaEditor.this.onReloadWindow();
+ }
+
}
public void onElementResize(nsIDOMElement element, int resizerConstrains, int top, int left, int width, int height) {
if (editorDomEventListener != null) {
@@ -249,7 +262,10 @@
}
});
- xulRunnerEditor.setURL(INIT_URL);
+
+ doctype = DocTypeUtil.getDoctype(getEditorInput());
+ xulRunnerEditor.setText(doctype
+ + DocTypeUtil.getContentInitFile(new File(INIT_URL)));
// Wait while visual part is loaded
while (!loaded) {
if (!Display.getCurrent().readAndDispatch())
@@ -629,6 +645,36 @@
this.contentAreaEventListener = contentAreaEventListener;
}
+
+
+ /**
+ *
+ */
+ private void onReloadWindow() {
+ removeDomEventListeners();
+ contentArea = findContentArea();
+ addDomEventListeners();
+ controller.reinit();
+
+ }
+ /**
+ *
+ */
+ public void reload() {
+
+ doctype = DocTypeUtil.getDoctype(getEditorInput());
+ xulRunnerEditor.setText(doctype
+ + DocTypeUtil.getContentInitFile(new File(INIT_URL)));
+
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getDoctype() {
+ return doctype;
+ }
}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaPreview.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaPreview.java 2008-06-09 15:53:50 UTC (rev 8645)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaPreview.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -36,6 +36,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+import org.jboss.tools.vpe.editor.util.DocTypeUtil;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
@@ -89,7 +90,9 @@
super.onDispose();
}
});
- getXulRunnerEditor().setURL(INIT_URL);
+// getXulRunnerEditor().setURL(INIT_URL);
+ getXulRunnerEditor().setText(DocTypeUtil.prepareInitFile(INIT_URL,
+ getEditorInput()));
getXulRunnerEditor().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
} catch (Exception e) {
Label title = new Label(parent, SWT.WRAP);
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/DocTypeUtil.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -0,0 +1,353 @@
+package org.jboss.tools.vpe.editor.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.filebuffers.ITextFileBufferManager;
+import org.eclipse.core.filebuffers.LocationKind;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.editors.text.ILocationProvider;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+public class DocTypeUtil {
+
+ static private List<String> urlTags;
+
+ static {
+ urlTags = new ArrayList<String>();
+ urlTags.add("link"); //$NON-NLS-1$
+ }
+
+ static private List<String> urlAttributes;
+
+ static {
+ urlAttributes = new ArrayList<String>();
+ urlAttributes.add("href"); //$NON-NLS-1$
+ }
+
+ /**
+ * get doctype by {@link IEditorInput}
+ *
+ * @param editorInput
+ * @return
+ */
+ static public String getDoctype(IEditorInput editorInput) {
+
+ // if opened file is located in eclipse workspace
+ if (editorInput instanceof IFileEditorInput) {
+ IFile f = ((IFileEditorInput) editorInput).getFile();
+ return (f == null || !f.exists()) ? null : getDoctype(f);
+ }
+ // if opened file is not located in eclipse workspace
+ else if (editorInput instanceof ILocationProvider) {
+ IPath path = ((ILocationProvider) editorInput).getPath(editorInput);
+ if (path == null || path.segmentCount() < 1)
+ return null;
+ return getDoctype(path.toFile());
+ }
+ return null;
+
+ }
+
+ /**
+ * get doctype by {@link IFile}
+ *
+ * @param file
+ * @return
+ */
+ static public String getDoctype(IFile file) {
+
+ String docTypeValue = null;
+
+ // get document
+ IDOMDocument document = getDocument(file);
+
+ if (document != null) {
+
+ /*
+ * if there is "component" element (ui:composition or ui:component )
+ * so we don't use doctype from current page (as all text outside
+ * this elements will be removed)
+ */
+
+ // find "component" element
+ Element componentElement = FaceletUtil
+ .findComponentElement(document.getDocumentElement());
+
+ // if "component" element was not found return doctype from current
+ // page
+ if (componentElement == null) {
+
+ IDOMDocumentType documentType = (IDOMDocumentType) document
+ .getDoctype();
+
+ if (documentType != null)
+ docTypeValue = documentType.getSource();
+
+ }
+
+ // if "component" element was not found return doctype from current
+ // page
+ else if ((componentElement != null)
+ && (FaceletUtil.TAG_COMPOSITION.equals(componentElement
+ .getLocalName()))
+ && (componentElement
+ .hasAttribute(FaceletUtil.ATTR_TEMPLATE))) {
+
+ // get attribute "template"
+ Attr attr = ((Element) componentElement)
+ .getAttributeNode(FaceletUtil.ATTR_TEMPLATE);
+
+ if (attr.getNodeValue().trim().length() > 0) {
+
+ // get name of template file
+ String fileName = attr.getNodeValue().trim();
+
+ // get file
+ IFile templateFile = FileUtil.getFile(fileName, file);
+
+ if (templateFile != null)
+ docTypeValue = getDoctype(templateFile);
+
+ }
+
+ }
+ }
+ return docTypeValue != null ? docTypeValue.trim() : ""; //$NON-NLS-1$
+ }
+
+ /**
+ * get doctype by {@link File}
+ *
+ * @param file
+ * @return
+ */
+ static public String getDoctype(File file) {
+
+ String docTypeValue = null;
+
+ // get document
+ IDOMDocument document = getDocument(file);
+
+ if (document != null) {
+
+ /*
+ * if there is "component" element (ui:composition or ui:component )
+ * so we don't use doctype from current page (as all text outside
+ * this elements will be removed)
+ */
+
+ // find "component" element
+ Element componentElement = FaceletUtil
+ .findComponentElement(document.getDocumentElement());
+
+ // if "component" element was not found return doctype from current
+ // page
+ if (componentElement == null) {
+
+ IDOMDocumentType documentType = (IDOMDocumentType) document
+ .getDoctype();
+
+ if (documentType != null)
+ docTypeValue = documentType.getSource();
+
+ }
+
+ // if "component" element was not found return doctype from current
+ // page
+ else if ((componentElement != null)
+ && (FaceletUtil.TAG_COMPOSITION.equals(componentElement
+ .getLocalName()))
+ && (componentElement
+ .hasAttribute(FaceletUtil.ATTR_TEMPLATE))) {
+
+ // get attribute "template"
+ Attr attr = ((Element) componentElement)
+ .getAttributeNode(FaceletUtil.ATTR_TEMPLATE);
+
+ if (attr.getNodeValue().trim().length() > 0) {
+
+ // get name of template file
+ String fileName = attr.getNodeValue().trim();
+
+ // get file
+ File templateFile = new File(file.getParent(), fileName);
+
+ if (templateFile.exists())
+ docTypeValue = getDoctype(templateFile);
+
+ }
+
+ }
+ }
+ return docTypeValue != null ? docTypeValue.trim() : ""; //$NON-NLS-1$
+
+ }
+
+ /**
+ * get document by {@link IFile}
+ *
+ * @param file
+ * @return
+ */
+ static private IDOMDocument getDocument(IFile file) {
+
+ IDOMDocument document = null;
+
+ if (file != null) {
+ try {
+
+ // get model
+ IDOMModel model = (IDOMModel) StructuredModelManager
+ .getModelManager().getModelForRead(file);
+
+ if (model != null)
+ document = model.getDocument();
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ return document;
+ }
+
+ /**
+ * get document by {@link File}
+ *
+ * @param file
+ * @return
+ */
+ static private IDOMDocument getDocument(File file) {
+
+ // if (file.exists()) {
+ //
+ // String content = org.jboss.tools.common.util.FileUtil
+ // .readFile(file);
+ //
+ // IStructuredDocument newStructuredDocument = StructuredDocumentFactory
+ // .getNewStructuredDocumentInstance(new JSPSourceParser());
+ //
+ // newStructuredDocument.set(content);
+ //
+ // IDOMModel modelForJSP = new DOMModelForJSP();
+ // modelForJSP.setStructuredDocument(newStructuredDocument);
+ //
+ // return modelForJSP.getDocument();
+ //
+ // }
+ // return null;
+
+ IDOMModel model = null;
+
+ ITextFileBufferManager bufferManager = FileBuffers
+ .getTextFileBufferManager();
+ IPath location = new Path(file.getAbsolutePath());
+
+ try {
+ bufferManager.connect(location, LocationKind.LOCATION,
+ new NullProgressMonitor());
+
+ ITextFileBuffer buffer = bufferManager.getTextFileBuffer(location,
+ LocationKind.LOCATION);
+ if (buffer != null) {
+
+ IDocument bufferDocument = buffer.getDocument();
+ if (bufferDocument instanceof IStructuredDocument) {
+ model = (IDOMModel) FileBufferModelManager.getInstance()
+ .getModel((IStructuredDocument) bufferDocument);
+ } else {
+
+ bufferManager.disconnect(location, LocationKind.IFILE,
+ new NullProgressMonitor());
+ }
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ return model.getDocument();
+ }
+
+ /**
+ * get
+ *
+ * @param initFilePath
+ * @param editorInput
+ * @return
+ */
+ public static String prepareInitFile(String initFilePath,
+ IEditorInput editorInput) {
+
+ return getDoctype(editorInput)
+ + getContentInitFile(new File(initFilePath));
+
+ }
+
+ /**
+ * get content of initFile, corrected paths on a page
+ *
+ * @param initFile
+ * @return
+ */
+ public static String getContentInitFile(File initFile) {
+
+ IDOMDocument document = getDocument(initFile);
+
+ if (document != null) {
+ // for each tag's name
+ for (String tag : urlTags) {
+
+ NodeList list = document.getElementsByTagName(tag);
+
+ for (int i = 0; i < list.getLength(); i++) {
+
+ Element element = (Element) list.item(i);
+
+ // for each attribute's name
+ for (String attributeName : urlAttributes) {
+
+ if (element.hasAttribute(attributeName)) {
+
+ Attr attr = element.getAttributeNode(attributeName);
+
+ // corrected path
+ attr.setValue(initFile.getParent() + File.separator
+ + attr.getValue());
+
+ }
+
+ }
+
+ }
+
+ }
+
+ return (document).getSource();
+ }
+
+ return ""; //$NON-NLS-1$
+
+ }
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FaceletUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FaceletUtil.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FaceletUtil.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -0,0 +1,69 @@
+package org.jboss.tools.vpe.editor.util;
+
+import java.util.HashSet;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class FaceletUtil {
+
+ public static final String TAG_COMPOSITION = "composition"; //$NON-NLS-1$
+ public static final String TAG_COMPONENT = "component"; //$NON-NLS-1$
+
+ public static final String ATTR_TEMPLATE = "template"; //$NON-NLS-1$
+
+ /**
+ * facelet elements, if there are these elements on a page then other
+ * elements are deleted
+ */
+ static public HashSet<String> componentElements = new HashSet<String>();
+
+ static {
+ componentElements.add(TAG_COMPOSITION); //$NON-NLS-1$
+ componentElements.add(TAG_COMPONENT); //$NON-NLS-1$
+ }
+
+ /**
+ *
+ * @param root
+ * @return
+ */
+ public static Element findComponentElement(Element root) {
+
+ NodeList children = root.getChildNodes();
+
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE) {
+
+ Element trimmedElement = findComponentElement((Element) child);
+ if (trimmedElement != null)
+ return trimmedElement;
+
+ }
+ }
+
+ if (componentElements.contains(root.getLocalName()))
+ return root;
+
+ return null;
+ }
+
+ /**
+ *
+ * @param document
+ * @return
+ */
+ public static Element getRootFaceletElement(Document document) {
+
+ Element root = document.getDocumentElement();
+
+ Element component = findComponentElement(root);
+
+ return component != null ? component : root;
+
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-06-09 15:53:50 UTC (rev 8645)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -90,6 +90,10 @@
public static final String VALUE_TOP_ALIGN = "top"; //$NON-NLS-1$
public static final String VALUE_MIDDLE_ALIGN = "middle"; //$NON-NLS-1$
public static final String VALUE_TEXT_TYPE = "text"; //$NON-NLS-1$
+ public static final String VALUE_PASSWORD_TYPE = "password"; //$NON-NLS-1$
public static final String VALUE_IMAGE_TYPE = "image"; //$NON-NLS-1$
-
+ public static final String VALUE_RADIOBUTTON_TYPE = "radiobutton"; //$NON-NLS-1$
+ public static final String VALUE_CHECKBOX_TYPE = "checkbox"; //$NON-NLS-1$
+ public static final String VALUE_HIDDEN_TYPE = "hidden"; //$NON-NLS-1$
+ public static final String VALUE_BUTTON_TYPE = "button"; //$NON-NLS-1$
}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlBodyTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlBodyTemplate.java 2008-06-09 15:53:50 UTC (rev 8645)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/template/HtmlBodyTemplate.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -40,7 +40,7 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
- goToTree(visualDocument.getChildNodes().item(0));
+ goToTree(visualDocument.getDocumentElement());
nsIDOMNamedNodeMap attrsMap = bodyOld.getAttributes();
long len = attrsMap.getLength();
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 2008-06-09 15:53:50 UTC (rev 8645)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2008-06-09 16:07:59 UTC (rev 8646)
@@ -434,4 +434,8 @@
protected void onDispose() {
}
+
+ public void setText(String html) {
+ browser.setText(html);
+ }
}
17 years, 10 months
JBoss Tools SVN: r8645 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-09 11:53:50 -0400 (Mon, 09 Jun 2008)
New Revision: 8645
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java
Log:
restore richfaces tests
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java 2008-06-09 13:11:25 UTC (rev 8644)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java 2008-06-09 15:53:50 UTC (rev 8645)
@@ -40,23 +40,22 @@
TestSuite suite = new TestSuite("Tests for Vpe RichFaces components"); // $NON-NLS-1$
// $JUnit-BEGIN$
-// suite.addTestSuite(RichFacesComponentTest.class);
-// suite.addTestSuite(JBIDE1579Test.class);
-// suite.addTestSuite(Jbide1580Test.class);
-// suite.addTestSuite(JBIDE1613Test.class);
-// suite.addTestSuite(Jbide1614Test.class);
-// suite.addTestSuite(Jbide1639Test.class);
-// suite.addTestSuite(Jbide1682Test.class);
-// suite.addTestSuite(Jbide1548Test.class);
-// suite.addTestSuite(JBIDE1713Test.class);
- //
-// suite.addTestSuite(RichFacesComboBoxTemplateTestCase.class);
-// suite.addTestSuite(RichFacesInplaceInputTemplateTestCase.class);
-// suite.addTestSuite(RichFacesInplaceSelectTemplateTestCase.class);
+ suite.addTestSuite(RichFacesComponentTest.class);
+ suite.addTestSuite(JBIDE1579Test.class);
+ suite.addTestSuite(Jbide1580Test.class);
+ suite.addTestSuite(JBIDE1613Test.class);
+ suite.addTestSuite(Jbide1614Test.class);
+ suite.addTestSuite(Jbide1639Test.class);
+ suite.addTestSuite(Jbide1682Test.class);
+ suite.addTestSuite(Jbide1548Test.class);
+ suite.addTestSuite(JBIDE1713Test.class);
+ suite.addTestSuite(RichFacesComboBoxTemplateTestCase.class);
+ suite.addTestSuite(RichFacesInplaceInputTemplateTestCase.class);
+ suite.addTestSuite(RichFacesInplaceSelectTemplateTestCase.class);
suite.addTestSuite(RichFacesProgressBarTemplateTestCase.class);
-// suite.addTestSuite(RichFacesFileUploadTemplateTestCase.class);
-// suite.addTestSuite(RichFacesColumnsTemplateTestCase.class);
-// suite.addTestSuite(RichFacesPickListTemplateTestCase.class);
+ suite.addTestSuite(RichFacesFileUploadTemplateTestCase.class);
+ suite.addTestSuite(RichFacesColumnsTemplateTestCase.class);
+ suite.addTestSuite(RichFacesPickListTemplateTestCase.class);
// $JUnit-END$
List<ImportBean> projectToImport = new ArrayList<ImportBean>();
17 years, 10 months
JBoss Tools SVN: r8644 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-06-09 09:11:25 -0400 (Mon, 09 Jun 2008)
New Revision: 8644
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1900
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 2008-06-09 12:05:31 UTC (rev 8643)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-06-09 13:11:25 UTC (rev 8644)
@@ -432,14 +432,14 @@
getChangeEvents().addLast(new VpeEventBean(notifier, eventType, feature, oldValue,newValue, pos));
- if(uiJob==null || uiJob.getState()==Job.NONE) {
+ if(uiJob==null) {
uiJob = new UIJob(VpeUIMessages.VPE_UPDATE_JOB_TITLE){
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
monitor.beginTask(VpeUIMessages.VPE_UPDATE_JOB_TITLE, 100);
while(getChangeEvents().size()>0) {
- VpeDebugUtil.debugInfo(getChangeEvents().size()+"\n"); //$NON-NLS-1$
+
monitor.worked((int)(100/getChangeEvents().size()));
VpeEventBean eventBean = getChangeEvents().getFirst();
if (monitor.isCanceled()) {
@@ -464,10 +464,15 @@
}
};
+ }
+
+ if(uiJob.getState()!=Job.RUNNING) {
+
uiJob.setPriority(Job.LONG);
- uiJob.schedule();
+ //Fix of JBIDE-1900
+ uiJob.cancel();
+ uiJob.schedule(400L);
}
-
return;
}
17 years, 10 months