JBoss Tools SVN: r9570 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test: jbide and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-06 09:19:04 -0400 (Wed, 06 Aug 2008)
New Revision: 9570
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/ElPreferencesTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2010Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
Move test cases from *.vpe.test to the vpe.ui.test package.
Copied: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java (from rev 9559, trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/CommonJBIDE2010Test.java)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/CommonJBIDE2010Test.java 2008-08-06 13:19:04 UTC (rev 9570)
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * 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;
+
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.vpe.editor.css.ELReferenceList;
+import org.jboss.tools.vpe.editor.css.ResourceReference;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+
+/**
+ * The common test case for the all test cases related to the <a
+ * href="https://jira.jboss.com:8443/jira/browse/JBIDE-2010"
+ * >JBIDE-2010</a>issue.
+ */
+public abstract class CommonJBIDE2010Test extends VpeTest {
+
+ /** The Constant DIR_TEST_PAGE_NAME_3. */
+ protected static final String DIR_TEST_PAGE_NAME_3 = "JBIDE/2010/page3.xhtml"; //$NON-NLS-1$
+
+ /** The Constant VALUE_5. */
+ protected static final String VALUE_5 = "world"; //$NON-NLS-1$
+
+ /** The Constant KEY_5. */
+ protected static final String KEY_5 = "#{bean1.property3}"; //$NON-NLS-1$
+
+ /** The Constant VALUE_4. */
+ protected static final String VALUE_4 = "background: red"; //$NON-NLS-1$
+
+ /** The Constant KEY_4. */
+ protected static final String KEY_4 = "#{bean1.property2}"; //$NON-NLS-1$
+
+ /** The Constant IMPORT_PROJECT_NAME. */
+ public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
+
+ /** The Constant KEY_3. */
+ protected static final String KEY_3 = "#{facesContext.requestPath}"; //$NON-NLS-1$
+
+ /** The Constant KEY_2. */
+ protected static final String KEY_2 = "#{beanA.property2}"; //$NON-NLS-1$
+
+ /** The Constant DIR_TEST_PAGE_NAME. */
+ protected static final String DIR_TEST_PAGE_NAME_2 = "JBIDE/2010/page2.jsp"; //$NON-NLS-1$
+
+ /** The Constant DIR_TEST_PAGE_NAME. */
+ protected static final String DIR_TEST_PAGE_NAME = "JBIDE/2010/page.jsp"; //$NON-NLS-1$
+
+ /** The Constant KEY_1. */
+ protected static final String KEY_1 = "#{beanA.property1}"; //$NON-NLS-1$
+
+ /** The Constant elValuesMap. */
+ protected static final Map<String, String> elValuesMap = new HashMap<String, String>();
+
+ /** The file. */
+ protected IFile file;
+
+ /**
+ * The Constructor.
+ *
+ * @param name the name
+ */
+ public CommonJBIDE2010Test(String name) {
+ super(name);
+
+ }
+
+ /**
+ * Sets the up.
+ *
+ * @throws Exception the exception
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ elValuesMap.put(KEY_1, "/path/image/path/to/image/"); //$NON-NLS-1$
+ elValuesMap.put(KEY_2, "/path2/"); //$NON-NLS-1$
+ elValuesMap.put(KEY_3, "/facesContext/"); //$NON-NLS-1$
+ elValuesMap.put(KEY_4, VALUE_4);
+ elValuesMap.put(KEY_5, VALUE_5);
+ file = (IFile) TestUtil.getComponentPath(getOpenPageName(), getOpenProjectName());
+ ResourceReference[] entries = new ResourceReference[elValuesMap.size()];
+ int i = 0;
+ for (Entry<String, String> string : elValuesMap.entrySet()) {
+
+ entries[i] = new ResourceReference(string.getKey(), ResourceReference.PROJECT_SCOPE);
+ entries[i].setProperties(string.getValue());
+ i++;
+
+
+ }
+ setValues(entries);
+ }
+
+
+ protected String getOpenPageName(){
+ return DIR_TEST_PAGE_NAME;
+ }
+
+ protected String getOpenProjectName(){
+ return IMPORT_PROJECT_NAME;
+ }
+ /**
+ * Sets the values.
+ *
+ * @param key the key
+ * @param value the value
+ * @param scope the scope
+ * @param entries the entries
+ */
+ protected void setValues(ResourceReference[] entries) {
+ ELReferenceList.getInstance().setAllResources(file, entries);
+ }
+
+ /**
+ * Tear down.
+ *
+ * @throws Exception the exception
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ ELReferenceList.getInstance().setAllResources(this.file, new ResourceReference[0]);
+ this.file = null;
+
+ }
+
+}
Copied: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/ElPreferencesTestCase.java (from rev 9559, trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ElPreferencesTestCase.java)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/ElPreferencesTestCase.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/ElPreferencesTestCase.java 2008-08-06 13:19:04 UTC (rev 9570)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * 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;
+
+
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.vpe.editor.util.ElService;
+
+/**
+ * <p>
+ * Test case for testing service {@link ElService}
+ * <p>
+ * See <a href="http://jira.jboss.com/jira/browse/JBIDE-2010">JBIDE-2010</a> issue
+ *
+ */
+public class ElPreferencesTestCase extends CommonJBIDE2010Test {
+
+
+ /**
+ * The Constructor.
+ *
+ * @param name the name
+ */
+ public ElPreferencesTestCase(String name) {
+ super(name);
+
+ }
+
+ /**
+ * Test replace attribute value.
+ *
+ * @throws CoreException the core exception
+ */
+ public void testReplaceAttributeValue() throws CoreException {
+ String string1 = "#{beanA.property1}/images/smalle.gif"; //$NON-NLS-1$
+ String replacedValue = ElService.getInstance().replaceEl(file, string1);
+
+ assertEquals("Should be equals " + elValuesMap.get(KEY_1) + "/images/smalle.gif", replacedValue, elValuesMap.get(KEY_1) //$NON-NLS-1$ //$NON-NLS-2$
+ + "/images/smalle.gif"); //$NON-NLS-1$
+
+ }
+
+ /**
+ * Test replace attribute value2.
+ *
+ * @throws CoreException the core exception
+ */
+ public void testReplaceAttributeValue2() throws CoreException {
+ String string1 = "#{beanA.property1}/images/#{beanA.property2}/path2/#{facesContext.requestPath}/smalle.gif"; //$NON-NLS-1$
+
+ final String replacedValue = ElService.getInstance().replaceEl(file, string1);
+ final String check = elValuesMap.get(KEY_1) + "/images/" + elValuesMap.get(KEY_2) + "/path2/" + elValuesMap.get(KEY_3) //$NON-NLS-1$ //$NON-NLS-2$
+ + "/smalle.gif"; //$NON-NLS-1$
+ assertEquals("Should be equals " + check, check, replacedValue); //$NON-NLS-1$
+
+ }
+
+ /**
+ * Test replace not in set.
+ */
+ public void testReplaceNotInSet() {
+ String string1 = "#{requestScope}/smalle.gif"; //$NON-NLS-1$
+
+ assertEquals("Should be equals", string1, ElService.getInstance().replaceEl(file, string1)); //$NON-NLS-1$
+ }
+}
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-08-06 13:07:48 UTC (rev 9569)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-08-06 13:19:04 UTC (rev 9570)
@@ -25,11 +25,13 @@
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.JBIDE2010Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2119Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2219Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2297Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2434Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2505Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2582Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2584Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
@@ -81,6 +83,9 @@
suite.addTestSuite(JBIDE2219Test.class);
suite.addTestSuite(JBIDE2505Test.class);
suite.addTestSuite(JBIDE2584Test.class);
+ suite.addTestSuite(ElPreferencesTestCase.class);
+ suite.addTestSuite(JBIDE2010Test.class);
+ suite.addTestSuite(JBIDE2582Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Copied: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2010Test.java (from rev 9559, trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/JBIDE2010Test.java)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2010Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2010Test.java 2008-08-06 13:19:04 UTC (rev 9570)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.jsf.vpe.jsf.test.CommonJBIDE2010Test;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+
+
+/**
+ * Test case for testing https://jira.jboss.com:8443/jira/browse/JBIDE-2010
+ * issue.
+ *
+ * @author Eugeny Stherbin
+ */
+public class JBIDE2010Test extends CommonJBIDE2010Test {
+
+
+ /**
+ * The Constructor.
+ *
+ * @param name the name
+ */
+ public JBIDE2010Test(String name) {
+ super(name);
+ }
+
+ /**
+ * Test el template simple.
+ *
+ * @throws CoreException the core exception
+ * @throws Throwable the throwable
+ */
+ public void testElTemplateSimple() throws CoreException, Throwable {
+ final nsIDOMElement rst = TestUtil.performTestForRichFacesComponent((IFile) TestUtil.getComponentPath(DIR_TEST_PAGE_NAME_2,
+ IMPORT_PROJECT_NAME));
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "td" elements
+
+ TestUtil.findAllElementsByName(rst, elements, HTML.TAG_SPAN);
+
+ assertEquals("Count of divs should be equals 1", 1, elements.size()); //$NON-NLS-1$
+ final nsIDOMElement spanOne = (nsIDOMElement) elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertEquals("Style attribute should be substituted", VALUE_4, spanOne.getFirstChild().getNodeValue()); //$NON-NLS-1$
+
+ }
+
+
+ /**
+ * Test el template simple.
+ *
+ * @throws CoreException the core exception
+ * @throws Throwable the throwable
+ */
+ public void testElTemplateSimple2() throws CoreException, Throwable {
+ final nsIDOMElement rst = TestUtil.performTestForRichFacesComponent((IFile) TestUtil.getComponentPath(DIR_TEST_PAGE_NAME_3,
+ IMPORT_PROJECT_NAME));
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "td" elements
+
+ TestUtil.findAllElementsByName(rst, elements, HTML.TAG_P);
+
+ assertEquals("Value should be equals", 1, elements.size()); //$NON-NLS-1$
+ final nsIDOMElement pOne = (nsIDOMElement) elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ // DOMTreeDumper d = new DOMTreeDumper();
+ // d.dumpToStream(System.out, rst);
+// assertEquals("Value should be equals", "Hello "+VALUE_5, pOne.getFirstChild().getFirstChild().getNodeValue());
+ assertTrue("Value should be contains",pOne.getAttribute(HTML.ATTR_STYLE).startsWith(VALUE_4)); //$NON-NLS-1$
+
+ }
+
+}
Copied: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java (from rev 9559, trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/JBIDE2582Test.java)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java 2008-08-06 13:19:04 UTC (rev 9570)
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * 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.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.jboss.tools.jsf.vpe.jsf.test.CommonJBIDE2010Test;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.SelectionUtil;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Node;
+
+
+/**
+ * Test case for testing <a
+ * href="https://jira.jboss.org/jira/browse/JBIDE-2582"> JBIDE-2582 </a> issue
+ *
+ * @author Evgenij Stherbin
+ */
+public class JBIDE2582Test extends CommonJBIDE2010Test {
+
+ /** The Constant DIR_TEST_PAGE_NAME_3. */
+ protected static final String PAGE_1 = "JBIDE/2582/page1.xhtml"; //$NON-NLS-1$
+
+ /** The Constant DIR_TEST_PAGE_NAME_3. */
+ protected static final String PAGE_2 = "JBIDE/2582/page2.xhtml"; //$NON-NLS-1$
+
+ /**
+ * The Constructor.
+ *
+ * @param name the name
+ */
+ public JBIDE2582Test(String name) {
+ super(name);
+
+ }
+
+ /**
+ * Test rs substitution.
+ *
+ * @throws Throwable the throwable
+ */
+ public void _testRsSubstitution() throws Throwable {
+ final nsIDOMElement rst = TestUtil.performTestForRichFacesComponent(file);
+
+ assertNotNull(rst);
+
+ final List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ TestUtil.findAllElementsByName(rst, elements, HTML.TAG_SPAN);
+
+ assertEquals("Size should be equals 1", 1, elements.size()); //$NON-NLS-1$
+
+ final nsIDOMElement spanOne = (nsIDOMElement) elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertEquals("Style attribute should be substituted", "Hello", spanOne.getFirstChild().getNodeValue()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+
+ /**
+ * _test resource substitution in text.
+ *
+ * @throws CoreException the core exception
+ * @throws Throwable the throwable
+ */
+ public void _testResourceSubstitutionInText() throws CoreException, Throwable {
+ final nsIDOMElement rst = TestUtil.performTestForRichFacesComponent((IFile) TestUtil.getComponentPath(PAGE_2, getOpenProjectName()));
+ final List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+ // DOMTreeDumper dumper = new DOMTreeDumper();
+ // dumper.dumpToStream(System.out, rst);
+ TestUtil.findAllElementsByName(rst, elements, "H3"); //$NON-NLS-1$
+ assertEquals("Size should be equals 1", 1, elements.size()); //$NON-NLS-1$
+
+ final nsIDOMElement h3one = (nsIDOMElement) elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertEquals("Style attribute should be substituted", "Hello", h3one.getFirstChild().getFirstChild().getNodeValue()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // There are the label:#{msg.header}f
+
+ TestUtil.findAllElementsByName(rst, elements, "SPAN"); //$NON-NLS-1$
+ assertEquals("Size should be equals 1", 4, elements.size()); //$NON-NLS-1$
+ final nsIDOMElement pOne = ((nsIDOMElement) elements.get(2).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
+
+ assertEquals(
+ "Style attribute should be substituted", "There are the label:Hello Demo Application", pOne.getFirstChild().getNodeValue()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+
+ /**
+ * Test selection with resource string.
+ *
+ * @throws CoreException the core exception
+ */
+ @SuppressWarnings("restriction")
+ public void testSelectionWithResourceString() throws CoreException {
+ IFile lfile = (IFile) TestUtil.getComponentPath(PAGE_2, getOpenProjectName());
+ IEditorInput input = new FileEditorInput(lfile);
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get controller
+ VpeController controller = getVpeController(part);
+ assertNotNull(controller);
+
+ // get dommapping
+ VpeDomMapping domMapping = controller.getDomMapping();
+
+ assertNotNull(domMapping);
+
+ // get source map
+ Map<Node, VpeNodeMapping> sourceMap = domMapping.getSourceMap();
+ assertNotNull(sourceMap);
+
+ // get collection of VpeNodeMapping
+ Collection<VpeNodeMapping> mappings = sourceMap.values();
+ assertNotNull(mappings);
+
+ // get xulrunner editor
+ XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
+ assertNotNull(xulRunnerEditor);
+
+ int start = controller.getPageContext().getSourceBuilder().getStructuredTextViewer().getTextWidget().getText().indexOf(
+ "#{msg.hello_message}"); //$NON-NLS-1$
+
+ assertTrue("Should be gt that 100", start > 100); //$NON-NLS-1$
+
+ IStructuredModel model;
+ model = StructuredModelManager.getModelManager()
+ .getExistingModelForRead(controller.getSourceEditor().getTextViewer().getDocument());
+ IDOMDocument document = null;
+ document = ((IDOMModel) model).getDocument();
+ ;
+ org.w3c.dom.NodeList nodeList = document.getElementsByTagName("h:outputText"); //$NON-NLS-1$
+
+ assertNotNull("Can't be null", nodeList); //$NON-NLS-1$
+ assertTrue("Size should be great that 0", nodeList.getLength() > 0); //$NON-NLS-1$
+
+ final Node elementNode = nodeList.item(0);
+
+ SelectionUtil.setSourceSelection(controller.getPageContext(), elementNode, 0, 0);
+
+ nsIDOMNode node = SelectionUtil.getLastSelectedNode(controller.getPageContext());
+
+ assertEquals("Node names should be equals", "Hello", node.getFirstChild().getNodeValue()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+
+ /**
+ * Gets the open page name.
+ *
+ * @return the open page name
+ */
+ protected String getOpenPageName() {
+ return PAGE_1;
+ }
+
+}
17 years, 4 months
JBoss Tools SVN: r9569 - trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-06 09:07:48 -0400 (Wed, 06 Aug 2008)
New Revision: 9569
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
Log:
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-08-06 13:00:43 UTC (rev 9568)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-08-06 13:07:48 UTC (rev 9569)
@@ -21,9 +21,6 @@
import org.jboss.tools.jsf.vpe.jsf.test.JsfTestPlugin;
import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPageTest;
import org.jboss.tools.vpe.editor.template.VpeTemplateManagerTest;
-import org.jboss.tools.vpe.ui.test.ElPreferencesTestCase;
-import org.jboss.tools.vpe.ui.test.JBIDE2010Test;
-import org.jboss.tools.vpe.ui.test.JBIDE2582Test;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
import org.jboss.tools.vpe.ui.test.beans.ImportBean;
17 years, 4 months
JBoss Tools SVN: r9568 - trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-06 09:00:43 -0400 (Wed, 06 Aug 2008)
New Revision: 9568
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
Log:
Remove moved testcases.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-08-06 12:20:55 UTC (rev 9567)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-08-06 13:00:43 UTC (rev 9568)
@@ -43,10 +43,6 @@
suite.addTestSuite(TemplatesExpressionParsingTest.class);
suite.addTestSuite(VpeEditorPreferencesPageTest.class);
suite.addTestSuite(VpeTemplateManagerTest.class);
- suite.addTestSuite(ElPreferencesTestCase.class);
- suite.addTestSuite(JBIDE2010Test.class);
- suite.addTestSuite(JBIDE2582Test.class);
-
List<ImportBean> projectToImport = new ArrayList<ImportBean>();
ImportBean importBean = new ImportBean();
importBean.setImportProjectName(JsfComponentTest.IMPORT_PROJECT_NAME);
17 years, 4 months
JBoss Tools SVN: r9567 - in trunk/documentation/movies: archiving and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-08-06 08:20:55 -0400 (Wed, 06 Aug 2008)
New Revision: 9567
Added:
trunk/documentation/movies/archiving/
trunk/documentation/movies/archiving/archiving_demo.htm
trunk/documentation/movies/archiving/archiving_demo.js
trunk/documentation/movies/archiving/archiving_demo.swf
trunk/documentation/movies/archiving/archiving_demo.wnk
Log:
https://jira.jboss.org/jira/browse/JBDS-348
Added: trunk/documentation/movies/archiving/archiving_demo.htm
===================================================================
--- trunk/documentation/movies/archiving/archiving_demo.htm (rev 0)
+++ trunk/documentation/movies/archiving/archiving_demo.htm 2008-08-06 12:20:55 UTC (rev 9567)
@@ -0,0 +1,28 @@
+<!-- saved from url=(0014)about:internet -->
+<HTML>
+
+ <head>
+<link rel="stylesheet" href="../resources/tools.css" type="text/css"/>
+<link xmlns="" rel="shortcut icon" type="image/vnd.microsoft.icon" href="../resources/images/favicon.ico"/>
+</head>
+
+<BODY>
+ <div class="book">
+<p id="title"><a href="http://www.jboss.org" class="site_href">
+<strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href">
+<strong >Community Demos</strong></a></p>
+
+<center><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="1030" HEIGHT="793" CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=7,0,0,0">
+<PARAM NAME=movie VALUE="archiving_demo.swf">
+<PARAM NAME=play VALUE=true>
+<PARAM NAME=loop VALUE=false>
+<PARAM NAME=wmode VALUE=transparent>
+<PARAM NAME=quality VALUE=low>
+<EMBED SRC="archiving_demo.swf" WIDTH=1030 HEIGHT=793 quality=low loop=false wmode=transparent TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Sh...">
+</EMBED>
+</OBJECT></center>
+
+ </div>
+<SCRIPT src='archiving_demo.js'></script>
+</BODY>
+</HTML>
Added: trunk/documentation/movies/archiving/archiving_demo.js
===================================================================
--- trunk/documentation/movies/archiving/archiving_demo.js (rev 0)
+++ trunk/documentation/movies/archiving/archiving_demo.js 2008-08-06 12:20:55 UTC (rev 9567)
@@ -0,0 +1,3 @@
+obj=document.getElementsByTagName('object');
+for (var i=0; i<obj.length; ++i)
+ obj[i].outerHTML=obj[i].outerHTML;
Added: trunk/documentation/movies/archiving/archiving_demo.swf
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/movies/archiving/archiving_demo.swf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/movies/archiving/archiving_demo.wnk
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/movies/archiving/archiving_demo.wnk
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 4 months
JBoss Tools SVN: r9566 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor: edit and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-08-06 07:54:26 -0400 (Wed, 06 Aug 2008)
New Revision: 9566
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/GraphicalPartFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesEditPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1189
Updated: one click show/hide params on pages
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java 2008-08-06 11:52:46 UTC (rev 9565)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java 2008-08-06 11:54:26 UTC (rev 9566)
@@ -70,6 +70,7 @@
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.widgets.Composite;
@@ -237,7 +238,7 @@
viewer.setRootEditPart(root);
- viewer.setEditPartFactory(new GraphicalPartFactory());
+ viewer.setEditPartFactory(new GraphicalPartFactory(this));
ContextMenuProvider provider = new PagesContextMenuProvider(viewer,
getActionRegistry());
viewer.setContextMenu(provider);
@@ -260,8 +261,15 @@
}
public void mouseDown(MouseEvent e) {
- }
+ boolean controlFlag = (e.stateMask & SWT.CONTROL) > 0;
+ EditPart part = getGraphicalViewer().findObjectAt(
+ new Point(e.x, e.y));
+
+ if (part instanceof PagesEditPart)
+ ((PagesEditPart) part).doMouseDown(new Point(e.x, e.y));
+ }
+
public void mouseUp(MouseEvent e) {
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/GraphicalPartFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/GraphicalPartFactory.java 2008-08-06 11:52:46 UTC (rev 9565)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/GraphicalPartFactory.java 2008-08-06 11:54:26 UTC (rev 9566)
@@ -12,6 +12,7 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
+import org.jboss.tools.seam.ui.pages.editor.PagesEditor;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesModel;
@@ -22,15 +23,22 @@
public class GraphicalPartFactory implements EditPartFactory {
public static final String REQ_INIT_EDIT = "init edit"; //$NON-NLS-1$
+ private PagesEditor editor;
+
+ public GraphicalPartFactory(PagesEditor editor){
+ this.editor = editor;
+ }
+
public EditPart createEditPart(EditPart context, Object model) {
EditPart child = null;
//System.out.println("createEditPart model - "+model);
if (model instanceof PagesModel)
child = new PagesDiagramEditPart();
- else if (model instanceof Page)
+ else if (model instanceof Page){
child = new PageEditPart();
- else if (model instanceof PageException)
+ ((PageEditPart)child).setEditor(editor);
+ }else if (model instanceof PageException)
child = new ExceptionEditPart();
else if (model instanceof PageWrapper)
child = new ParamListEditPart();
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-08-06 11:52:46 UTC (rev 9565)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-08-06 11:54:26 UTC (rev 9566)
@@ -35,11 +35,13 @@
import org.eclipse.gef.requests.SelectionRequest;
import org.eclipse.swt.accessibility.AccessibleControlEvent;
import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.jboss.tools.common.gef.edit.GEFRootEditPart;
import org.jboss.tools.common.meta.action.XAction;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.seam.ui.pages.SeamUiPagesPlugin;
+import org.jboss.tools.seam.ui.pages.editor.PagesEditor;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
import org.jboss.tools.seam.ui.pages.editor.figures.NodeFigure;
@@ -48,6 +50,12 @@
public class PageEditPart extends PagesEditPart implements
PropertyChangeListener, EditPartListener, Adapter {
private PageFigure fig = null;
+
+ PagesEditor editor;
+
+ public void setEditor(PagesEditor editor){
+ this.editor = editor;
+ }
public void doControlUp() {
}
@@ -60,6 +68,15 @@
public void childAdded(EditPart child, int index) {
}
+
+ public void doMouseDown(Point mp) {
+ Point mouseLocation = mp.scale(1/((GEFRootEditPart)editor.getScrollingGraphicalViewer().getRootEditPart()).getZoomManager().getZoom()).translate(-getPageFigure().getLocation().x, -getPageFigure().getLocation().y);
+ if(mouseLocation.x < 15 && mouseLocation.y > getPageFigure().getSize().height-15){
+ getPageModel().setParamsVisible(!getPageModel().isParamsVisible());
+ refresh();
+ fig.repaint();
+ }
+ }
public void partActivated(EditPart editpart) {
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesEditPart.java 2008-08-06 11:52:46 UTC (rev 9565)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesEditPart.java 2008-08-06 11:54:26 UTC (rev 9566)
@@ -282,4 +282,6 @@
loc.y -= loc.y % 8;
}
+ public void doMouseDown(Point point){
+ }
}
17 years, 4 months
JBoss Tools SVN: r9565 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-08-06 07:52:46 -0400 (Wed, 06 Aug 2008)
New Revision: 9565
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
Log:
add language pluggability
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-08-06 11:52:25 UTC (rev 9564)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-08-06 11:52:46 UTC (rev 9565)
@@ -9,8 +9,16 @@
icon="icons/process.gif"
contributorClass="org.jboss.tools.flow.common.editor.GenericActionBarContributor"
class="org.jboss.tools.flow.jpdl4.editor.JpdlEditor"
- id="org.jboss.tools.process.jpdl4.graph.editor.JpdlEditor">
+ id="org.jboss.tools.flow.jpdl4.editor">
</editor>
</extension>
+ <extension
+ point="org.jboss.tools.flow.common.languages">
+ <language
+ editor="org.jboss.tools.flow.jpdl4.editor"
+ id="org.jboss.tools.flow.jpdl4"
+ name="jBPM Process Definition Language">
+ </language>
+ </extension>
</plugin>
17 years, 4 months
JBoss Tools SVN: r9564 - in trunk/flow/plugins/org.jboss.tools.flow.common: schema and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-08-06 07:52:25 -0400 (Wed, 06 Aug 2008)
New Revision: 9564
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/plugin.xml
trunk/flow/plugins/org.jboss.tools.flow.common/schema/
trunk/flow/plugins/org.jboss.tools.flow.common/schema/languages.exsd
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/LanguageRegistry.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/build.properties
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java
Log:
add language pluggability
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/build.properties
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/build.properties 2008-08-06 11:44:50 UTC (rev 9563)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/build.properties 2008-08-06 11:52:25 UTC (rev 9564)
@@ -4,5 +4,6 @@
build.properties,\
META-INF/
bin.includes = .,\
- META-INF/
+ META-INF/,\
+ plugin.xml
output.. = bin/
Added: trunk/flow/plugins/org.jboss.tools.flow.common/plugin.xml
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/plugin.xml (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/plugin.xml 2008-08-06 11:52:25 UTC (rev 9564)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="languages" name="JBoss Tools Flow Language Extensions" schema="schema/languages.exsd"/>
+
+</plugin>
Added: trunk/flow/plugins/org.jboss.tools.flow.common/schema/languages.exsd
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/schema/languages.exsd (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/schema/languages.exsd 2008-08-06 11:52:25 UTC (rev 9564)
@@ -0,0 +1,113 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.flow.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.flow.common" id="language" name="JBoss Tools Flow Language Extensions"/>
+ </appinfo>
+ <documentation>
+ This extension points enables to register domain specific languages that can be edited as graphs or flows. The language is associated with an appropriate editor.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="language"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="language">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="editor" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java 2008-08-06 11:44:50 UTC (rev 9563)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java 2008-08-06 11:52:25 UTC (rev 9564)
@@ -61,8 +61,10 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.dialogs.SaveAsDialog;
@@ -71,6 +73,7 @@
import org.jboss.tools.flow.common.Activator;
import org.jboss.tools.flow.common.action.HorizontalAutoLayoutAction;
import org.jboss.tools.flow.common.action.VerticalAutoLayoutAction;
+import org.jboss.tools.flow.common.registry.LanguageRegistry;
/**
* Abstract implementation of a graphical editor.
@@ -85,6 +88,8 @@
private PaletteRoot root;
private OverviewOutlinePage overviewOutlinePage;
+ private String language;
+
public GenericModelEditor() {
setEditDomain(new DefaultEditDomain(this));
}
@@ -97,8 +102,27 @@
return model;
}
+ public void init(IEditorSite site, IEditorInput input)
+ throws PartInitException {
+ super.init(site, input);
+ initializeEditDomain();
+ initializeLanguage();
+ }
+
+ protected void initializeEditDomain() {
+ setEditDomain(new DefaultEditDomain(this));
+ }
+
+ protected void initializeLanguage() {
+ language = LanguageRegistry.getLanguageRegisteredFor(getSite().getId());
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
@SuppressWarnings("unchecked")
- protected void createActions() {
+ protected void createActions() {
super.createActions();
ActionRegistry registry = getActionRegistry();
@@ -162,20 +186,22 @@
IAction showGrid = new ToggleGridAction(getGraphicalViewer());
getActionRegistry().registerAction(showGrid);
-
- IAction layoutVertically = new VerticalAutoLayoutAction(getGraphicalViewer());
+
+ IAction layoutVertically = new VerticalAutoLayoutAction(
+ getGraphicalViewer());
getActionRegistry().registerAction(layoutVertically);
- IAction layoutHorizontally = new HorizontalAutoLayoutAction(getGraphicalViewer());
+ IAction layoutHorizontally = new HorizontalAutoLayoutAction(
+ getGraphicalViewer());
getActionRegistry().registerAction(layoutHorizontally);
-
ContextMenuProvider provider = new GenericContextMenuProvider(
getGraphicalViewer(), getActionRegistry());
getGraphicalViewer().setContextMenu(provider);
- getSite().registerContextMenu("org.jboss.tools.flow.editor.contextmenu",
- provider, getGraphicalViewer());
+ getSite().registerContextMenu(
+ "org.jboss.tools.flow.editor.contextmenu", provider,
+ getGraphicalViewer());
}
-
+
protected abstract EditPartFactory createEditPartFactory();
protected void initializeGraphicalViewer() {
@@ -293,11 +319,11 @@
initializeGraphicalViewer();
}
}
-
+
public IFile getFile() {
- return ((IFileEditorInput) getEditorInput()).getFile();
+ return ((IFileEditorInput) getEditorInput()).getFile();
}
-
+
public IProject getProject() {
IFile file = getFile();
if (file != null) {
@@ -305,10 +331,10 @@
}
return null;
}
-
+
protected abstract void createModel(InputStream is);
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class type) {
if (type == IContentOutlinePage.class) {
return getOverviewOutlinePage();
@@ -328,47 +354,47 @@
}
return overviewOutlinePage;
}
-
+
public String getContributorId() {
- return getSite().getId();
+ return getSite().getId();
}
-
+
/**
- * Writes the content of this editor to the given stream.
- * Possible formats are for example SWT.IMAGE_BMP, IMAGE_GIF,
- * IMAGE_JPEG, IMAGE_PNG.
+ * Writes the content of this editor to the given stream. Possible formats
+ * are for example SWT.IMAGE_BMP, IMAGE_GIF, IMAGE_JPEG, IMAGE_PNG.
+ *
* @param stream
* @param format
*/
public void createImage(OutputStream stream, int format) {
- SWTGraphics g = null;
- GC gc = null;
- Image image = null;
- LayerManager layerManager = (LayerManager)
- getGraphicalViewer().getEditPartRegistry().get(LayerManager.ID);
- IFigure figure = layerManager.getLayer(LayerConstants.PRINTABLE_LAYERS);
- Rectangle r = figure.getBounds();
- try {
- image = new Image(Display.getDefault(), r.width, r.height);
- gc = new GC(image);
- g = new SWTGraphics(gc);
- g.translate(r.x * -1, r.y * -1);
- figure.paint(g);
- ImageLoader imageLoader = new ImageLoader();
- imageLoader.data = new ImageData[] { image.getImageData() };
- imageLoader.save(stream, format);
- } catch (Throwable t) {
- Activator.log(t);
- } finally {
- if (g != null) {
- g.dispose();
- }
- if (gc != null) {
- gc.dispose();
- }
- if (image != null) {
- image.dispose();
- }
- }
+ SWTGraphics g = null;
+ GC gc = null;
+ Image image = null;
+ LayerManager layerManager = (LayerManager) getGraphicalViewer()
+ .getEditPartRegistry().get(LayerManager.ID);
+ IFigure figure = layerManager.getLayer(LayerConstants.PRINTABLE_LAYERS);
+ Rectangle r = figure.getBounds();
+ try {
+ image = new Image(Display.getDefault(), r.width, r.height);
+ gc = new GC(image);
+ g = new SWTGraphics(gc);
+ g.translate(r.x * -1, r.y * -1);
+ figure.paint(g);
+ ImageLoader imageLoader = new ImageLoader();
+ imageLoader.data = new ImageData[] { image.getImageData() };
+ imageLoader.save(stream, format);
+ } catch (Throwable t) {
+ Activator.log(t);
+ } finally {
+ if (g != null) {
+ g.dispose();
+ }
+ if (gc != null) {
+ gc.dispose();
+ }
+ if (image != null) {
+ image.dispose();
+ }
+ }
}
}
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/LanguageRegistry.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/LanguageRegistry.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/LanguageRegistry.java 2008-08-06 11:52:25 UTC (rev 9564)
@@ -0,0 +1,40 @@
+package org.jboss.tools.flow.common.registry;
+
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+
+public class LanguageRegistry {
+
+ private static final String languagesExtensionPointId = "org.jboss.tools.flow.common.languages";
+ private static HashMap<String, String> languageMap = null;
+
+ private static void initializeRegistry() {
+ languageMap = new HashMap<String, String>();
+ IConfigurationElement[] configurationElements =
+ Platform.getExtensionRegistry().getConfigurationElementsFor(languagesExtensionPointId);
+ for (IConfigurationElement configElement: configurationElements) {
+ String id = configElement.getAttribute("id");
+ String editor = configElement.getAttribute("editor");
+ if (id != null && editor != null) {
+ languageMap.put(editor, id);
+ }
+ }
+ }
+
+ public static boolean isLanguageRegisteredFor(String editorId) {
+ if (languageMap == null) {
+ initializeRegistry();
+ }
+ return languageMap.containsKey(editorId);
+ }
+
+ public static String getLanguageRegisteredFor(String editorId) {
+ if (languageMap == null) {
+ initializeRegistry();
+ }
+ return languageMap.get(editorId);
+ }
+
+}
17 years, 4 months
JBoss Tools SVN: r9563 - trunk/vpe/plugins/org.jboss.tools.vpe.html/templates.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-06 07:44:50 -0400 (Wed, 06 Aug 2008)
New Revision: 9563
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
Log:
Fix JBIDE-2508
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2008-08-06 11:04:31 UTC (rev 9562)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2008-08-06 11:44:50 UTC (rev 9563)
@@ -797,6 +797,7 @@
<vpe:tag name="form" case-sensitive="no">
<vpe:template children="yes" modify="yes">
+ <vpe:copy attrs="id,style,class,align" />
<div />
<vpe:dnd>
<vpe:drag start-enable="yes" />
17 years, 4 months
JBoss Tools SVN: r9562 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-08-06 07:04:31 -0400 (Wed, 06 Aug 2008)
New Revision: 9562
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1718Test.java
Log:
was corrected test
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1718Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1718Test.java 2008-08-06 10:38:21 UTC (rev 9561)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1718Test.java 2008-08-06 11:04:31 UTC (rev 9562)
@@ -102,7 +102,7 @@
TestUtil.findElementsByName(b, aElements, HTML.TAG_A);
// number of "span" elements must be 2
- assertEquals(2, spanElements.size());
+ assertEquals(3, spanElements.size());
// number of "label" elements must be 1
assertEquals(1, labelElements.size());
17 years, 4 months
JBoss Tools SVN: r9561 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-06 06:38:21 -0400 (Wed, 06 Aug 2008)
New Revision: 9561
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputFormatTemplate.java
Log:
Move test cases from *.vpe.test to the vpe.ui.test package.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java 2008-08-06 09:44:17 UTC (rev 9560)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractOutputJsfTemplate.java 2008-08-06 10:38:21 UTC (rev 9561)
@@ -84,14 +84,14 @@
if (outputAttr != null) {
// prepare value
- String newValue = outputAttr.getValue();
+ String newValue = prepareAttrValue(pageContext, sourceElement, outputAttr);
// if escape then contents of value (or other attribute) is only
// text
if (!sourceElement.hasAttribute(JSF.ATTR_ESCAPE)
|| "true".equalsIgnoreCase(sourceElement //$NON-NLS-1$
.getAttribute(JSF.ATTR_ESCAPE))) {
- String value = outputAttr.getNodeValue();
+ String value = outputAttr.getValue();
nsIDOMText text;
// if bundleValue differ from value then will be represent
@@ -224,4 +224,10 @@
}
return node;
}
+
+ protected String prepareAttrValue(VpePageContext pageContext,
+ Element parent, Attr attr) {
+
+ return attr.getNodeValue();
+ }
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputFormatTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputFormatTemplate.java 2008-08-06 09:44:17 UTC (rev 9560)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputFormatTemplate.java 2008-08-06 10:38:21 UTC (rev 9561)
@@ -96,6 +96,14 @@
return true;
}
+ @Override
+ protected String prepareAttrValue(VpePageContext pageContext,
+ Element parent, Attr attr) {
+ String newString = prepareAttrValueByParams(attr.getNodeValue(),
+ getParams(parent));
+
+ return newString;
+ }
/**
* find message format elements and update value
17 years, 4 months