JBoss Tools SVN: r5313 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test: src/org/jboss/tools/jsf/vpe/seam/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2007-12-14 08:43:22 -0500 (Fri, 14 Dec 2007)
New Revision: 5313
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/seamtest.jar
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1491
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/seamtest.jar
===================================================================
(Binary files differ)
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentTest.java 2007-12-14 12:51:47 UTC (rev 5312)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentTest.java 2007-12-14 13:43:22 UTC (rev 5313)
@@ -114,19 +114,42 @@
delay(5000);
}
- public void testAllComponentsOnSinglePage() throws PartInitException, Throwable {
- performTestForSeamComponent("seamtest.xhtml"); // $NON-NLS-1$
- }
-
public void testButton() throws PartInitException, Throwable {
performTestForSeamComponent("button.xhtml"); // $NON-NLS-1$
}
+ public void testDecorate() throws PartInitException, Throwable {
+ performTestForSeamComponent("decorate.xhtml"); // $NON-NLS-1$
+ }
+
+ public void testDiv() throws PartInitException, Throwable {
+ performTestForSeamComponent("div.xhtml"); // $NON-NLS-1$
+ }
+
+ public void testFormattedText() throws PartInitException, Throwable {
+ performTestForSeamComponent("formattedText.xhtml"); // $NON-NLS-1$
+ }
+
public void testSpan() throws PartInitException, Throwable {
performTestForSeamComponent("span.xhtml"); // $NON-NLS-1$
}
+ public void testLabel() throws PartInitException, Throwable {
+ performTestForSeamComponent("label.xhtml"); // $NON-NLS-1$
+ }
+ public void testLink() throws PartInitException, Throwable {
+ performTestForSeamComponent("link.xhtml"); // $NON-NLS-1$
+ }
+
+ public void testMessage() throws PartInitException, Throwable {
+ performTestForSeamComponent("message.xhtml"); // $NON-NLS-1$
+ }
+
+ public void testAllComponentsOnSinglePage() throws PartInitException, Throwable {
+ performTestForSeamComponent("seamtest.xhtml"); // $NON-NLS-1$
+ }
+
private void performTestForSeamComponent(String componentPage) throws PartInitException, Throwable {
waitForJobs();
17 years
JBoss Tools SVN: r5312 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2007-12-14 07:51:47 -0500 (Fri, 14 Dec 2007)
New Revision: 5312
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-1243
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 2007-12-14 12:50:44 UTC (rev 5311)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2007-12-14 12:51:47 UTC (rev 5312)
@@ -72,7 +72,7 @@
file = ((IFileEditorInput)input).getFile();
}
- if (file != null) {
+ if (null != file) {
ResourceReference resourceReference = null;
if ("/".equals(tagValue.substring(0, 1))) {
resourceReference = pageContext.getRuntimeAbsoluteFolder(file);
@@ -86,13 +86,15 @@
location = resourceReference.getLocation();
}
- if (location == null) {
+ if (null == location && null != file.getLocation()) {
location = file.getLocation().toFile().getParent();
}
- File f = new File(location + File.separator + tagValue);
- if (f.exists()) {
- return new VpeValue(getPrefix() + f.getPath());
+ if (null != location) {
+ File f = new File(location + File.separator + tagValue);
+ if (f.exists()) {
+ return new VpeValue(getPrefix() + f.getPath());
+ }
}
}
}
17 years
JBoss Tools SVN: r5311 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2007-12-14 07:50:44 -0500 (Fri, 14 Dec 2007)
New Revision: 5311
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1243
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2007-12-14 12:48:32 UTC (rev 5310)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/bundle/BundleMap.java 2007-12-14 12:50:44 UTC (rev 5311)
@@ -108,6 +108,7 @@
IEditorInput ei = editor.getEditorInput();
if(!(ei instanceof IFileEditorInput)) return false;
IProject project = ((IFileEditorInput)ei).getFile().getProject();
+ if (!project.exists() || !project.isOpen()) return false;
for (int i = 0; i < JSF_PROJECT_NATURES.length; i++) {
if (project.getNature(JSF_PROJECT_NATURES[i]) != null)
17 years
JBoss Tools SVN: r5310 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss: tools/jsf/vpe/seam and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2007-12-14 07:48:32 -0500 (Fri, 14 Dec 2007)
New Revision: 5310
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1449
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.java 2007-12-14 12:45:08 UTC (rev 5309)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.java 2007-12-14 12:48:32 UTC (rev 5310)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.seam.test.unit;
import java.io.InputStreamReader;
@@ -6,6 +16,11 @@
import org.jboss.seam.text.SeamTextLexer;
import org.jboss.seam.text.SeamTextParser;
+/**
+ * @author Vitali (vyemialyanchyk(a)exadel.com)
+ *
+ * Test seam lexer functionality
+ */
public class SeamTextTest
{
public static void main(String[] args) throws Exception {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java 2007-12-14 12:45:08 UTC (rev 5309)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java 2007-12-14 12:48:32 UTC (rev 5310)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.seam;
import org.mozilla.interfaces.nsIDOMElement;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java 2007-12-14 12:45:08 UTC (rev 5309)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java 2007-12-14 12:48:32 UTC (rev 5310)
@@ -20,6 +20,8 @@
import org.osgi.framework.BundleContext;
/**
+ * @author Vitali (vyemialyanchyk(a)exadel.com)
+ *
* The activator class controls the plug-in life cycle
*/
public class SeamTemplatesActivator extends BaseUIPlugin {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java 2007-12-14 12:45:08 UTC (rev 5309)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java 2007-12-14 12:48:32 UTC (rev 5310)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.seam.template;
import java.io.InputStreamReader;
@@ -32,6 +42,11 @@
import antlr.RecognitionException;
import antlr.TokenStreamException;
+/**
+ * @author Vitali (vyemialyanchyk(a)exadel.com)
+ *
+ * s:formattedText template
+ */
public class SeamFormattedTextTemplate extends VpeAbstractTemplate {
private static final String CID_DOMPARSER = "@mozilla.org/xmlextras/domparser;1";
17 years
JBoss Tools SVN: r5309 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-12-14 07:45:08 -0500 (Fri, 14 Dec 2007)
New Revision: 5309
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
Log:
JBIDE-1374
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2007-12-14 12:44:49 UTC (rev 5308)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2007-12-14 12:45:08 UTC (rev 5309)
@@ -495,4 +495,10 @@
assertTrue("Prompting has to contain 'payment' property for '#{myUser.' seed", list.contains("payment"));
}
+ public void testInnerClass_JBIDE_1374() {
+ ISeamProject seamProject = getSeamProject();
+ ISeamComponent c = seamProject.getComponent("inner_JBIDE_1374");
+ assertTrue("Component inner_JBIDE_1374 declared in inner static class is not found.", c != null);
+ }
+
}
17 years
JBoss Tools SVN: r5308 - trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-12-14 07:44:49 -0500 (Fri, 14 Dec 2007)
New Revision: 5308
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo/User.java
Log:
JBIDE-1374
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo/User.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo/User.java 2007-12-14 12:44:20 UTC (rev 5307)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/JavaSource/demo/User.java 2007-12-14 12:44:49 UTC (rev 5308)
@@ -25,6 +25,19 @@
@Install(precedence=Install.FRAMEWORK)
public class User {
+
+ @Name("inner_JBIDE_1374")
+ public static class Inner {
+ private String innerName;
+
+ public String getInnerName() {
+ return innerName;
+ }
+
+ public void setInnerName(String s) {
+ innerName = s;
+ }
+ }
private String name;
17 years
JBoss Tools SVN: r5307 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: project/facet and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-12-14 07:44:20 -0500 (Fri, 14 Dec 2007)
New Revision: 5307
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java
Log:
JBIDE-1374
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2007-12-14 12:41:48 UTC (rev 5306)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2007-12-14 12:44:20 UTC (rev 5307)
@@ -19,7 +19,9 @@
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.JavaUI;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -138,14 +140,57 @@
public Set<ISeamComponentMethod> getMethodsByType(
SeamComponentMethodType type) {
Set<ISeamComponentMethod> result = null;
+ Set<String> names = null;
for(ISeamComponentMethod a: getMethods()) {
if(a.isOfType(type)) {
- if(result == null) result = new HashSet<ISeamComponentMethod>();
+ if(result == null) {
+ result = new HashSet<ISeamComponentMethod>();
+ names = new HashSet<String>();
+ }
result.add(a);
+ if(a.getSourceMember() != null) {
+ names.add(a.getSourceMember().getElementName());
+ }
}
}
+
+ ISeamJavaComponentDeclaration superDeclaration = getSuperDeclaration();
+ if(superDeclaration != null) {
+ Set<ISeamComponentMethod> s = superDeclaration.getMethodsByType(type);
+ if(s != null) for(ISeamComponentMethod a: s) {
+ if(a.getSourceMember() == null) continue;
+ String n = a.getSourceMember().getElementName();
+ if(names != null && names.contains(n)) continue;
+ if(result == null) {
+ result = new HashSet<ISeamComponentMethod>();
+ names = new HashSet<String>();
+ }
+ result.add(a);
+ if(a.getSourceMember() != null) {
+ names.add(a.getSourceMember().getElementName());
+ }
+ }
+ }
return result;
}
+
+ public ISeamJavaComponentDeclaration getSuperDeclaration() {
+ if(type == null) return null;
+ String superclass = null;
+ try {
+ superclass = type.getSuperclassName();
+ } catch (JavaModelException e) {
+ return null;
+ }
+ if(superclass == null || "java.lang.Object".equals(superclass)) {
+ return null;
+ }
+ if(superclass.indexOf('.') < 0) {
+ superclass = EclipseJavaUtil.resolveType(type, superclass);
+ }
+ SeamProject p = (SeamProject)getSeamProject();
+ return p == null ? null : p.getAllJavaComponentDeclarations().get(superclass);
+ }
public Set<IRole> getRoles() {
return roles;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-12-14 12:41:48 UTC (rev 5306)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-12-14 12:44:20 UTC (rev 5307)
@@ -789,6 +789,14 @@
}
fireChanges(changes);
}
+ Iterator<String> it = javaDeclarations.keySet().iterator();
+ while(it.hasNext()) {
+ String cn = it.next();
+ SeamJavaComponentDeclaration d = javaDeclarations.get(cn);
+ if(source.equals(d.getSourcePath())) {
+ it.remove();
+ }
+ }
revalidateLock--;
revalidate();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java 2007-12-14 12:41:48 UTC (rev 5306)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java 2007-12-14 12:44:20 UTC (rev 5307)
@@ -11,27 +11,22 @@
package org.jboss.tools.seam.internal.core.project.facet;
-import java.net.URI;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.AssertionFailedException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaModelStatus;
import org.eclipse.jdt.core.IJavaProject;
@@ -44,7 +39,6 @@
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
import org.jboss.tools.seam.core.SeamCorePlugin;
/**
@@ -120,8 +114,8 @@
try {
IFacetedProject facetedProject = ProjectFacetsManager.create(project);
IRuntime rt = facetedProject.getPrimaryRuntime();
- if(facetedProject.getPrimaryRuntime()!=null) {
- return facetedProject.getPrimaryRuntime().getName();
+ if(rt != null) {
+ return rt.getName();
}
} catch (CoreException e) {
SeamCorePlugin.getPluginLog().logError(e);
@@ -133,7 +127,6 @@
IJavaProject javaProject;
IClasspathEntry[] javaProjectEntries;
IPath outputLocation;
- IWorkspaceRoot workspaceRoot;
if (project == null || !project.exists()) {
return null;
@@ -148,34 +141,41 @@
javaProject= JavaCore.create(project);
javaProjectEntries= javaProject.getRawClasspath();
outputLocation= javaProject.getOutputLocation();
- workspaceRoot= ResourcesPlugin.getWorkspace().getRoot();
IPath projPath= javaProject.getProject().getFullPath();
IPath newSourceFolderPath = projPath.append(path);
IPath excludeSourceFolderPath = projPath.append(exclude);
- ArrayList newEntries= new ArrayList(javaProjectEntries.length + 1);
+ ArrayList<IClasspathEntry> newEntries = new ArrayList<IClasspathEntry>(javaProjectEntries.length + 1);
int projectEntryIndex= -1;
for (int i= 0; i < javaProjectEntries.length; i++) {
IClasspathEntry curr= javaProjectEntries[i];
- if (curr.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- if (newSourceFolderPath.equals(curr.getPath())) {
+ IClasspathEntry resolved = curr;
+ if(resolved.getEntryKind() == IClasspathEntry.CPE_VARIABLE) {
+ try {
+ resolved = JavaCore.getResolvedClasspathEntry(resolved);
+ } catch (AssertionFailedException e) {
+ continue;
+ }
+ }
+ if (resolved.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ if (newSourceFolderPath.equals(resolved.getPath())) {
return null;
}
- if (projPath.equals(curr.getPath())) {
+ if (projPath.equals(resolved.getPath())) {
projectEntryIndex= i;
}
- if (excludeSourceFolderPath.equals(curr.getPath())) {
+ if (excludeSourceFolderPath.equals(resolved.getPath())) {
continue;
}
}
newEntries.add(curr);
}
- if(outputFolder!=null) {
+ if(outputFolder != null) {
CoreUtility.createDerivedFolder(project.getFolder(outputFolder), true, true, new NullProgressMonitor());
}
- IClasspathEntry newEntry= JavaCore.newSourceEntry(newSourceFolderPath,new Path[]{},new Path[]{},outputFolder!=null?project.getFullPath().append(outputFolder):null);
+ IClasspathEntry newEntry = JavaCore.newSourceEntry(newSourceFolderPath,new Path[]{},new Path[]{},outputFolder!=null?project.getFullPath().append(outputFolder):null);
if (projectEntryIndex != -1) {
newEntries.set(projectEntryIndex, newEntry);
@@ -183,10 +183,10 @@
insertClasspathEntry(newEntry, newEntries);
}
- IClasspathEntry[] newClasspathEntries= (IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries.size()]);
- IPath newOutputLocation= outputLocation;
+ IClasspathEntry[] newClasspathEntries = newEntries.toArray(new IClasspathEntry[newEntries.size()]);
+ IPath newOutputLocation = outputLocation;
- IJavaModelStatus result= JavaConventions.validateClasspath(javaProject, newClasspathEntries, newOutputLocation);
+ IJavaModelStatus result = JavaConventions.validateClasspath(javaProject, newClasspathEntries, newOutputLocation);
if (!result.isOK()) {
if (outputLocation.equals(projPath)) {
newOutputLocation= projPath.append(PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME));
@@ -212,9 +212,9 @@
return null;
}
- static private void insertClasspathEntry(IClasspathEntry entry, List entries) {
+ static private void insertClasspathEntry(IClasspathEntry entry, List<IClasspathEntry> entries) {
int length= entries.size();
- IClasspathEntry[] elements= (IClasspathEntry[])entries.toArray(new IClasspathEntry[length]);
+ IClasspathEntry[] elements = entries.toArray(new IClasspathEntry[length]);
int i= 0;
while (i < length && elements[i].getEntryKind() != entry.getEntryKind()) {
i++;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2007-12-14 12:41:48 UTC (rev 5306)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2007-12-14 12:44:20 UTC (rev 5307)
@@ -10,10 +10,14 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.scanner.java;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
+import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.Annotation;
import org.eclipse.jdt.core.dom.Block;
@@ -26,6 +30,7 @@
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.seam.internal.core.scanner.Util;
/**
@@ -35,42 +40,75 @@
*/
public class ASTVisitorImpl extends ASTVisitor implements SeamAnnotations {
- IType type;
-
- AnnotatedASTNode<TypeDeclaration> annotatedType = null;
- Set<AnnotatedASTNode<FieldDeclaration>> annotatedFields = new HashSet<AnnotatedASTNode<FieldDeclaration>>();
- Set<AnnotatedASTNode<MethodDeclaration>> annotatedMethods = new HashSet<AnnotatedASTNode<MethodDeclaration>>();
+ static class TypeData {
+ TypeData parent = null;
+ List<TypeData> children = new ArrayList<TypeData>();
- AnnotatedASTNode<?> currentAnnotatedNode = null;
- AnnotatedASTNode<FieldDeclaration> currentAnnotatedField = null;
- AnnotatedASTNode<MethodDeclaration> currentAnnotatedMethod = null;
+ IType type;
+ int innerLock = 0;
+
+ AnnotatedASTNode<TypeDeclaration> annotatedType = null;
+ Set<AnnotatedASTNode<FieldDeclaration>> annotatedFields = new HashSet<AnnotatedASTNode<FieldDeclaration>>();
+ Set<AnnotatedASTNode<MethodDeclaration>> annotatedMethods = new HashSet<AnnotatedASTNode<MethodDeclaration>>();
+
+ AnnotatedASTNode<?> currentAnnotatedNode = null;
+ AnnotatedASTNode<FieldDeclaration> currentAnnotatedField = null;
+ AnnotatedASTNode<MethodDeclaration> currentAnnotatedMethod = null;
+
+ public boolean hasSeamComponentItself() {
+ if(annotatedFields.size() > 0 || annotatedMethods.size() > 0) return true;
+ if(annotatedType != null && annotatedType.getAnnotations() != null) return true;
+ return false;
+ }
+
+ public boolean hasSeamComponent() {
+ if(hasSeamComponentItself()) return true;
+ for (TypeData c: children) {
+ if(c.hasSeamComponent()) return true;
+ }
+ return false;
+ }
+
+ }
+ TypeData root = null;
+ TypeData current = null;
+
+ ASTVisitorImpl() {}
+
+ public void setType(IType type) {
+ root = new TypeData();
+ root.type = type;
+ }
+
+
public boolean hasSeamComponent() {
- if(annotatedFields.size() > 0 || annotatedMethods.size() > 0) return true;
- if(annotatedType != null && annotatedType.getAnnotations() != null) return true;
- return false;
+ return root.hasSeamComponent();
}
public boolean visit(SingleMemberAnnotation node) {
+ if(current.innerLock > 0) return false;
String type = resolveType(node);
- if(Util.isSeamAnnotationType(type) && currentAnnotatedNode != null) {
- currentAnnotatedNode.addAnnotation(new ResolvedAnnotation(type, node));
+ if(Util.isSeamAnnotationType(type) && current.currentAnnotatedNode != null) {
+ current.currentAnnotatedNode.addAnnotation(new ResolvedAnnotation(type, node));
}
return false;
}
public boolean visit(NormalAnnotation node) {
+ if(current.innerLock > 0) return false;
String type = resolveType(node);
- if(Util.isSeamAnnotationType(type) && currentAnnotatedNode != null) {
- currentAnnotatedNode.addAnnotation(new ResolvedAnnotation(type, node));
+ if(Util.isSeamAnnotationType(type) && current.currentAnnotatedNode != null) {
+ current.currentAnnotatedNode.addAnnotation(new ResolvedAnnotation(type, node));
}
return false;
}
public boolean visit(MarkerAnnotation node) {
+ if(current.innerLock > 0) return false;
String type = resolveType(node);
- if(Util.isSeamAnnotationType(type) && currentAnnotatedNode != null) {
- currentAnnotatedNode.addAnnotation(new ResolvedAnnotation(type, node));
+ if(Util.isSeamAnnotationType(type) && current.currentAnnotatedNode != null) {
+ current.currentAnnotatedNode.addAnnotation(new ResolvedAnnotation(type, node));
}
return true;
}
@@ -81,7 +119,7 @@
}
String resolveType(Annotation node) {
- return resolveType(type, node);
+ return resolveType(current.type, node);
}
static String resolveType(IType type, Annotation node) {
@@ -104,45 +142,93 @@
}
public boolean visit(TypeDeclaration node) {
- if(annotatedType == null) {
- annotatedType = new AnnotatedASTNode<TypeDeclaration>(node);
- currentAnnotatedNode = annotatedType;
+ if(current == null) {
+ String n = node.getName().getFullyQualifiedName();
+ if(n != null && n.indexOf('.') < 0) n = EclipseJavaUtil.resolveType(root.type, n);
+ String nr = root.type.getFullyQualifiedName();
+ if(n == null || !n.equals(nr)) return false;
+ current = root;
}
+ if(current.annotatedType == null) {
+ current.annotatedType = new AnnotatedASTNode<TypeDeclaration>(node);
+ current.currentAnnotatedNode = current.annotatedType;
+ } else {
+ String n = node.getName().getFullyQualifiedName();
+ if(n != null && n.indexOf('.') < 0) n = EclipseJavaUtil.resolveType(current.type, n);
+ IType[] ts = null;
+ try {
+ ts = current.type.getTypes();
+ } catch (JavaModelException e) {
+ //ignore
+ }
+ IType t = null;
+ if(ts != null) for (int i = 0; t == null && i < ts.length; i++) {
+ try {
+ if(!Flags.isStatic(ts[i].getFlags())) continue;
+ } catch (JavaModelException e) {
+ continue;
+ }
+ String ni = ts[i].getFullyQualifiedName();
+ if(ni != null) ni = ni.replace('$', '.');
+ if(n == null || !n.equals(ni)) continue;
+ t = ts[i];
+ }
+ if(t == null) {
+ current.innerLock++;
+ return false;
+ } else {
+ TypeData d = new TypeData();
+ d.type = t;
+ d.parent = current;
+ current.children.add(d);
+ current = d;
+ current.annotatedType = new AnnotatedASTNode<TypeDeclaration>(node);
+ current.currentAnnotatedNode = current.annotatedType;
+ }
+ }
return true;
}
public void endVisit(TypeDeclaration node) {
- if(currentAnnotatedNode != null && currentAnnotatedNode.node == node) {
- currentAnnotatedNode = null;
+ if(current == null) return;
+ if(current.currentAnnotatedNode != null && current.currentAnnotatedNode.node == node) {
+ current.currentAnnotatedNode = null;
+ current = current.parent;
+ } else {
+ current.innerLock--;
}
}
public boolean visit(FieldDeclaration node) {
- currentAnnotatedField = new AnnotatedASTNode<FieldDeclaration>(node);
- currentAnnotatedNode = currentAnnotatedField;
+ if(current == null || current.innerLock > 0) return false;
+ current.currentAnnotatedField = new AnnotatedASTNode<FieldDeclaration>(node);
+ current.currentAnnotatedNode = current.currentAnnotatedField;
return true;
}
public void endVisit(FieldDeclaration node) {
- if(currentAnnotatedField != null && currentAnnotatedField.getAnnotations() != null) {
- annotatedFields.add(currentAnnotatedField);
+ if(current == null || current.innerLock > 0) return;
+ if(current.currentAnnotatedField != null && current.currentAnnotatedField.getAnnotations() != null) {
+ current.annotatedFields.add(current.currentAnnotatedField);
}
- currentAnnotatedField = null;
- currentAnnotatedNode = annotatedType;
+ current.currentAnnotatedField = null;
+ current.currentAnnotatedNode = current.annotatedType;
}
public boolean visit(MethodDeclaration node) {
- currentAnnotatedMethod = new AnnotatedASTNode<MethodDeclaration>(node);
- currentAnnotatedNode = currentAnnotatedMethod;
+ if(current == null || current.innerLock > 0) return false;
+ current.currentAnnotatedMethod = new AnnotatedASTNode<MethodDeclaration>(node);
+ current.currentAnnotatedNode = current.currentAnnotatedMethod;
return true;
}
public void endVisit(MethodDeclaration node) {
- if(currentAnnotatedMethod != null && currentAnnotatedMethod.getAnnotations() != null) {
- annotatedMethods.add(currentAnnotatedMethod);
+ if(current == null || current.innerLock > 0) return;
+ if(current.currentAnnotatedMethod != null && current.currentAnnotatedMethod.getAnnotations() != null) {
+ current.annotatedMethods.add(current.currentAnnotatedMethod);
}
- currentAnnotatedMethod = null;
- currentAnnotatedNode = annotatedType;
+ current.currentAnnotatedMethod = null;
+ current.currentAnnotatedNode = current.annotatedType;
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2007-12-14 12:41:48 UTC (rev 5306)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2007-12-14 12:44:20 UTC (rev 5307)
@@ -57,7 +57,7 @@
SeamJavaComponentDeclaration component = new SeamJavaComponentDeclaration();
- public ComponentBuilder(LoadedDeclarations ds, ASTVisitorImpl visitor) {
+ public ComponentBuilder(LoadedDeclarations ds, ASTVisitorImpl.TypeData visitor) {
this.ds = ds;
annotatedType = visitor.annotatedType;
annotatedFields = visitor.annotatedFields;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java 2007-12-14 12:41:48 UTC (rev 5306)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java 2007-12-14 12:44:20 UTC (rev 5307)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
@@ -127,26 +128,44 @@
}
public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
-
+ IType[] ts = null;
try {
- IType[] ts = source.getTypes();
- if(ts != null && ts.length > 0) {
- visitor.type = ts[0];
- }
+ ts = source.getTypes();
} catch (JavaModelException e) {
//ignore
}
- ast.accept(visitor);
-
- if(!visitor.hasSeamComponent()) return;
-
- ComponentBuilder b = new ComponentBuilder(ds, visitor);
-
- b.component.setSourcePath(sourcePath);
- b.component.setResource(resource);
-
- b.process();
+ if(ts == null || ts.length == 0) return;
+ for (int i = 0; i < ts.length; i++) {
+ visitor.setType(null);
+ int f = 0;
+ try {
+ f = ts[i].getFlags();
+ } catch (JavaModelException e) {
+ //ignore
+ continue;
+ }
+ if(Flags.isPublic(f)) {
+ visitor.setType(ts[i]);
+ ast.accept(visitor);
+ if(!visitor.hasSeamComponent()) continue;
+ processTypeData(visitor.root);
+ }
+ }
}
+
+ private void processTypeData(ASTVisitorImpl.TypeData data) {
+ if(data.hasSeamComponentItself()) {
+ ComponentBuilder b = new ComponentBuilder(ds, data);
+
+ b.component.setSourcePath(sourcePath);
+ b.component.setResource(resource);
+
+ b.process();
+ }
+ for (ASTVisitorImpl.TypeData c: data.children) {
+ processTypeData(c);
+ }
+ }
}
static String getResolvedType(IType type, String n) {
17 years
JBoss Tools SVN: r5306 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src: org and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2007-12-14 07:41:48 -0500 (Fri, 14 Dec 2007)
New Revision: 5306
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.txt
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextLexer.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParser.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParserTokenTypes.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParserTokenTypes.txt
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamTextTest2.txt
Log:
http://jira.jboss.com/jira/browse/JBIDE-1449
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.java 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,18 @@
+package org.jboss.seam.test.unit;
+
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+import org.jboss.seam.text.SeamTextLexer;
+import org.jboss.seam.text.SeamTextParser;
+
+public class SeamTextTest
+{
+ public static void main(String[] args) throws Exception {
+ Reader r = new InputStreamReader( SeamTextTest.class.getResourceAsStream("SeamTextTest.txt") );
+ SeamTextLexer lexer = new SeamTextLexer(r);
+ SeamTextParser parser = new SeamTextParser(lexer);
+ parser.startRule();
+ System.out.println(parser);
+ }
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.txt
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.txt (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/test/unit/SeamTextTest.txt 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,104 @@
++Seam Text!
+This page demonstrates Seam Text.
+
+++Some examples:
+
+Here is some wiki text:
+*bold* |mono| ~deleted~ _underline_ /italic/ ^super^
+
+This is a new paragraph. (Just leave a blank line.)
+
+*/_Multiple ~tags~ styles_ can be nested!/*
+
+Special characters can be escaped: \| \* \_
+
+This is especially useful for HTML: \<notatag\> \¬anentity;
+
+But if we don't want to use escapes in our preformatted
+text, we can wrap it in backwards quotes, and special
+characters get escaped automagically:
+
+`//This is some code:
+
+<some-tag/>
+"a string"
+a_variable_name
+a||b
+x=y*z/2`
+
+We wrap quoted text in double quotes:
+
+"This is a block quote with /formatting/. The quote can cross multiple
+lines, but a blank line does not start a new paragraph. If you
+need multiple paragraphs in a quote, you have to use \<p\>."
+
+You can even have "a quote", or `some code` inside
+a regular paragraph!
+
+We use ordinary old HTML for tables:
+
+<table>
+ <tr><td>foo</td><td>*bar*</td><td>baz</td></tr><tr>
+ <td>fee</td>
+ <td>fi</td>
+ <td>/fo/</td>
+ </tr>
+</table>
+
+And we can use HTML for lists:
+
+<ol>
+ <li>foo</li>
+ <li>*bar*</li>
+ <li>/baz/</li>
+</ol>
+
+<ul><li>foo</li><li>*bar*</li><li>/baz/</li></ul>
+
+But if the items fit on a line, we can use \#
+for ordered lists:
+
+# item 1
+# item 2
+# item 3
+
+And \= for unordered lists:
+
+= item 1
+= item 2
+= item 3
+
+We use HTML for <a href="http://www.hibernate.org/">links</a>.
+
+Or we can use [a special syntax=>http://jboss.com/products/seam] to
+link to [=>http://jboss.com/products/seam].
+
+And for images: <img src="http://www.hibernate.org/tpl/jboss/img/01_oben_logo.gif"/>
+
+And even for more exotic formatting, for example:
+
+<q>This is a /HTML/ quote with a <a href="http://jboss.org/">link</a>,
+and a "nested quote" and even `some code` in it.</q>
+
+<p>
+This is a HTML paragraph with some lists:
+
+# item 1
+# item 2
+
+= an item
+= another item
+
+And "a quote" in it.
+</p>
+
+Oh, and one last thing:
+
+"This is a block quote with
+
+= a list,
+= with 2 items
+
+and <i>some HTML</i> formatting and `some code` and
+and <a href="http://jboss.com/products/seam"><i>yet
+another</i> link</a>."
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextLexer.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextLexer.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextLexer.java 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,711 @@
+// $ANTLR 2.7.6 (2005-12-22): "seam-text.g" -> "SeamTextLexer.java"$
+
+package org.jboss.seam.text;
+
+import java.io.InputStream;
+import antlr.TokenStreamException;
+import antlr.TokenStreamIOException;
+import antlr.TokenStreamRecognitionException;
+import antlr.CharStreamException;
+import antlr.CharStreamIOException;
+import antlr.ANTLRException;
+import java.io.Reader;
+import java.util.Hashtable;
+import antlr.CharScanner;
+import antlr.InputBuffer;
+import antlr.ByteBuffer;
+import antlr.CharBuffer;
+import antlr.Token;
+import antlr.CommonToken;
+import antlr.RecognitionException;
+import antlr.NoViableAltForCharException;
+import antlr.MismatchedCharException;
+import antlr.TokenStream;
+import antlr.ANTLRHashString;
+import antlr.LexerSharedInputState;
+import antlr.collections.impl.BitSet;
+import antlr.SemanticException;
+
+public class SeamTextLexer extends antlr.CharScanner implements SeamTextParserTokenTypes, TokenStream
+ {
+public SeamTextLexer(InputStream in) {
+ this(new ByteBuffer(in));
+}
+public SeamTextLexer(Reader in) {
+ this(new CharBuffer(in));
+}
+public SeamTextLexer(InputBuffer ib) {
+ this(new LexerSharedInputState(ib));
+}
+public SeamTextLexer(LexerSharedInputState state) {
+ super(state);
+ caseSensitiveLiterals = true;
+ setCaseSensitive(true);
+ literals = new Hashtable();
+}
+
+public Token nextToken() throws TokenStreamException {
+ Token theRetToken=null;
+tryAgain:
+ for (;;) {
+ Token _token = null;
+ int _ttype = Token.INVALID_TYPE;
+ resetText();
+ try { // for char stream error handling
+ try { // for lexical error handling
+ switch ( LA(1)) {
+ case '!': case '$': case '%': case '\'':
+ case '(': case ')': case ',': case '-':
+ case '.': case ':': case ';': case '?':
+ case '@': case '{': case '}':
+ {
+ mPUNCTUATION(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '=':
+ {
+ mEQ(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '+':
+ {
+ mPLUS(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '_':
+ {
+ mUNDERSCORE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '*':
+ {
+ mSTAR(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '/':
+ {
+ mSLASH(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '\\':
+ {
+ mESCAPE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '|':
+ {
+ mBAR(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '`':
+ {
+ mBACKTICK(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '~':
+ {
+ mTWIDDLE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '"':
+ {
+ mDOUBLEQUOTE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '[':
+ {
+ mOPEN(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case ']':
+ {
+ mCLOSE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '#':
+ {
+ mHASH(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '^':
+ {
+ mHAT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '>':
+ {
+ mGT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '<':
+ {
+ mLT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '&':
+ {
+ mAMPERSAND(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '\t': case ' ':
+ {
+ mSPACE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '\n': case '\r':
+ {
+ mNEWLINE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '\uffff':
+ {
+ mEOF(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ default:
+ if ((_tokenSet_0.member(LA(1)))) {
+ mWORD(true);
+ theRetToken=_returnToken;
+ }
+ else {
+ if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
+ else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ }
+ }
+ if ( _returnToken==null ) continue tryAgain; // found SKIP token
+ _ttype = _returnToken.getType();
+ _ttype = testLiteralsTable(_ttype);
+ _returnToken.setType(_ttype);
+ return _returnToken;
+ }
+ catch (RecognitionException e) {
+ throw new TokenStreamRecognitionException(e);
+ }
+ }
+ catch (CharStreamException cse) {
+ if ( cse instanceof CharStreamIOException ) {
+ throw new TokenStreamIOException(((CharStreamIOException)cse).io);
+ }
+ else {
+ throw new TokenStreamException(cse.getMessage());
+ }
+ }
+ }
+}
+
+ public final void mWORD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = WORD;
+ int _saveIndex;
+
+ {
+ int _cnt107=0;
+ _loop107:
+ do {
+ switch ( LA(1)) {
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ {
+ matchRange('A','Z');
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ matchRange('0','9');
+ break;
+ }
+ case '\u00a0': case '\u00a1': case '\u00a2': case '\u00a3':
+ case '\u00a4': case '\u00a5': case '\u00a6': case '\u00a7':
+ case '\u00a8': case '\u00a9': case '\u00aa': case '\u00ab':
+ case '\u00ac': case '\u00ad': case '\u00ae': case '\u00af':
+ case '\u00b0': case '\u00b1': case '\u00b2': case '\u00b3':
+ case '\u00b4': case '\u00b5': case '\u00b6': case '\u00b7':
+ case '\u00b8': case '\u00b9': case '\u00ba': case '\u00bb':
+ case '\u00bc': case '\u00bd': case '\u00be': case '\u00bf':
+ case '\u00c0': case '\u00c1': case '\u00c2': case '\u00c3':
+ case '\u00c4': case '\u00c5': case '\u00c6': case '\u00c7':
+ case '\u00c8': case '\u00c9': case '\u00ca': case '\u00cb':
+ case '\u00cc': case '\u00cd': case '\u00ce': case '\u00cf':
+ case '\u00d0': case '\u00d1': case '\u00d2': case '\u00d3':
+ case '\u00d4': case '\u00d5': case '\u00d6': case '\u00d7':
+ case '\u00d8': case '\u00d9': case '\u00da': case '\u00db':
+ case '\u00dc': case '\u00dd': case '\u00de': case '\u00df':
+ case '\u00e0': case '\u00e1': case '\u00e2': case '\u00e3':
+ case '\u00e4': case '\u00e5': case '\u00e6': case '\u00e7':
+ case '\u00e8': case '\u00e9': case '\u00ea': case '\u00eb':
+ case '\u00ec': case '\u00ed': case '\u00ee': case '\u00ef':
+ case '\u00f0': case '\u00f1': case '\u00f2': case '\u00f3':
+ case '\u00f4': case '\u00f5': case '\u00f6': case '\u00f7':
+ case '\u00f8': case '\u00f9': case '\u00fa': case '\u00fb':
+ case '\u00fc': case '\u00fd': case '\u00fe': case '\u00ff':
+ {
+ matchRange('\u00a0','\u00ff');
+ break;
+ }
+ default:
+ if (((LA(1) >= '\u0100' && LA(1) <= '\u017f'))) {
+ matchRange('\u0100','\u017f');
+ }
+ else if (((LA(1) >= '\u0180' && LA(1) <= '\u024f'))) {
+ matchRange('\u0180','\u024f');
+ }
+ else if (((LA(1) >= '\u0250' && LA(1) <= '\ufaff'))) {
+ matchRange('\u0250','\ufaff');
+ }
+ else if (((LA(1) >= '\uff00' && LA(1) <= '\uffef'))) {
+ matchRange('\uff00','\uffef');
+ }
+ else {
+ if ( _cnt107>=1 ) { break _loop107; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ }
+ }
+ _cnt107++;
+ } while (true);
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mPUNCTUATION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = PUNCTUATION;
+ int _saveIndex;
+
+ switch ( LA(1)) {
+ case '-':
+ {
+ match('-');
+ break;
+ }
+ case ';':
+ {
+ match(';');
+ break;
+ }
+ case ':':
+ {
+ match(':');
+ break;
+ }
+ case '(':
+ {
+ match('(');
+ break;
+ }
+ case ')':
+ {
+ match(')');
+ break;
+ }
+ case '{':
+ {
+ match('{');
+ break;
+ }
+ case '}':
+ {
+ match('}');
+ break;
+ }
+ case '?':
+ {
+ match('?');
+ break;
+ }
+ case '!':
+ {
+ match('!');
+ break;
+ }
+ case '@':
+ {
+ match('@');
+ break;
+ }
+ case '%':
+ {
+ match('%');
+ break;
+ }
+ case '.':
+ {
+ match('.');
+ break;
+ }
+ case ',':
+ {
+ match(',');
+ break;
+ }
+ case '\'':
+ {
+ match('\'');
+ break;
+ }
+ case '$':
+ {
+ match('$');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = EQ;
+ int _saveIndex;
+
+ match('=');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = PLUS;
+ int _saveIndex;
+
+ match('+');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mUNDERSCORE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = UNDERSCORE;
+ int _saveIndex;
+
+ match('_');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = STAR;
+ int _saveIndex;
+
+ match('*');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mSLASH(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = SLASH;
+ int _saveIndex;
+
+ match('/');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mESCAPE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = ESCAPE;
+ int _saveIndex;
+
+ match('\\');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mBAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = BAR;
+ int _saveIndex;
+
+ match('|');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mBACKTICK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = BACKTICK;
+ int _saveIndex;
+
+ match('`');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mTWIDDLE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = TWIDDLE;
+ int _saveIndex;
+
+ match('~');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mDOUBLEQUOTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = DOUBLEQUOTE;
+ int _saveIndex;
+
+ match('"');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mOPEN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = OPEN;
+ int _saveIndex;
+
+ match('[');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mCLOSE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = CLOSE;
+ int _saveIndex;
+
+ match(']');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mHASH(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = HASH;
+ int _saveIndex;
+
+ match('#');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mHAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = HAT;
+ int _saveIndex;
+
+ match('^');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = GT;
+ int _saveIndex;
+
+ match('>');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = LT;
+ int _saveIndex;
+
+ match('<');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mAMPERSAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = AMPERSAND;
+ int _saveIndex;
+
+ match('&');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mSPACE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = SPACE;
+ int _saveIndex;
+
+ {
+ int _cnt128=0;
+ _loop128:
+ do {
+ switch ( LA(1)) {
+ case ' ':
+ {
+ match(' ');
+ break;
+ }
+ case '\t':
+ {
+ match('\t');
+ break;
+ }
+ default:
+ {
+ if ( _cnt128>=1 ) { break _loop128; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ }
+ }
+ _cnt128++;
+ } while (true);
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mNEWLINE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = NEWLINE;
+ int _saveIndex;
+
+ if ((LA(1)=='\r') && (LA(2)=='\n')) {
+ match("\r\n");
+ }
+ else if ((LA(1)=='\r') && (true)) {
+ match('\r');
+ }
+ else if ((LA(1)=='\n')) {
+ match('\n');
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mEOF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = Token.EOF_TYPE;
+ int _saveIndex;
+
+ match('\uFFFF');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+
+ private static final long[] mk_tokenSet_0() {
+ long[] data = new long[4084];
+ data[0]=287948901175001088L;
+ data[1]=576460743847706622L;
+ data[2]=-4294967296L;
+ for (int i = 3; i<=1003; i++) { data[i]=-1L; }
+ for (int i = 1020; i<=1022; i++) { data[i]=-1L; }
+ data[1023]=281474976710655L;
+ return data;
+ }
+ public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
+
+ }
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParser.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParser.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParser.java 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,1828 @@
+// $ANTLR 2.7.6 (2005-12-22): "seam-text.g" -> "SeamTextParser.java"$
+
+package org.jboss.seam.text;
+
+import antlr.TokenBuffer;
+import antlr.TokenStreamException;
+import antlr.TokenStreamIOException;
+import antlr.ANTLRException;
+import antlr.LLkParser;
+import antlr.Token;
+import antlr.TokenStream;
+import antlr.RecognitionException;
+import antlr.NoViableAltException;
+import antlr.MismatchedTokenException;
+import antlr.SemanticException;
+import antlr.ParserSharedInputState;
+import antlr.collections.impl.BitSet;
+
+public class SeamTextParser extends antlr.LLkParser implements SeamTextParserTokenTypes
+ {
+
+ private java.util.Set htmlElements = new java.util.HashSet( java.util.Arrays.asList( new String[] { "a", "p", "q", "code", "pre", "table", "tr", "td", "th", "ul", "ol", "li", "b", "i", "u", "tt", "del", "em", "hr", "br", "div", "span", "h1", "h2", "h3", "h4", "img" , "object", "param", "embed"} ) );
+ private java.util.Set htmlAttributes = new java.util.HashSet( java.util.Arrays.asList( new String[] { "src", "href", "lang", "class", "id", "style", "width", "height", "name", "value", "type", "wmode" } ) );
+
+ private StringBuilder mainBuilder = new StringBuilder();
+ private StringBuilder builder = mainBuilder;
+
+ public String toString() {
+ return builder.toString();
+ }
+
+ private void append(String... strings) {
+ for (String string: strings) builder.append(string);
+ }
+
+ private static boolean hasMultiple(String string, char c) {
+ return string.indexOf(c)!=string.lastIndexOf(c);
+ }
+
+ private void validateElement(Token t) throws NoViableAltException {
+ if ( !htmlElements.contains( t.getText().toLowerCase() ) ) {
+ throw new NoViableAltException(t, null);
+ }
+ }
+
+ private void validateAttribute(Token t) throws NoViableAltException {
+ if ( !htmlAttributes.contains( t.getText().toLowerCase() ) ) {
+ throw new NoViableAltException(t, null);
+ }
+ }
+
+ private void beginCapture() {
+ builder = new StringBuilder();
+ }
+
+ private String endCapture() {
+ String result = builder.toString();
+ builder = mainBuilder;
+ return result;
+ }
+
+ protected String linkTag(String description, String url) {
+ return "<a href=\"" + url + "\" styleClass=\"seamTextLink\">" + description + "</a>";
+ }
+
+ protected String macroInclude(String macroName) {
+ return "";
+ }
+
+protected SeamTextParser(TokenBuffer tokenBuf, int k) {
+ super(tokenBuf,k);
+ tokenNames = _tokenNames;
+}
+
+public SeamTextParser(TokenBuffer tokenBuf) {
+ this(tokenBuf,4);
+}
+
+protected SeamTextParser(TokenStream lexer, int k) {
+ super(lexer,k);
+ tokenNames = _tokenNames;
+}
+
+public SeamTextParser(TokenStream lexer) {
+ this(lexer,4);
+}
+
+public SeamTextParser(ParserSharedInputState state) {
+ super(state,4);
+ tokenNames = _tokenNames;
+}
+
+ public final void startRule() throws RecognitionException, TokenStreamException {
+
+
+ {
+ _loop3:
+ do {
+ if ((LA(1)==NEWLINE)) {
+ newline();
+ }
+ else {
+ break _loop3;
+ }
+
+ } while (true);
+ }
+ {
+ switch ( LA(1)) {
+ case DOUBLEQUOTE:
+ case BACKTICK:
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case PLUS:
+ case EQ:
+ case HASH:
+ case TWIDDLE:
+ case UNDERSCORE:
+ case OPEN:
+ case LT:
+ case SPACE:
+ {
+ {
+ switch ( LA(1)) {
+ case PLUS:
+ {
+ heading();
+ {
+ _loop7:
+ do {
+ if ((LA(1)==NEWLINE)) {
+ newline();
+ }
+ else {
+ break _loop7;
+ }
+
+ } while (true);
+ }
+ break;
+ }
+ case DOUBLEQUOTE:
+ case BACKTICK:
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case EQ:
+ case HASH:
+ case TWIDDLE:
+ case UNDERSCORE:
+ case OPEN:
+ case LT:
+ case SPACE:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ text();
+ {
+ _loop11:
+ do {
+ if ((LA(1)==PLUS)) {
+ heading();
+ {
+ _loop10:
+ do {
+ if ((LA(1)==NEWLINE)) {
+ newline();
+ }
+ else {
+ break _loop10;
+ }
+
+ } while (true);
+ }
+ text();
+ }
+ else {
+ break _loop11;
+ }
+
+ } while (true);
+ }
+ break;
+ }
+ case EOF:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+
+ public final void newline() throws RecognitionException, TokenStreamException {
+
+ Token n = null;
+
+ n = LT(1);
+ match(NEWLINE);
+ append( n.getText() );
+ }
+
+ public final void heading() throws RecognitionException, TokenStreamException {
+
+
+ {
+ if ((LA(1)==PLUS) && (_tokenSet_0.member(LA(2)))) {
+ h1();
+ }
+ else if ((LA(1)==PLUS) && (LA(2)==PLUS) && (_tokenSet_0.member(LA(3)))) {
+ h2();
+ }
+ else if ((LA(1)==PLUS) && (LA(2)==PLUS) && (LA(3)==PLUS) && (_tokenSet_0.member(LA(4)))) {
+ h3();
+ }
+ else if ((LA(1)==PLUS) && (LA(2)==PLUS) && (LA(3)==PLUS) && (LA(4)==PLUS)) {
+ h4();
+ }
+ else {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ newlineOrEof();
+ }
+
+ public final void text() throws RecognitionException, TokenStreamException {
+
+
+ {
+ int _cnt17=0;
+ _loop17:
+ do {
+ if ((_tokenSet_1.member(LA(1)))) {
+ {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case TWIDDLE:
+ case UNDERSCORE:
+ case OPEN:
+ case SPACE:
+ {
+ paragraph();
+ break;
+ }
+ case BACKTICK:
+ {
+ preformatted();
+ break;
+ }
+ case DOUBLEQUOTE:
+ {
+ blockquote();
+ break;
+ }
+ case EQ:
+ case HASH:
+ {
+ list();
+ break;
+ }
+ case LT:
+ {
+ html();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ _loop16:
+ do {
+ if ((LA(1)==NEWLINE)) {
+ newline();
+ }
+ else {
+ break _loop16;
+ }
+
+ } while (true);
+ }
+ }
+ else {
+ if ( _cnt17>=1 ) { break _loop17; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt17++;
+ } while (true);
+ }
+ }
+
+ public final void paragraph() throws RecognitionException, TokenStreamException {
+
+
+ append("<p>\n");
+ {
+ int _cnt20=0;
+ _loop20:
+ do {
+ if ((_tokenSet_0.member(LA(1)))) {
+ line();
+ newlineOrEof();
+ }
+ else {
+ if ( _cnt20>=1 ) { break _loop20; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt20++;
+ } while (true);
+ }
+ append("</p>\n");
+ newlineOrEof();
+ }
+
+ public final void preformatted() throws RecognitionException, TokenStreamException {
+
+
+ match(BACKTICK);
+ append("<pre>");
+ {
+ _loop30:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ {
+ word();
+ break;
+ }
+ case PUNCTUATION:
+ {
+ punctuation();
+ break;
+ }
+ case ESCAPE:
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case PLUS:
+ case EQ:
+ case HASH:
+ case TWIDDLE:
+ case UNDERSCORE:
+ {
+ specialChars();
+ break;
+ }
+ case OPEN:
+ case CLOSE:
+ {
+ moreSpecialChars();
+ break;
+ }
+ case DOUBLEQUOTE:
+ case GT:
+ case LT:
+ case AMPERSAND:
+ {
+ htmlSpecialChars();
+ break;
+ }
+ case SPACE:
+ {
+ space();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ default:
+ {
+ break _loop30;
+ }
+ }
+ } while (true);
+ }
+ match(BACKTICK);
+ append("</pre>");
+ }
+
+ public final void blockquote() throws RecognitionException, TokenStreamException {
+
+
+ match(DOUBLEQUOTE);
+ append("<blockquote>\n");
+ {
+ _loop27:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case TWIDDLE:
+ case UNDERSCORE:
+ {
+ formatted();
+ break;
+ }
+ case BACKTICK:
+ {
+ preformatted();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ case LT:
+ {
+ html();
+ break;
+ }
+ case EQ:
+ case HASH:
+ {
+ list();
+ break;
+ }
+ default:
+ {
+ break _loop27;
+ }
+ }
+ } while (true);
+ }
+ match(DOUBLEQUOTE);
+ newlineOrEof();
+ append("</blockquote>\n");
+ }
+
+ public final void list() throws RecognitionException, TokenStreamException {
+
+
+ {
+ switch ( LA(1)) {
+ case HASH:
+ {
+ olist();
+ break;
+ }
+ case EQ:
+ {
+ ulist();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ newlineOrEof();
+ }
+
+ public final void html() throws RecognitionException, TokenStreamException {
+
+
+ openTag();
+ {
+ _loop87:
+ do {
+ if ((LA(1)==SPACE) && (LA(2)==SLASH||LA(2)==GT||LA(2)==SPACE)) {
+ space();
+ }
+ else if ((LA(1)==SPACE) && (LA(2)==WORD)) {
+ space();
+ attribute();
+ }
+ else {
+ break _loop87;
+ }
+
+ } while (true);
+ }
+ {
+ switch ( LA(1)) {
+ case GT:
+ {
+ {
+ beforeBody();
+ body();
+ closeTagWithBody();
+ }
+ break;
+ }
+ case SLASH:
+ {
+ closeTagWithNoBody();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+
+ public final void line() throws RecognitionException, TokenStreamException {
+
+
+ {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case TWIDDLE:
+ case UNDERSCORE:
+ {
+ formatted();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ _loop24:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case TWIDDLE:
+ case UNDERSCORE:
+ {
+ formatted();
+ break;
+ }
+ case BACKTICK:
+ {
+ preformatted();
+ break;
+ }
+ case DOUBLEQUOTE:
+ {
+ quoted();
+ break;
+ }
+ case LT:
+ {
+ html();
+ break;
+ }
+ default:
+ {
+ break _loop24;
+ }
+ }
+ } while (true);
+ }
+ }
+
+ public final void newlineOrEof() throws RecognitionException, TokenStreamException {
+
+
+ switch ( LA(1)) {
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ case EOF:
+ {
+ match(Token.EOF_TYPE);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+
+ public final void plain() throws RecognitionException, TokenStreamException {
+
+
+ switch ( LA(1)) {
+ case WORD:
+ {
+ word();
+ break;
+ }
+ case PUNCTUATION:
+ {
+ punctuation();
+ break;
+ }
+ case ESCAPE:
+ {
+ escape();
+ break;
+ }
+ case SPACE:
+ {
+ space();
+ break;
+ }
+ default:
+ if ((LA(1)==OPEN) && (_tokenSet_2.member(LA(2)))) {
+ link();
+ }
+ else if ((LA(1)==OPEN) && (LA(2)==LT)) {
+ macro();
+ }
+ else {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+
+ public final void formatted() throws RecognitionException, TokenStreamException {
+
+
+ switch ( LA(1)) {
+ case STAR:
+ {
+ bold();
+ break;
+ }
+ case UNDERSCORE:
+ {
+ underline();
+ break;
+ }
+ case SLASH:
+ {
+ italic();
+ break;
+ }
+ case BAR:
+ {
+ monospace();
+ break;
+ }
+ case HAT:
+ {
+ superscript();
+ break;
+ }
+ case TWIDDLE:
+ {
+ deleted();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+
+ public final void quoted() throws RecognitionException, TokenStreamException {
+
+
+ match(DOUBLEQUOTE);
+ append("<q>");
+ {
+ int _cnt65=0;
+ _loop65:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case STAR:
+ {
+ bold();
+ break;
+ }
+ case UNDERSCORE:
+ {
+ underline();
+ break;
+ }
+ case SLASH:
+ {
+ italic();
+ break;
+ }
+ case BAR:
+ {
+ monospace();
+ break;
+ }
+ case HAT:
+ {
+ superscript();
+ break;
+ }
+ case TWIDDLE:
+ {
+ deleted();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ default:
+ {
+ if ( _cnt65>=1 ) { break _loop65; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt65++;
+ } while (true);
+ }
+ match(DOUBLEQUOTE);
+ append("</q>");
+ }
+
+ public final void word() throws RecognitionException, TokenStreamException {
+
+ Token w = null;
+
+ w = LT(1);
+ match(WORD);
+ append( w.getText() );
+ }
+
+ public final void punctuation() throws RecognitionException, TokenStreamException {
+
+ Token p = null;
+
+ p = LT(1);
+ match(PUNCTUATION);
+ append( p.getText() );
+ }
+
+ public final void specialChars() throws RecognitionException, TokenStreamException {
+
+ Token st = null;
+ Token sl = null;
+ Token b = null;
+ Token h = null;
+ Token p = null;
+ Token eq = null;
+ Token hh = null;
+ Token e = null;
+ Token t = null;
+ Token u = null;
+
+ switch ( LA(1)) {
+ case STAR:
+ {
+ st = LT(1);
+ match(STAR);
+ append( st.getText() );
+ break;
+ }
+ case SLASH:
+ {
+ sl = LT(1);
+ match(SLASH);
+ append( sl.getText() );
+ break;
+ }
+ case BAR:
+ {
+ b = LT(1);
+ match(BAR);
+ append( b.getText() );
+ break;
+ }
+ case HAT:
+ {
+ h = LT(1);
+ match(HAT);
+ append( h.getText() );
+ break;
+ }
+ case PLUS:
+ {
+ p = LT(1);
+ match(PLUS);
+ append( p.getText() );
+ break;
+ }
+ case EQ:
+ {
+ eq = LT(1);
+ match(EQ);
+ append( eq.getText() );
+ break;
+ }
+ case HASH:
+ {
+ hh = LT(1);
+ match(HASH);
+ append( hh.getText() );
+ break;
+ }
+ case ESCAPE:
+ {
+ e = LT(1);
+ match(ESCAPE);
+ append( e.getText() );
+ break;
+ }
+ case TWIDDLE:
+ {
+ t = LT(1);
+ match(TWIDDLE);
+ append( t.getText() );
+ break;
+ }
+ case UNDERSCORE:
+ {
+ u = LT(1);
+ match(UNDERSCORE);
+ append( u.getText() );
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+
+ public final void moreSpecialChars() throws RecognitionException, TokenStreamException {
+
+ Token o = null;
+ Token c = null;
+
+ switch ( LA(1)) {
+ case OPEN:
+ {
+ o = LT(1);
+ match(OPEN);
+ append( o.getText() );
+ break;
+ }
+ case CLOSE:
+ {
+ c = LT(1);
+ match(CLOSE);
+ append( c.getText() );
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+
+ public final void htmlSpecialChars() throws RecognitionException, TokenStreamException {
+
+
+ switch ( LA(1)) {
+ case GT:
+ {
+ match(GT);
+ append(">");
+ break;
+ }
+ case LT:
+ {
+ match(LT);
+ append("<");
+ break;
+ }
+ case DOUBLEQUOTE:
+ {
+ match(DOUBLEQUOTE);
+ append(""");
+ break;
+ }
+ case AMPERSAND:
+ {
+ match(AMPERSAND);
+ append("&");
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+
+ public final void space() throws RecognitionException, TokenStreamException {
+
+ Token s = null;
+
+ s = LT(1);
+ match(SPACE);
+ append( s.getText() );
+ }
+
+ public final void escape() throws RecognitionException, TokenStreamException {
+
+
+ match(ESCAPE);
+ {
+ switch ( LA(1)) {
+ case ESCAPE:
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case PLUS:
+ case EQ:
+ case HASH:
+ case TWIDDLE:
+ case UNDERSCORE:
+ {
+ specialChars();
+ break;
+ }
+ case OPEN:
+ case CLOSE:
+ {
+ moreSpecialChars();
+ break;
+ }
+ case QUOTE:
+ {
+ evenMoreSpecialChars();
+ break;
+ }
+ case DOUBLEQUOTE:
+ case GT:
+ case LT:
+ case AMPERSAND:
+ {
+ htmlSpecialChars();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+
+ public final void link() throws RecognitionException, TokenStreamException {
+
+
+ match(OPEN);
+ beginCapture();
+ {
+ _loop43:
+ do {
+ if ((_tokenSet_3.member(LA(1)))) {
+ plain();
+ }
+ else {
+ break _loop43;
+ }
+
+ } while (true);
+ }
+ String text=endCapture();
+ match(EQ);
+ match(GT);
+ beginCapture();
+ attributeValue();
+ String link = endCapture(); append(linkTag(text, link));
+ match(CLOSE);
+ }
+
+ public final void macro() throws RecognitionException, TokenStreamException {
+
+
+ match(OPEN);
+ match(LT);
+ match(EQ);
+ beginCapture();
+ attributeValue();
+ String macroName = endCapture(); append(macroInclude(macroName));
+ match(CLOSE);
+ }
+
+ public final void bold() throws RecognitionException, TokenStreamException {
+
+
+ match(STAR);
+ append("<b>");
+ {
+ int _cnt47=0;
+ _loop47:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case UNDERSCORE:
+ {
+ underline();
+ break;
+ }
+ case SLASH:
+ {
+ italic();
+ break;
+ }
+ case BAR:
+ {
+ monospace();
+ break;
+ }
+ case HAT:
+ {
+ superscript();
+ break;
+ }
+ case TWIDDLE:
+ {
+ deleted();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ default:
+ {
+ if ( _cnt47>=1 ) { break _loop47; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt47++;
+ } while (true);
+ }
+ match(STAR);
+ append("</b>");
+ }
+
+ public final void underline() throws RecognitionException, TokenStreamException {
+
+
+ match(UNDERSCORE);
+ append("<u>");
+ {
+ int _cnt50=0;
+ _loop50:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case STAR:
+ {
+ bold();
+ break;
+ }
+ case SLASH:
+ {
+ italic();
+ break;
+ }
+ case BAR:
+ {
+ monospace();
+ break;
+ }
+ case HAT:
+ {
+ superscript();
+ break;
+ }
+ case TWIDDLE:
+ {
+ deleted();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ default:
+ {
+ if ( _cnt50>=1 ) { break _loop50; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt50++;
+ } while (true);
+ }
+ match(UNDERSCORE);
+ append("</u>");
+ }
+
+ public final void italic() throws RecognitionException, TokenStreamException {
+
+
+ match(SLASH);
+ append("<i>");
+ {
+ int _cnt53=0;
+ _loop53:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case STAR:
+ {
+ bold();
+ break;
+ }
+ case UNDERSCORE:
+ {
+ underline();
+ break;
+ }
+ case BAR:
+ {
+ monospace();
+ break;
+ }
+ case HAT:
+ {
+ superscript();
+ break;
+ }
+ case TWIDDLE:
+ {
+ deleted();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ default:
+ {
+ if ( _cnt53>=1 ) { break _loop53; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt53++;
+ } while (true);
+ }
+ match(SLASH);
+ append("</i>");
+ }
+
+ public final void monospace() throws RecognitionException, TokenStreamException {
+
+ Token st = null;
+ Token sl = null;
+ Token h = null;
+ Token p = null;
+ Token eq = null;
+ Token hh = null;
+ Token e = null;
+ Token t = null;
+ Token u = null;
+
+ match(BAR);
+ append("<tt>");
+ {
+ int _cnt56=0;
+ _loop56:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ {
+ word();
+ break;
+ }
+ case PUNCTUATION:
+ {
+ punctuation();
+ break;
+ }
+ case SPACE:
+ {
+ space();
+ break;
+ }
+ case STAR:
+ {
+ st = LT(1);
+ match(STAR);
+ append( st.getText() );
+ break;
+ }
+ case SLASH:
+ {
+ sl = LT(1);
+ match(SLASH);
+ append( sl.getText() );
+ break;
+ }
+ case HAT:
+ {
+ h = LT(1);
+ match(HAT);
+ append( h.getText() );
+ break;
+ }
+ case PLUS:
+ {
+ p = LT(1);
+ match(PLUS);
+ append( p.getText() );
+ break;
+ }
+ case EQ:
+ {
+ eq = LT(1);
+ match(EQ);
+ append( eq.getText() );
+ break;
+ }
+ case HASH:
+ {
+ hh = LT(1);
+ match(HASH);
+ append( hh.getText() );
+ break;
+ }
+ case ESCAPE:
+ {
+ e = LT(1);
+ match(ESCAPE);
+ append( e.getText() );
+ break;
+ }
+ case TWIDDLE:
+ {
+ t = LT(1);
+ match(TWIDDLE);
+ append( t.getText() );
+ break;
+ }
+ case UNDERSCORE:
+ {
+ u = LT(1);
+ match(UNDERSCORE);
+ append( u.getText() );
+ break;
+ }
+ case OPEN:
+ case CLOSE:
+ {
+ moreSpecialChars();
+ break;
+ }
+ case DOUBLEQUOTE:
+ case GT:
+ case LT:
+ case AMPERSAND:
+ {
+ htmlSpecialChars();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ default:
+ {
+ if ( _cnt56>=1 ) { break _loop56; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt56++;
+ } while (true);
+ }
+ match(BAR);
+ append("</tt>");
+ }
+
+ public final void superscript() throws RecognitionException, TokenStreamException {
+
+
+ match(HAT);
+ append("<sup>");
+ {
+ int _cnt59=0;
+ _loop59:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case STAR:
+ {
+ bold();
+ break;
+ }
+ case UNDERSCORE:
+ {
+ underline();
+ break;
+ }
+ case SLASH:
+ {
+ italic();
+ break;
+ }
+ case BAR:
+ {
+ monospace();
+ break;
+ }
+ case TWIDDLE:
+ {
+ deleted();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ default:
+ {
+ if ( _cnt59>=1 ) { break _loop59; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt59++;
+ } while (true);
+ }
+ match(HAT);
+ append("</sup>");
+ }
+
+ public final void deleted() throws RecognitionException, TokenStreamException {
+
+
+ match(TWIDDLE);
+ append("<del>");
+ {
+ int _cnt62=0;
+ _loop62:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case STAR:
+ {
+ bold();
+ break;
+ }
+ case UNDERSCORE:
+ {
+ underline();
+ break;
+ }
+ case SLASH:
+ {
+ italic();
+ break;
+ }
+ case BAR:
+ {
+ monospace();
+ break;
+ }
+ case HAT:
+ {
+ superscript();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ default:
+ {
+ if ( _cnt62>=1 ) { break _loop62; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt62++;
+ } while (true);
+ }
+ match(TWIDDLE);
+ append("</del>");
+ }
+
+ public final void evenMoreSpecialChars() throws RecognitionException, TokenStreamException {
+
+ Token q = null;
+
+ q = LT(1);
+ match(QUOTE);
+ append( q.getText() );
+ }
+
+ public final void attributeValue() throws RecognitionException, TokenStreamException {
+
+
+ {
+ _loop104:
+ do {
+ switch ( LA(1)) {
+ case AMPERSAND:
+ {
+ match(AMPERSAND);
+ append("&");
+ break;
+ }
+ case WORD:
+ {
+ word();
+ break;
+ }
+ case PUNCTUATION:
+ {
+ punctuation();
+ break;
+ }
+ case SPACE:
+ {
+ space();
+ break;
+ }
+ case ESCAPE:
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case PLUS:
+ case EQ:
+ case HASH:
+ case TWIDDLE:
+ case UNDERSCORE:
+ {
+ specialChars();
+ break;
+ }
+ default:
+ {
+ break _loop104;
+ }
+ }
+ } while (true);
+ }
+ }
+
+ public final void h1() throws RecognitionException, TokenStreamException {
+
+
+ match(PLUS);
+ append("<h1>");
+ line();
+ append("</h1>");
+ }
+
+ public final void h2() throws RecognitionException, TokenStreamException {
+
+
+ match(PLUS);
+ match(PLUS);
+ append("<h2>");
+ line();
+ append("</h2>");
+ }
+
+ public final void h3() throws RecognitionException, TokenStreamException {
+
+
+ match(PLUS);
+ match(PLUS);
+ match(PLUS);
+ append("<h3>");
+ line();
+ append("</h3>");
+ }
+
+ public final void h4() throws RecognitionException, TokenStreamException {
+
+
+ match(PLUS);
+ match(PLUS);
+ match(PLUS);
+ match(PLUS);
+ append("<h4>");
+ line();
+ append("</h4>");
+ }
+
+ public final void olist() throws RecognitionException, TokenStreamException {
+
+
+ append("<ol>\n");
+ {
+ int _cnt76=0;
+ _loop76:
+ do {
+ if ((LA(1)==HASH)) {
+ olistLine();
+ newlineOrEof();
+ }
+ else {
+ if ( _cnt76>=1 ) { break _loop76; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt76++;
+ } while (true);
+ }
+ append("</ol>\n");
+ }
+
+ public final void ulist() throws RecognitionException, TokenStreamException {
+
+
+ append("<ul>\n");
+ {
+ int _cnt80=0;
+ _loop80:
+ do {
+ if ((LA(1)==EQ)) {
+ ulistLine();
+ newlineOrEof();
+ }
+ else {
+ if ( _cnt80>=1 ) { break _loop80; } else {throw new NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt80++;
+ } while (true);
+ }
+ append("</ul>\n");
+ }
+
+ public final void olistLine() throws RecognitionException, TokenStreamException {
+
+
+ match(HASH);
+ append("<li>");
+ line();
+ append("</li>");
+ }
+
+ public final void ulistLine() throws RecognitionException, TokenStreamException {
+
+
+ match(EQ);
+ append("<li>");
+ line();
+ append("</li>");
+ }
+
+ public final void openTag() throws RecognitionException, TokenStreamException {
+
+ Token name = null;
+
+ match(LT);
+ name = LT(1);
+ match(WORD);
+ validateElement(name); append("<"); append(name.getText());
+ }
+
+ public final void attribute() throws RecognitionException, TokenStreamException {
+
+ Token att = null;
+
+ att = LT(1);
+ match(WORD);
+ {
+ _loop99:
+ do {
+ if ((LA(1)==SPACE)) {
+ space();
+ }
+ else {
+ break _loop99;
+ }
+
+ } while (true);
+ }
+ match(EQ);
+ {
+ _loop101:
+ do {
+ if ((LA(1)==SPACE)) {
+ space();
+ }
+ else {
+ break _loop101;
+ }
+
+ } while (true);
+ }
+ match(DOUBLEQUOTE);
+ validateAttribute(att); append(att.getText()); append("=\"");
+ attributeValue();
+ match(DOUBLEQUOTE);
+ append("\"");
+ }
+
+ public final void beforeBody() throws RecognitionException, TokenStreamException {
+
+
+ match(GT);
+ append(">");
+ }
+
+ public final void body() throws RecognitionException, TokenStreamException {
+
+
+ {
+ _loop92:
+ do {
+ switch ( LA(1)) {
+ case WORD:
+ case PUNCTUATION:
+ case ESCAPE:
+ case OPEN:
+ case SPACE:
+ {
+ plain();
+ break;
+ }
+ case STAR:
+ case SLASH:
+ case BAR:
+ case HAT:
+ case TWIDDLE:
+ case UNDERSCORE:
+ {
+ formatted();
+ break;
+ }
+ case BACKTICK:
+ {
+ preformatted();
+ break;
+ }
+ case DOUBLEQUOTE:
+ {
+ quoted();
+ break;
+ }
+ case EQ:
+ case HASH:
+ {
+ list();
+ break;
+ }
+ case NEWLINE:
+ {
+ newline();
+ break;
+ }
+ default:
+ if ((LA(1)==LT) && (LA(2)==WORD)) {
+ html();
+ }
+ else {
+ break _loop92;
+ }
+ }
+ } while (true);
+ }
+ }
+
+ public final void closeTagWithBody() throws RecognitionException, TokenStreamException {
+
+ Token name = null;
+
+ match(LT);
+ match(SLASH);
+ name = LT(1);
+ match(WORD);
+ match(GT);
+ append("</"); append(name.getText()); append(">");
+ }
+
+ public final void closeTagWithNoBody() throws RecognitionException, TokenStreamException {
+
+
+ match(SLASH);
+ match(GT);
+ append("/>");
+ }
+
+
+ public static final String[] _tokenNames = {
+ "<0>",
+ "EOF",
+ "<2>",
+ "NULL_TREE_LOOKAHEAD",
+ "DOUBLEQUOTE",
+ "BACKTICK",
+ "WORD",
+ "PUNCTUATION",
+ "ESCAPE",
+ "STAR",
+ "SLASH",
+ "BAR",
+ "HAT",
+ "PLUS",
+ "EQ",
+ "HASH",
+ "TWIDDLE",
+ "UNDERSCORE",
+ "OPEN",
+ "CLOSE",
+ "QUOTE",
+ "GT",
+ "LT",
+ "AMPERSAND",
+ "SPACE",
+ "NEWLINE"
+ };
+
+ private static final long[] mk_tokenSet_0() {
+ long[] data = { 17244096L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
+ private static final long[] mk_tokenSet_1() {
+ long[] data = { 21487600L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
+ private static final long[] mk_tokenSet_2() {
+ long[] data = { 17056192L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
+ private static final long[] mk_tokenSet_3() {
+ long[] data = { 17039808L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
+
+ }
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParserTokenTypes.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParserTokenTypes.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParserTokenTypes.java 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,30 @@
+// $ANTLR 2.7.6 (2005-12-22): "seam-text.g" -> "SeamTextLexer.java"$
+
+package org.jboss.seam.text;
+
+public interface SeamTextParserTokenTypes {
+ int EOF = 1;
+ int NULL_TREE_LOOKAHEAD = 3;
+ int DOUBLEQUOTE = 4;
+ int BACKTICK = 5;
+ int WORD = 6;
+ int PUNCTUATION = 7;
+ int ESCAPE = 8;
+ int STAR = 9;
+ int SLASH = 10;
+ int BAR = 11;
+ int HAT = 12;
+ int PLUS = 13;
+ int EQ = 14;
+ int HASH = 15;
+ int TWIDDLE = 16;
+ int UNDERSCORE = 17;
+ int OPEN = 18;
+ int CLOSE = 19;
+ int QUOTE = 20;
+ int GT = 21;
+ int LT = 22;
+ int AMPERSAND = 23;
+ int SPACE = 24;
+ int NEWLINE = 25;
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParserTokenTypes.txt
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParserTokenTypes.txt (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/seam/text/SeamTextParserTokenTypes.txt 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,24 @@
+// $ANTLR 2.7.6 (2005-12-22): seam-text.g -> SeamTextParserTokenTypes.txt$
+SeamTextParser // output token vocab name
+DOUBLEQUOTE=4
+BACKTICK=5
+WORD=6
+PUNCTUATION=7
+ESCAPE=8
+STAR=9
+SLASH=10
+BAR=11
+HAT=12
+PLUS=13
+EQ=14
+HASH=15
+TWIDDLE=16
+UNDERSCORE=17
+OPEN=18
+CLOSE=19
+QUOTE=20
+GT=21
+LT=22
+AMPERSAND=23
+SPACE=24
+NEWLINE=25
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/ComponentUtil.java 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,25 @@
+package org.jboss.tools.jsf.vpe.seam;
+
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+public class ComponentUtil {
+
+ /**
+ * Copies all attributes from source node to visual node.
+ *
+ * @param sourceNode
+ * @param visualNode
+ */
+ public static void copyAttributes(Node sourceNode,
+ nsIDOMElement visualElement) {
+ NamedNodeMap namedNodeMap = sourceNode.getAttributes();
+ for (int i = 0; i < namedNodeMap.getLength(); i++) {
+ Node attribute = namedNodeMap.item(i);
+ visualElement.setAttribute(attribute.getNodeName(), attribute
+ .getNodeValue());
+ }
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * 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.seam;
+
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.jboss.tools.common.log.IPluginLog;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class SeamTemplatesActivator extends BaseUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jsf.vpe.seam";
+
+ // The shared instance
+ private static SeamTemplatesActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public SeamTemplatesActivator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static SeamTemplatesActivator getDefault() {
+ return plugin;
+ }
+
+ /** /
+ public static String getPluginResourcePath() {
+ Bundle bundle = Platform.getBundle(PLUGIN_ID);
+ URL url = null;
+ try {
+ url = bundle == null ? null : FileLocator.resolve(bundle.getEntry("/resources"));
+ } catch (Exception e) {
+ url = bundle.getEntry("/resources");
+ }
+ return (url == null) ? null : url.getPath();
+ }
+ /**/
+
+ public static IPluginLog getPluginLog() {
+ return getDefault();
+ }
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,138 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.test.unit.SeamTextTest;
+import org.jboss.seam.text.SeamTextLexer;
+import org.jboss.seam.text.SeamTextParser;
+import org.jboss.tools.jsf.vpe.seam.ComponentUtil;
+import org.jboss.tools.jsf.vpe.seam.SeamTemplatesActivator;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.mozilla.interfaces.nsIComponentManager;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMDocumentRange;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDOMParser;
+import org.mozilla.interfaces.nsIDOMText;
+import org.mozilla.interfaces.nsISupportsArray;
+import org.mozilla.xpcom.Mozilla;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import antlr.RecognitionException;
+import antlr.TokenStreamException;
+
+public class SeamFormattedTextTemplate extends VpeAbstractTemplate {
+
+ private static final String CID_DOMPARSER = "@mozilla.org/xmlextras/domparser;1";
+
+ /**
+ * component manager
+ */
+ private nsIComponentManager componentManager;
+
+ /**
+ * Creates a node of the visual tree on the node of the source tree. This
+ * visual node should not have the parent node This visual node can have
+ * child nodes.
+ *
+ * @param pageContext
+ * Contains the information on edited page.
+ * @param sourceNode
+ * The current node of the source tree.
+ * @param visualDocument
+ * The document of the visual tree.
+ * @return The information on the created node of the visual tree.
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+
+ Element sourceElement = (Element) sourceNode;
+ String valueT = sourceElement.getAttribute("value");
+ // complex test case:
+ //Reader r = new InputStreamReader( SeamFormattedTextTemplate.class.getResourceAsStream("SeamTextTest2.txt") );
+ StringReader r = new StringReader(valueT);
+ SeamTextLexer lexer = new SeamTextLexer(r);
+ SeamTextParser parser = new SeamTextParser(lexer);
+ try {
+ parser.startRule();
+ } catch (RecognitionException e) {
+ SeamTemplatesActivator.getPluginLog().logError(e);
+ } catch (TokenStreamException e) {
+ SeamTemplatesActivator.getPluginLog().logError(e);
+ }
+ nsIDOMParser parserDom = null;
+ try {
+ parserDom = (nsIDOMParser)getComponentManager().
+ createInstanceByContractID(CID_DOMPARSER, null, nsIDOMParser.NS_IDOMPARSER_IID);
+ } catch (Exception e) {
+ SeamTemplatesActivator.getPluginLog().logError(e);
+ }
+ String strDoc = "<HTML><BODY>" + parser.toString() + "</BODY></HTML>";
+ nsIDOMDocument domDoc = null != parserDom ? parserDom.parseFromString(strDoc, "application/xhtml+xml") : null;
+ nsIDOMNode patronItem = null, nodeTmp = null;
+ nsIDOMNodeList list = null;
+ if (null != domDoc && null != domDoc.getDocumentElement()) {
+ list = domDoc.getDocumentElement().getChildNodes();
+ long i = 0;
+ for (; i < list.getLength(); i++) {
+ nodeTmp = list.item(i);
+ if ("BODY".equalsIgnoreCase(nodeTmp.getNodeName())) {
+ patronItem = nodeTmp.cloneNode(true);
+ break;
+ }
+ }
+ }
+ if (null != patronItem) {
+ list = patronItem.getChildNodes();
+ //mainItem = visualDocument.createElement("DIV");
+ patronItem = visualDocument.createElement("SPAN");
+ createCopyChildren(visualDocument, patronItem, list);
+ }
+ VpeCreationData creationData = new VpeCreationData(patronItem);
+ return creationData;
+ }
+
+ public void createCopyChildren(nsIDOMDocument visualDocument,
+ nsIDOMNode nodeParent, nsIDOMNodeList listCopyChildren) {
+ long i = 0;
+ nsIDOMNode nodeTmp = null, nodeTmp2 = null;
+ for (; i < listCopyChildren.getLength(); i++) {
+ nodeTmp = listCopyChildren.item(i);
+ // remark: cloneNode true/false - is not suitable function here
+ //nodeTmp2 = nodeTmp.cloneNode(false);
+ if (nodeTmp.getNodeName().startsWith("#text")) {
+ nodeTmp2 = visualDocument.createTextNode(nodeTmp.getNodeValue());
+ }
+ else {
+ if (!nodeTmp.getNodeName().startsWith("#")) {
+ nodeTmp2 = visualDocument.createElement(nodeTmp.getNodeName());
+ }
+ }
+ if (null == nodeTmp2) {
+ continue;
+ }
+ nodeParent.appendChild(nodeTmp2);
+ createCopyChildren(visualDocument, nodeTmp2, nodeTmp.getChildNodes());
+ nodeTmp2 = null;
+ }
+ }
+
+ public nsIComponentManager getComponentManager() {
+ if (null == componentManager) {
+ componentManager = Mozilla.getInstance().getComponentManager();
+ }
+ return componentManager;
+ }
+}
+// html code
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamTextTest2.txt
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamTextTest2.txt (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamTextTest2.txt 2007-12-14 12:41:48 UTC (rev 5306)
@@ -0,0 +1,6 @@
+Here is some wiki text:
+*bold* |mono| ~deleted~ _underline_ /italic/ ^super^
+
+This is a new paragraph. (Just leave a blank line.)
+
+*/_Multiple ~tags~ styles_ can be nested!/*
17 years
JBoss Tools SVN: r5305 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2007-12-14 07:40:50 -0500 (Fri, 14 Dec 2007)
New Revision: 5305
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1449
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2007-12-14 12:40:10 UTC (rev 5304)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2007-12-14 12:40:50 UTC (rev 5305)
@@ -90,7 +90,8 @@
<vpe:tag name="s:formattedText" case-sensitive="yes">
- <vpe:template children="yes" modify="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamFormattedTextTemplate">
<div style="{@style}" class="{@styleClass}"
title="{tagstring()}">
<vpe:value expr="{jsfvalue(@value)}" />
17 years
JBoss Tools SVN: r5304 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2007-12-14 07:40:10 -0500 (Fri, 14 Dec 2007)
New Revision: 5304
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/.classpath
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/build.properties
Log:
http://jira.jboss.com/jira/browse/JBIDE-1449
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/.classpath
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/.classpath 2007-12-14 12:39:40 UTC (rev 5303)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/.classpath 2007-12-14 12:40:10 UTC (rev 5304)
@@ -3,5 +3,8 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="lib" path="lib/ant-antlr.jar"/>
+ <classpathentry kind="lib" path="lib/antlr.jar"/>
+ <classpathentry kind="lib" path="lib/antlr-runtime.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/build.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/build.properties 2007-12-14 12:39:40 UTC (rev 5303)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/build.properties 2007-12-14 12:40:10 UTC (rev 5304)
@@ -3,11 +3,10 @@
bin.includes = META-INF/,\
.,\
plugin.xml,\
+ lib/,\
+ lib/ant-antlr.jar,\
+ lib/antlr.jar,\
+ lib/antlr-runtime.jar,\
templates/
src.includes = templates/,\
- src/,\
- plugin.xml,\
- build.properties,\
- META-INF/,\
- .project,\
- .classpath
+ src/
17 years