JBoss Tools SVN: r18893 - in trunk: jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-11-27 12:24:20 -0500 (Fri, 27 Nov 2009)
New Revision: 18893
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IXmlContext.java
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java
Log:
JBIDE-5119: Refactor PageContextFactory to improve perfomance of context creation
Context interfaces hierarchy is updated
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java 2009-11-27 17:02:02 UTC (rev 18892)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java 2009-11-27 17:24:20 UTC (rev 18893)
@@ -32,13 +32,6 @@
Var[] getVars();
/**
- * Returns "var" attributes which are available in particular offset.
- * @param offset
- * @return
- */
- Var[] getVars(int offset);
-
- /**
* Returns EL Resolvers which are declared for this resource
* @return
*/
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java 2009-11-27 17:02:02 UTC (rev 18892)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java 2009-11-27 17:24:20 UTC (rev 18893)
@@ -34,19 +34,6 @@
return allVars.toArray(new Var[allVars.size()]);
}
- /*
- * (non-Javadoc)
- */
- public Var[] getVars(int offset) {
- List<Var> result = new ArrayList<Var>();
- for (Region region : vars.keySet()) {
- if(offset>=region.getOffset() && offset<=region.getOffset() + region.getLength()) {
- result.addAll(vars.get(region));
- }
- }
- return result.toArray(new Var[result.size()]);
- }
-
/**
* Adds new Var to the context
* @param region
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java 2009-11-27 17:02:02 UTC (rev 18892)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java 2009-11-27 17:24:20 UTC (rev 18893)
@@ -56,14 +56,6 @@
return vars.toArray(new Var[vars.size()]);
}
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.core.resolver.ELContext#getVars(int)
- */
- public Var[] getVars(int i) {
- return getVars();
- }
-
/**
* @param vars
*/
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IXmlContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IXmlContext.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IXmlContext.java 2009-11-27 17:24:20 UTC (rev 18893)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jst.web.kb;
+
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.common.el.core.resolver.Var;
+
+/**
+ *
+ * @author Victor Rubezhny
+ *
+ */
+public interface IXmlContext extends ELContext {
+
+ /**
+ * Returns "var" attributes which are available in particular offset.
+ * @param offset
+ * @return
+ */
+ Var[] getVars(int offset);
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IXmlContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-27 17:02:02 UTC (rev 18892)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-27 17:24:20 UTC (rev 18893)
@@ -14,7 +14,6 @@
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-11-27 17:02:02 UTC (rev 18892)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-11-27 17:24:20 UTC (rev 18893)
@@ -20,6 +20,7 @@
import org.jboss.tools.jst.web.kb.IIncludedContextSupport;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.IResourceBundle;
+import org.jboss.tools.jst.web.kb.IXmlContext;
import org.jboss.tools.jst.web.kb.PageContextFactory.CSSStyleSheetDescriptor;
import org.jboss.tools.jst.web.kb.internal.taglib.NameSpace;
import org.jboss.tools.jst.web.kb.taglib.INameSpace;
@@ -95,7 +96,10 @@
List<ELContext> includedContexts = getIncludedContexts();
if (includedContexts != null) {
for (ELContext includedContext : includedContexts) {
- Var[] vars = includedContext.getVars(offset);
+ if (!(includedContext instanceof IXmlContext))
+ continue;
+
+ Var[] vars = ((IXmlContext)includedContext).getVars(offset);
if (vars != null) {
for (Var b : vars) {
includedVars.add(b);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java 2009-11-27 17:02:02 UTC (rev 18892)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java 2009-11-27 17:24:20 UTC (rev 18893)
@@ -10,15 +10,18 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.DocumentProviderRegistry;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.jboss.tools.common.el.core.resolver.ELContextImpl;
+import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.jst.web.kb.IXmlContext;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.jboss.tools.jst.web.kb.taglib.INameSpace;
-public class XmlContextImpl extends ELContextImpl {
+public class XmlContextImpl extends ELContextImpl implements IXmlContext {
protected IDocument document;
private FileEditorInput editorInput;
@@ -51,6 +54,21 @@
return document;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.IXmlContext#getVars(int)
+ */
+ public Var[] getVars(int offset) {
+ List<Var> result = new ArrayList<Var>();
+ for (Region region : vars.keySet()) {
+ if(offset>=region.getOffset() && offset<=region.getOffset() + region.getLength()) {
+ result.addAll(vars.get(region));
+ }
+ }
+ return result.toArray(new Var[result.size()]);
+ }
+
+
/*
* TODO: the visibility must differ between 'include'-like and 'template'-like inclusion
*
@@ -130,7 +148,7 @@
}
super.finalize();
}
-
+
private IDocument getConnectedDocument(IEditorInput input) {
IDocumentProvider provider= DocumentProviderRegistry.getDefault().getDocumentProvider(input);
try {
15 years, 1 month
JBoss Tools SVN: r18892 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-11-27 12:02:02 -0500 (Fri, 27 Nov 2009)
New Revision: 18892
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
JBIDE-5286: NullPointerException on JSPTextEditor.dispose()
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-11-27 16:55:22 UTC (rev 18891)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-11-27 17:02:02 UTC (rev 18892)
@@ -1295,7 +1295,9 @@
dnd = null;
}
textEditorDropProvider = null;
- getSourceViewer().removeTextListener(this);
+ if (getSourceViewer() != null) {
+ getSourceViewer().removeTextListener(this);
+ }
if (fOutlinePage != null) {
if (fOutlinePage instanceof ConfigurableContentOutlinePage
&& fOutlinePageListener != null) {
15 years, 1 month
JBoss Tools SVN: r18891 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-11-27 11:55:22 -0500 (Fri, 27 Nov 2009)
New Revision: 18891
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
JBIDE-5273: NPE in junit tests for jsp components
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-27 16:48:34 UTC (rev 18890)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-27 16:55:22 UTC (rev 18891)
@@ -179,7 +179,7 @@
return;
// Remove all the contexts that are parent to the removed context
- Collection<ELContext> contexts = cache.values();
+ ELContext[] contexts = cache.values().toArray(new ELContext[0]);
if (contexts != null) {
for (ELContext context : contexts) {
if (isDependencyContext(context, file)) {
@@ -200,7 +200,7 @@
return;
synchronized (cache) {
// Remove all the contexts that are parent to the removed context
- Collection<IFile> files = cache.keySet();
+ IFile[] files = cache.keySet().toArray(new IFile[0]);
if (files != null) {
for (IFile file : files) {
if (project.equals(file.getProject())) {
@@ -217,9 +217,11 @@
* @param file
*/
public void cleanUp(IResourceDelta delta) {
- if(cache == null || cache.size() == 0) return;
- if(!checkDelta(delta)) return;
- processDelta(delta);
+ synchronized (cache) {
+ if(cache.size() == 0) return;
+ if(!checkDelta(delta)) return;
+ processDelta(delta);
+ }
}
// long ctm = 0;
@@ -979,7 +981,7 @@
synchronized (cache) {
// Remove all the contexts that are parent to the removed context
- Collection<ELContext> contexts = cache.values();
+ ELContext[] contexts = cache.values().toArray(new ELContext[0]);
if (contexts != null) {
for (ELContext context : contexts) {
removeSavedContext(context.getResource());
@@ -1006,7 +1008,7 @@
synchronized (cache) {
// Remove all the contexts that are parent to the removed context
- Collection<ELContext> contexts = cache.values();
+ ELContext[] contexts = cache.values().toArray(new ELContext[0]);
if (contexts != null) {
for (ELContext context : contexts) {
if (context instanceof XmlContextImpl &&
15 years, 1 month
JBoss Tools SVN: r18890 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui/preferences and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-11-27 11:48:34 -0500 (Fri, 27 Nov 2009)
New Revision: 18890
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/RemoveSeamSupportAction.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/AddSeamSupportAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5275
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.properties 2009-11-27 16:31:01 UTC (rev 18889)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.properties 2009-11-27 16:48:34 UTC (rev 18890)
@@ -7,6 +7,7 @@
ViewCategory_Seam=Seam
ViewName_SeamComponents=Seam Components
ConfigureMenu_AddSeamSupport=Add Seam support...
+ConfigureMenu_RemoveSeamSupport=Remove Seam support...
perspective.name=Seam
Bundle-Vendor.0 = JBoss by Red Hat
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-11-27 16:31:01 UTC (rev 18889)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-11-27 16:48:34 UTC (rev 18890)
@@ -410,24 +410,6 @@
name="org.jboss.tools.seam.ui.contentAssistProcessor">
</extension>
- <extension
- point="org.eclipse.ui.popupMenus">
- <!-- TODO: We should either remove this or move it to a not so prominient place in the final release -->
- <objectContribution
- adaptable="true"
- id="org.jboss.tools.seam.ui.enableSeamAction"
- nameFilter="*"
- objectClass="org.eclipse.core.resources.IProject">
- <!--action
- class="org.jboss.tools.seam.ui.builder.ToggleSeamNatureAction"
- enablesFor="+"
- id="org.jboss.tools.seam.ui.addRemoveSeamNatureAction"
- label="Add/Remove Seam support"
- menubarPath="additions">
- </action-->
- </objectContribution>
- </extension>
-
<extension point="org.eclipse.ui.preferencePages">
<page
category="org.jboss.tools.common.model.ui.seam"
@@ -682,7 +664,7 @@
point="org.eclipse.ui.popupMenus">
<objectContribution
- id="org.jboss.tools.seam.ui.project.configure"
+ id="org.jboss.tools.seam.ui.project.configure.enable"
objectClass="org.eclipse.core.resources.IProject"
adaptable="true">
<visibility>
@@ -706,6 +688,25 @@
menubarPath="org.eclipse.ui.projectConfigure/additions"/>
</objectContribution>
+
+ <objectContribution
+ id="org.jboss.tools.seam.ui.project.configure.disable"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <visibility>
+ <objectState
+ name="projectNature"
+ value="org.jboss.tools.seam.core.seamnature"/>
+ </visibility>
+
+ <action
+ id="org.jboss.tools.seam.ui.RemoveSeamSupport"
+ label="%ConfigureMenu_RemoveSeamSupport"
+ class="org.jboss.tools.seam.ui.preferences.RemoveSeamSupportAction"
+ enablesFor="1"
+ menubarPath="org.eclipse.ui.projectConfigure/additions"/>
+
+ </objectContribution>
</extension>
</plugin>
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/AddSeamSupportAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/AddSeamSupportAction.java 2009-11-27 16:31:01 UTC (rev 18889)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/AddSeamSupportAction.java 2009-11-27 16:48:34 UTC (rev 18890)
@@ -39,9 +39,15 @@
public void run(IAction action) {
IProject project = (IProject) ((IStructuredSelection) currentSelection).getFirstElement();
PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), project, SeamSettingsPreferencePage.ID, new String[] {SeamSettingsPreferencePage.ID}, null);
+ SeamSettingsPreferencePage page = (SeamSettingsPreferencePage)dialog.getSelectedPage();
+ page.setEnabledSeamSuport(shouldEnable());
dialog.open();
}
+ protected boolean shouldEnable() {
+ return true;
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/RemoveSeamSupportAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/RemoveSeamSupportAction.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/RemoveSeamSupportAction.java 2009-11-27 16:48:34 UTC (rev 18890)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.preferences;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class RemoveSeamSupportAction extends AddSeamSupportAction {
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.preferences.AddSeamSupportAction#shouldEnable()
+ */
+ @Override
+ protected boolean shouldEnable() {
+ return false;
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/RemoveSeamSupportAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2009-11-27 16:31:01 UTC (rev 18889)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2009-11-27 16:48:34 UTC (rev 18890)
@@ -714,7 +714,11 @@
private String getSeamRuntimeName() {
if(preferences!=null) {
- return preferences.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, "");
+ SeamRuntime defaultRuntime = SeamRuntimeManager.getDefaultRuntimeForProject(warProject!=null?warProject:project);
+ if(defaultRuntime==null) {
+ defaultRuntime = SeamRuntimeManager.getInstance().getDefaultRuntime();
+ }
+ return preferences.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, defaultRuntime==null?"":defaultRuntime.getName());
}
return "";
}
@@ -841,9 +845,10 @@
return suportSeam;
}
- private void setEnabledSeamSuport(boolean enabled) {
- // just for enabling/disabling groups
+ public void setEnabledSeamSuport(boolean enabled) {
suportSeam = enabled;
+ editorRegistry.get(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_SEAM_SUPPORT).setValue(enabled);
+ // just for enabling/disabling groups
if(!enabled) {
setEnabledGroups(enabled);
// disable all below
@@ -851,7 +856,7 @@
if(key!=SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_SEAM_SUPPORT) {
editorRegistry.get(key).setEnabled(enabled);
}
- }
+ }
} else {
editorRegistry.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).setEnabled(enabled);
if(runtimeIsSelected) {
15 years, 1 month
JBoss Tools SVN: r18889 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-11-27 11:31:01 -0500 (Fri, 27 Nov 2009)
New Revision: 18889
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/ZoomActionMenuManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/ZoomEventManager.java
Log:
Public license was added to some new classes.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/ZoomActionMenuManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/ZoomActionMenuManager.java 2009-11-27 16:29:12 UTC (rev 18888)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/ZoomActionMenuManager.java 2009-11-27 16:31:01 UTC (rev 18889)
@@ -1,5 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.vpe.editor.menu;
+/**
+ * @author yzhishko
+ */
+
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/ZoomEventManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/ZoomEventManager.java 2009-11-27 16:29:12 UTC (rev 18888)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/ZoomEventManager.java 2009-11-27 16:31:01 UTC (rev 18889)
@@ -1,5 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.vpe.editor.template;
+/**
+ * @author yzhishko
+ */
+
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
import org.mozilla.interfaces.nsIContentViewer;
import org.mozilla.interfaces.nsIDOMAbstractView;
15 years, 1 month
JBoss Tools SVN: r18888 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-11-27 11:29:12 -0500 (Fri, 27 Nov 2009)
New Revision: 18888
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChart.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChartSeriesNested.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChart.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChartSeriesNested.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChart.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChartSeriesNested.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAnchorTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfBarChartTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfCellTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfChapterTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfDocumentTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFontTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFooterTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfLineChartTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfParagraphTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfPieChartTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfSectionTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTextTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTitleTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/color.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/data.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/header.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/image.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/series.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/stroke.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml.xml
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java
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/template/SeamDecorateTemplate.java
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/SeamGraphicImageTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1452 templates for seam-pdf components were added
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChart.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChart.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChartSeriesNested.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChartSeriesNested.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChart.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChart.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChartSeriesNested.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChartSeriesNested.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChart.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChart.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChartSeriesNested.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChartSeriesNested.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
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 2009-11-27 16:22:04 UTC (rev 18887)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -10,8 +10,14 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.seam;
+import java.io.IOException;
+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;
/**
@@ -63,4 +69,16 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
+
+ public static String getPluginResourcePath() {
+ Bundle bundle = Platform.getBundle(PLUGIN_ID);
+ URL url = null;
+ try {
+ url = bundle == null ? null : FileLocator.resolve(bundle.getEntry("/resources")); //$NON-NLS-1$
+ } catch (IOException e) {
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$
+ }
+ return (url == null) ? null : url.getPath();
+ }
+
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamDecorateTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamDecorateTemplate.java 2009-11-27 16:22:04 UTC (rev 18887)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamDecorateTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -3,7 +3,7 @@
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
-import org.jboss.tools.jsf.vpe.seam.template.util.Seam;
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeDefineContainerTemplate;
@@ -25,8 +25,8 @@
/*
* Reading attributes
*/
- String fileName = sourceElement.getAttribute(Seam.ATTR_TEMPLATE);
- String styleClass = sourceElement.getAttribute(Seam.ATTR_STYLE_CLASS);
+ String fileName = sourceElement.getAttribute(SeamUtil.ATTR_TEMPLATE);
+ String styleClass = sourceElement.getAttribute(SeamUtil.ATTR_STYLE_CLASS);
String style = sourceElement.getAttribute(HTML.ATTR_STYLE);
/*
@@ -53,7 +53,7 @@
public IRegion getSourceRegionForOpenOn(VpePageContext pageContext,
Node sourceNode, nsIDOMNode domNode) {
Element sourceElement = (Element) sourceNode;
- Node paramAttr = sourceElement.getAttributeNode(Seam.ATTR_TEMPLATE);
+ Node paramAttr = sourceElement.getAttributeNode(SeamUtil.ATTR_TEMPLATE);
return new Region(NodesManagingUtil.getStartOffsetNode(paramAttr),0);
}
}
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 2009-11-27 16:22:04 UTC (rev 18887)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -83,7 +83,7 @@
SeamTemplatesActivator.getPluginLog().logError(e);
}
- nsIDOMParser parserDom = parserDom = (nsIDOMParser) getComponentManager()
+ nsIDOMParser parserDom = (nsIDOMParser) getComponentManager()
.createInstanceByContractID(CID_DOMPARSER, null,
nsIDOMParser.NS_IDOMPARSER_IID);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java 2009-11-27 16:22:04 UTC (rev 18887)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -13,7 +13,7 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
-import org.jboss.tools.jsf.vpe.seam.template.util.Seam;
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
@@ -71,16 +71,16 @@
if (sourceElement.hasAttribute(HTML.ATTR_STYLE)) {
img.setAttribute(HTML.ATTR_STYLE, sourceElement.getAttribute(HTML.ATTR_STYLE));
}
- if (sourceElement.hasAttribute(Seam.ATTR_STYLE_CLASS)) {
- img.setAttribute(HTML.ATTR_CLASS, sourceElement.getAttribute(Seam.ATTR_STYLE_CLASS));
+ if (sourceElement.hasAttribute(SeamUtil.ATTR_STYLE_CLASS)) {
+ img.setAttribute(HTML.ATTR_CLASS, sourceElement.getAttribute(SeamUtil.ATTR_STYLE_CLASS));
}
if (sourceElement.hasAttribute(HTML.ATTR_VALUE)) {
img.setAttribute(HTML.ATTR_SRC, VpeStyleUtil.addFullPathToImgSrc(
sourceElement.getAttribute(HTML.ATTR_VALUE), pageContext,
true));
- } else if (sourceElement.hasAttribute(Seam.ATTR_URL)) {
+ } else if (sourceElement.hasAttribute(SeamUtil.ATTR_URL)) {
img.setAttribute(HTML.ATTR_SRC, VpeStyleUtil.addFullPathToImgSrc(
- sourceElement.getAttribute(Seam.ATTR_URL), pageContext,
+ sourceElement.getAttribute(SeamUtil.ATTR_URL), pageContext,
true));
}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public abstract class SeamPdfAbstractTemplate extends VpeAbstractTemplate {
+
+ @Override
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMNode visualNode, Object data) {
+ Node[] footers = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:footer");
+ if (footers != null && footers.length != 0) {
+ Node parentPdfDocumentNode = SeamUtil.getParentByName(pageContext,
+ sourceNode, "p:document");
+ if (parentPdfDocumentNode != null) {
+ return parentPdfDocumentNode;
+ }
+ }
+ return super
+ .getNodeForUpdate(pageContext, sourceNode, visualNode, data);
+ }
+
+ protected final void copySizeAttrs(nsIDOMElement visualElement,
+ Element sourceElement) {
+ String width = sourceElement.getAttribute(HTML.ATTR_WIDTH);
+ String height = sourceElement.getAttribute(HTML.ATTR_HEIGHT);
+ if (width != null) {
+ String styleAttrValue = visualElement.getAttribute(HTML.ATTR_STYLE);
+ if (styleAttrValue == null) {
+ visualElement.setAttribute(HTML.ATTR_STYLE, "width:" + width);
+ } else {
+ visualElement.setAttribute(HTML.ATTR_STYLE, styleAttrValue
+ + "; width:" + width);
+ }
+ }
+ if (height != null) {
+ String styleAttrValue = visualElement.getAttribute(HTML.ATTR_STYLE);
+ if (styleAttrValue == null) {
+ visualElement.setAttribute(HTML.ATTR_STYLE, "height:" + height);
+ } else {
+ visualElement.setAttribute(HTML.ATTR_STYLE, styleAttrValue
+ + "; height:" + height);
+ }
+ }
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAnchorTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAnchorTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAnchorTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfAnchorTemplate extends SeamPdfAbstractTemplate {
+
+ private static final String ATTR_REF = "reference";
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element sourceElement = (Element) sourceNode;
+ nsIDOMElement visualElement = visualDocument.createElement(HTML.TAG_A);
+ if (sourceElement.hasAttribute(HTML.ATTR_NAME)) {
+ visualElement.setAttribute(HTML.ATTR_NAME, sourceElement
+ .getAttribute(HTML.ATTR_NAME));
+ visualElement.setAttribute(HTML.ATTR_STYLE,
+ "color:black; text-decoration:none");
+ }
+ if (sourceElement.hasAttribute(ATTR_REF)) {
+ visualElement.setAttribute(HTML.ATTR_HREF, sourceElement
+ .getAttribute(ATTR_REF));
+ visualElement.removeAttribute(HTML.ATTR_STYLE);
+ }
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfBarChartTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfBarChartTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfBarChartTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,31 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfBarChartTemplate extends SeamPdfAbstractTemplate {
+
+ private static String BAR_CHART = "/barChart/barChart.png"; //$NON-NLS-1$
+ private static String BAR_CHART_SERIES_NESTED = "/barChart/barChartSeriesNested.png"; //$NON-NLS-1$
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement visualElement = visualDocument.createElement(HTML.TAG_IMG);
+ Node[] seriesNodes = SeamUtil.getChildsByName(pageContext, sourceNode, "p:series");
+ if (seriesNodes!=null && seriesNodes.length!=0) {
+ SeamUtil.setImg(visualElement, BAR_CHART_SERIES_NESTED);
+ }else {
+ SeamUtil.setImg(visualElement, BAR_CHART);
+ }
+ copySizeAttrs(visualElement, (Element)sourceNode);
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfCellTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfCellTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfCellTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfCellTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ sourceElement = (Element) sourceNode;
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_TD);
+ visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ copyAttrs(visualElement, sourceElement);
+ visualElement.setAttribute(HTML.ATTR_STYLE, "border-width: 2px; border-color: black; border-style: solid");
+ return new VpeCreationData(visualElement);
+ }
+
+ @Override
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMNode visualNode, Object data) {
+ Node nodeForUpdate = super.getNodeForUpdate(pageContext, sourceNode,
+ visualNode, data);
+ if (nodeForUpdate == null) {
+ nodeForUpdate = SeamUtil.getParentByName(pageContext, sourceNode,
+ "p:table");
+ }
+ return nodeForUpdate;
+ }
+
+ private void copyAttrs(nsIDOMElement visualElement, Element sourceElement) {
+ String attr = sourceElement.getAttribute(HTML.ATTR_COLSPAN);
+ if (attr != null) {
+ visualElement.setAttribute(HTML.ATTR_COLSPAN, attr);
+ }
+ attr = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_HORIZONAL_ALIGNMENT);
+ if (attr != null) {
+ visualElement.setAttribute(HTML.ATTR_ALIGN, attr);
+ }
+ attr = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_VERTICAL_ALIGNMENT);
+ if (attr != null) {
+ visualElement.setAttribute(HTML.ATTR_VALIGN, attr);
+ }
+ attr = sourceElement.getAttribute("noWrap");
+ if (attr != null) {
+ visualElement.setAttribute("nowrap", attr);
+ }
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfChapterTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfChapterTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfChapterTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class SeamPdfChapterTemplate extends SeamPdfAbstractTemplate {
+
+ private static final String NUMBER = "number";
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ sourceElement = (Element) sourceNode;
+ visualElement = VisualDomUtil.createBorderlessContainer(visualDocument);
+ nsIDOMNode headNode = visualDocument.createElement(HTML.TAG_H1);
+ String chapterNumber = sourceElement.getAttribute(NUMBER);
+ if (chapterNumber != null) {
+ try {
+ Integer.parseInt(chapterNumber);
+ } catch (NumberFormatException e) {
+ chapterNumber = "1";
+ }
+ } else {
+ chapterNumber = "1";
+ }
+ nsIDOMText chapterNumberNode = visualDocument
+ .createTextNode(chapterNumber + ". ");
+ headNode.appendChild(chapterNumberNode);
+ visualElement.appendChild(headNode);
+ return new VpeCreationData(visualElement);
+ }
+
+ private void setTitle(VpePageContext pageContext, Element sourceElement,
+ VpeCreationData data) {
+ Node sourceTitleNode = null;
+ NodeList children = sourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i) instanceof Element) {
+ if (children.item(i).getNodeName().endsWith(":title")) {
+ sourceTitleNode = children.item(i);
+ }
+ }
+ }
+ nsIDOMNode visualTitleNode = null;
+ if (sourceTitleNode != null) {
+ visualTitleNode = pageContext.getDomMapping().getVisualNode(
+ sourceTitleNode);
+ }
+ if (visualTitleNode != null) {
+ nsIDOMElement headElement = getHeadElement(data);
+ nsIDOMNode parentNode = visualTitleNode.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualTitleNode);
+ headElement.appendChild(visualTitleNode);
+ }
+ }
+ }
+
+ private nsIDOMElement getHeadElement(VpeCreationData data) {
+ nsIDOMNode visualNode = data.getNode();
+ nsIDOMNodeList children = visualNode.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getNodeType() == nsIDOMNode.ELEMENT_NODE) {
+ if (children.item(i).getNodeName()
+ .equalsIgnoreCase(HTML.TAG_H1)) {
+ return (nsIDOMElement) children.item(i).queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ setTitle(pageContext, (Element) sourceNode, data);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfDocumentTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfDocumentTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfDocumentTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfDocumentTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement headElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMNode headNode = visualDocument.createElement(HTML.TAG_DIV);
+ headElement = (nsIDOMElement) headNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ sourceElement = (Element) sourceNode;
+ setMarginValues();
+ return new VpeCreationData(headElement);
+ }
+
+ private boolean setMarginValues(float... marginValues) {
+ if (marginValues.length != 4) {
+ return false;
+ }
+ headElement.removeAttribute("style");
+ headElement.setAttribute("style", "margin-left:"
+ + Float.toString(marginValues[0]) + ";margin-right:"
+ + Float.toString(marginValues[1]) + ";margin-top:"
+ + Float.toString(marginValues[2]) + ";margin-bottom:"
+ + Float.toString(marginValues[3]) + ";");
+ return true;
+ }
+
+ private float[] parseMarginValues(String stringMarginValues)
+ throws NumberFormatException {
+ String[] parts = stringMarginValues.split("\\s");
+ float[] values = new float[parts.length];
+ for (int i = 0; i < parts.length; i++) {
+ values[i] = Float.valueOf(parts[i]);
+ }
+ return values;
+ }
+
+ private void setDefaultMargingValues() {
+ setMarginValues(36.0f, 36.0f, 36.0f, 36.0f);
+ }
+
+ private void setMarginValues() {
+ String marginsAttrValue = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_MARGINS);
+ try {
+ if (marginsAttrValue != null && !"".equals(marginsAttrValue)) {
+ float[] floatMarginValues = parseMarginValues(marginsAttrValue);
+ if (!setMarginValues(floatMarginValues)) {
+ setDefaultMargingValues();
+ }
+ } else {
+ setDefaultMargingValues();
+ }
+ } catch (NumberFormatException e) {
+ setDefaultMargingValues();
+ }
+ }
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ setFooter(pageContext, sourceNode, data);
+ }
+
+ private void setFooter(VpePageContext pageContext, Node sourceNode,
+ VpeCreationData data) {
+ Node[] footers = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:footer");
+ nsIDOMNode visualFooter = null;
+ if (footers != null && footers.length != 0) {
+ visualFooter = pageContext.getDomMapping().getVisualNode(
+ footers[footers.length - 1]);
+
+ }
+ if (visualFooter != null) {
+ for (int i = 0; i < footers.length; i++) {
+ nsIDOMNode visualFootersRepresent = pageContext.getDomMapping()
+ .getVisualNode(footers[i]);
+ if (visualFootersRepresent != null
+ && visualFootersRepresent != visualFooter) {
+ nsIDOMNode parentNode = visualFootersRepresent.getParentNode();
+ parentNode.removeChild(visualFootersRepresent);
+ }
+ }
+ nsIDOMNode parentNode = visualFooter.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualFooter);
+ data.getNode().appendChild(visualFooter);
+ }
+ }
+ }
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFontTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFontTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFontTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,25 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Node;
+
+public class SeamPdfFontTemplate extends SeamPdfAbstractTemplate {
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_SPAN);
+ String styleAttrValue = SeamUtil.getStyleAttr(sourceNode);
+ nsIDOMElement visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.setAttribute(HTML.ATTR_STYLE, styleAttrValue);
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFooterTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFooterTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFooterTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfFooterTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ sourceElement = (Element) sourceNode;
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_DIV);
+ visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ SeamUtil.setAlignment(sourceElement, visualElement);
+ Node parentFontNode = SeamUtil.getParentByName(pageContext, sourceNode,
+ "p:font");
+ String styleAttr = SeamUtil.getStyleAttr(parentFontNode);
+ if (styleAttr != null && !"".equals(styleAttr)) {
+ visualElement.setAttribute(HTML.ATTR_STYLE, styleAttr);
+ }
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfLineChartTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfLineChartTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfLineChartTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,33 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfLineChartTemplate extends SeamPdfAbstractTemplate {
+
+ private static String LINE_CHART = "/lineChart/lineChart.png"; //$NON-NLS-1$
+ private static String LINE_CHART_SERIES_NESTED = "/lineChart/lineChartSeriesNested.png"; //$NON-NLS-1$
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement visualElement = visualDocument
+ .createElement(HTML.TAG_IMG);
+ Node[] seriesNodes = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:series");
+ if (seriesNodes != null && seriesNodes.length != 0) {
+ SeamUtil.setImg(visualElement, LINE_CHART_SERIES_NESTED);
+ } else {
+ SeamUtil.setImg(visualElement, LINE_CHART);
+ }
+ copySizeAttrs(visualElement, (Element)sourceNode);
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListItemTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListItemTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,19 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Node;
+
+public class SeamPdfListItemTemplate extends SeamPdfAbstractTemplate {
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_LI);
+ return new VpeCreationData(visualNode);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,41 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfListTemplate extends SeamPdfAbstractTemplate {
+
+ private static List<String> NUMBERED_VALUES;
+ static{
+ NUMBERED_VALUES = new ArrayList<String>(0);
+ NUMBERED_VALUES.add("numbered");
+ NUMBERED_VALUES.add("greek");
+ NUMBERED_VALUES.add("roman");
+ NUMBERED_VALUES.add("zapfdingbats");
+ NUMBERED_VALUES.add("zapfdingbats_number");
+ }
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ String styleAttr = ((Element)sourceNode).getAttribute(HTML.ATTR_STYLE);
+ if (isNumberedAttr(styleAttr)) {
+ return new VpeCreationData(visualDocument.createElement(HTML.TAG_OL));
+ }
+ return new VpeCreationData(visualDocument.createElement(HTML.TAG_UL));
+ }
+
+ private boolean isNumberedAttr (String styleAttr){
+ if (styleAttr!=null) {
+ return NUMBERED_VALUES.contains(styleAttr);
+ }
+ return false;
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfParagraphTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfParagraphTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfParagraphTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfParagraphTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+ private nsIDOMDocument visualDocument;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ this.visualDocument = visualDocument;
+ sourceElement = (Element) sourceNode;
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_DIV);
+ visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ processFirstChild();
+ SeamUtil.setAlignment(sourceElement, visualElement);
+ return new VpeCreationData(visualElement);
+ }
+
+ private void processFirstChild() {
+ Node firstChild = sourceElement.getFirstChild();
+ if (firstChild != null) {
+ if (firstChild.getNodeType() == Node.TEXT_NODE) {
+ String nodeValue = firstChild.getNodeValue();
+ nodeValue = nodeValue.replace(" ", "").replace("\n", "")
+ .replace("\t", "").replace("\r", "");
+ if (!nodeValue.equals("")) {
+ nsIDOMNode brNode = visualDocument
+ .createElement(HTML.TAG_BR);
+ visualElement.appendChild(brNode);
+ }
+ }
+ }
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfPieChartTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfPieChartTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfPieChartTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,33 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfPieChartTemplate extends SeamPdfAbstractTemplate {
+
+ private static String PIE_CHART = "/pieChart/pieChart.png"; //$NON-NLS-1$
+ private static String PIE_CHART_SERIES_NESTED = "/pieChart/pieChartSeriesNested.png"; //$NON-NLS-1$
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement visualElement = visualDocument
+ .createElement(HTML.TAG_IMG);
+ Node[] seriesNodes = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:series");
+ if (seriesNodes != null && seriesNodes.length != 0) {
+ SeamUtil.setImg(visualElement, PIE_CHART_SERIES_NESTED);
+ } else {
+ SeamUtil.setImg(visualElement, PIE_CHART);
+ }
+ copySizeAttrs(visualElement, (Element)sourceNode);
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfSectionTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfSectionTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfSectionTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import java.util.StringTokenizer;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class SeamPdfSectionTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+ private String sectionNumberString;
+ private String headNameString;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ visualElement = VisualDomUtil.createBorderlessContainer(visualDocument);
+ sourceElement = (Element) sourceNode;
+ sectionNumberString = calculateSectionNumber(pageContext, sourceElement);
+ headNameString = calculateHeadName(sectionNumberString);
+ nsIDOMNode headNode = visualDocument.createElement(headNameString);
+ nsIDOMText textNode = visualDocument
+ .createTextNode(sectionNumberString);
+ headNode.appendChild(textNode);
+ visualElement.appendChild(headNode);
+ return new VpeCreationData(visualElement);
+ }
+
+ private String calculateSectionNumber(VpePageContext pageContext,
+ Element sourceElement) {
+ StringBuffer chapterNumberBuffer = new StringBuffer();
+ calculateNumberFromTree(pageContext, sourceElement, chapterNumberBuffer);
+ Node parentSection = SeamUtil.getParentByName(pageContext,
+ sourceElement, "p:chapter");
+ if (parentSection != null) {
+ int chapterNumber = getChapterNumber(parentSection);
+ chapterNumberBuffer
+ .insert(0, Integer.toString(chapterNumber) + ".");
+ }
+ return chapterNumberBuffer.toString();
+ }
+
+ private String calculateHeadName(String sectionNumberString) {
+ StringTokenizer tokenizer = new StringTokenizer(sectionNumberString,
+ ".", false);
+ int headNumber = 0;
+ while (tokenizer.hasMoreElements()) {
+ tokenizer.nextToken();
+ headNumber++;
+ }
+ if (headNumber > 6) {
+ headNumber = 6;
+ }
+ return "H" + Integer.toString(headNumber);
+ }
+
+ private void calculateNumberFromTree(VpePageContext pageContext,
+ Element sourceElement, StringBuffer sectionNumberString) {
+ Node parentSection = SeamUtil.getParentByName(pageContext,
+ sourceElement, "p:section");
+ if (parentSection != null) {
+ int sectionNum = 0;
+ NodeList children = parentSection.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getNodeName().endsWith(":section")) {
+ sectionNum++;
+ if (children.item(i) == sourceElement) {
+ sectionNumberString.insert(0, Integer
+ .toString(sectionNum)
+ + ".");
+ break;
+ }
+ }
+ }
+ calculateNumberFromTree(pageContext, (Element) parentSection,
+ sectionNumberString);
+ } else {
+ Node parentChapter = SeamUtil.getParentByName(pageContext,
+ sourceElement, "p:chapter");
+ int sectionNum = 0;
+ NodeList children = parentChapter.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getNodeName().endsWith(":section")) {
+ sectionNum++;
+ if (children.item(i) == sourceElement) {
+ sectionNumberString.insert(0, Integer
+ .toString(sectionNum)
+ + ".");
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ private int getChapterNumber(Node chapterNode) {
+ int chapterNumber = 1;
+ String chapterNumberString = ((Element) chapterNode)
+ .getAttribute("number");
+ if (chapterNumberString != null) {
+ try {
+ chapterNumber = Integer.parseInt(chapterNumberString);
+ } catch (NumberFormatException e) {
+ chapterNumber = 1;
+ }
+ } else {
+ chapterNumber = 1;
+ }
+ return chapterNumber;
+ }
+
+ private void setTitle(VpePageContext pageContext, Element sourceElement,
+ VpeCreationData data) {
+ Node sourceTitleNode = null;
+ NodeList children = sourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i) instanceof Element) {
+ if (children.item(i).getNodeName().endsWith(":title")) {
+ sourceTitleNode = children.item(i);
+ }
+ }
+ }
+ nsIDOMNode visualTitleNode = null;
+ if (sourceTitleNode != null) {
+ visualTitleNode = pageContext.getDomMapping().getVisualNode(
+ sourceTitleNode);
+ }
+ if (visualTitleNode != null) {
+ nsIDOMElement headElement = getHeadElement(data);
+ nsIDOMNode parentNode = visualTitleNode.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualTitleNode);
+ headElement.appendChild(visualTitleNode);
+ }
+ }
+ }
+
+ private nsIDOMElement getHeadElement(VpeCreationData data) {
+ nsIDOMNode visualNode = data.getNode();
+ nsIDOMNodeList children = visualNode.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getNodeType() == nsIDOMNode.ELEMENT_NODE) {
+ String nodeName = children.item(i).getNodeName();
+ if (HTML.TAG_H1.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H2.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H3.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H4.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H5.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H6.equalsIgnoreCase(nodeName)) {
+ return (nsIDOMElement) children.item(i).queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ setTitle(pageContext, (Element) sourceNode, data);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfTableTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ sourceElement = (Element) sourceNode;
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_DIV);
+ nsIDOMNode tableNode = visualDocument.createElement(HTML.TAG_TABLE);
+ nsIDOMElement visualTable = (nsIDOMElement) tableNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualNode.appendChild(tableNode);
+ visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualTable.setAttribute(HTML.ATTR_WIDTH, getWidthPerc(sourceElement));
+ visualTable.setAttribute(HTML.ATTR_ALIGN, getAlignment(sourceElement));
+ visualTable.setAttribute(HTML.ATTR_CELLSPACING, "0px");
+ return new VpeCreationData(visualElement);
+ }
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ setColumns(pageContext, sourceNode, visualDocument, data);
+ }
+
+ private int getNumberOfColumns(Node sourceTableNode) {
+ int columnsNumber = 1;
+ String columnsNumberString = ((Element) sourceTableNode)
+ .getAttribute("columns");
+ if (columnsNumberString != null) {
+ try {
+ columnsNumber = Integer.parseInt(columnsNumberString);
+ if (columnsNumber < 1) {
+ columnsNumber = 1;
+ }
+ } catch (NumberFormatException e) {
+ columnsNumber = 1;
+ }
+ } else {
+ columnsNumber = 1;
+ }
+ return columnsNumber;
+ }
+
+ private void setColumns(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ int numberOfColumns = getNumberOfColumns(sourceNode);
+ Node[] cells = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:cell");
+ int cellsLength = cells.length;
+ if (numberOfColumns > cellsLength) {
+ for (int i = 0; i < cells.length; i++) {
+ nsIDOMNode visualCell = pageContext.getDomMapping()
+ .getVisualNode(cells[i]);
+ nsIDOMNode parentNode = visualCell.getParentNode();
+ parentNode.removeChild(visualCell);
+ }
+ return;
+ }
+ nsIDOMNode visualTable = ((nsIDOMElement) data.getNode()
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))
+ .getElementsByTagName(HTML.TAG_TABLE).item(0);
+ if (cellsLength != 0) {
+ nsIDOMNode trVisualNode = visualDocument.createElement(HTML.TAG_TR);
+ visualTable.appendChild(trVisualNode);
+ int posCounter = 0;
+ for (int i = 0; i < cellsLength; i++) {
+ nsIDOMNode visualCell = pageContext.getDomMapping()
+ .getVisualNode(cells[i]);
+ nsIDOMNode parentNode = visualCell.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualCell);
+ trVisualNode.appendChild(visualCell);
+ int colspanValue = getColspanValue(visualCell);
+ posCounter++;
+ if (colspanValue > 1 && posCounter % numberOfColumns != 0) {
+ int posInRow = posCounter - 1;
+ int numEndCells = numberOfColumns - posInRow;
+ if (numEndCells <= colspanValue) {
+ colspanValue = numEndCells;
+ trVisualNode = visualDocument
+ .createElement(HTML.TAG_TR);
+ visualTable.appendChild(trVisualNode);
+ posCounter = 0;
+ continue;
+ } else {
+ for (int j = 0; j < numberOfColumns
+ - (colspanValue); j++) {
+ i++;
+ visualCell = pageContext.getDomMapping()
+ .getVisualNode(cells[i]);
+ trVisualNode.appendChild(visualCell);
+ }
+ i -= numberOfColumns - (colspanValue);
+ posCounter += colspanValue - 1;
+ }
+ }
+ }
+ if ((posCounter % numberOfColumns == 0)
+ && ((i + 1) != cellsLength)) {
+ trVisualNode = visualDocument.createElement(HTML.TAG_TR);
+ visualTable.appendChild(trVisualNode);
+ posCounter = 0;
+ }
+ }
+ if (trVisualNode.getChildNodes().getLength() != numberOfColumns) {
+ trVisualNode.getParentNode().removeChild(trVisualNode);
+ }
+ }
+ }
+
+ private String getWidthPerc(Element sourceElement) {
+ String width = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_WIDTH_PERCENTAGE);
+ if (width != null) {
+ try {
+ int intWidth = Integer.parseInt(width);
+ if (intWidth < 1 || intWidth > 100) {
+ width = "100%";
+ } else {
+ width = Integer.toString(intWidth) + "%";
+ }
+ } catch (NumberFormatException e) {
+ width = "100%";
+ }
+ } else {
+ width = "100%";
+ }
+ return width;
+ }
+
+ private String getAlignment(Element sourceElement) {
+ String align = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_HORIZONAL_ALIGNMENT);
+ if (align != null) {
+ for (int i = 0; i < SeamUtil.POSSIBLE_ALIGNS.length; i++) {
+ if (SeamUtil.POSSIBLE_ALIGNS[i].equalsIgnoreCase(align)) {
+ if (SeamUtil.POSSIBLE_ALIGNS[i]
+ .equalsIgnoreCase("justifyall")) {
+ return HTML.VALUE_ALIGN_JUSTIFY;
+ }
+ return align;
+ }
+ }
+ }
+ return HTML.VALUE_ALIGN_CENTER;
+ }
+
+ private int getColspanValue(nsIDOMNode visualNode) {
+ int colspan = 1;
+ nsIDOMElement visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ String colspanString = visualElement.getAttribute(HTML.ATTR_COLSPAN);
+ if (colspanString != null) {
+ try {
+ colspan = Integer.parseInt(colspanString);
+ if (colspan < 1) {
+ colspan = 1;
+ }
+ } catch (NumberFormatException e) {
+ colspan = 1;
+ }
+ }
+ return colspan;
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTextTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTextTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTextTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.jsf.template.AbstractOutputJsfTemplate;
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfTextTemplate extends AbstractOutputJsfTemplate {
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element element = (Element) sourceNode;
+
+ // create container
+ final nsIDOMElement container;
+ container = VisualDomUtil.createBorderlessContainer(visualDocument);
+
+ VpeCreationData creationData = new VpeCreationData(container);
+
+ processOutputAttribute(pageContext, visualDocument, element, container,
+ creationData);
+
+ return creationData;
+ }
+
+ @Override
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMNode visualNode, Object data) {
+ Node[] footers = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:footer");
+ if (footers != null && footers.length != 0) {
+ Node parentPdfDocumentNode = SeamUtil.getParentByName(pageContext,
+ sourceNode, "p:document");
+ if (parentPdfDocumentNode != null) {
+ return parentPdfDocumentNode;
+ }
+ }
+ return super
+ .getNodeForUpdate(pageContext, sourceNode, visualNode, data);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTitleTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTitleTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTitleTemplate.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,19 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Node;
+
+public class SeamPdfTitleTemplate extends SeamPdfAbstractTemplate {
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMNode visualNode = VisualDomUtil.createBorderlessContainer(visualDocument);
+ return new VpeCreationData(visualNode);
+ }
+
+}
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java 2009-11-27 16:22:04 UTC (rev 18887)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.seam.template.util;
-
-/**
- * Class contains Seam tags and general attributes.
- *
- * @author dmaliarevich
- *
- */
-public class Seam {
-
- public static final String ATTR_TEMPLATE = "template"; //$NON-NLS-1$
- public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
- public static final String ATTR_URL = "url"; //$NON-NLS-1$
-
-}
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java (from rev 18775, trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,223 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template.util;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.jsf.vpe.seam.SeamTemplatesActivator;
+import org.jboss.tools.jst.web.tld.TaglibData;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.XmlUtil;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Class contains Seam tags, general attributes and static methods usually used
+ * in Seam template classes.
+ *
+ * @author dmaliarevich
+ *
+ */
+public class SeamUtil {
+
+ public static final String ATTR_TEMPLATE = "template"; //$NON-NLS-1$
+ public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
+ public static final String ATTR_URL = "url"; //$NON-NLS-1$
+ public final static String SEAM_ATTR_MARGINS = "margins";
+ public final static String[] POSSIBLE_ALIGNS = new String[] { "left",
+ "right", "center", "justify", "justifyall" };
+ public final static String SEAM_ATTR_ALIGNMENT = "alignment";
+ public final static String SEAM_DIV_BASIC_STYLE_VALUE = "line-height: 142.0pt; font-family: unknown;";
+ public final static String SEAM_SPAN_BASIC_STYLE_VALUE = "font-family: unknown;";
+ public final static String SEAM_ATTR_HORIZONAL_ALIGNMENT = "horizontalAlignment";
+ public final static String SEAM_ATTR_VERTICAL_ALIGNMENT = "verticalAlignment";
+ public final static String SEAM_ATTR_WIDTH_PERCENTAGE = "widthPercentage";
+
+ public static Node getParentByName(VpePageContext pageContext,
+ Node sourceNode, String parentName) {
+
+ Node parentNode = sourceNode.getParentNode();
+
+ while (parentNode != null) {
+ String parentSourcePrefix = parentNode.getPrefix();
+ List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(parentNode,
+ pageContext);
+ TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(
+ parentSourcePrefix, taglibs);
+
+ String parentNodeName = parentNode.getNodeName();
+ if (sourceNodeTaglib != null) {
+ String sourceNodeUri = sourceNodeTaglib.getUri();
+ String templateTaglibPrefix = VpeTemplateManager.getInstance()
+ .getTemplateTaglibPrefix(sourceNodeUri);
+
+ if (templateTaglibPrefix != null) {
+ parentNodeName = templateTaglibPrefix
+ + ":" + parentNode.getLocalName(); //$NON-NLS-1$
+ }
+ }
+ if (parentNodeName.equals(parentName)) {
+ return parentNode;
+ }
+ parentNode = parentNode.getParentNode();
+ }
+ return null;
+ }
+
+ public static void setAlignment(Element sourceElement,
+ nsIDOMElement visualElement) {
+ String align = sourceElement.getAttribute(SeamUtil.SEAM_ATTR_ALIGNMENT);
+ if (align != null) {
+ visualElement.setAttribute(HTML.ATTR_ALIGN, HTML.VALUE_ALIGN_LEFT);
+ for (int i = 0; i < SeamUtil.POSSIBLE_ALIGNS.length; i++) {
+ if (SeamUtil.POSSIBLE_ALIGNS[i].equalsIgnoreCase(align)) {
+ if (SeamUtil.POSSIBLE_ALIGNS[i]
+ .equalsIgnoreCase("justifyall")) {
+ visualElement.setAttribute(HTML.ATTR_ALIGN,
+ HTML.VALUE_ALIGN_JUSTIFY);
+ return;
+ }
+ visualElement.setAttribute(HTML.ATTR_ALIGN,
+ SeamUtil.POSSIBLE_ALIGNS[i]);
+ return;
+ }
+ }
+ }
+ }
+
+ public static void getChildsByName(VpePageContext pageContext,
+ Node sourceNode, String childName, List<Node> childNodes) {
+ NodeList children = sourceNode.getChildNodes();
+ if (children != null) {
+ for (int i = 0; i < children.getLength(); i++) {
+ Node childNode = children.item(i);
+ String childSourcePrefix = childNode.getPrefix();
+ List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(childNode,
+ pageContext);
+
+ TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(
+ childSourcePrefix, taglibs);
+
+ String childNodeName = childNode.getNodeName();
+ if (sourceNodeTaglib != null) {
+ String sourceNodeUri = sourceNodeTaglib.getUri();
+ String templateTaglibPrefix = VpeTemplateManager
+ .getInstance().getTemplateTaglibPrefix(
+ sourceNodeUri);
+
+ if (templateTaglibPrefix != null) {
+ childNodeName = templateTaglibPrefix
+ + ":" + childNode.getLocalName(); //$NON-NLS-1$
+ }
+ }
+ if (childNodeName.equals(childName)) {
+ childNodes.add(childNode);
+ }
+ getChildsByName(pageContext, childNode, childName, childNodes);
+ }
+ }
+ }
+
+ public static Node[] getChildsByName(VpePageContext pageContext,
+ Node sourceNode, String childName) {
+ List<Node> footerNodes = new ArrayList<Node>(0);
+ getChildsByName(pageContext, sourceNode, childName, footerNodes);
+ return footerNodes.toArray(new Node[0]);
+ }
+
+ public static String getStyleAttr(Node sourceFontNode) {
+ if (sourceFontNode == null
+ || !sourceFontNode.getNodeName().endsWith(":font")) {
+ return null;
+ }
+ String styleAttrValue = getFontFamily(sourceFontNode)
+ + getSize(sourceFontNode) + parseFontStyleValue(sourceFontNode);
+ return styleAttrValue;
+ }
+
+ private static String parseFontStyleValue(Node sourceFontNode) {
+ StringBuffer styleAttrValue = new StringBuffer("");
+ String stringValueToParse = ((Element) sourceFontNode)
+ .getAttribute(HTML.ATTR_STYLE);
+ if (stringValueToParse != null) {
+ int boldPos = stringValueToParse.indexOf("bold");
+ if (boldPos != -1) {
+ styleAttrValue.append(" font-weight : bold;");
+ }
+ int italicPos = stringValueToParse.indexOf("italic");
+ if (italicPos != -1) {
+ styleAttrValue.append(" font-style : italic;");
+ }
+ int underLinePos = stringValueToParse.indexOf("underline");
+ if (underLinePos != -1) {
+ styleAttrValue.append(" text-decoration : underline;");
+ }
+ int lineThroughPos = stringValueToParse.indexOf("line-through");
+ if (lineThroughPos != -1) {
+ styleAttrValue.append(" text-decoration : line-through;");
+ }
+ }
+ return styleAttrValue.toString();
+ }
+
+ private static String getFontFamily(Node sourceFontNode) {
+ String fontFamily = "unknown";
+ String stringName = ((Element) sourceFontNode)
+ .getAttribute(HTML.ATTR_NAME);
+ if (stringName != null) {
+ fontFamily = stringName;
+ }
+ return " font-family : " + fontFamily + ";";
+ }
+
+ private static String getSize(Node sourceFontNode) {
+ String stringSizeAttr = ((Element) sourceFontNode)
+ .getAttribute(HTML.ATTR_SIZE);
+ if (stringSizeAttr != null) {
+ try {
+ int intSize = Integer.parseInt(stringSizeAttr);
+ if (intSize < 0) {
+ return "";
+ }
+ } catch (NumberFormatException e) {
+ return "";
+ }
+ } else {
+ return "";
+ }
+ return " font-size : " + stringSizeAttr + "pt;";
+ }
+
+ public static String getAbsoluteResourcePath(String resourcePathInPlugin) {
+ String pluginPath = SeamTemplatesActivator.getPluginResourcePath();
+ IPath pluginFile = new Path(pluginPath);
+ File file = pluginFile.append(resourcePathInPlugin).toFile();
+ if (file.exists()) {
+ return file.getAbsolutePath();
+ } else {
+ throw new IllegalArgumentException("Can't get path for " //$NON-NLS-1$
+ + resourcePathInPlugin);
+ }
+ }
+
+ public static void setImg(nsIDOMElement img, String fileImageName) {
+ img.setAttribute(HTML.ATTR_SRC, "file://" //$NON-NLS-1$
+ + getAbsoluteResourcePath(fileImageName).replace('\\', '/'));
+ }
+
+}
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 2009-11-27 16:22:04 UTC (rev 18887)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -5,6 +5,8 @@
prefix="s" />
<vpe:template-taglib uri="http://jboss.com/products/seam/mail"
prefix="m" />
+ <vpe:template-taglib uri="http://jboss.com/products/seam/pdf"
+ prefix="p" />
<vpe:tag name="s:button" case-sensitive="yes">
<!--
@@ -360,12 +362,13 @@
<vpe:tag name="m:message" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
- <div/>
+ <div />
</vpe:template>
</vpe:tag>
<vpe:tag name="m:body" case-sensitive="yes">
- <vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.seam.template.SeamMailBodyTemplate"/>
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamMailBodyTemplate" />
</vpe:tag>
<vpe:tag name="m:from" case-sensitive="yes">
@@ -400,4 +403,214 @@
<vpe:template children="no" modify="no" />
</vpe:tag>
+ <vpe:tag name="p:document" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfDocumentTemplate" />
+ </vpe:tag>
+
+ <vpe:tag name="p:paragraph" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:title')">
+ <vpe:template children="yes" modify="yes">
+ <span class="vpe-text" />
+ </vpe:template>
+ </vpe:if>
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfParagraphTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:text" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="no"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfTextTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes">
+ <vpe:container-child tag-name="converter" />
+ <vpe:container-child tag-name="convertNumber" />
+ <vpe:container-child tag-name="convertDateTime" />
+ <vpe:container-child tag-name="validator" />
+ <vpe:container-child tag-name="validateDoubleRange" />
+ <vpe:container-child tag-name="validateLongRange" />
+ <vpe:container-child tag-name="validateLength" />
+ </vpe:drop>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:newPage" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="no" modify="no">
+ <div style="page-break-before: always;" />
+ <vpe:drop container="no" />
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:image" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:anchor" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfAnchorTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:footer" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfFooterTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:header" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:pageNumber" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:header')|hasinparents('p:footer')">
+ <vpe:template children="no" modify="no">
+ <span class="vpe-text">1</span>
+ </vpe:template>
+ <vpe:drop container="no" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:chapter" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfChapterTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:title" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:chapter')|hasinparents('p:section')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfTitleTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:section" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:chapter')|hasinparents('p:section')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfSectionTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:table" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfTableTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:cell" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:table')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfCellTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:list" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfListTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:listItem" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:list')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfListItemTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:font" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfFontTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:barchart" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="no" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfBarChartTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="width" />
+ <vpe:height height-attr="height" />
+ </vpe:resize>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:linechart" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="no" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfLineChartTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="width" />
+ <vpe:height height-attr="height" />
+ </vpe:resize>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:piechart" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="no" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfPieChartTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="width" />
+ <vpe:height height-attr="height" />
+ </vpe:resize>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:series" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:data" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:barcode" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:color" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:stroke" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
</vpe:templates>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,7 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:anchor id="referenceAnchor" reference="#reason1">Reason 1</p:anchor>
+ <p:anchor id="unreferenceAnchor" name="reason1">It's the quickest way to get "rich"</p:anchor>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<tests>
+ <test id="referenceAnchor">
+ <A HREF="#reason1">
+ <SPAN CLASS="vpe-text">Reason 1</SPAN>
+ </A>
+ </test>
+ <test id="unreferenceAnchor">
+ <A NAME="reason1" STYLE="color: black; text-decoration: none;">
+ <SPAN CLASS="vpe-text">It's the quickest way to get "rich"</SPAN>
+ </A>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<p:document subject="subject" title="title" author="author" type="html"
+ creator="creator" pageSize="LETTER" orientation="portrait"
+ xmlns:p="http://jboss.com/products/seam/pdf"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:barchart id="barchartID1" width="508" height="615"></p:barchart>
+ <p:barchart id="barchartID2">
+ <p:series></p:series>
+ </p:barchart>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<tests>
+ <test id="barchartID1">
+ <IMG SRC="/.*resources/barChart/barChart.png/" STYLE="width: 508px; height: 615px;" />
+ </test>
+ <test id="barchartID2">
+ <IMG SRC="/.*resources/barChart/barChartSeriesNested.png/" />
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:barcode id="id1">Not rendered</p:barcode>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,7 @@
+<p:document subject="subject" title="title" author="author" type="html"
+ creator="creator" pageSize="LETTER" orientation="portrait"
+ margins="50 60 70 80" xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:table headerRows="1" id="tableID">
+ <p:cell horizontalAlignment="center" id="cellID">1</p:cell>
+ </p:table>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,9 @@
+<tests>
+ <test id="cellID">
+ <TD ALIGN="center" STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 1
+</SPAN>
+ </TD>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,17 @@
+<p:document id="footerID" subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:chapter id="chapterID1">
+ <p:title>
+ Chapter title
+ </p:title>
+ </p:chapter>
+ <p:chapter number="3" alignment="center" id="chapterID2">
+ <p:section>
+ <p:title>
+ <p:paragraph>Section Title</p:paragraph>
+ </p:title>
+ </p:section>
+ </p:chapter>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,33 @@
+<tests>
+ <test id="chapterID1">
+ <SPAN CLASS="vpe-text">
+ <H1>
+ 1.
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ Chapter title
+</SPAN>
+ </SPAN>
+ </H1>
+ </SPAN>
+ </test>
+ <test id="chapterID2">
+ <SPAN CLASS="vpe-text">
+ <H1>
+ 3.
+</H1>
+ <SPAN CLASS="vpe-text">
+ <H2>
+ 3.1.
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ Section Title
+</SPAN>
+ </SPAN>
+ </SPAN>
+ </H2>
+ </SPAN>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/color.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/color.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/color.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:color id="id1">Not rendered</p:color>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/data.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/data.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/data.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:data id="id1">Not rendered</p:data>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,11 @@
+<p:document id="documentID1" subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ Document 1 goes here
+</p:document>
+<p:document id="documentID2" subject="subject" title="title"
+ author="author" type="pdf" creator="creator" pageSize="LETTER"
+ orientation="portrait" xmlns:p="http://jboss.com/products/seam/pdf">
+ Document 2 goes here
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<tests>
+ <test id="documentID1">
+ <DIV STYLE="margin: 70px 60px 80px 50px;">
+ <SPAN CLASS="vpe-text">
+ Document 1 goes here
+</SPAN>
+ </DIV>
+ </test>
+ <test id="documentID2">
+ <DIV STYLE="margin: 36px;">
+ <SPAN CLASS="vpe-text">
+ Document 2 goes here
+</SPAN>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,10 @@
+<p:document id="fontID" subject="subject" title="title" author="author"
+ type="html" creator="creator" pageSize="LETTER" orientation="portrait"
+ margins="50 60 70 80" xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:font size="34" style="italic" name="courier">
+ <p:paragraph>
+ <p:footer alignment="center">
+ <p:pageNumber></p:pageNumber>
+ </p:footer>Paragraph Text</p:paragraph>
+ </p:font>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,19 @@
+<tests>
+ <test id="fontID">
+ <DIV STYLE="margin: 70px 60px 80px 50px;">
+ <SPAN STYLE="font-family: courier; font-size: 34pt; font-style: italic;">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ Paragraph Text
+</SPAN>
+ </DIV>
+ </SPAN>
+ <DIV ALIGN="center"
+ STYLE="font-family: courier; font-size: 34pt; font-style: italic;">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+ 1
+</SPAN>
+ </DIV>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<p:document id="footerID" subject="subject" title="title" author="author" type="html"
+ creator="creator" pageSize="LETTER" orientation="portrait"
+ margins="50 60 70 80" xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:paragraph>
+ <p:footer alignment="center">
+ <p:pageNumber></p:pageNumber>
+ </p:footer>Paragraph Text</p:paragraph>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<tests>
+ <test id="footerID">
+ <DIV STYLE="margin: 70px 60px 80px 50px;">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ Paragraph Text
+</SPAN>
+ </DIV>
+ <DIV ALIGN="center">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+ 1
+</SPAN>
+ </DIV>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/header.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/header.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/header.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:header id="id1">Not rendered</p:header>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/image.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/image.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/image.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:image id="id1">Not rendered</p:image>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<p:document subject="subject" title="title" author="author" type="html"
+ creator="creator" pageSize="LETTER" orientation="portrait"
+ xmlns:p="http://jboss.com/products/seam/pdf"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:linechart id="linechartID1" width="508" height="615"></p:linechart>
+ <p:linechart id="linechartID2">
+ <p:series></p:series>
+ </p:linechart>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<tests>
+ <test id="linechartID1">
+ <IMG SRC="/.*resources/lineChart/lineChart.png/" STYLE="width: 508px; height: 615px;" />
+ </test>
+ <test id="linechartID2">
+ <IMG SRC="/.*resources/lineChart/lineChartSeriesNested.png/" />
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,20 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" xmlns:p="http://jboss.com/products/seam/pdf"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:list style="numbered" id="listID1">
+ <p:listItem>Item 1</p:listItem>
+ <p:listItem>Item 2</p:listItem>
+ <p:listItem>Item 3</p:listItem>
+ <p:listItem>Item 4</p:listItem>
+ </p:list>
+ <p:list id="listID2">
+ <p:listItem>Item 1</p:listItem>
+ <p:listItem>Item 2</p:listItem>
+ <p:listItem>Item 3</p:listItem>
+ <p:listItem>Item 4</p:listItem>
+ </p:list>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,50 @@
+<tests>
+ <test id="listID1">
+ <OL>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 1
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 2
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 3
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 4
+</SPAN>
+ </LI>
+ </OL>
+ </test>
+ <test id="listID2">
+ <UL>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 1
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 2
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 3
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 4
+</SPAN>
+ </LI>
+ </UL>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,11 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" xmlns:p="http://jboss.com/products/seam/pdf"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:list style="numbered">
+ <p:listItem id="listItemID1">Item 1</p:listItem>
+ </p:list>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,9 @@
+<tests>
+ <test id="listItemID1">
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 1
+</SPAN>
+ </LI>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,10 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" xmlns:p="http://jboss.com/products/seam/pdf"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:newPage id="newPageID">
+ </p:newPage>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<tests>
+ <test id="newPageID">
+ <DIV STYLE="page-break-before: always; -moz-user-modify: read-only;">
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<p:document id="footerID" subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:footer alignment="center">
+ <p:pageNumber id="pageNumberID"></p:pageNumber>
+ </p:footer>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,7 @@
+<tests>
+ <test id="pageNumberID">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+ 1
+</SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" xmlns:p="http://jboss.com/products/seam/pdf"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:paragraph id="paragraphID1">
+ <p:text value="Paragraph"></p:text>
+ </p:paragraph>
+ <p:chapter>
+ <p:title>
+ <p:paragraph id="paragraphID2">Paragraph inside title</p:paragraph>
+ </p:title>
+ </p:chapter>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<tests>
+ <test id="paragraphID1">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ Paragraph
+</SPAN>
+ </DIV>
+ </test>
+ <test id="paragraphID2">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ Paragraph inside title
+</SPAN>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<p:document subject="subject" title="title" author="author" type="html"
+ creator="creator" pageSize="LETTER" orientation="portrait"
+ xmlns:p="http://jboss.com/products/seam/pdf"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:piechart id="piechartID1" width="508" height="615"></p:piechart>
+ <p:piechart id="piechartID2">
+ <p:series></p:series>
+ </p:piechart>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<tests>
+ <test id="piechartID1">
+ <IMG SRC="/.*resources/pieChart/pieChart.png/" STYLE="width: 508px; height: 615px;" />
+ </test>
+ <test id="piechartID1">
+ <IMG SRC="/.*resources/pieChart/pieChartSeriesNested.png/" />
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<p:document id="footerID" subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:chapter number="3" alignment="center">
+ <p:section id="sectionID">
+ <p:title>
+ <p:paragraph>Section Title</p:paragraph>
+ </p:title>
+ </p:section>
+ </p:chapter>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<tests>
+ <test id="sectionID">
+ <SPAN CLASS="vpe-text">
+ <H2>
+ 3.1.
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ Section Title
+</SPAN>
+ </SPAN>
+ </SPAN>
+ </H2>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/series.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/series.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/series.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:series id="id1">Not rendered</p:series>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/stroke.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/stroke.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/stroke.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:stroke id="id1">Not rendered</p:stroke>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,15 @@
+<p:document subject="subject" title="title" author="author" type="html"
+ creator="creator" pageSize="LETTER" orientation="portrait"
+ margins="50 60 70 80" xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:table columns="3" headerRows="1" id="tableID">
+ <p:cell>1</p:cell>
+ <p:cell>2</p:cell>
+ <p:cell>3</p:cell>
+ <p:cell>4</p:cell>
+ <p:cell colspan="2">5</p:cell>
+ <p:cell>6</p:cell>
+ <p:cell colspan="2">7</p:cell>
+ <p:cell>8</p:cell>
+ <p:cell>9</p:cell>
+ </p:table>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,49 @@
+<tests>
+ <test id="tableID">
+ <DIV>
+ <TABLE WIDTH="100%" CELLSPACING="0px" ALIGN="center">
+ <TR>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 1
+</SPAN>
+ </TD>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 2
+</SPAN>
+ </TD>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 3
+</SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 4
+</SPAN>
+ </TD>
+ <TD COLSPAN="2" STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 5
+</SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 6
+</SPAN>
+ </TD>
+ <TD COLSPAN="2" STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 7
+</SPAN>
+ </TD>
+ </TR>
+ </TABLE>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,11 @@
+<p:document subject="subject" title="title" author="author" type="html"
+ creator="creator" pageSize="LETTER" orientation="portrait"
+ xmlns:p="http://jboss.com/products/seam/pdf"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:paragraph>
+ <p:text value="Text value" id="textID"></p:text>
+ </p:paragraph>
+</p:document>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,7 @@
+<tests>
+ <test id="textID">
+ <SPAN CLASS="vpe-text">
+ Text value
+</SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,17 @@
+<p:document id="footerID" subject="subject" title="title"
+ author="author" type="html" creator="creator" pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+ xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:chapter>
+ <p:title id="titleID1">
+ Chapter title
+ </p:title>
+ </p:chapter>
+ <p:chapter number="3" alignment="center" id="chapterID2">
+ <p:section>
+ <p:title id="titleID2">
+ <p:paragraph>Section Title</p:paragraph>
+ </p:title>
+ </p:section>
+ </p:chapter>
+</p:document>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml.xml 2009-11-27 16:29:12 UTC (rev 18888)
@@ -0,0 +1,18 @@
+<tests>
+ <test id="titleID1">
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ Chapter title
+</SPAN>
+ </SPAN>
+ </test>
+ <test id="titleID2">
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-write;">
+ <SPAN CLASS="vpe-text">
+ Section Title
+</SPAN>
+ </SPAN>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java 2009-11-27 16:22:04 UTC (rev 18887)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -125,47 +125,145 @@
public void testTaskId() throws Throwable {
performInvisibleTagTest("components/taskId.xhtml", "id1"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
- //mail components
-
- public void testMailMessage() throws Throwable{
+
+ // mail components
+
+ public void testMailMessage() throws Throwable {
performContentTest("components/mail/message.xhtml");
}
-
- public void testMailBody() throws Throwable{
+
+ public void testMailBody() throws Throwable {
performContentTest("components/mail/body.xhtml");
}
-
- public void testMailFrom() throws Throwable{
+
+ public void testMailFrom() throws Throwable {
performInvisibleTagTest("components/mail/from.xhtml", "id1");
}
-
- public void testMailTo() throws Throwable{
+
+ public void testMailTo() throws Throwable {
performInvisibleTagTest("components/mail/to.xhtml", "id1");
}
-
- public void testMailSubject() throws Throwable{
+
+ public void testMailSubject() throws Throwable {
performInvisibleTagTest("components/mail/subject.xhtml", "id1");
}
-
- public void testMailAttachment() throws Throwable{
+
+ public void testMailAttachment() throws Throwable {
performInvisibleTagTest("components/mail/attachment.xhtml", "id1");
}
-
- public void testMailBcc() throws Throwable{
+
+ public void testMailBcc() throws Throwable {
performInvisibleTagTest("components/mail/bcc.xhtml", "id1");
}
-
- public void testMailCc() throws Throwable{
+
+ public void testMailCc() throws Throwable {
performInvisibleTagTest("components/mail/cc.xhtml", "id1");
}
-
- public void testMailHeader() throws Throwable{
+
+ public void testMailHeader() throws Throwable {
performInvisibleTagTest("components/mail/header.xhtml", "id1");
}
-
- public void testMailReplyTo() throws Throwable{
+
+ public void testMailReplyTo() throws Throwable {
performInvisibleTagTest("components/mail/replyTo.xhtml", "id1");
}
-
+
+ // pdf components
+
+ public void testPdfDocument() throws Throwable {
+ performContentTest("components/pdf/document.xhtml");
+ }
+
+ public void testPdfParagraph() throws Throwable {
+ performContentTest("components/pdf/paragraph.xhtml");
+ }
+
+ public void testPdfText() throws Throwable {
+ performContentTest("components/pdf/text.xhtml");
+ }
+
+ public void testPdfFont() throws Throwable {
+ performContentTest("components/pdf/font.xhtml");
+ }
+
+ public void testPdfNewPage() throws Throwable {
+ performContentTest("components/pdf/newPage.xhtml");
+ }
+
+ public void testPdfImage() throws Throwable {
+ performInvisibleTagTest("components/pdf/image.xhtml", "id1");
+ }
+
+ public void testPdfAnchor() throws Throwable {
+ performContentTest("components/pdf/anchor.xhtml");
+ }
+
+ public void testPdfHeader() throws Throwable {
+ performInvisibleTagTest("components/pdf/header.xhtml", "id1");
+ }
+
+ public void testPdfFooter() throws Throwable {
+ performContentTest("components/pdf/footer.xhtml");
+ }
+
+ public void testPdfPageNumber() throws Throwable {
+ performContentTest("components/pdf/pageNumber.xhtml");
+ }
+
+ public void testPdfChapter() throws Throwable {
+ performContentTest("components/pdf/chapter.xhtml");
+ }
+
+ public void testPdfSection() throws Throwable {
+ performContentTest("components/pdf/section.xhtml");
+ }
+
+ public void testPdfList() throws Throwable {
+ performContentTest("components/pdf/list.xhtml");
+ }
+
+ public void testPdfListItem() throws Throwable {
+ performContentTest("components/pdf/listItem.xhtml");
+ }
+
+ public void testPdfTable() throws Throwable {
+ performContentTest("components/pdf/table.xhtml");
+ }
+
+ public void testPdfCell() throws Throwable {
+ performContentTest("components/pdf/cell.xhtml");
+ }
+
+ public void testPdfBarChart() throws Throwable {
+ performContentTest("components/pdf/barChart.xhtml");
+ }
+
+ public void testPdfLineChart() throws Throwable {
+ performContentTest("components/pdf/lineChart.xhtml");
+ }
+
+ public void testPdfPieChart() throws Throwable {
+ performContentTest("components/pdf/pieChart.xhtml");
+ }
+
+ public void testPdfSeries() throws Throwable {
+ performInvisibleTagTest("components/pdf/series.xhtml", "id1");
+ }
+
+ public void testPdfData() throws Throwable {
+ performInvisibleTagTest("components/pdf/data.xhtml", "id1");
+ }
+
+ public void testPdfColor() throws Throwable {
+ performInvisibleTagTest("components/pdf/color.xhtml", "id1");
+ }
+
+ public void testPdfStroke() throws Throwable {
+ performInvisibleTagTest("components/pdf/stroke.xhtml", "id1");
+ }
+
+ public void testPdfBarCode() throws Throwable {
+ performInvisibleTagTest("components/pdf/barCode.xhtml", "id1");
+ }
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2009-11-27 16:22:04 UTC (rev 18887)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2009-11-27 16:29:12 UTC (rev 18888)
@@ -60,6 +60,11 @@
public static final String TAG_LABEL = "label"; //$NON-NLS-1$
public static final String TAG_A = "a"; //$NON-NLS-1$
public static final String TAG_H1 = "h1"; //$NON-NLS-1$
+ public static final String TAG_H2 = "h2"; //$NON-NLS-1$
+ public static final String TAG_H3 = "h3"; //$NON-NLS-1$
+ public static final String TAG_H4 = "h4"; //$NON-NLS-1$
+ public static final String TAG_H5 = "h5"; //$NON-NLS-1$
+ public static final String TAG_H6 = "h6"; //$NON-NLS-1$
public static final String TAG_FORM = "form"; //$NON-NLS-1$
/**Use this class if you want to wrap a text node in a span that
@@ -118,6 +123,7 @@
public static final String VALUE_ALIGN_BOTTOM = "bottom"; //$NON-NLS-1$
public static final String VALUE_ALIGN_MIDDLE = "middle"; //$NON-NLS-1$
public static final String VALUE_ALIGN_CENTER = "center"; //$NON-NLS-1$
+ public static final String VALUE_ALIGN_JUSTIFY = "justify"; //$NON-NLS-1$
public static final String VALUE_CLASS_DELIMITER = " "; //$NON-NLS-1$
public static final String VALUE_STYLE_DELIMITER = ";"; //$NON-NLS-1$
public static final String VALUE_TYPE_TEXT = "text"; //$NON-NLS-1$
15 years, 1 month
JBoss Tools SVN: r18887 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2009-11-27 11:22:04 -0500 (Fri, 27 Nov 2009)
New Revision: 18887
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5271
Apply Template bindings not saved in Smooks Config XML
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-11-27 16:21:19 UTC (rev 18886)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-11-27 16:22:04 UTC (rev 18887)
@@ -377,14 +377,13 @@
char quote = SmooksModelUtils.getFreemarkerCSVQuote(freemarker);
String[] fields = SmooksModelUtils.getFreemarkerCSVFileds(freemarker);
try {
- if (SmooksConstants.VERSION_1_2.equals(smooksModelProvider.getPlatformVersion())) {
- contents = SmooksModelUtils.getAnyTypeComment(template);
+ if(contents != null) {
+ CSVModelBuilder modelBuilder = new CSVModelBuilder(fields);
+ Document model = modelBuilder.buildModel();
+ TemplateBuilder builder = new CSVFreeMarkerTemplateBuilder(model, seprator, quote, contents);
+ List<Mapping> mappings = builder.getMappings();
+ mappingList.addAll(mappings);
}
- CSVModelBuilder modelBuilder = new CSVModelBuilder(fields);
- Document model = modelBuilder.buildModel();
- TemplateBuilder builder = new CSVFreeMarkerTemplateBuilder(model, seprator, quote, contents);
- List<Mapping> mappings = builder.getMappings();
- mappingList.addAll(mappings);
} catch (Exception e) {
e.printStackTrace();
}
15 years, 1 month
JBoss Tools SVN: r18886 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-11-27 11:21:19 -0500 (Fri, 27 Nov 2009)
New Revision: 18886
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5283
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java 2009-11-27 16:10:53 UTC (rev 18885)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/markers/XMarkerManager.java 2009-11-27 16:21:19 UTC (rev 18886)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.model.markers;
import java.util.*;
+
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
@@ -32,8 +33,8 @@
return instance;
}
- private Set<XModelObject> errorObjects = new HashSet<XModelObject>();
- private Set<XModelObject> warningObjects = new HashSet<XModelObject>();
+ private Map<IProject, Set<XModelObject>> errorObjects = new HashMap<IProject, Set<XModelObject>>();
+ private Map<IProject, Set<XModelObject>> warningObjects = new HashMap<IProject, Set<XModelObject>>();
private XMarkerManager() {
reload(null);
@@ -43,6 +44,11 @@
public void resourceChanged(IResourceChangeEvent event) {
IProject project = null;
Object o = event.getSource();
+ if(event.getType() == IResourceChangeEvent.PRE_DELETE && event.getResource() instanceof IProject) {
+ errorObjects.remove((IProject)event.getResource());
+ warningObjects.remove((IProject)event.getResource());
+ return;
+ }
if(o instanceof IWorkspace) {
IResourceDelta d = event.getDelta();
IResourceDelta[] cs = d.getAffectedChildren();
@@ -74,8 +80,18 @@
} catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
}
- reload(ms, errorObjects, IMarker.SEVERITY_ERROR);
- reload(ms, warningObjects, IMarker.SEVERITY_WARNING);
+ Set<XModelObject> os = errorObjects.get(project);
+ if(os == null) {
+ os = new HashSet<XModelObject>();
+ errorObjects.put(project, os);
+ }
+ reload(ms, os, IMarker.SEVERITY_ERROR);
+ os = warningObjects.get(project);
+ if(os == null) {
+ os = new HashSet<XModelObject>();
+ warningObjects.put(project, os);
+ }
+ reload(ms, os, IMarker.SEVERITY_WARNING);
}
void reload(IMarker[] ms, Set<XModelObject> objects, int severity) {
15 years, 1 month
JBoss Tools SVN: r18885 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb: src/org/jboss/tools/jst/web/kb and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-11-27 11:10:53 -0500 (Fri, 27 Nov 2009)
New Revision: 18885
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.properties
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
JBIDE-5273: NPE in junit tests for jsp components
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2009-11-27 15:59:05 UTC (rev 18884)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2009-11-27 16:10:53 UTC (rev 18885)
@@ -83,6 +83,8 @@
<contexttype id="JSP_PAGE_CONTEXT_TYPE">
<contenttype id="org.eclipse.jst.jsp.core.jspsource" />
+ <contenttype id="org.eclipse.jst.jsp.core.jspfragmentsource"/>
+ <contenttype id="org.eclipse.jst.jsp.core.tagsource"/>
</contexttype>
<contexttype id="FACELETS_PAGE_CONTEXT_TYPE">
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java 2009-11-27 15:59:05 UTC (rev 18884)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.java 2009-11-27 16:10:53 UTC (rev 18885)
@@ -28,4 +28,5 @@
public static String KBBUILDER_NOT_FOUND;
public static String KBPROBLEM;
public static String ENABLE_KB;
+ public static String ILLEGAL_CONTENTTYPE;
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.properties 2009-11-27 15:59:05 UTC (rev 18884)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbMessages.properties 2009-11-27 16:10:53 UTC (rev 18885)
@@ -4,4 +4,6 @@
KBNATURE_NOT_FOUND=KB Nature is not installed.
KBBUILDER_NOT_FOUND=KB Builder is not installed.
KBPROBLEM=KB Problem: {0} {1} Use Quick Fix to allow JSF Content Assistant and Validation.
-ENABLE_KB=Enable JSF CA and validation on this project
\ No newline at end of file
+ENABLE_KB=Enable JSF CA and validation on this project
+
+ILLEGAL_CONTENTTYPE=Unknown contentType argument value: {0}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-27 15:59:05 UTC (rev 18884)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-11-27 16:10:53 UTC (rev 18885)
@@ -36,6 +36,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.internal.corext.util.Messages;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
@@ -67,6 +68,7 @@
import org.jboss.tools.common.el.core.resolver.ELContextImpl;
import org.jboss.tools.common.el.core.resolver.ELResolverFactoryManager;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.common.text.ext.util.Utils;
@@ -308,8 +310,10 @@
return new JspContextImpl();
} else if (FACELETS_PAGE_CONTEXT_TYPE.equals(contextType)) {
return new FaceletPageContextImpl();
+ } else {
+ WebKbPlugin.getDefault().logError(Messages.format(KbMessages.ILLEGAL_CONTENTTYPE, contentType));
}
- return null;
+ return new SimpleELContext();
}
/**
15 years, 1 month
JBoss Tools SVN: r18884 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-11-27 10:59:05 -0500 (Fri, 27 Nov 2009)
New Revision: 18884
Modified:
trunk/seam/docs/reference/en/modules/seam_refactoring.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-957 - updating the 'Seam Refactoring Tools' chapter;
Modified: trunk/seam/docs/reference/en/modules/seam_refactoring.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/seam_refactoring.xml 2009-11-27 15:10:44 UTC (rev 18883)
+++ trunk/seam/docs/reference/en/modules/seam_refactoring.xml 2009-11-27 15:59:05 UTC (rev 18884)
@@ -11,43 +11,35 @@
</chapterinfo>
<title>Seam Refactoring Tools</title>
<para>The goal of Seam components refactoring is to make system-wide code changes without affecting the behavior of the program.
- The Seam module of JBoss Tools provides assistance in easily code refactoring. Starting from Jboss Tools M4 refactoring functionality became also available for managed beans, method and properties used in ELs
- When performing a refactoring operation, you can preview all of the changes resulting from a refactoring action before you choose to carry them out.
- Refactoring commands are available from the context menus of several views and editors.
- Now Seam refactoring tools include only one refactoring command:<emphasis><property>Rename Seam Component</property></emphasis>.
- </para>
- <para>The command is available from the next views:</para>
- <itemizedlist>
- <listitem>
- <para> <link linkend="JavaEditor">Java Editor</link>
- </para>
- </listitem>
- <listitem>
- <para>
- <link linkend="SeamComponents">Seam Components</link>
- </para>
- </listitem>
- <listitem>
- <para><link linkend="xml_html">JBossTools XML Editor, other xml/html editors
-
- </link>
- </para>
- </listitem>
- <listitem>
- <para><link linkend="properties">JBossTools Properties Editor
-
- </link>
- </para>
- </listitem>
- </itemizedlist>
- <para>Renaming the selected seam component also (if enabled) corrects all references to the
- component(also in other files in the project).Renaming a type doesn't allow to rename
- similarly named variables and methods.
- </para>
+ The Seam module of <property>JBoss Tools</property> provides assistance in easily code refactoring.</para>
+
+ <para>Starting from Jboss Tools M4 refactoring functionality became also available for managed beans, method and properties used in ELs.
+ Thus now Seam refactoring tools include the next refactoring operations:</para>
+
+ <itemizedlist>
+ <listitem><para><link linkend="renaming_seam_components">Renaming Seam components</link></para></listitem>
+ <listitem><para><link linkend="renaming_seam_context_vars">Renaming Seam context variables in EL</link></para></listitem>
+ </itemizedlist>
+
+ <para>Refactoring commands are available from the context menus of several views and editors and use a standard Eclipse refactoring wizard.
+ For details, see <link linkend="RefactornigWizard">"Using the Refactoring Wizard"</link> later in this chapter.</para>
+
+ <note>
+ <title>Note:</title>
+ <para>Seam refactoring could be only performed in the file that is not marked as <emphasis><property>Read only</property></emphasis> in its properties.</para>
+ </note>
+
+ <figure>
+ <title>Properties View for Java File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_refactoring/seam_refactor10.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
<section id="RefactornigWizard">
- <?dbhtml filename="RefactornigWizard.html"?>
- <title>Refactorinig wizard
- </title>
+ <title>Using the Refactorinig Wizard</title>
<para>This wizard is opened always when the user clicks <property>Rename Seam Component</property>/<property>Rename Seam Context Variable</property>/<property>Rename</property> command in any
of the mentioned views.
</para>
@@ -60,9 +52,11 @@
</imageobject>
</mediaobject>
</figure>
- <para>In the <property>Seam Components Field</property> you should write a new name of the component,
- click <property>Next</property> and follow the next wizard steps:
+
+ <para>In the <property>Seam Components name</property> field you should enter a new name of the component,
+ then click <property>Next</property> and follow the next wizard steps:
</para>
+
<figure>
<title>Navigating between the differences</title>
<mediaobject>
@@ -71,7 +65,13 @@
</imageobject>
</mediaobject>
</figure>
- <para>The view represents two windows: one with the source code and the second with refactored one. With the help of
+
+ <para>As you see, when performing a refactoring operation, you can preview all of the changes resulting from a refactoring
+ action before you choose to carry them out.</para>
+
+ <para>The view represents two windows: one with the original source code and the other with refactored one.</para>
+
+ <para>With the help of
<inlinemediaobject> <imageobject>
<imagedata fileref="images/seam_refactoring/butt1.png"/>
</imageobject></inlinemediaobject>,
@@ -84,8 +84,9 @@
<inlinemediaobject> <imageobject>
<imagedata fileref="images/seam_refactoring/butt4.png"/>
</imageobject></inlinemediaobject> buttons you can quickly navigate between the differences in the code.
- If you don't agree with some changes you can't undo them but you can remove the class from the list of classes that need refactoring.
- </para>
+ If you don't agree with some changes you can't undo them but you can remove the class from the list of classes that need refactoring.
+ </para>
+
<figure>
<title>List of classes that need refactoring
</title>
@@ -95,109 +96,112 @@
</imageobject>
</mediaobject>
</figure>
- <para>To apply the changes click <emphasis><property>Finish</property></emphasis>.
- </para>
+
+ <para>To apply the changes click <emphasis><property>Finish</property>.</emphasis></para>
+
+ <para>Renaming the selected seam component also corrects all references to the
+ component (also in other files in the project). Renaming a type doesn't allow to rename
+ similarly named variables and methods.
+ </para>
</section>
-
- <section>
- <title>Opening Refactoring wizard in different views</title>
- <para>Seam component can be renamed only if it's not marked as <emphasis><property>Read only</property></emphasis> in properties for the java file where it's declared.
- </para>
- <figure>
- <title>Properties view for java file
- </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/seam_refactoring/seam_refactor10.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <section id="JavaEditor">
- <?dbhtml filename="JavaEditor.html"?>
- <title>Opening Refactoring wizard in Java Editor</title>
- <para>If you want to rename certain seam component using Java Editor,first of all it's necessary to open it.
- If you don't know ,where the seam component is declared,use <link linkend="open_seam_component">Open Seam Components icon</link>.
-
- </para>
- <para>To open the rename Seam Component command in Java Editor it's necessary to left click the file <emphasis><property>>Seam Refactor>Rename Seam Component</property></emphasis>.
- </para>
- <figure>
- <title>Opening Refactoring wizard in Java Editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/seam_refactoring/seam_refactor1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="SeamComponents">
- <title>Opening Refactoring wizard in Seam Components view</title>
- <para>To open <property>Refactoring wizard</property> in <property>Seam Components</property> view the user should left click the component he wants to open and choose <property>Rename Seam Component</property> option.</para>
- <figure>
- <title>Opening Refactoring wizard in Seam Components view</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/seam_refactoring/seam_refactor5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="xml_html">
- <title>Opening Refactoring wizard in JBossTools XML Editor, other xml/html editors
- </title>
- <para>When you open <property>components.xml</property> file using JBossTools XML Editor,it's possible to open the <property>Refactoring dialog</property> in two ways:</para>
- <itemizedlist>
- <listitem>
- <para>in the Tree tab.You should left click the component in <property>components</property> section and choose <property>Rename</property> option.
- </para>
- <figure>
- <title>Opening Refactoring wizard in <emphasis><property>components.xml</property></emphasis> file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/seam_refactoring/seam_refactor6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>
- in the Source tab.To do this, select the component name in the file,open context menu by left click and choose <property>Seam Refactor> Rename Seam Context Variable</property>
- .</para>
- <figure>
- <title>Opening Refactoring wizard in components.xml file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/seam_refactoring/seam_refactor7.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>This method of <property>Refactoring wizard</property> opening is also available in other xml/html editors.</para>
- <figure>
- <title>Opening Refactoring wizard in .html file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/seam_refactoring/seam_refactor8.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- </section>
- <section id="properties">
- <title>Opening Refactoring wizard in .properties files
- </title>
- <para>You can also open seam components in .properties files by selecting
- the component name in the file and choose <property>Seam Refactor> Rename Seam Context Variable</property> from the context menu.</para>
- <figure>
- <title>Opening Refactoring wizard in .properties files</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/seam_refactoring/seam_refactor9.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
+
+ <section id="renaming_seam_components">
+ <title>Renaming Seam Components</title>
+
+ <para>Renaming a Seam component could be performed in the:</para>
+
+ <itemizedlist>
+ <listitem><para><link linkend="JavaEditor">Java editor</link></para></listitem>
+ <listitem><para><link linkend="SeamComponents">Seam Components view</link></para></listitem>
+ <listitem><para><link linkend="components_xml_editor">Tree view of the components.xml editor</link></para></listitem>
+ </itemizedlist>
+
+ <section id="JavaEditor">
+ <title>Renaming Seam Components in the Java Editor</title>
+ <para>If you want to rename certain seam component using Java Editor,first of all it's necessary to open it.
+ If you don't know ,where the seam component is declared,use <link linkend="open_seam_component">Open Seam Components icon</link>.
+
+ </para>
+ <para>To open the rename Seam Component command in Java Editor it's necessary to left click the file <emphasis><property>>Seam Refactor>Rename Seam Component</property></emphasis>.
+ </para>
+ <figure>
+ <title>Opening Refactoring wizard in Java Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_refactoring/seam_refactor1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <section id="SeamComponents">
+ <title>Renaming Seam Components in the Seam Components View</title>
+ <para>To open <property>Refactoring</property> wizard in the <property>Seam Components</property> view
+ you should left click the component you wants to open and choose <property>Rename Seam Component</property> option.</para>
+
+ <figure>
+ <title>Opening Refactoring Wizard in Seam Components View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_refactoring/seam_refactor5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <section id="components_xml_editor">
+ <title>Renaming Seam Components in the Seam Components Editor</title>
+ <para>When you open <literal>components.xml</literal> file using <property>JBossTools XML Editor</property>, open the
+ <property>Refactoring</property> wizard in the Tree tab by left-clicking the component in
+ <property>components</property> area and choosing <property>Rename</property> option.</para>
+
+ <figure>
+ <title>Opening Refactoring Wizard in <emphasis><property>components.xml</property></emphasis> File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_refactoring/seam_refactor6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+ </section>
+
+ <section id="renaming_seam_context_vars">
+ <title>Renaming Seam Context Variables in EL</title>
+
+ <para>Renaming a Seam context variables in EL could be executed in <literal>.java</literal>, <literal>.xml</literal>, <literal>.jsp</literal>,
+ <literal>.xhtml</literal> and <literal>.properties</literal> files in Seam projects using
+ the context menu command <emphasis><property>Seam Refactor > Rename Seam Context Variable</property>.</emphasis></para>
+
+ <figure>
+ <title>Refactoring Seam Context Variable in .properties File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_refactoring/seam_refactor9.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <figure>
+ <title>Opening Refactoring wizard in components.xml file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_refactoring/seam_refactor7.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <figure>
+ <title>Opening Refactoring wizard in .html file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/seam_refactoring/seam_refactor8.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
</chapter>
15 years, 1 month