JBoss Tools SVN: r11863 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-11-18 09:20:24 -0500 (Tue, 18 Nov 2008)
New Revision: 11863
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml
Log:
JUnit test for rich:progressBar was updated.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml 2008-11-18 12:55:54 UTC (rev 11862)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml 2008-11-18 14:20:24 UTC (rev 11863)
@@ -7,14 +7,18 @@
STYLE="height: 13px; width: 60%;">
<DIV
STYLE="height: 13px; font-weight: bold; position: relative; text-align: center;"> #{progressBarBean.currentValue} %
- </DIV>
- </DIV>
- <DIV><BR STYLE="-moz-user-modify: read-write;"/>
+</DIV>
+</DIV>
+<DIV>
+<SPAN STYLE="display: none; -moz-user-modify: read-only;"><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
- </DIV>
- <DIV><BR STYLE="-moz-user-modify: read-write;"/>
+</SPAN>
+</DIV>
+<DIV>
+<SPAN STYLE="display: none; -moz-user-modify: read-only;"><BR VPE:PSEUDO-ELEMENT="yes" STYLE="font-style: italic; color: green; -moz-user-modify: read-only;"/>
- </DIV>
- </DIV>
+</SPAN>
+</DIV>
+</DIV>
</test>
</tests>
\ No newline at end of file
17 years, 5 months
JBoss Tools SVN: r11862 - in trunk: documentation/guides/GettingStartedGuide/en and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-11-18 07:55:54 -0500 (Tue, 18 Nov 2008)
New Revision: 11862
Modified:
trunk/birt/docs/en/master.xml
trunk/documentation/guides/GettingStartedGuide/en/master.xml
trunk/portlet/docs/reference/en/master.xml
Log:
https://jira.jboss.org/jira/browse/RF-4644
error in tags is fixed
Modified: trunk/birt/docs/en/master.xml
===================================================================
--- trunk/birt/docs/en/master.xml 2008-11-18 10:22:24 UTC (rev 11861)
+++ trunk/birt/docs/en/master.xml 2008-11-18 12:55:54 UTC (rev 11862)
@@ -25,7 +25,7 @@
<releaseinfo>
Version: 3.0.0.beta1
</releaseinfo>
- </bookinfo>
+
<abstract>
<title/>
@@ -35,8 +35,10 @@
</abstract>
- <toc/>
-
+ </bookinfo>
+ <toc/>
+
+
&introduction;
&birt_support;
&birt_designer;
Modified: trunk/documentation/guides/GettingStartedGuide/en/master.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/master.xml 2008-11-18 10:22:24 UTC (rev 11861)
+++ trunk/documentation/guides/GettingStartedGuide/en/master.xml 2008-11-18 12:55:54 UTC (rev 11862)
@@ -36,17 +36,20 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>Version: 2.0.0.Beta1</releaseinfo>
- </bookinfo>
- <toc/>
-
-<abstract>
+ <abstract>
<title/>
<para>
<ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/GettingStartedGuide/...">PDF version</ulink>
</para>
</abstract>
- &getting_started;
+
+</bookinfo>
+ <toc/>
+
+
+
+&getting_started;
&manage;
&first_seam;
&jsp_application;
Modified: trunk/portlet/docs/reference/en/master.xml
===================================================================
--- trunk/portlet/docs/reference/en/master.xml 2008-11-18 10:22:24 UTC (rev 11861)
+++ trunk/portlet/docs/reference/en/master.xml 2008-11-18 12:55:54 UTC (rev 11862)
@@ -38,7 +38,6 @@
<releaseinfo>
Version: 3.0.0.beta1
</releaseinfo>
- </bookinfo>
<abstract>
<title/>
@@ -48,7 +47,10 @@
</abstract>
- <toc/>
+ </bookinfo>
+ <toc/>
+
+
&intro;
&installation;
&starting_project;
17 years, 5 months
JBoss Tools SVN: r11861 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-11-18 05:22:24 -0500 (Tue, 18 Nov 2008)
New Revision: 11861
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2938, icons paths were updated, inputWidth attribute processing was updated.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2008-11-18 08:03:21 UTC (rev 11860)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesAbstractInplaceTemplate.java 2008-11-18 10:22:24 UTC (rev 11861)
@@ -28,6 +28,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMText;
@@ -465,8 +466,7 @@
final nsIDOMElement element = visualDocument.createElement(HTML.TAG_DIV);
element.setAttribute(HTML.ATTR_CLASS, getMainControlsDivCssClass());
- element.setAttribute(HTML.ATTR_STYLE, "position: absolute; "+getControlPositionsSubStyles()); //$NON-NLS-1$
-
+ element.setAttribute(HTML.ATTR_STYLE, "position: absolute; " + getControlPositionsSubStyles()); //$NON-NLS-1$
final nsIDOMElement divShadov = visualDocument.createElement(HTML.TAG_DIV);
divShadov.setAttribute(HTML.ATTR_CLASS, "rich-inplace"+getCssStylesSuffix()+"-shadow"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -524,10 +524,16 @@
final String saveControlIconImg = buttonImages
.get("saveControlIcon"); //$NON-NLS-1$
if (defaultButtonImages.containsValue(saveControlIconImg)) {
+ /*
+ * Set default icon from resources
+ */
ComponentUtil.setImg(applyButtonImg, saveControlIconImg);
} else {
- ComponentUtil.setImgFromResources(pageContext, applyButtonImg,
- saveControlIconImg, ""); //$NON-NLS-1$
+ /*
+ * Set custom user icon
+ */
+ String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(saveControlIconImg, pageContext, true);
+ applyButtonImg.setAttribute(HTML.ATTR_SRC, imgFullPath);
}
applyButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String
.valueOf(0));
@@ -548,10 +554,16 @@
final String cancelControlIconImg = buttonImages
.get("cancelControlIcon"); //$NON-NLS-1$
if (defaultButtonImages.containsValue(cancelControlIconImg)) {
+ /*
+ * Set default icon from resources
+ */
ComponentUtil.setImg(cancelButtonImg, cancelControlIconImg);
} else {
- ComponentUtil.setImgFromResources(pageContext, cancelButtonImg,
- cancelControlIconImg, ""); //$NON-NLS-1$
+ /*
+ * Set custom user icon
+ */
+ String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(cancelControlIconImg, pageContext, true);
+ cancelButtonImg.setAttribute(HTML.ATTR_SRC, imgFullPath);
}
cancelButtonImg.setAttribute(VPE_USER_TOGGLE_ID_ATTR, String
.valueOf(0));
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2008-11-18 08:03:21 UTC (rev 11860)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceInputTemplate.java 2008-11-18 10:22:24 UTC (rev 11861)
@@ -17,6 +17,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -176,7 +177,8 @@
*/
protected void prepareData(VpePageContext pageContext,Element source) {
try {
- this.inputWidth = String.valueOf(ComponentUtil.parseWidthHeightValue(source.getAttribute("inputWidth"))); //$NON-NLS-1$
+ this.inputWidth = String.valueOf(ComponentUtil
+ .parseWidthHeightValue(source.getAttribute("inputWidth"))) + Constants.PIXEL; //$NON-NLS-1$
} catch (NumberFormatException e) {
this.inputWidth = DEFAULT_INPUT_WIDTH_VALUE;
}
17 years, 5 months
JBoss Tools SVN: r11860 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: xml/ui and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-11-18 03:03:21 -0500 (Tue, 18 Nov 2008)
New Revision: 11860
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/ui/XMLPropertiesSection.java
Log:
JBIDE-3200
Fix some bugs.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java 2008-11-18 01:36:31 UTC (rev 11859)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java 2008-11-18 08:03:21 UTC (rev 11860)
@@ -178,7 +178,16 @@
}
if (NormalSmooksModelBuilder
.isDateConfig((ResourceConfigType) element)) {
- return Messages.getString("SmooksResourceConfigFormBlock.DateType"); //$NON-NLS-1$
+ String name = Messages.getString("SmooksResourceConfigFormBlock.DateType"); //$NON-NLS-1$
+ String selector = ((ResourceConfigType) element).getSelector();
+ if(selector == null){
+ return name;
+ }
+ selector = selector.trim();
+ if(selector.indexOf(":") != -1){
+ selector = selector.substring(selector.indexOf(":") + 1, selector.length());
+ }
+ return name + "(" + selector + ")";
}
if (SmooksModelUtils
.isFilePathResourceConfig((ResourceConfigType) element)) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/messages.properties 2008-11-18 01:36:31 UTC (rev 11859)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/messages.properties 2008-11-18 08:03:21 UTC (rev 11860)
@@ -8,7 +8,7 @@
SmooksGraphicalFormPage.CleanErrorsDialogContents1=There occurs some errors on the graphical design , please clean all errors .\n
SmooksGraphicalFormPage.CleanErrorsDialogContents2=Click "Yes" to return . If you don't care that , click "No" to save file.
SmooksGraphicalFormPage.CleanErrorsDialogTitle=Clean all the errors please
-SmooksGraphicalFormPage.FillViewerErrorContent=a error occurs during filling Data into the viewer:\n
+SmooksGraphicalFormPage.FillViewerErrorContent=a error occurs during filling Data into the viewer\:\n
SmooksGraphicalFormPage.FillViewerErrorTitle=Error
SmooksGraphicalFormPage.MappingPageFormTitle=Data Mapping Page
SmooksGraphicalFormPage.MappingSectionDescription=Edit the source and target assosiation
@@ -21,8 +21,8 @@
SmooksGraphicalFormPage.TargetSelectLinkText=Target Select
SmooksNormalContentEditFormPage.ConfigurationPageText=Configuration Page
SmooksNormalContentEditFormPage.SmooksParseType=Smooks Parse Type
-SmooksResourceConfigFormBlock.BeanPopulator=BeanPopulator :
-SmooksResourceConfigFormBlock.DateType=Data Type
+SmooksResourceConfigFormBlock.BeanPopulator=BeanPopulator \:
+SmooksResourceConfigFormBlock.DateType=Date Type
SmooksResourceConfigFormBlock.DeleteButton=Delete
SmooksResourceConfigFormBlock.DownButton=Down
SmooksResourceConfigFormBlock.NewButton=New
@@ -32,8 +32,8 @@
SmooksResourceConfigFormBlock.UpButton=Up
TypeIDSelectionWizard.TypeIDSelection=TypeID Selection
TypeIDSelectionWizardPage.NameColumn=Name
-TypeIDSelectionWizardPage.SourceTypeIDTitle=Source Data Type ID List :
-TypeIDSelectionWizardPage.TargetTypeIDTitle=Target Data Type ID List :
+TypeIDSelectionWizardPage.SourceTypeIDTitle=Source Data Type ID List \:
+TypeIDSelectionWizardPage.TargetTypeIDTitle=Target Data Type ID List \:
TypeIDSelectionWizardPage.TypeIDSelectionWizardPageDescription=Select the data type for source/target data
TypeIDSelectionWizardPage.TypeIDSelectionWizardPageTitle=Select Source/Target Data Type
TypeIDSelectionWizardPage.WarningMessage=Please select the data type first
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/ui/XMLPropertiesSection.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/ui/XMLPropertiesSection.java 2008-11-18 01:36:31 UTC (rev 11859)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/ui/XMLPropertiesSection.java 2008-11-18 08:03:21 UTC (rev 11860)
@@ -111,6 +111,7 @@
if (propertyModel.getName()
.equals(SELECTOR_NAMESPACE)) {
if (propertyModel.getValue().equals(namespace)) {
+ checkButton.setEnabled(true);
lockEventFire();
checkButton.setSelection(true);
unLockEventFire();
@@ -118,6 +119,8 @@
}
}
}
+ }else{
+ checkButton.setEnabled(false);
}
}
}
17 years, 5 months
JBoss Tools SVN: r11859 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2008-11-17 20:36:31 -0500 (Mon, 17 Nov 2008)
New Revision: 11859
Modified:
trunk/i18n/build.xml
Log:
Changing filename mappings for po/pot (WIP)
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-17 21:54:05 UTC (rev 11858)
+++ trunk/i18n/build.xml 2008-11-18 01:36:31 UTC (rev 11859)
@@ -63,6 +63,9 @@
<taskdef name="pot2en" classname="org.fedorahosted.tennera.antgettext.Pot2EnTask" classpathref="dependency.classpath" />
<taskdef name="po2prop" classname="org.fedorahosted.tennera.antgettext.Po2PropTask" classpathref="dependency.classpath" />
<taskdef name="xpath2pot" classname="org.fedorahosted.tennera.antgettext.XPath2PotTask" classpathref="dependency.classpath" />
+ <typedef name="unbundlemapper"
+ classname="org.fedorahosted.tennera.antgettext.UnBundleNameMapper"
+ classpathref="dependency.classpath" />
</target>
@@ -114,12 +117,14 @@
<mkdir dir="${potdir}" />
<!-- paths under jbt.srcdir look like: ${module}/plugins/${plugin}/{src,main,...} -->
<prop2pot srcDir="${jbt.srcdir}" dstDir="${potdir}" includes="*/plugins/*/src/**/*.properties">
+ <!-- rename to pluginID-org.jboss.ide.*.pot -->
<chainedmapper>
<!-- rename -> "pluginID dash pathRelativeToSrc" -->
- <regexpmapper from="^.*/plugins/(.*)/src/(.*)" to="\1-\2" />
- <!-- rename org/jboss/ide/*.properties -> org.jboss.ide.*.pot -->
+ <regexpmapper handledirsep="true" from="^.*/plugins/(.*)/src/(.*)" to="\1-\2" />
+ <!-- rename org/jboss/ide/*.properties -> pluginID-org.jboss.ide.*.pot -->
<packagemapper from="*.properties" to="*.pot" />
- <!-- rename -> pluginID/org.jboss.ide.*.pot -->
+ <!-- rename -> pluginID/org.jboss.ide.*.pot:
+ -->
<!--<regexpmapper from="([^-]+)-(.*)" to="\1/\2"/>-->
<!-- Silly idea: Replace plugin id in package names with ~
@@ -164,12 +169,58 @@
<target name="po2prop" depends="init" description="Generate Java properties files from translated PO files">
<delete dir="${propdir}" />
<mkdir dir="${propdir}" />
- <!-- for each locale in po/* -->
+ <po2prop srcDir="po" dstDir="${propdir}" failonnull="true">
+ <unbundlemapper directoryPerLocale="true" />
+<!--
+
+ <scriptmapper language="groovy" classpathref="dependency.classpath">
+ <![CDATA[
+// 7 seconds on hot run
+ // map locale/pluginID-org.jboss.ide.*.po -> locale/pluginID/org/jboss/ide/*.properties
+ static def exp
+ if (exp == null)
+ {
+ println "null"
+ exp = /^([^\/\\]+[\/\\][^-]+)-(.*)[.]po$$/
+ }
+ def m = source =~ exp
+ if (m.matches())
+ {
+ def localeAndPlugin = m[0][1]
+ def resource = m[0][2].replace '.' '/'
+ self.addMappedName localeAndPlugin+"/"+resource+".properties";
+ }
+
+ ]]>
+ </scriptmapper>
+ -->
+ </po2prop>
+<!--
<for param="locale" list="${locales}">
<sequential>
- <po2prop srcDir="po/@{locale}" dstDir="${propdir}/@{locale}" locale="@{locale}" />
+ <for param="plugindir">
+ <path>
+ <dirset dir="po/@{locale}" includes="*" />
+ </path>
+ <sequential>
+ <po2prop srcDir="@{plugindir}" dstDir="${propdir}/@{locale}" locale="@{locale}" failonnull="true">
+ <chainedmapper>
+ <filtermapper>
+ <replacestring from="${file.separator}" to="-"/>
+ </filtermapper>
+
+ <unpackagemapper from="*.po" to="*.properties" />
+ <filtermapper>
+ <replacestring from="/" to="-"/>
+ </filtermapper>
+ </chainedmapper>
+ </po2prop>
+ </sequential>
+ </for>
</sequential>
- </for>
+ </for>
+-->
+
</target>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
17 years, 5 months
JBoss Tools SVN: r11858 - in trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core: model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-11-17 16:54:05 -0500 (Mon, 17 Nov 2008)
New Revision: 11858
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/asf/DirectoryScanner.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
Log:
JBDS-485 - another CCE
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/asf/DirectoryScanner.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/asf/DirectoryScanner.java 2008-11-17 20:58:15 UTC (rev 11857)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/asf/DirectoryScanner.java 2008-11-17 21:54:05 UTC (rev 11858)
@@ -892,7 +892,7 @@
continue;
}
String originalpattern = (String) entry.getValue();
- File myfile = new File(basedir, currentelement);
+ File myfile = getChild(basedir, currentelement);
if (myfile.exists()) {
// may be on a case insensitive file system. We want
@@ -1032,7 +1032,7 @@
private void processSlowScan(String[] arr) {
for (int i = 0; i < arr.length; i++) {
if (!couldHoldIncluded(arr[i])) {
- scandir(new File(basedir, arr[i]),
+ scandir(getChild(basedir, arr[i]),
arr[i] + File.separator, false);
}
}
@@ -1721,5 +1721,10 @@
return set.size() == 0 ? patterns
: al.toArray(new String[al.size()]);
}
+
+ protected File getChild(File file, String element) {
+ return new File(file, element);
+ }
+
}
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2008-11-17 20:58:15 UTC (rev 11857)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/DirectoryScannerFactory.java 2008-11-17 21:54:05 UTC (rev 11858)
@@ -121,6 +121,15 @@
return list2absolute(file);
}
+ protected File getChild(File file, String element) {
+ if( !fs.inWorkspace)
+ return super.getChild(file, element);
+ FileWrapper pWrapper = (FileWrapper)file;
+ File child = super.getChild(file, element);
+ FileWrapper childWrapper = new FileWrapper(child, pWrapper.getWrapperPath().append(element));
+ return childWrapper;
+ }
+
protected File[] list2workspace(File file) {
IPath workspaceRelative = ((FileWrapper)file).getWrapperPath();
if( workspaceRelative == null )
17 years, 5 months
JBoss Tools SVN: r11857 - trunk/jmx/plugins/org.jboss.tools.jmx.core/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-11-17 15:58:15 -0500 (Mon, 17 Nov 2008)
New Revision: 11857
Modified:
trunk/jmx/plugins/org.jboss.tools.jmx.core/META-INF/MANIFEST.MF
Log:
JBIDE-3190 - duplicate vendor name
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/META-INF/MANIFEST.MF 2008-11-17 20:52:02 UTC (rev 11856)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/META-INF/MANIFEST.MF 2008-11-17 20:58:15 UTC (rev 11857)
@@ -13,7 +13,6 @@
org.jboss.tools.jmx.ui",
org.jboss.tools.jmx.core.tree
Bundle-Localization: plugin
-Bundle-Vendor: %BundleProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
17 years, 5 months
JBoss Tools SVN: r11856 - in trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui: preferences and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-11-17 15:52:02 -0500 (Mon, 17 Nov 2008)
New Revision: 11856
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java
Log:
JBIDE-3047
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2008-11-17 19:29:46 UTC (rev 11855)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2008-11-17 20:52:02 UTC (rev 11856)
@@ -132,8 +132,8 @@
public static String ShowBuildErrorDialog;
public static String EnableNodeAlways;
public static String ProjectPackagesView;
- public static String ShowFullOutputPath;
- public static String ShowFullRootDirectory;
+ public static String ShowOutputPath;
+ public static String ShowRootDirectory;
public static String ShowRootProject;
public static String ShowAllProjects;
public static String ArchivesVariables;
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2008-11-17 19:29:46 UTC (rev 11855)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2008-11-17 20:52:02 UTC (rev 11856)
@@ -116,8 +116,8 @@
ShowBuildErrorDialog=Show build error dialog
EnableNodeAlways=Show node in all projects
ProjectPackagesView=Project Archives View
-ShowFullOutputPath=Show full output path next to packages.
-ShowFullRootDirectory=Show the full root directory of filesets.
+ShowOutputPath=Show output path next to packages.
+ShowRootDirectory=Show the root directory of filesets.
ShowRootProject=Show project at the root
ShowAllProjects=Show all projects that contain packages
ArchivesVariables=Archives Variables
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2008-11-17 19:29:46 UTC (rev 11855)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2008-11-17 20:52:02 UTC (rev 11856)
@@ -157,10 +157,10 @@
viewPrefGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
showPackageOutputPath = new Button(viewPrefGroup, SWT.CHECK);
- showPackageOutputPath.setText(ArchivesUIMessages.ShowFullOutputPath);
+ showPackageOutputPath.setText(ArchivesUIMessages.ShowOutputPath);
showFullFilesetRootDir = new Button(viewPrefGroup, SWT.CHECK);
- showFullFilesetRootDir.setText(ArchivesUIMessages.ShowFullRootDirectory);
+ showFullFilesetRootDir.setText(ArchivesUIMessages.ShowRootDirectory);
showProjectRoot = new Button(viewPrefGroup, SWT.CHECK);
showProjectRoot.setText(ArchivesUIMessages.ShowRootProject);
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java 2008-11-17 19:29:46 UTC (rev 11855)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java 2008-11-17 20:52:02 UTC (rev 11856)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.ide.eclipse.archives.ui.providers;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.swt.graphics.Image;
@@ -124,7 +125,7 @@
private String getPackageText (IArchive pkg) {
String text = pkg.getName();
if (PrefsInitializer.getBoolean( PrefsInitializer.PREF_SHOW_PACKAGE_OUTPUT_PATH)) {
- text += " [" + PathUtils.getGlobalLocation(pkg) + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ text += " [" + PathUtils.getAbsoluteLocation(pkg) + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
return text;
}
@@ -147,11 +148,11 @@
}
if (showFullPath) {
- text += PathUtils.getGlobalLocation(fileset);
+ text += PathUtils.getAbsoluteLocation(fileset);
} else if( inWorkspace ){
text += fileset.getRawSourcePath();
} else {
- text += PathUtils.getGlobalLocation(fileset).lastSegment();
+ text += new Path(PathUtils.getAbsoluteLocation(fileset)).lastSegment();
}
return text;
17 years, 5 months
JBoss Tools SVN: r11855 - in trunk/seam/plugins/org.jboss.tools.seam.core: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-11-17 14:29:46 -0500 (Mon, 17 Nov 2008)
New Revision: 11855
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2194 Set compilation level and java facet to the same ones for ejb,web,test seam projects.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2008-11-17 19:18:56 UTC (rev 11854)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2008-11-17 19:29:46 UTC (rev 11855)
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
-Eclipse-LazyStart: true
+Bundle-ActivationPolicy: lazy
Bundle-Name: Seam Core Plug-in
Bundle-ClassPath: seam-core.jar
Bundle-Activator: org.jboss.tools.seam.core.SeamCorePlugin
@@ -48,14 +48,11 @@
org.eclipse.jst.jsf.common,
org.eclipse.emf.ecore,
org.eclipse.jst.j2ee.core,
- org.eclipse.jst.jsf.facesconfig;bundle-version="1.1.0"
-Provide-Package: org.jboss.tools.seam.core,
- org.jboss.tools.seam.internal.core,
- org.jboss.tools.seam.internal.core.scanner,
- org.jboss.tools.seam.internal.core.preferences,
- org.jboss.tools.seam.internal.core.refactoring
+ org.eclipse.jst.jsf.facesconfig,
+ org.eclipse.jst.common.frameworks
Bundle-Version: 2.0.0
-Export-Package: org.jboss.tools.seam.core,
+Export-Package:
+ org.jboss.tools.seam.core,
org.jboss.tools.seam.core.event,
org.jboss.tools.seam.core.project.facet,
org.jboss.tools.seam.internal.core,
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-11-17 19:18:56 UTC (rev 11854)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-11-17 19:29:46 UTC (rev 11855)
@@ -99,7 +99,7 @@
</requires>
<requires
facet="jst.java"
- version="5.0">
+ version="[5.0">
</requires>
</and>
</or>
@@ -129,7 +129,7 @@
</requires>
<requires
facet="jst.java"
- version="5.0">
+ version="[5.0">
</requires>
</and>
</or>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2008-11-17 19:18:56 UTC (rev 11854)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2008-11-17 19:29:46 UTC (rev 11855)
@@ -13,6 +13,7 @@
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
+import java.util.Collections;
import org.apache.tools.ant.types.FilterSet;
import org.apache.tools.ant.types.FilterSetCollection;
@@ -27,14 +28,17 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jst.common.project.facet.JavaFacetUtils;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
import org.jboss.tools.common.util.ResourcesUtils;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
@@ -232,7 +236,18 @@
if (!SeamFacetAbstractInstallDelegate.isWarConfiguration(model)) {
IProject ejbProjectToBeImported = wsRoot.getProject(ejbProjectName);
+
ResourcesUtils.importExistingProject(ejbProjectToBeImported, wsPath + "/" + ejbProjectName, ejbProjectName, monitor, false);
+ // Set up compilation level and java facet for ejb project.
+ String level = JavaFacetUtils.getCompilerLevel(seamWebProject);
+ String ejbLevel = JavaFacetUtils.getCompilerLevel(ejbProjectToBeImported);
+ if (!ejbLevel.equals(level)) {
+ JavaFacetUtils.setCompilerLevel(ejbProjectToBeImported, level);
+ }
+ Action action = new Action(Action.Type.VERSION_CHANGE, JavaFacetUtils.compilerLevelToFacet(level), null);
+ IFacetedProject facetedProject = ProjectFacetsManager.create(ejbProjectToBeImported);
+ facetedProject.modify(Collections.singleton(action), null);
+
SeamFacetAbstractInstallDelegate.toggleHibernateOnProject(ejbProjectToBeImported, consoleName);
IProjectFacet sf = ProjectFacetsManager.getProjectFacet("jst.ejb");
IProjectFacetVersion pfv = ProjectFacetsManager.create(ejbProjectToBeImported).getInstalledVersion(sf);
@@ -245,6 +260,13 @@
IProject testProjectToBeImported = wsRoot.getProject(testProjectName);
ResourcesUtils.importExistingProject(testProjectToBeImported, wsPath + "/" + testProjectName, testProjectName, monitor, true);
+ // Set up compilation level for test project.
+ String level = JavaFacetUtils.getCompilerLevel(seamWebProject);
+ String testLevel = JavaFacetUtils.getCompilerLevel(testProjectToBeImported);
+ if (!testLevel.equals(level)) {
+ JavaFacetUtils.setCompilerLevel(testProjectToBeImported, level);
+ }
+
SeamFacetAbstractInstallDelegate.toggleHibernateOnProject(testProjectToBeImported, consoleName);
createSeamProjectPreferenes();
17 years, 5 months
JBoss Tools SVN: r11854 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-11-17 14:18:56 -0500 (Mon, 17 Nov 2008)
New Revision: 11854
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableChildrenEncoder.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableStyleClassesApplier.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableChildrenEncoder.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/scrollableDataTable.xhtml.xml
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/VisualDomUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeClassUtil.java
Log:
CODING IN PROGRESS - issue JBIDE-2877: <rich:dataTable>, <rich:column> interaction
https://jira.jboss.org/jira/browse/JBIDE-2877
Attributes 'columnClasses' and 'rowClasses' of <rich:dataTable> and <rich:scrollableDataTable> now are supported by VPE.
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableChildrenEncoder.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableChildrenEncoder.java 2008-11-17 19:06:38 UTC (rev 11853)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableChildrenEncoder.java 2008-11-17 19:18:56 UTC (rev 11854)
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.richfaces.template;
-
-import java.util.List;
-
-import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.RichFacesTemplatesActivator;
-import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
-import org.jboss.tools.vpe.editor.template.VpeCreationData;
-import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
-import org.jboss.tools.vpe.editor.template.VpeTemplate;
-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.mozilla.interfaces.nsIDOMNodeList;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * The class {@code RichFacesDataTableChildrenEncoder} encodes children of a {@code rich:*Table}.
- *
- * <BR/>Use this class as follows:
- * <blockquote><pre>
- * RichFacesDataTableChildrenEncoder encoder
- * = new RichFacesDataTableChildrenEncoder(
- * creationData, visualDocument, sourceElement, table);
- * encoder.encodeChildren();</pre></blockquote>
- *
- * Method {@link #validateChildren(VpePageContext, Node, nsIDOMDocument, VpeCreationData) validateChildren}
- * MUST be invoked from {@link VpeTemplate#validate(VpePageContext, Node, nsIDOMDocument, VpeCreationData) validate}
- * method of the caller of this class:
- * <blockquote><pre>
- * public void validate(VpePageContext pageContext, Node sourceNode,
- * nsIDOMDocument visualDocument, VpeCreationData data) {
- * RichFacesDataTableChildrenEncoder.validateChildren(
- * pageContext, sourceNode, visualDocument, data);
- * ...
- * }</pre></blockquote>
- *
- * @author yradtsevich
- * */
-class RichFacesDataTableChildrenEncoder {
- private String firstRowClass = "dr-table-firstrow rich-table-firstrow";
- private String nonFirstRowClass = "dr-table-row rich-table-row";
-
- /**@param firstRowClass the class of the first row in the table
- * @param nonFirstRowClass the class of all rows in the table except the first one*/
- public void setRowClasses(final String firstRowClass, final String nonFirstRowClass) {
- this.firstRowClass = firstRowClass;
- this.nonFirstRowClass = nonFirstRowClass;
- }
-
- /**Non-HTML tag that is used to create temporary containers for {@code rich:subTable} and {@code rich:columnGroup}.*/
- private static final String TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER = "subTableOrColumnGroup-container"; //$NON-NLS-1$
- private final VpeCreationData creationData;
- private final nsIDOMDocument visualDocument;
- private final Element sourceElement;
- private final nsIDOMElement table;
-
- public RichFacesDataTableChildrenEncoder(final VpeCreationData creationData,
- final nsIDOMDocument visualDocument, final Element sourceElement,
- final nsIDOMElement table) {
- this.creationData = creationData;
- this.visualDocument = visualDocument;
- this.sourceElement = sourceElement;
- this.table = table;
- }
-
- /**
- * Creates containers in {@code table} for {@code sourceElement}'s children
- * and adds appropriate objects of {@link VpeChildrenInfo} to {@code creationData}.
- *
- * <BR/>It knows about following tags:
- * {@code rich:column, rich:columns, rich:subTable} and {@code rich:columnGroup}.
- * <BR/>For any another tag it uses {@link #addElementToTable(Node)} method.
- * */
- public void encodeChildren() {
- final List<Node> children = ComponentUtil.getChildren(sourceElement);
- boolean createNewRow = true;
- for (final Node child : children) {
- final String nodeName = child.getNodeName();
- if (nodeName.endsWith(RichFaces.TAG_COLUMN) ||
- nodeName.endsWith(RichFaces.TAG_COLUMNS)) {
- createNewRow |= RichFacesColumnTemplate.isBreakBefore(child);
- addColumnToRow(child, createNewRow);
- createNewRow = false;
- } else if(nodeName.endsWith(RichFaces.TAG_SUB_TABLE)
- || nodeName.endsWith(RichFaces.TAG_COLUMN_GROUP)) {
- addSubTableOrColumnGroupToTable(child);
- createNewRow = true;
- } else if (!VpeCreatorUtil.isFacet(child)) {
- addElementToTable(child);
- createNewRow = true;
- }
- }
- }
-
- /**
- * Makes necessary changes in the table's body after all children of the table have been encoded.
- * */
- public static void validateChildren(final VpePageContext pageContext, final Node sourceNode,
- final nsIDOMDocument visualDocument, final VpeCreationData creationData) {
- final nsIDOMNode visualNode = creationData.getNode();
- fixSubTables(visualNode);
- }
-
- /**
- * Creates a container for {@code subTableOrColumnGroupNode} in {@code table}
- * and adds an appropriate object of {@link VpeChildrenInfo} to {@code creationData}.
- * <BR/>The container is the tag {@link #TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER}.
- * */
- private nsIDOMElement addSubTableOrColumnGroupToTable(final Node subTableOrColumnGroupNode) {
- final nsIDOMElement subTableOrColumnGroupContainer = visualDocument.createElement(TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER);
- table.appendChild(subTableOrColumnGroupContainer);
- final VpeChildrenInfo childInfo = new VpeChildrenInfo(subTableOrColumnGroupContainer);
- childInfo.addSourceChild(subTableOrColumnGroupNode);
- creationData.addChildrenInfo(childInfo);
-
- return subTableOrColumnGroupContainer;
- }
-
- private nsIDOMElement currentRow = null;
- private VpeChildrenInfo currentRowChildrenInfo = null;
- private int rowNumber = 0;
- /**
- * Creates a container for {@code columnNode} in {@code table}
- * and adds an appropriate object of {@link VpeChildrenInfo} to {@code creationData}.
- * <BR/>If the parameter {@code createNewRow} is {@code true} then it creates the
- * container in a new row.
- * */
- private nsIDOMElement addColumnToRow(final Node columnNode, final boolean createNewRow) {
- if ( createNewRow || (currentRow == null) ) {
- currentRow = visualDocument.createElement(HTML.TAG_TR);
- table.appendChild(currentRow);
- currentRowChildrenInfo = new VpeChildrenInfo(currentRow);
- creationData.addChildrenInfo(currentRowChildrenInfo);
- rowNumber++;
- if (rowNumber == 1) {
- currentRow.setAttribute(HTML.ATTR_CLASS, firstRowClass); //$NON-NLS-1$
- } else {
- currentRow.setAttribute(HTML.ATTR_CLASS, nonFirstRowClass); //$NON-NLS-1$
- }
- }
-
- currentRowChildrenInfo.addSourceChild(columnNode);
- return currentRow;
- }
-
- /**
- * Creates a row container for {@code node} in {@code table}
- * and adds an appropriate object of {@link VpeChildrenInfo} to {@code creationData}.
- * <BR/>The container spans the entire row.
- * */
- private void addElementToTable(final Node node) {
- final nsIDOMElement tr = this.visualDocument.createElement(HTML.TAG_TR);
- table.appendChild(tr);
- final nsIDOMElement td = this.visualDocument.createElement(HTML.TAG_TD);
-
- td.setAttribute(HTML.ATTR_COLSPAN, HTML.VALUE_COLSPAN_ALL);
- tr.appendChild(td);
- final VpeChildrenInfo childInfo = new VpeChildrenInfo(td);
- childInfo.addSourceChild(node);
- creationData.addChildrenInfo(childInfo);
- }
-
- /**
- * Replaces all occurencies of {@link #TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER} tag in
- * the {@code visualNode} by the tag's child.
- * @see #addSubTableOrColumnGroupToTable(Node)
- */
- private static void fixSubTables(final nsIDOMNode visualNode) {
- final nsIDOMElement element = (nsIDOMElement) visualNode;
- final nsIDOMNodeList subTableContainers = element.getElementsByTagName(TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER);
- final long length = subTableContainers.getLength();
- for (int i = 0; i < length; i++) {
- final nsIDOMNode subTableContainer = subTableContainers.item(0);
- final nsIDOMNodeList subTableContainerChildren = subTableContainer.getChildNodes();
- final nsIDOMNode containerParent = subTableContainer.getParentNode();
- if (subTableContainerChildren != null
- && subTableContainerChildren.getLength() == 1) {
- final nsIDOMNode subTableMainTag = subTableContainerChildren.item(0);
- subTableContainer.removeChild(subTableMainTag);
- containerParent.insertBefore(subTableMainTag, subTableContainer);
- } else {
- final RuntimeException e = new RuntimeException("This is probably a bug. subTable-container should have one inner tag.");//$NON-NLS-1$
- RichFacesTemplatesActivator.getPluginLog().logError(e);
- }
- containerParent.removeChild(subTableContainer);
- }
- }
-}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableChildrenEncoder.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableChildrenEncoder.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableChildrenEncoder.java 2008-11-17 19:18:56 UTC (rev 11854)
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import java.util.List;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.RichFacesTemplatesActivator;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
+import org.jboss.tools.vpe.editor.template.VpeTemplate;
+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.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * The class {@code RichFacesDataTableChildrenEncoder} encodes children of a {@code rich:*Table}.
+ *
+ * <BR/>Use this class as follows:
+ * <blockquote><pre>
+ * RichFacesDataTableChildrenEncoder encoder
+ * = new RichFacesDataTableChildrenEncoder(
+ * creationData, visualDocument, sourceElement, table);
+ * encoder.encodeChildren();</pre></blockquote>
+ *
+ * Method {@link #validateChildren(VpePageContext, Node, nsIDOMDocument, VpeCreationData) validateChildren}
+ * MUST be invoked from {@link VpeTemplate#validate(VpePageContext, Node, nsIDOMDocument, VpeCreationData) validate}
+ * method of the caller of this class:
+ * <blockquote><pre>
+ * public void validate(VpePageContext pageContext, Node sourceNode,
+ * nsIDOMDocument visualDocument, VpeCreationData data) {
+ * RichFacesDataTableChildrenEncoder.validateChildren(
+ * pageContext, sourceNode, visualDocument, data);
+ * ...
+ * }</pre></blockquote>
+ *
+ * @author yradtsevich
+ * */
+class RichFacesDataTableChildrenEncoder {
+ private String firstRowClass = "dr-table-firstrow rich-table-firstrow"; //$NON-NLS-1$
+ private String nonFirstRowClass = "dr-table-row rich-table-row"; //$NON-NLS-1$
+
+ /**@param firstRowClass the class of the first row in the table
+ * @param nonFirstRowClass the class of all rows in the table except the first one*/
+ public void setRowClasses(final String firstRowClass, final String nonFirstRowClass) {
+ this.firstRowClass = firstRowClass;
+ this.nonFirstRowClass = nonFirstRowClass;
+ }
+
+ /**Non-HTML tag that is used to create temporary containers for {@code rich:subTable} and {@code rich:columnGroup}.*/
+ private static final String TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER = "subTableOrColumnGroup-container"; //$NON-NLS-1$
+ private final VpeCreationData creationData;
+ private final nsIDOMDocument visualDocument;
+ private final Element sourceElement;
+ private final nsIDOMElement table;
+
+ public RichFacesDataTableChildrenEncoder(final VpeCreationData creationData,
+ final nsIDOMDocument visualDocument, final Element sourceElement,
+ final nsIDOMElement table) {
+ this.creationData = creationData;
+ this.visualDocument = visualDocument;
+ this.sourceElement = sourceElement;
+ this.table = table;
+ }
+
+ /**
+ * Creates containers in {@code table} for {@code sourceElement}'s children
+ * and adds appropriate objects of {@link VpeChildrenInfo} to {@code creationData}.
+ *
+ * <BR/>It knows about following tags:
+ * {@code rich:column, rich:columns, rich:subTable} and {@code rich:columnGroup}.
+ * <BR/>For any another tag it uses {@link #addElementToTable(Node)} method.
+ * */
+ public void encodeChildren() {
+ final List<Node> children = ComponentUtil.getChildren(sourceElement);
+ boolean createNewRow = true;
+ for (final Node child : children) {
+ final String nodeName = child.getNodeName();
+ if (nodeName.endsWith(RichFaces.TAG_COLUMN) ||
+ nodeName.endsWith(RichFaces.TAG_COLUMNS)) {
+ createNewRow |= RichFacesColumnTemplate.isBreakBefore(child);
+ addColumnToRow(child, createNewRow);
+ createNewRow = false;
+ } else if(nodeName.endsWith(RichFaces.TAG_SUB_TABLE)
+ || nodeName.endsWith(RichFaces.TAG_COLUMN_GROUP)) {
+ addSubTableOrColumnGroupToTable(child);
+ createNewRow = true;
+ } else if (!VpeCreatorUtil.isFacet(child)) {
+ addElementToTable(child);
+ createNewRow = true;
+ }
+ }
+ }
+
+ /**
+ * Makes necessary changes in the table's body after all children of the table have been encoded.
+ */
+ public static void validateChildren(final VpePageContext pageContext, final Node sourceNode,
+ final nsIDOMDocument visualDocument, final VpeCreationData creationData) {
+ final nsIDOMNode visualNode = creationData.getNode();
+ fixSubTables(visualNode);
+ }
+
+ /**
+ * Creates a container for {@code subTableOrColumnGroupNode} in {@code table}
+ * and adds an appropriate object of {@link VpeChildrenInfo} to {@code creationData}.
+ * <BR/>The container is the tag {@link #TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER}.
+ */
+ private nsIDOMElement addSubTableOrColumnGroupToTable(final Node subTableOrColumnGroupNode) {
+ final nsIDOMElement subTableOrColumnGroupContainer = visualDocument.createElement(TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER);
+ table.appendChild(subTableOrColumnGroupContainer);
+ final VpeChildrenInfo childInfo = new VpeChildrenInfo(subTableOrColumnGroupContainer);
+ childInfo.addSourceChild(subTableOrColumnGroupNode);
+ creationData.addChildrenInfo(childInfo);
+
+ return subTableOrColumnGroupContainer;
+ }
+
+ private nsIDOMElement currentRow = null;
+ private VpeChildrenInfo currentRowChildrenInfo = null;
+ private int rowNumber = 0;
+ /**
+ * Creates a container for {@code columnNode} in {@code table}
+ * and adds an appropriate object of {@link VpeChildrenInfo} to {@code creationData}.
+ * <BR/>If the parameter {@code createNewRow} is {@code true} then it creates the
+ * container in a new row.
+ * */
+ private nsIDOMElement addColumnToRow(final Node columnNode, final boolean createNewRow) {
+ if ( createNewRow || (currentRow == null) ) {
+ currentRow = visualDocument.createElement(HTML.TAG_TR);
+ table.appendChild(currentRow);
+ currentRowChildrenInfo = new VpeChildrenInfo(currentRow);
+ creationData.addChildrenInfo(currentRowChildrenInfo);
+ rowNumber++;
+ if (rowNumber == 1) {
+ currentRow.setAttribute(HTML.ATTR_CLASS, firstRowClass);
+ } else {
+ currentRow.setAttribute(HTML.ATTR_CLASS, nonFirstRowClass);
+ }
+ }
+
+ currentRowChildrenInfo.addSourceChild(columnNode);
+ return currentRow;
+ }
+
+ /**
+ * Creates a row container for {@code node} in {@code table}
+ * and adds an appropriate object of {@link VpeChildrenInfo} to {@code creationData}.
+ * <BR/>The container spans the entire row.
+ * */
+ private void addElementToTable(final Node node) {
+ final nsIDOMElement tr = this.visualDocument.createElement(HTML.TAG_TR);
+ table.appendChild(tr);
+ final nsIDOMElement td = this.visualDocument.createElement(HTML.TAG_TD);
+
+ td.setAttribute(HTML.ATTR_COLSPAN, HTML.VALUE_COLSPAN_ALL);
+ tr.appendChild(td);
+ final VpeChildrenInfo childInfo = new VpeChildrenInfo(td);
+ childInfo.addSourceChild(node);
+ creationData.addChildrenInfo(childInfo);
+ }
+
+ /**
+ * Replaces all occurencies of {@link #TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER} tag in
+ * the {@code visualNode} by the tag's child.
+ * @see #addSubTableOrColumnGroupToTable(Node)
+ */
+ private static void fixSubTables(final nsIDOMNode visualNode) {
+ final nsIDOMElement element = (nsIDOMElement) visualNode;
+ final nsIDOMNodeList subTableContainers = element.getElementsByTagName(TAG_SUB_TABLE_OR_COLUMN_GROUP_CONTAINER);
+ final long length = subTableContainers.getLength();
+ for (int i = 0; i < length; i++) {
+ final nsIDOMNode subTableContainer = subTableContainers.item(0);
+ final nsIDOMNodeList subTableContainerChildren = subTableContainer.getChildNodes();
+
+ if (subTableContainerChildren == null
+ || subTableContainerChildren.getLength() != 1) {
+ final RuntimeException e = new RuntimeException("This is probably a bug. subTable-container should have one inner tag.");//$NON-NLS-1$
+ RichFacesTemplatesActivator.getPluginLog().logError(e);
+ }
+
+ VisualDomUtil.replaceNodeByItsChildren(subTableContainer);
+ }
+ }
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableChildrenEncoder.java
___________________________________________________________________
Name: svn:mergeinfo
+
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableStyleClassesApplier.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableStyleClassesApplier.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableStyleClassesApplier.java 2008-11-17 19:18:56 UTC (rev 11854)
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import java.util.List;
+
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpression;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpressionBuilder;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpressionBuilderException;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpressionException;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeClassUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.w3c.dom.Node;
+
+/**
+ * Class {@code RichFacesDataTableStyleClassesApplier} should be used in templates
+ * of tags that support attributes {@code 'rowClasses'} and {@code 'columnClasses'}.
+ * <P/>
+ * It expects it is used in pair with {@link RichFacesDataTableChildrenEncoder}.
+ *
+ * @author yradtsevich
+ */
+public class RichFacesDataTableStyleClassesApplier {
+ private static final String COLUMN_CLASSES_EXPRESSION =
+ "{@" + RichFaces.ATTR_COLUMN_CLASSES + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ private static final String ROW_CLASSES_EXPRESSION =
+ "{@" + RichFaces.ATTR_ROW_CLASSES + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ private final List<String> rowClasses;
+ private final List<String> columnClasses;
+
+ /**
+ * Constructs {@code RichFacesDataTableStyleClassesApplier}.
+ *
+ * @param visualDocument an object of {@link nsIDOMDocument}
+ * @param pageContext an object of {@link VpePageContext}
+ * @param sourceNode an object of a tag that could have
+ * attributes {@code 'rowClasses'} and {@code 'columnClasses'}.
+ */
+ public RichFacesDataTableStyleClassesApplier(final nsIDOMDocument visualDocument,
+ final VpePageContext pageContext, final Node sourceNode) {
+ VpeExpression rowClassesExpr;
+ VpeExpression columnClassesExpr;
+ try {
+ rowClassesExpr = VpeExpressionBuilder
+ .buildCompletedExpression(ROW_CLASSES_EXPRESSION, true).getExpression();
+ columnClassesExpr = VpeExpressionBuilder
+ .buildCompletedExpression(COLUMN_CLASSES_EXPRESSION, true).getExpression();
+ } catch (final VpeExpressionBuilderException e) {
+ throw new RuntimeException(e);
+ }
+
+ try {
+ rowClasses = VpeClassUtil.getClasses(rowClassesExpr, sourceNode,
+ pageContext);
+ columnClasses = VpeClassUtil.getClasses(columnClassesExpr, sourceNode,
+ pageContext);
+ } catch (final VpeExpressionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Applies style-classes specified in attributes {@code 'rowClasses'} and
+ * {@code 'columnClasses'} of {@code sourceNode} to the {@code targetTable}.
+ * <P/>
+ * This method should be used in
+ * {@link VpeAbstractTemplate#validate(VpePageContext, Node, nsIDOMDocument, VpeCreationData) validate()}
+ * method of a template after
+ * {@link RichFacesDataTableChildrenEncoder#validateChildren(VpePageContext, Node, nsIDOMDocument, VpeCreationData) RichFacesDataTableChildrenEncoder.validateChildren()}
+ * is called.
+ * <P/>
+ * The basic idea of the method is to add appropriate rowClasses only
+ * to the direct TR children of the table and add appropriate columnClasses
+ * only to direct TD children of that TRs. It gives us opportunity to separate
+ * TRs and TDs that created by the tag directly from TRs and TDs created
+ * by the tag's children.
+ */
+ public void applyClasses(final nsIDOMElement targetTable) {
+ final nsIDOMNodeList tableChildren = targetTable.getChildNodes();
+ int rowIndex = 0;
+ final int tableChildrenLength = (int) tableChildren.getLength();
+ for (int i = 0; i < tableChildrenLength; i++) {
+ final nsIDOMNode tableChild = tableChildren.item(i);
+ if (tableChild.getNodeType() == nsIDOMNode.ELEMENT_NODE
+ && HTML.TAG_TR.equalsIgnoreCase( tableChild.getNodeName() )) {
+ final nsIDOMElement row =
+ (nsIDOMElement) tableChild.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ applyClass(rowClasses, row, rowIndex);
+
+ applyClassesToCells(row);
+ rowIndex++;
+ }
+ }
+ }
+
+ /**
+ * Applies style-classes specified in attribute {@code 'columnClasses'}
+ * of {@code sourceNode} to the {@code row}.
+ */
+ private void applyClassesToCells(final nsIDOMElement row) {
+ final int columnClassesSize = columnClasses.size();
+ if (columnClassesSize > 0) {
+ final nsIDOMNodeList rowChildren = row.getChildNodes();
+ int columnIndex = 0;
+ int rowChildrenLength = (int)rowChildren.getLength();
+ for (int j = 0; j < rowChildrenLength; j++) {
+ final nsIDOMNode rowChild = rowChildren.item(j);
+ if (rowChild.getNodeType() == nsIDOMNode.ELEMENT_NODE
+ && HTML.TAG_TD.equalsIgnoreCase( rowChild.getNodeName() )) {
+ final nsIDOMElement cell =
+ (nsIDOMElement) rowChild.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ applyClass(columnClasses, cell, columnIndex);
+
+ columnIndex++;
+ }
+ }
+ }
+ }
+
+ /**
+ * Applies appropriate style-class from the list {@code classes} to the
+ * {@code element} (a row or a cell) position of that is {@code elementIndex}.
+ */
+ private static void applyClass(final List<String> classes, final nsIDOMElement element,
+ int elementIndex) {
+ int classesSize = classes.size();
+ if (classesSize > 0) {
+ final String clazz = classes.get(elementIndex % classesSize);
+ String actualClass = element.getAttribute(HTML.ATTR_CLASS);
+ if (actualClass == null) {
+ actualClass = clazz;
+ } else {
+ actualClass+= HTML.VALUE_CLASS_DELIMITER + clazz;
+ }
+ element.setAttribute(HTML.ATTR_CLASS, actualClass);
+ }
+ }
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-11-17 19:06:38 UTC (rev 11853)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-11-17 19:18:56 UTC (rev 11854)
@@ -11,7 +11,6 @@
package org.jboss.tools.jsf.vpe.richfaces.template;
import java.util.ArrayList;
-import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
@@ -333,6 +332,11 @@
public void validate(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument, VpeCreationData data) {
RichFacesDataTableChildrenEncoder.validateChildren(pageContext, sourceNode, visualDocument, data);
+
+ final RichFacesDataTableStyleClassesApplier styleClassesApplier =
+ new RichFacesDataTableStyleClassesApplier(visualDocument,
+ pageContext, sourceNode);
+ styleClassesApplier.applyClasses((nsIDOMElement) data.getNode());
}
@Override
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2008-11-17 19:06:38 UTC (rev 11853)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2008-11-17 19:18:56 UTC (rev 11854)
@@ -15,14 +15,18 @@
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.RichFacesTemplatesActivator;
import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.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.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -51,6 +55,7 @@
private static String STYLE_FOR_RIGHT_SCROLL = "overflow: scroll; width: 17px; height: 100%;";
private static final int NUM_ROW = 5;
+ private static final String TAG_MAIN_TABLE_WRAPPER = "mainTable-wrapper"; //$NON-NLS-1$
/**
* Creates a node of the visual tree on the node of the source tree. This
@@ -131,18 +136,21 @@
div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, divStyle);
- nsIDOMElement table = visualDocument
+ nsIDOMElement mainTable = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- ComponentUtil.copyAttributes(sourceNode, table);
- table.removeAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT);
- div.appendChild(table);
+ ComponentUtil.copyAttributes(sourceNode, mainTable);
+ mainTable.removeAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT);
+ nsIDOMElement mainTableWrapper = visualDocument.createElement(TAG_MAIN_TABLE_WRAPPER);
+ mainTableWrapper.appendChild(mainTable);
+ div.appendChild(mainTableWrapper);
+
ComponentUtil.setCSSLink(pageContext,
"scrollableDataTable/scrollableDataTable.css",
"richFacesDataTable");
String tableClass = sourceElement
.getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
- table
+ mainTable
.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
"dr-table rich-table "
+ (tableClass == null ? "" : tableClass));
@@ -154,10 +162,10 @@
.createElement(HtmlComponentUtil.HTML_TAG_COLGROUP);
colgroup.setAttribute(HtmlComponentUtil.HTML_TAG_SPAN, String
.valueOf(columnsLength));
- table.appendChild(colgroup);
+ mainTable.appendChild(colgroup);
// Encode Caption
- encodeCaption(creationData, sourceElement, visualDocument, table);
+ encodeCaption(creationData, sourceElement, visualDocument, mainTable);
// Encode Header
Element header = ComponentUtil.getFacet(sourceElement, HEADER);
@@ -165,7 +173,7 @@
if (header != null || !columnsHeaders.isEmpty()) {
nsIDOMElement thead = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_THEAD);
- table.appendChild(thead);
+ mainTable.appendChild(thead);
String headerClass = (String) sourceElement
.getAttribute(HEADER_CLASS);
if (header != null) {
@@ -199,7 +207,7 @@
if (footer != null || !columnsFooters.isEmpty()) {
nsIDOMElement tfoot = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TFOOT);
- table.appendChild(tfoot);
+ mainTable.appendChild(tfoot);
String footerClass = (String) sourceElement
.getAttribute(FOOTER_CLASS);
if (!columnsFooters.isEmpty()) {
@@ -230,11 +238,11 @@
nsIDOMElement tbody = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TBODY);
- table.appendChild(tbody);
+ mainTable.appendChild(tbody);
for (int i = 0; i < NUM_ROW; i++) {
new RichFacesDataTableChildrenEncoder(creationData, visualDocument,
- sourceElement, table).encodeChildren();
+ sourceElement, mainTable).encodeChildren();
}
return creationData;
@@ -552,8 +560,40 @@
public void validate(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument, VpeCreationData data) {
RichFacesDataTableChildrenEncoder.validateChildren(pageContext, sourceNode, visualDocument, data);
+ applyStyleClasses(pageContext, sourceNode, visualDocument, data);
}
+ private void applyStyleClasses(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+
+ nsIDOMElement element = (nsIDOMElement) data.getNode();
+ final nsIDOMNodeList mainTableWrappers = element.getElementsByTagName(TAG_MAIN_TABLE_WRAPPER);
+
+ if (mainTableWrappers == null
+ || mainTableWrappers.getLength() != 1) {
+ final RuntimeException e = new RuntimeException("This is probably a bug. There should be exatly one " + TAG_MAIN_TABLE_WRAPPER);//$NON-NLS-1$
+ RichFacesTemplatesActivator.getPluginLog().logError(e);
+ }
+ final nsIDOMNode mainTableWrapper = mainTableWrappers.item(0);
+ final nsIDOMNodeList mainTableWrapperChildren = mainTableWrapper.getChildNodes();
+
+ if (mainTableWrapperChildren == null
+ || mainTableWrapperChildren.getLength() != 1) {
+ final RuntimeException e = new RuntimeException("This is probably a bug. " + TAG_MAIN_TABLE_WRAPPER + " should have exactly one child.");//$NON-NLS-1$ //$NON-NLS-2$
+ RichFacesTemplatesActivator.getPluginLog().logError(e);
+ }
+
+ final nsIDOMElement mainTable = (nsIDOMElement) mainTableWrapperChildren.item(0)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ final RichFacesDataTableStyleClassesApplier styleClassesApplier =
+ new RichFacesDataTableStyleClassesApplier(visualDocument,
+ pageContext, sourceNode);
+ styleClassesApplier.applyClasses(mainTable);
+
+ VisualDomUtil.replaceNodeByItsChildren(mainTableWrapper);
+ }
+
// @Override
// public void removeAttribute(VpePageContext pageContext,
// Element sourceElement, nsIDOMDocument visualDocument,
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2008-11-17 19:06:38 UTC (rev 11853)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2008-11-17 19:18:56 UTC (rev 11854)
@@ -177,7 +177,8 @@
if (columnStyle == null) {
columnStyle = visualDocument.createAttribute(HTML.ATTR_CLASS);
}
- columnStyle.setNodeValue(columnStyle.getNodeValue() + ' ' + getColumnClass(column));
+ columnStyle.setNodeValue(columnStyle.getNodeValue() + HTML.VALUE_CLASS_DELIMITER
+ + getColumnClass(column));
column++;
}
}
@@ -249,27 +250,27 @@
}
protected String getRowClass(final int row) {
- StringBuffer rowClass = new StringBuffer(DEAFAULT_CELL_CLASS);
+ String rowClass = DEAFAULT_CELL_CLASS;
if (rowClasses != null) {
final int rowClassesSize = rowClasses.size();
if(rowClassesSize > 0) {
- rowClass = new StringBuffer(rowClasses.get(row % rowClassesSize));
+ rowClass = rowClasses.get(row % rowClassesSize);
}
}
- return rowClass.toString();
+ return rowClass;
}
private String getColumnClass(final int column) {
- StringBuffer columnClass = new StringBuffer(DEAFAULT_CELL_CLASS);
+ String columnClass = DEAFAULT_CELL_CLASS;
if (columnClasses != null) {
final int columnClassesSize = columnClasses.size();
if (columnClassesSize > 0) {
- columnClass = new StringBuffer(columnClasses.get(column % columnClassesSize));
+ columnClass = columnClasses.get(column % columnClassesSize);
}
}
- return columnClass.toString();
+ return columnClass;
}
private void initClasses(final Node sourceNode, final VpePageContext pageContext) {
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/scrollableDataTable.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/scrollableDataTable.xhtml.xml 2008-11-17 19:06:38 UTC (rev 11853)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/scrollableDataTable.xhtml.xml 2008-11-17 19:18:56 UTC (rev 11854)
@@ -42,102 +42,102 @@
<TBODY>
</TBODY>
<TR CLASS="dr-table-firstrow rich-table-firstrow">
- <TD ID="make" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="make" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.make}</SPAN>
</TD>
- <TD ID="model" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="model" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.model}</SPAN>
</TD>
- <TD ID="price" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="price" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.price}</SPAN>
</TD>
- <TD ID="mileage" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="mileage" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.mileage}</SPAN>
</TD>
- <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell">
+ <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.vin}</SPAN>
</TD>
- <TD ID="stock" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="stock" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.stock}</SPAN>
</TD>
</TR>
<TR CLASS="dr-table-firstrow rich-table-firstrow">
- <TD ID="make" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="make" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.make}</SPAN>
</TD>
- <TD ID="model" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="model" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.model}</SPAN>
</TD>
- <TD ID="price" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="price" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.price}</SPAN>
</TD>
- <TD ID="mileage" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="mileage" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.mileage}</SPAN>
</TD>
- <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell">
+ <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.vin}</SPAN>
</TD>
- <TD ID="stock" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="stock" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.stock}</SPAN>
</TD>
</TR>
<TR CLASS="dr-table-firstrow rich-table-firstrow">
- <TD ID="make" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="make" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.make}</SPAN>
</TD>
- <TD ID="model" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="model" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.model}</SPAN>
</TD>
- <TD ID="price" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="price" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.price}</SPAN>
</TD>
- <TD ID="mileage" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="mileage" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.mileage}</SPAN>
</TD>
- <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell">
+ <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.vin}</SPAN>
</TD>
- <TD ID="stock" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="stock" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.stock}</SPAN>
</TD>
</TR>
<TR CLASS="dr-table-firstrow rich-table-firstrow">
- <TD ID="make" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="make" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.make}</SPAN>
</TD>
- <TD ID="model" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="model" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.model}</SPAN>
</TD>
- <TD ID="price" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="price" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.price}</SPAN>
</TD>
- <TD ID="mileage" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="mileage" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.mileage}</SPAN>
</TD>
- <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell">
+ <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.vin}</SPAN>
</TD>
- <TD ID="stock" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="stock" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.stock}</SPAN>
</TD>
</TR>
<TR CLASS="dr-table-firstrow rich-table-firstrow">
- <TD ID="make" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="make" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.make}</SPAN>
</TD>
- <TD ID="model" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="model" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.model}</SPAN>
</TD>
- <TD ID="price" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="price" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.price}</SPAN>
</TD>
- <TD ID="mileage" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="mileage" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.mileage}</SPAN>
</TD>
- <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell">
+ <TD WIDTH="200" ID="vin" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.vin}</SPAN>
</TD>
- <TD ID="stock" CLASS="dr-table-cell rich-table-cell">
+ <TD ID="stock" CLASS="dr-table-cell rich-table-cell col">
<SPAN> #{category.stock}</SPAN>
</TD>
</TR>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-11-17 19:06:38 UTC (rev 11853)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-11-17 19:18:56 UTC (rev 11854)
@@ -102,6 +102,7 @@
public static final String VALUE_ALIGN_TOP = "top"; //$NON-NLS-1$
public static final String VALUE_ALIGN_RIGHT = "right"; //$NON-NLS-1$
public static final String VALUE_ALIGN_MIDDLE = "middle"; //$NON-NLS-1$
+ public static final String VALUE_CLASS_DELIMITER = " "; //$NON-NLS-1$
public static final String VALUE_TYPE_TEXT = "text"; //$NON-NLS-1$
public static final String VALUE_TYPE_PASSWORD = "password"; //$NON-NLS-1$
public static final String VALUE_TYPE_IMAGE = "image"; //$NON-NLS-1$
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2008-11-17 19:06:38 UTC (rev 11853)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2008-11-17 19:18:56 UTC (rev 11854)
@@ -12,7 +12,6 @@
import org.eclipse.swt.graphics.Point;
import org.mozilla.interfaces.nsIDOMEvent;
-import org.mozilla.interfaces.nsIDOMEventTarget;
import org.mozilla.interfaces.nsIDOMMouseEvent;
import org.mozilla.interfaces.nsIDOMNSRange;
import org.mozilla.interfaces.nsIDOMNSUIEvent;
@@ -102,4 +101,24 @@
return inRange;
}
+ /**
+ * Appends all children of the {@code node} to its parent at the point before the {@code node}
+ * and removes the {@code node} from the list of its parent's children.
+ *
+ * @param node should be not null
+ */
+ public static void replaceNodeByItsChildren(nsIDOMNode node) {
+ final nsIDOMNodeList subTableContainerChildren = node.getChildNodes();
+ final nsIDOMNode containerParent = node.getParentNode();
+ if (subTableContainerChildren != null) {
+ final int length = (int) subTableContainerChildren.getLength();
+ for (int i = 0; i < length; i++) {
+ final nsIDOMNode child = subTableContainerChildren.item(i);
+ node.removeChild(child);
+ containerParent.insertBefore(child, node);
+ }
+ }
+ containerParent.removeChild(node);
+ }
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeClassUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeClassUtil.java 2008-11-17 19:06:38 UTC (rev 11853)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeClassUtil.java 2008-11-17 19:18:56 UTC (rev 11854)
@@ -23,9 +23,6 @@
*
*/
public class VpeClassUtil {
- /**
- *
- */
private static final String CLASSES_DELIMITER = ","; //$NON-NLS-1$
/**
17 years, 5 months