JBoss Tools SVN: r3091 - in trunk/hibernatetools/plugins: org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-08-13 10:29:07 -0400 (Mon, 13 Aug 2007)
New Revision: 3091
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/HibernateUtils.java
Log:
JBIDE-700: Hibernate diagram fails on simplest mapping
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-08-13 14:25:04 UTC (rev 3090)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-08-13 14:29:07 UTC (rev 3091)
@@ -141,7 +141,7 @@
if (ormElement instanceof RootClass) {
ormShape = new OrmShape(ormElement);
getChildren().add(ormShape);
- elements.put(((RootClass)ormElement).getEntityName(), ormShape);
+ elements.put(HibernateUtils.getPersistentClassName(((RootClass)ormElement).getEntityName()), ormShape);
} else if (ormElement instanceof Table) {
ormShape = new OrmShape(ormElement);
getChildren().add(ormShape);
@@ -150,11 +150,11 @@
SpecialRootClass specialRootClass = new SpecialRootClass((Property)ormElement);
ormShape = new SpecialOrmShape(specialRootClass);
getChildren().add(ormShape);
- elements.put(specialRootClass.getEntityName(), ormShape);
+ elements.put(HibernateUtils.getPersistentClassName(specialRootClass.getEntityName()), ormShape);
} else if (ormElement instanceof Subclass) {
ormShape = new OrmShape(ormElement);
getChildren().add(ormShape);
- elements.put(((Subclass)ormElement).getEntityName(), ormShape);
+ elements.put(HibernateUtils.getPersistentClassName(((Subclass)ormElement).getEntityName()), ormShape);
}
return ormShape;
}
@@ -162,14 +162,14 @@
public OrmShape getShape(Object ormElement) {
OrmShape ormShape = null;
if (ormElement instanceof RootClass) {
- ormShape = elements.get(((RootClass)ormElement).getEntityName());
+ ormShape = elements.get(HibernateUtils.getPersistentClassName(((RootClass)ormElement).getEntityName()));
} else if (ormElement instanceof Table) {
ormShape = elements.get(HibernateUtils.getTableName((Table)ormElement));
} else if (ormElement instanceof Property) {
SpecialRootClass specialRootClass = new SpecialRootClass((Property)ormElement);
- ormShape = elements.get(specialRootClass.getEntityName());
+ ormShape = elements.get(HibernateUtils.getPersistentClassName(specialRootClass.getEntityName()));
} else if (ormElement instanceof Subclass) {
- ormShape = elements.get(((Subclass)ormElement).getEntityName());
+ ormShape = elements.get(HibernateUtils.getPersistentClassName(((Subclass)ormElement).getEntityName()));
}
return ormShape;
}
@@ -179,7 +179,7 @@
OrmShape classShape = null;
OrmShape shape = null;
if(persistentClass != null) {
- classShape = elements.get(persistentClass.getEntityName());
+ classShape = elements.get(HibernateUtils.getPersistentClassName(persistentClass.getEntityName()));
if (classShape == null) classShape = createShape(persistentClass);
if(componentClassDatabaseTable == null && persistentClass.getTable() != null)
componentClassDatabaseTable = persistentClass.getTable();
@@ -199,7 +199,7 @@
Object element = iter.next();
if (element instanceof Subclass) {
Subclass subclass = (Subclass)element;
- OrmShape subclassShape = elements.get(subclass.getEntityName());
+ OrmShape subclassShape = elements.get(HibernateUtils.getPersistentClassName(subclass.getEntityName()));
if (subclassShape == null) subclassShape = createShape(subclass);
if (((Subclass)element).isJoinedSubclass()) {
Table jcTable = ((Subclass)element).getTable();
@@ -290,7 +290,7 @@
RootClass cls = (RootClass)clazz;
Table table = cls.getTable();
if (tableName.equals(table.getName() + "." + table.getName())) {
- if (elements.get(cls.getEntityName()) == null)
+ if (elements.get(HibernateUtils.getPersistentClassName(cls.getEntityName())) == null)
getOrCreatePersistentClass(cls, null);
}
}
@@ -506,7 +506,7 @@
}
Shape parentShape = ((SpecialOrmShape)classShape).getParentShape();
if (parentShape != null) {
- OrmShape parentClassShape = (OrmShape)elements.get(((Property)parentShape.getOrmElement()).getPersistentClass().getEntityName());
+ OrmShape parentClassShape = (OrmShape)elements.get(HibernateUtils.getPersistentClassName(((Property)parentShape.getOrmElement()).getPersistentClass().getEntityName()));
if(!isConnectionExist(parentShape, parentClassShape)){
new Connection(parentShape, parentClassShape);
parentShape.firePropertyChange(REFRESH, null, null);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/HibernateUtils.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/HibernateUtils.java 2007-08-13 14:25:04 UTC (rev 3090)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/HibernateUtils.java 2007-08-13 14:29:07 UTC (rev 3091)
@@ -4,6 +4,8 @@
import org.hibernate.mapping.Column;
import org.hibernate.mapping.ForeignKey;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.Table;
public class HibernateUtils {
@@ -13,6 +15,13 @@
String schema = table.getSchema();
return (catalog != null ? catalog + "." : "") + (schema != null ? schema + "." : "") + table.getName();
}
+
+ public static String getPersistentClassName(String className) {
+ if (className.indexOf(".") < 0) {
+ return "default." + className;
+ }
+ return className;
+ }
public static boolean isPrimaryKey(Column column){
Table table = getTable(column);
18 years, 4 months
JBoss Tools SVN: r3090 - in trunk/documentation/GettingStartedGuide/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sabrashevich
Date: 2007-08-13 10:25:04 -0400 (Mon, 13 Aug 2007)
New Revision: 3090
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj01.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj02.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj03.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj04.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj05.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj06.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj07.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/consoleoutput.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-447 Re-take the screen-shots in this chapter
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj01.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj02.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj03.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj04.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj05.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj06.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj07.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/consoleoutput.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml 2007-08-13 14:24:07 UTC (rev 3089)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GetStartSeamGen.xml 2007-08-13 14:25:04 UTC (rev 3090)
@@ -7,21 +7,21 @@
<keyword>Seam</keyword>
<keyword>JBoss</keyword>
</keywordset>
- </chapterinfo>
-
- <title>Write Your First Web Application</title>
-
- <para>The Red Hat Developer Studio provides sophisticated tools for enterprise applications. With the Red Hat Developer Studio, you can get started very quickly with a web prototype, and then scale up your application to include enterprise features (e.g., business processes, web services, etc.) using the same developer tools. It is a "scalable" RAD (Rapid Application Development) tool.</para>
-
- <para>A core element that makes the Red Hat Developer Studio "scalable" is the JBoss Seam framework. Seam is a fully featured application framework on top of Java EE 5. It is also one of the most popular enterprise Java framework today. Seam deeply integrates many other standard-based or open source frameworks (e.g., JSF, EJB3, JMS, Web Services, jBPM, JBoss Rules, Ajax4jsf, RichFaces, Facelets, Spring, iText, Quartz, TestNG etc.), and provides a single programming model for developers to "drive" those underlying frameworks via simple annotated POJOs (Plain Old Java Objects). It makes life easier for developers to tackle complex enterprise applications with many component frameworks.</para>
-
- <para>In this chapter, we will cover how to build a simple Seam web application in minutes with the Red Hat Developer Studio.</para>
-
- <section>
- <title>Create a Seam Project</title>
-
- <para>To create a new web application in Seam, select "New > Project ... > Seam > Seam Project". You will be prompted to enter a name and a location directory for your new project. You will also be asked to choose a JBoss AS server to deploy the project. You must choose the JBoss AS 4.2.0 instance we had defined in the JBoss AS Server manager view.</para>
-
+ </chapterinfo>
+
+ <title>Write Your First Web Application</title>
+
+ <para>The Red Hat Developer Studio provides sophisticated tools for enterprise applications. With the Red Hat Developer Studio, you can get started very quickly with a web prototype, and then scale up your application to include enterprise features (e.g., business processes, web services, etc.) using the same developer tools. It is a "scalable" RAD (Rapid Application Development) tool.</para>
+
+ <para>A core element that makes the Red Hat Developer Studio "scalable" is the JBoss Seam framework. Seam is a fully featured application framework on top of Java EE 5. It is also one of the most popular enterprise Java framework today. Seam deeply integrates many other standard-based or open source frameworks (e.g., JSF, EJB3, JMS, Web Services, jBPM, JBoss Rules, Ajax4jsf, RichFaces, Facelets, Spring, iText, Quartz, TestNG etc.), and provides a single programming model for developers to "drive" those underlying frameworks via simple annotated POJOs (Plain Old Java Objects). It makes life easier for developers to tackle complex enterprise applications with many component frameworks.</para>
+
+ <para>In this chapter, we will cover how to build a simple Seam web application in minutes with the Red Hat Developer Studio.</para>
+
+ <section>
+ <title>Create a Seam Project</title>
+
+ <para>To create a new web application in Seam, select "New > Project ... > Seam > Seam Web Project". You will be prompted to enter a name and a location directory for your new project. You will also be asked to choose a JBoss AS server to deploy the project. You must choose the JBoss AS 4.2.0 instance we had defined in the JBoss AS Server manager view.</para>
+
<figure>
<title>Create a Seam project</title>
<mediaobject>
@@ -29,10 +29,10 @@
<imagedata fileref="images/SeamNewProj01.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>Next, you will be asked to select the "features" you want to use in your project. This allows Red Hat Developer Studio to setup the appropriate tooling for your project. Since JBoss Seam integrates all popular Java EE frameworks, you can select any combination of technologies from the list. Here, for this project, we will select Dynamic Web Module, Java, Java Persistence (JPA), JavaServer Faces (JSF), and Seam Facet for a typical database-driven web application.</para>
-
+ </figure>
+
+ <para>Next, you will be asked to select the "features" you want to use in your project. This allows Red Hat Developer Studio to setup the appropriate tooling for your project. Since JBoss Seam integrates all popular Java EE frameworks, you can select any combination of technologies from the list. Here, for this project, we will select Dynamic Web Module, Java, Java Persistence (JPA), JavaServer Faces (JSF), and Seam Facet for a typical database-driven web application.</para>
+
<figure>
<title>Select toolings for the project</title>
<mediaobject>
@@ -40,10 +40,10 @@
<imagedata fileref="images/SeamNewProj02.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>A dynamic web application contains both web pages and Java code. The wizard will ask you where you want to put those files. You can just leave the default values.</para>
-
+ </figure>
+
+ <para>A dynamic web application contains both web pages and Java code. The wizard will ask you where you want to put those files. You can just leave the default values.</para>
+
<figure>
<title>Select directory names for web pages and Java files</title>
<mediaobject>
@@ -51,12 +51,12 @@
<imagedata fileref="images/SeamNewProj03.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>Since you selected JPA and JSF tooling support, the project needs to incorporate the JAR files for those frameworks on its classpath. In the next two screens, you will be able to select where those library JARs come from. The easiest is just to select the JARs provided by the JBoss AS runtime associated with this project. That is why it is important to chose the right JBoss AS 4.2 runtime in the project setup window.</para>
-
- <para>Ignore the database selection for now since we do not use an external database in this simple application. We can still use the embedded HSQL DB inside JBoss AS for development / testing purposes, as we will see soon.</para>
-
+ </figure>
+
+ <para>Since you selected JPA and JSF tooling support, the project needs to incorporate the JAR files for those frameworks on its classpath. In the next two screens, you will be able to select where those library JARs come from. The easiest is just to select the JARs provided by the JBoss AS runtime associated with this project. That is why it is important to chose the right JBoss AS 4.2 runtime in the project setup window.</para>
+
+ <para>Ignore the database selection for now since we do not use an external database in this simple application. We can still use the embedded HSQL DB inside JBoss AS for development / testing purposes, as we will see soon.</para>
+
<figure>
<title>Select provider for JPA JARs</title>
<mediaobject>
@@ -64,8 +64,8 @@
<imagedata fileref="images/SeamNewProj04.png"/>
</imageobject>
</mediaobject>
- </figure>
-
+ </figure>
+
<figure>
<title>Select provider for JSF JARs</title>
<mediaobject>
@@ -73,10 +73,10 @@
<imagedata fileref="images/SeamNewProj05.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>The project setup wizard also asks you to configure how Seam generates code for the project. The Seam Home Folder should point to a valid Seam distribution. By default, it is set to the Seam distribution bundled in your Red Hat Developer Studio tool. For the deployment format, choose WAR deployment if you want to use POJOs for UI event handling and business logic; choose EAR deployment if you want to EJB3 beans for added features. In most web applications, the WAR deployment option would suffice. You should also enter Java packages for the entity beans (for database mapping) and session beans (for action handlers). All generated code will be placed in those packages. </para>
-
+ </figure>
+
+ <para>The project setup wizard also asks you to configure how Seam generates code for the project. The Seam Home Folder should point to a valid Seam distribution. By default, it is set to the Seam distribution bundled in your Red Hat Developer Studio tool. For the deployment format, choose WAR deployment if you want to use POJOs for UI event handling and business logic; choose EAR deployment if you want to EJB3 beans for added features. In most web applications, the WAR deployment option would suffice. You should also enter Java packages for the entity beans (for database mapping) and session beans (for action handlers). All generated code will be placed in those packages. </para>
+
<figure>
<title>Enter Java packages for generated code</title>
<mediaobject>
@@ -84,10 +84,10 @@
<imagedata fileref="images/SeamNewProj06.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>Click on Finish to generate the application. The generated project contains all the necessary library JARs, XML configuration files, the ANT build script, as well as simple XHTML web pages and Java classes for the skeleton web application.</para>
-
+ </figure>
+
+ <para>Click on Finish to generate the application. The generated project contains all the necessary library JARs, XML configuration files, the ANT build script, as well as simple XHTML web pages and Java classes for the skeleton web application.</para>
+
<figure>
<title>The generated Seam web application</title>
<mediaobject>
@@ -95,15 +95,15 @@
<imagedata fileref="images/SeamNewProj07.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- </section>
-
- <section>
- <title>Build and Deploy the Seam Application</title>
-
- <para>Once the application is generated, you can use the "Run on server" menu to build and deploy it into the JBoss AS runtime associated with the project. All you need is to start JBoss AS in the server manager, and load the browser at URL http://127.0.0.1:8080/MySeamProj/. You should see the following web page.</para>
-
+ </figure>
+
+ </section>
+
+ <section>
+ <title>Build and Deploy the Seam Application</title>
+
+ <para>Once the application is generated, you can use the "Run on server" menu to build and deploy it into the JBoss AS runtime associated with the project. All you need is to start JBoss AS in the server manager, and load the browser at URL http://127.0.0.1:8080/MySeamProj/. You should see the following web page.</para>
+
<figure>
<title>The generated application in action</title>
<mediaobject>
@@ -111,10 +111,10 @@
<imagedata fileref="images/xxxx.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>To make simple changes to the page, you just need to double click on the view/index.xhtml file and edit it in the visual editor. Notice that the visual editor lets you both the XHTML code and the rendered page. The rendered view is designed to make it easy to find stuff in a complex XHTML page.</para>
-
+ </figure>
+
+ <para>To make simple changes to the page, you just need to double click on the view/index.xhtml file and edit it in the visual editor. Notice that the visual editor lets you both the XHTML code and the rendered page. The rendered view is designed to make it easy to find stuff in a complex XHTML page.</para>
+
<figure>
<title>Making changes in the visual editor</title>
<mediaobject>
@@ -122,10 +122,10 @@
<imagedata fileref="images/SeamJsfEditor.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>Once you finished editing, save the file (File > Save), re-deploy the application, and reload the browser to see the changes.</para>
-
+ </figure>
+
+ <para>Once you finished editing, save the file (File > Save), re-deploy the application, and reload the browser to see the changes.</para>
+
<figure>
<title>The front page is changed</title>
<mediaobject>
@@ -133,19 +133,19 @@
<imagedata fileref="images/xxxx.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <!-- Not yet ...
- <para>Notice that we do not need to re-build and re-deploy the application. Just save the edited page and reload the browser.</para>
- -->
-
- </section>
-
- <section>
- <title>Add a Web Page and an Action</title>
-
- <para>To add a new page and related UI action to the project, use the "New > Other ... > Seam > Seam Form" wizard. You are prompted to enter the name of the web page, the name for the Seam component that handles UI actions from the page, and UI action method name.</para>
-
+ </figure>
+
+ <!-- Not yet ...
+ <para>Notice that we do not need to re-build and re-deploy the application. Just save the edited page and reload the browser.</para>
+ -->
+
+ </section>
+
+ <section>
+ <title>Add a Web Page and an Action</title>
+
+ <para>To add a new page and related UI action to the project, use the "New > Other ... > Seam > Seam Form" wizard. You are prompted to enter the name of the web page, the name for the Seam component that handles UI actions from the page, and UI action method name.</para>
+
<figure>
<title>New form for the application</title>
<mediaobject>
@@ -153,99 +153,99 @@
<imagedata fileref="images/xxxx.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>The wizard generate a web page with a single text input field and an action button. Notice that the generated page uses layout/template.xhtml as a template. The template page provides the page header, footer, side menu, and CSS styles (see the template.xhtml for more details). The Simplepage.xhtml is assembled into the template when the Simplepage.seam URL is loaded.</para>
-
- <programlisting role="JSP"><![CDATA[
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- template="layout/template.xhtml">
-
-<ui:define name="body">
-
- <h1>Simplepage</h1>
- <p>Generated form page</p>
-
- <h:messages globalOnly="true" styleClass="message"/>
-
- <h:form id="simpleAction">
- <div class="dialog">
- <s:validateAll>
- <div class="prop">
- <span class="name">Value</span>
- <span class="value">
- <s:decorate>
- <h:inputText id="value" required="true"
- value="#{simpleAction.value}"/>
- </s:decorate>
- </span>
- </div>
- </s:validateAll>
- </div>
- <div class="actionButtons">
- <h:commandButton id="hello" value="hello"
- action="#{simpleAction.hello}"/>
- </div>
- </h:form>
-
-</ui:define>
-
+ </figure>
+
+ <para>The wizard generate a web page with a single text input field and an action button. Notice that the generated page uses layout/template.xhtml as a template. The template page provides the page header, footer, side menu, and CSS styles (see the template.xhtml for more details). The Simplepage.xhtml is assembled into the template when the Simplepage.seam URL is loaded.</para>
+
+ <programlisting role="JSP"><![CDATA[
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h1>Simplepage</h1>
+ <p>Generated form page</p>
+
+ <h:messages globalOnly="true" styleClass="message"/>
+
+ <h:form id="simpleAction">
+ <div class="dialog">
+ <s:validateAll>
+ <div class="prop">
+ <span class="name">Value</span>
+ <span class="value">
+ <s:decorate>
+ <h:inputText id="value" required="true"
+ value="#{simpleAction.value}"/>
+ </s:decorate>
+ </span>
+ </div>
+ </s:validateAll>
+ </div>
+ <div class="actionButtons">
+ <h:commandButton id="hello" value="hello"
+ action="#{simpleAction.hello}"/>
+ </div>
+ </h:form>
+
+</ui:define>
+
</ui:composition>
-]]></programlisting>
-
- <para>The #{simpleAction.value} notation on the web page maps to the "value" property in the backend component named "simpleAction", and the #{simpleAction.hello} notation indicates that the hello() method is called when the button is clicked on. Here is the "simpleAction" named backend Seam component generated by the wizard.</para>
-
- <programlisting role="JAVA"><![CDATA[
-@Name("simpleAction")
-public class SimpleAction {
-
- @Logger private Log log;
-
- @In
- FacesMessages facesMessages;
-
- private String value;
-
- //seam-gen method
- public String hello()
- {
- //implement your business logic here
- log.info("simpleAction.echo() action called with: #{simpleAction.value}");
- facesMessages.add("echo #{simpleAction.value}");
- return "success";
- }
-
- //add additional action methods
-
- @Length(max=10)
- public String getValue()
- {
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
+]]></programlisting>
+
+ <para>The #{simpleAction.value} notation on the web page maps to the "value" property in the backend component named "simpleAction", and the #{simpleAction.hello} notation indicates that the hello() method is called when the button is clicked on. Here is the "simpleAction" named backend Seam component generated by the wizard.</para>
+
+ <programlisting role="JAVA"><![CDATA[
+@Name("simpleAction")
+public class SimpleAction {
+
+ @Logger private Log log;
+
+ @In
+ FacesMessages facesMessages;
+
+ private String value;
+
+ //seam-gen method
+ public String hello()
+ {
+ //implement your business logic here
+ log.info("simpleAction.echo() action called with: #{simpleAction.value}");
+ facesMessages.add("echo #{simpleAction.value}");
+ return "success";
+ }
+
+ //add additional action methods
+
+ @Length(max=10)
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
}
-]]></programlisting>
-
- <para>Load the Simplepage.seam in the web browser. Type something in the text field and click on the "hello" button. A JSF message containing the input string is created by the SimpleAction.hello() method. The message is displayed on the page via the h:messages tag.</para>
-
- </section>
-
- <section>
- <title>Input Validation</title>
-
- <para>Notice that in the generated SimpleAction class, there is a @Length annotation to validate the input when the input string is bound to #{simpleAction.value}. To see how this works, enter a text string longer than 10 chars and click on the button. This is what you should see.</para>
-
+]]></programlisting>
+
+ <para>Load the Simplepage.seam in the web browser. Type something in the text field and click on the "hello" button. A JSF message containing the input string is created by the SimpleAction.hello() method. The message is displayed on the page via the h:messages tag.</para>
+
+ </section>
+
+ <section>
+ <title>Input Validation</title>
+
+ <para>Notice that in the generated SimpleAction class, there is a @Length annotation to validate the input when the input string is bound to #{simpleAction.value}. To see how this works, enter a text string longer than 10 chars and click on the button. This is what you should see.</para>
+
<figure>
<title>The input validation in action</title>
<mediaobject>
@@ -253,22 +253,22 @@
<imagedata fileref="images/xxxx.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>Seam supports many different input validation annotations. To see an example, you can replace the @Length(max=10) annotation with the following. It would require the input string to have a first name and last name separated by a space. If the validation fails, the web page would print the customized error message.</para>
-
- <programlisting role="JAVA"><![CDATA[
-@NotNull
-@Pattern(regex="^[a-zA-Z.-]+ [a-zA-Z.-]+",
- message="Need a firstname and a lastname")
-public String getValue()
-{
- return value;
+ </figure>
+
+ <para>Seam supports many different input validation annotations. To see an example, you can replace the @Length(max=10) annotation with the following. It would require the input string to have a first name and last name separated by a space. If the validation fails, the web page would print the customized error message.</para>
+
+ <programlisting role="JAVA"><![CDATA[
+@NotNull
+@Pattern(regex="^[a-zA-Z.-]+ [a-zA-Z.-]+",
+ message="Need a firstname and a lastname")
+public String getValue()
+{
+ return value;
}
-]]></programlisting>
-
- <para>Save the Java file, deploy the application, and reload the browser to see the new validation scheme in action.</para>
-
+]]></programlisting>
+
+ <para>Save the Java file, deploy the application, and reload the browser to see the new validation scheme in action.</para>
+
<figure>
<title>More input validation</title>
<mediaobject>
@@ -276,51 +276,51 @@
<imagedata fileref="images/xxxx.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- </section>
-
- <section>
- <title>Add a new UI Component</title>
-
- <para>Now, let's add a little more logic to the application. We will add a new boolean property to the action component. If it is set to true, the action would capitalize the input string and display it on the web page. The following code in the SimpleAction class implements the logic.</para>
-
- <programlisting role="JAVA"><![CDATA[
-@Name("simpleAction")
-public class SimpleAction {
-
- private boolean convertToCap;
-
- public boolean getConvertToCap () { return convertToCap; }
- public void setConvertToCap (boolean b) { convertToCap = b; }
-
- public String hello()
- {
- if (convertToCap) {
- value = value.toUpperCase ();
- }
- return null;
- }
- ... ...
+ </figure>
+
+ </section>
+
+ <section>
+ <title>Add a new UI Component</title>
+
+ <para>Now, let's add a little more logic to the application. We will add a new boolean property to the action component. If it is set to true, the action would capitalize the input string and display it on the web page. The following code in the SimpleAction class implements the logic.</para>
+
+ <programlisting role="JAVA"><![CDATA[
+@Name("simpleAction")
+public class SimpleAction {
+
+ private boolean convertToCap;
+
+ public boolean getConvertToCap () { return convertToCap; }
+ public void setConvertToCap (boolean b) { convertToCap = b; }
+
+ public String hello()
+ {
+ if (convertToCap) {
+ value = value.toUpperCase ();
+ }
+ return null;
+ }
+ ... ...
}
-]]></programlisting>
-
- <para>Next, on the web page, add the following line to display the value property on the simpleAction component. Notice that code completion is supported for the JSF EL expression.</para>
-
- <programlisting role="JSP"><![CDATA[
+]]></programlisting>
+
+ <para>Next, on the web page, add the following line to display the value property on the simpleAction component. Notice that code completion is supported for the JSF EL expression.</para>
+
+ <programlisting role="JSP"><![CDATA[
<p><b>Hello, #{simpleAction.value}</b></p>
-]]></programlisting>
-
- <para>Finally, on the web page, we add a boolean selection box component. It is bound to the XXXX property on the backend component.</para>
-
- <programlisting role="JSP"><![CDATA[
-<h:selectBooleanCheckbox title="convertToCap"
- value="#{simpleAction.convertToCap}" />
+]]></programlisting>
+
+ <para>Finally, on the web page, we add a boolean selection box component. It is bound to the XXXX property on the backend component.</para>
+
+ <programlisting role="JSP"><![CDATA[
+<h:selectBooleanCheckbox title="convertToCap"
+ value="#{simpleAction.convertToCap}" />
Capitalize the input?
-]]></programlisting>
-
- <para>Deploy the application and see it in action now.</para>
-
+]]></programlisting>
+
+ <para>Deploy the application and see it in action now.</para>
+
<figure>
<title>Add UI components and business logic</title>
<mediaobject>
@@ -328,25 +328,25 @@
<imagedata fileref="images/xxxx.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- </section>
-
- <section>
- <title>Add Security to the Application</title>
-
- <para>You have probably noticed that the web page template has a login link at the top of the page. You can use the Seam security framework to secure access to any web page or web action. You can implement the login logic in the XXXX method. In the following example, we just use hardcoded username and password. But you can easily change it to use database, LDAP or any other means.</para>
-
+ </figure>
+
+ </section>
+
+ <section>
+ <title>Add Security to the Application</title>
+
+ <para>You have probably noticed that the web page template has a login link at the top of the page. You can use the Seam security framework to secure access to any web page or web action. You can implement the login logic in the XXXX method. In the following example, we just use hardcoded username and password. But you can easily change it to use database, LDAP or any other means.</para>
+
<programlisting role="JAVA"><![CDATA[
-]]></programlisting>
-
- <para>Then, on the action method, you can use the XXXX annotation to specify that it is only invoked by authenticated users.</para>
-
+]]></programlisting>
+
+ <para>Then, on the action method, you can use the XXXX annotation to specify that it is only invoked by authenticated users.</para>
+
<programlisting role="JAVA"><![CDATA[
-]]></programlisting>
-
- <para>Now, re-deploy the application and try the XXXX button. The application redirects to the XXXX page asking for login credentials. The method is invoked after you successfully logged in.</para>
-
+]]></programlisting>
+
+ <para>Now, re-deploy the application and try the XXXX button. The application redirects to the XXXX page asking for login credentials. The method is invoked after you successfully logged in.</para>
+
<figure>
<title>Access control for action methods</title>
<mediaobject>
@@ -354,18 +354,18 @@
<imagedata fileref="images/xxxx.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>We can also secure web pages. You can edit the XXXX file to put an access constraint on the XXXXX page.</para>
-
+ </figure>
+
+ <para>We can also secure web pages. You can edit the XXXX file to put an access constraint on the XXXXX page.</para>
+
<programlisting role="JSP"><![CDATA[
-]]></programlisting>
-
- <para>You can try to load the XXXX URL in the browser and it will redirect to ask for login.</para>
-
- </section>
-
+]]></programlisting>
+ <para>You can try to load the XXXX URL in the browser and it will redirect to ask for login.</para>
+
+ </section>
+
+
<section id="OtherRelevantResourcesOnTheTopic2">
<?dbhtml filename="OtherRelevantResourcesOnTheTopic2.html"?>
<title>Other relevant resources on the topic</title>
18 years, 4 months
JBoss Tools SVN: r3089 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/capabilities.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-13 10:24:07 -0400 (Mon, 13 Aug 2007)
New Revision: 3089
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/capabilities/AddCapabilitiesScreenOne.java
Log:
EXIN-256
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/capabilities/AddCapabilitiesScreenOne.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/capabilities/AddCapabilitiesScreenOne.java 2007-08-13 14:22:09 UTC (rev 3088)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/wizard/capabilities/AddCapabilitiesScreenOne.java 2007-08-13 14:24:07 UTC (rev 3089)
@@ -60,7 +60,11 @@
if(w == null || !w.isEnabled()) return;
w.setSelected(!w.isSelected());
treeViewer.refresh(w);
- }
+ }
+ public boolean isSelected(Object data) {
+ IPerformerItem w = (IPerformerItem)data;
+ return w != null && w.isSelected();
+ }
}
}
18 years, 4 months
JBoss Tools SVN: r3088 - in trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules: wizard/config and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-13 10:22:09 -0400 (Mon, 13 Aug 2007)
New Revision: 3088
Modified:
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/preferences/RulesConfigurationPage.java
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/config/ConfigRulesProvider.java
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/config/VRulesConfigurationWizardView.java
Log:
EXIN-256
Modified: trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/preferences/RulesConfigurationPage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/preferences/RulesConfigurationPage.java 2007-08-13 14:19:47 UTC (rev 3087)
+++ trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/preferences/RulesConfigurationPage.java 2007-08-13 14:22:09 UTC (rev 3088)
@@ -47,16 +47,17 @@
Control sc = significance.createControl(composite);
sc.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- treeViewer = new TreeViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ treeViewer = new TreeViewer(composite, SWT.CHECK | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
treeViewer.setContentProvider(provider);
treeViewer.setLabelProvider(provider);
treeViewer.setInput(this);
Control tc = treeViewer.getControl();
tc.setLayoutData(new GridData(GridData.FILL_BOTH));
- new TreeItemSelectionManager(treeViewer, new Flipper());
+ TreeItemSelectionManager m = new TreeItemSelectionManager(treeViewer, new Flipper());
significance.update();
tip.install(treeViewer.getTree());
treeViewer.expandToLevel(2);
+ m.update();
return composite;
}
@@ -100,6 +101,10 @@
w.flip();
treeViewer.refresh(w);
}
+ public boolean isSelected(Object data) {
+ ConfigItemWrapper w = (ConfigItemWrapper)data;
+ return w != null && w.isSelected();
+ }
}
public boolean performCancel() {
Modified: trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/config/ConfigRulesProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/config/ConfigRulesProvider.java 2007-08-13 14:19:47 UTC (rev 3087)
+++ trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/config/ConfigRulesProvider.java 2007-08-13 14:22:09 UTC (rev 3088)
@@ -49,11 +49,14 @@
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ /**
+ * Tree style SWT.CHECK is used instead.
public Image getImage(Object element) {
if(!(element instanceof ConfigItemWrapper)) return null;
ConfigItemWrapper w = (ConfigItemWrapper)element;
return (w.isSelected() && w.isEnabled()) ? IMAGE_ENABLED : IMAGE_DISABLED;
}
+ */
public Color getForeground(Object element) {
if(!(element instanceof ConfigItemWrapper)) return null;
Modified: trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/config/VRulesConfigurationWizardView.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/config/VRulesConfigurationWizardView.java 2007-08-13 14:19:47 UTC (rev 3087)
+++ trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/config/VRulesConfigurationWizardView.java 2007-08-13 14:22:09 UTC (rev 3088)
@@ -55,16 +55,17 @@
Control sc = significance.createControl(composite);
sc.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- treeViewer = new TreeViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ treeViewer = new TreeViewer(composite, SWT.CHECK | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
treeViewer.setContentProvider(provider);
treeViewer.setLabelProvider(provider);
treeViewer.setInput(this);
Control tc = treeViewer.getControl();
tc.setLayoutData(new GridData(GridData.FILL_BOTH));
- new TreeItemSelectionManager(treeViewer, new Flipper());
+ TreeItemSelectionManager m = new TreeItemSelectionManager(treeViewer, new Flipper());
significance.update();
tip.install(treeViewer.getTree());
treeViewer.expandToLevel(2);
+ m.update();
return composite;
}
@@ -134,5 +135,9 @@
w.flip();
treeViewer.refresh(w);
}
+ public boolean isSelected(Object data) {
+ ConfigItemWrapper w = (ConfigItemWrapper)data;
+ return w.isSelected();
+ }
}
}
18 years, 4 months
JBoss Tools SVN: r3087 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui: attribute/editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-13 10:19:47 -0400 (Mon, 13 Aug 2007)
New Revision: 3087
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckListAdapter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckTreeAdapter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckListFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckTreeFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/AbstractTreeWizardView.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/TreeItemSelectionManager.java
Log:
EXIN-256
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckListAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckListAdapter.java 2007-08-13 12:44:41 UTC (rev 3086)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckListAdapter.java 2007-08-13 14:19:47 UTC (rev 3087)
@@ -95,6 +95,8 @@
}
class STCPTreeLabelProvider extends LabelProvider {
+ /**
+ * Tree style SWT.CHECK is used instead.
public Image getImage(Object element) {
String s = getStringValue(true);
StringTokenizer st = new StringTokenizer(s, ";,");
@@ -103,6 +105,7 @@
}
return IMAGE_DISABLED;
}
+ */
}
class STCPSpecialHelperSupportHandler implements ITreeContentProvider {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckTreeAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckTreeAdapter.java 2007-08-13 12:44:41 UTC (rev 3086)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/CheckTreeAdapter.java 2007-08-13 14:19:47 UTC (rev 3087)
@@ -75,6 +75,7 @@
}
public int getState(Object element) {
+ if(element == null) return 0;
return ((CheckItem)element).getState();
}
@@ -207,6 +208,7 @@
}
public int getState(Object element) {
+ if(element == null) return state;
if (this.tree!=null) return tree.getState(element);
return ICheckable.STATE_UNCHECK;
}
@@ -394,6 +396,8 @@
}
protected class CheckLabelProvider extends LabelProvider {
+ /**
+ * Tree style SWT.CHECK is used instead.
public Image getImage(Object element) {
if (((CheckItem)element).getState() == ICheckable.STATE_UNCHECK) {
return IMAGE_UNCHECK;
@@ -403,6 +407,7 @@
return IMAGE_HALFCHECK;
}
}
+ */
public String getText(Object element) {
return ((CheckItem)element).getName();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckListFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckListFieldEditor.java 2007-08-13 12:44:41 UTC (rev 3086)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckListFieldEditor.java 2007-08-13 14:19:47 UTC (rev 3087)
@@ -22,9 +22,11 @@
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
@@ -86,10 +88,11 @@
private Control getListControl(Composite parent) {
if(viewer != null && !viewer.getControl().isDisposed()) return viewer.getControl();
- viewer = new TreeViewer(parent);
+ viewer = new TreeViewer(parent, SWT.CHECK);
viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(labelProvider);
viewer.setInput(contentProvider);
+
new TreeItemSelectionManager(viewer, new Flipper());
return viewer.getControl();
}
@@ -129,6 +132,7 @@
init();
}
+ int lock = 0;
public void propertyChange(PropertyChangeEvent event) {
valueProvider.removeValueChangeListener(this);
if (IPropertyEditor.VALUE.equals(event.getPropertyName())) {
@@ -137,6 +141,23 @@
try {
if(!s.equals(stringValue)) {
stringValue = s;
+ if(lock == 0) {
+ lock++;
+ Tree tree = viewer.getTree();
+ TreeItem[] is = tree.getItems();
+ for (int i = 0; i < is.length; i++) {
+ Object d = is[i].getData();
+ StringTokenizer values = new StringTokenizer(stringValue, ";,");
+ while(values.hasMoreTokens()) {
+ String n = values.nextToken();
+ if(n.equals(d)) {
+ is[i].setChecked(true);
+ }
+ }
+ }
+ lock--;
+ }
+
viewer.refresh();
}
} catch (Exception e) {
@@ -175,7 +196,19 @@
class Flipper implements TreeItemSelectionManager.Listener {
public void flip(TreeItem item) {
+ if(lock > 0) return;
+ lock++;
flip0(item);
+ lock--;
+ }
+
+ public boolean isSelected(Object data) {
+ StringTokenizer values = new StringTokenizer(valueProvider.getStringValue(true), ";,");
+ while (values.hasMoreTokens()) {
+ String n = values.nextToken();
+ if(data != null && data.equals(n)) return true;
+ }
+ return false;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckTreeFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckTreeFieldEditor.java 2007-08-13 12:44:41 UTC (rev 3086)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckTreeFieldEditor.java 2007-08-13 14:19:47 UTC (rev 3087)
@@ -28,6 +28,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.TreeItem;
+import org.jboss.tools.common.model.ui.attribute.adapter.CheckTreeAdapter;
import org.jboss.tools.common.model.ui.viewers.xpl.ICheckable;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
@@ -161,6 +162,13 @@
}
viewer.refresh();
}
+ public boolean isSelected(Object data) {
+ if(data instanceof ICheckable) {
+ ICheckable o = (ICheckable)data;
+ return o.getState(null) != 0;
+ }
+ return false;
+ }
}
protected void valueChanged(String newValue) {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/AbstractTreeWizardView.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/AbstractTreeWizardView.java 2007-08-13 12:44:41 UTC (rev 3086)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/AbstractTreeWizardView.java 2007-08-13 14:19:47 UTC (rev 3087)
@@ -93,12 +93,16 @@
GridData gd = new GridData(GridData.FILL_BOTH);
composite.setLayoutData(gd);
- treeViewer = new TreeViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ treeViewer = new TreeViewer(composite, SWT.CHECK | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
treeViewer.setContentProvider(provider);
treeViewer.setLabelProvider(provider);
treeViewer.setInput(this);
+
+ Object[] os = provider.getChildren(this);
+
Control tc = treeViewer.getControl();
tc.setLayoutData(new GridData(GridData.FILL_BOTH));
+ initTree();
new TreeItemSelectionManager(treeViewer, new Flipper());
treeViewer.expandToLevel(expandingLevel);
Control bc = allBar.createControl(composite);
@@ -106,6 +110,18 @@
return composite;
}
+ private void initTree() {
+ Tree tree = treeViewer.getTree();
+ TreeItem[] is = tree.getItems();
+ for (int i = 0; i < is.length; i++) {
+ Object d = is[i].getData();
+ if(d instanceof CheckObject) {
+ CheckObject o = (CheckObject)d;
+ is[i].setChecked(!o.isDisabled());
+ }
+ }
+ }
+
public void action(String command) {
if(CANCEL.equals(command) ||
OK.equals(command) ||
@@ -146,6 +162,14 @@
CheckObject w = (CheckObject)item.getData();
w.flip();
treeViewer.refresh(w);
+ }
+
+ public boolean isSelected(Object data) {
+ if(data instanceof CheckObject) {
+ CheckObject o = (CheckObject)data;
+ return !o.isDisabled();
+ }
+ return false;
}
}
@@ -248,11 +272,14 @@
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ /**
+ * Tree style SWT.CHECK is used instead.
public Image getImage(Object element) {
if(!(element instanceof CheckObject)) return null;
CheckObject w = (CheckObject)element;
return (!w.isDisabled()) ? IMAGE_ENABLED : IMAGE_DISABLED;
}
+ */
public Color getForeground(Object element) {
if(!(element instanceof CheckObject)) return null;
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/TreeItemSelectionManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/TreeItemSelectionManager.java 2007-08-13 12:44:41 UTC (rev 3086)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/list/TreeItemSelectionManager.java 2007-08-13 14:19:47 UTC (rev 3087)
@@ -16,6 +16,10 @@
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TreeEvent;
+import org.eclipse.swt.events.TreeListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.TreeItem;
@@ -23,6 +27,7 @@
public class TreeItemSelectionManager {
public interface Listener {
public void flip(TreeItem item);
+ public boolean isSelected(Object data);
}
TreeViewer treeViewer = null;
@@ -31,39 +36,71 @@
public TreeItemSelectionManager(TreeViewer treeViewer, Listener listener) {
this.listener = listener;
this.treeViewer = treeViewer;
- SL sl = new SL();
- treeViewer.getTree().addMouseListener(sl);
- treeViewer.getTree().addMouseMoveListener(sl);
+ update();
treeViewer.getTree().addKeyListener(new KL());
+ treeViewer.getTree().addSelectionListener(new SL());
+ treeViewer.getTree().addTreeListener(new EL());
}
- class SL extends MouseAdapter implements MouseMoveListener {
- TreeItem item = null;
- boolean out = false;
- public void mouseDown(MouseEvent e) {
- item = getItem(e);
- out = false;
+ int lock = 0;
+ class EL implements TreeListener {
+
+ public void treeCollapsed(TreeEvent e) {
}
- public void mouseUp(MouseEvent e) {
- if(item != null && item == getItem(e) && !out) {
- listener.flip(item);
+
+ public void treeExpanded(TreeEvent e) {
+ if(e.item instanceof TreeItem) {
+ TreeItem item = (TreeItem)e.item;
+ TreeItem[] is = item.getItems();
+ update(is);
+ }
+ }
+ }
+
+ public void update() {
+ update(treeViewer.getTree().getItems());
+ }
+
+ void update(TreeItem[] is) {
+ lock++;
+ try {
+ for (int i = 0; i < is.length; i++) {
+ Object d = is[i].getData();
+ is[i].setChecked(listener.isSelected(is[i].getData()));
+ update(is[i].getItems());
}
- item = null;
+ } finally {
+ lock--;
}
- public void mouseMove(MouseEvent e) {
- if(item == null) return;
- out = (item != getItem(e));
+ }
+
+ class SL implements SelectionListener {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
}
- private TreeItem getItem(MouseEvent e) {
- if(e.button != 1) return null;
- TreeItem item = treeViewer.getTree().getItem(new Point(e.x, e.y));
- if(item == null) return null;
- Rectangle r = item.getBounds();
- if(e.x < r.x - 20 || e.x > r.x) return null;
- return item;
+
+ public void widgetSelected(SelectionEvent e) {
+ if(e.item instanceof TreeItem) {
+ if(lock > 0) return;
+ lock++;
+ try {
+ TreeItem item = (TreeItem)e.item;
+ if(listener.isSelected(item.getData()) != item.getChecked()) {
+ listener.flip(item);
+ }
+ if(listener.isSelected(item.getData()) != item.getChecked()) {
+ item.setChecked(listener.isSelected(item.getData()));
+ }
+ } finally {
+ lock--;
+ }
+ }
+
}
+
}
-
+
class KL extends KeyAdapter {
public void keyPressed(KeyEvent e) {
boolean flip = e.keyCode == (int)' ';
18 years, 4 months
JBoss Tools SVN: r3086 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-08-13 08:44:41 -0400 (Mon, 13 Aug 2007)
New Revision: 3086
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy/hibernate-eclipse-news-3.2.0.beta10.html
Log:
new and noteworthy for hibernate
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy/hibernate-eclipse-news-3.2.0.beta10.html
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy/hibernate-eclipse-news-3.2.0.beta10.html (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/doc/newandnoteworthy/hibernate-eclipse-news-3.2.0.beta10.html 2007-08-13 12:44:41 UTC (rev 3086)
@@ -0,0 +1,100 @@
+<html>
+
+<head>
+<link rel="stylesheet" href="default_.css">
+<title>Hibernate Eclipse Tools 3.2.0.beta10 News</title>
+</head>
+
+<body>
+
+<h1>Hibernate Tools 3.2.0.beta10 - New and Noteworthy</h1>
+
+ <p>Previous <a href="hibernate-eclipse-news-3.2.0.beta9.html">new and noteworthy for 3.2.0.beta9</a></p>
+ <p><a href="http://opensource.atlassian.com/projects/hibernate/secure/IssueNavigator....">Release notes</a></p>
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+ <tr>
+ <td colspan="2">
+ <hr>
+ <h3>General</h3>
+ <hr>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p align="right"><b>Eclipse 3.3 and Java 5</b></td>
+ <td valign="top">
+ <p>This release is compatible with Eclipse 3.2/WTP 1.5 and Eclipse 3.3/WTP 2.0. Remember to use Java 5 VM when running Eclipse 3/WTP 2.0.</p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p align="right"><b>Seam 0.x templates removed</b></td>
+ <td valign="top">
+ <p>The Seam templates were getting to much out of date and have now been removed to avoid confusion.</p>
+ <p>Use seam-gen or JBoss Seam Tools to get proper Seam application generation (both of these tools uses hibernate tools to implement their functionallity)</p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr>
+ <h3>Reverse Engineering</h3>
+ <hr>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p align="right"><b>Auto-detection of identification strategy</b></td>
+ <td valign="top">
+ <p>Previously the default identifier strategy was always "assigned" and if users wanted it differently had to be explicit about what strategy they want to use. The core can now detect the default identifier strategy if the MetaDataDialect supports the underlying database.</p>
+<p>Support for MySQL and H2 is included in this version.</p>
+
+<p>If you want to see your database added (or improve the existing
+ones) then
+visit <a href="http://opensource.atlassian.com/projects/hibernate/browse/HBX-935">HBX-935</a>
+and add a jira task with details/patch on what meta data to read to detect
+the identifcation strategy.</p>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr>
+ <h3>Configuration</h3>
+ <hr>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p align="right"><b>JPA auto detected</b></td>
+ <td valign="top">
+ <p>If a META-INF/persistence.xml exist in the selected project when a new Hibernate Console Configuration is created JPA is now assumed.</p>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <p align="right"><b>Properties always overrides</b></td>
+ <td valign="top">
+ <p>The Ant and Eclipse setup were not always in sync on when the properties found in the properties files or custom properties would take effect.</p>
+<p>In this release if a user points to a property file it is *always*
+used for overriding any settings found in /hibernate.properties,
+hibernate.cfg.xml's and persistence.xml; this allow you to use the
+existing configuration but only override the really different parts;
+e.g. specify JDBC connection properties to override the datasource
+which neither eclipse nor ant can reference.</p>
+ </td>
+ </tr>
+
+</table>
+
+</body>
+
+</html>
+
+
18 years, 4 months
JBoss Tools SVN: r3085 - in trunk/common/plugins/org.jboss.tools.common.projecttemplates: lib/jsf-1.1.02 and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-08-13 08:42:19 -0400 (Mon, 13 Aug 2007)
New Revision: 3085
Added:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/jsf-1.1.02/
Removed:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/jsf-1.1.01/
Modified:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/jsf-1.1.02/jsf-api.jar
trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/jsf-1.1.02/jsf-impl.jar
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/JSFVersions.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-442 Updated JSF 1.1.01 to JSF 1.1.02
Copied: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/jsf-1.1.02 (from rev 2172, trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/jsf-1.1.01)
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/jsf-1.1.02/jsf-api.jar
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/lib/jsf-1.1.02/jsf-impl.jar
===================================================================
(Binary files differ)
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/JSFVersions.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/JSFVersions.xml 2007-08-13 11:17:20 UTC (rev 3084)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/JSFVersions.xml 2007-08-13 12:42:19 UTC (rev 3085)
@@ -5,8 +5,8 @@
<refLib type="servlet" location="../servlet" />
<projectTempl location="./jsf-1.0" />
</version>
- <version displayName="JSF 1.1.01 - Reference Implementation">
- <lib type="core" location="../lib/jsf-1.1.01" />
+ <version displayName="JSF 1.1.02 - Reference Implementation">
+ <lib type="core" location="../lib/jsf-1.1.02" />
<lib type="common" location="../lib/ApacheCommon2.3" />
<refLib type="servlet" location="../servlet" />
<projectTempl location="./jsf-1.1" />
18 years, 4 months
JBoss Tools SVN: r3084 - branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: ezheleznyakov
Date: 2007-08-13 07:17:20 -0400 (Mon, 13 Aug 2007)
New Revision: 3084
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
http://jira.jboss.com/jira/browse/EXIN-435
remove ClassCastException
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-08-13 09:23:03 UTC (rev 3083)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-08-13 11:17:20 UTC (rev 3084)
@@ -950,7 +950,7 @@
if (node.getNodeType() == Node.ELEMENT_NODE) {
if (HTML.TAG_LINK.equalsIgnoreCase(node.getNodeName())
|| isLinkReplacer(node) ) {
- nsIDOMElement element = (nsIDOMElement)node;
+ nsIDOMElement element = (nsIDOMElement)node.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
if (ext_val.equalsIgnoreCase(element.getAttribute(VpeTemplateManager.ATTR_LINK_EXT))
&& href_val.equalsIgnoreCase(element.getAttribute(VpeTemplateManager.ATTR_LINK_HREF))) {
return node;
@@ -1322,7 +1322,7 @@
nsIDOMNode child = children.item(i);
if (child.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
if (domMapping.getNodeMapping(child) == null) {
- resetTooltip((nsIDOMElement)child, titleValue);
+ resetTooltip((nsIDOMElement)child.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID), titleValue);
}
}
}
18 years, 4 months
JBoss Tools SVN: r3083 - in branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces: template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ayukhovich
Date: 2007-08-13 05:23:03 -0400 (Mon, 13 Aug 2007)
New Revision: 3083
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/AbstractRichFacesInputNumberTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataListTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataOrderedListTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesGMapTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSpinnerTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java
Log:
http://jira.jboss.com/jira/browse/EXIN-435
change using Node to nsIDOMNode and Element to nsIDOMElement for classes:
RichFacesGridTemplate
RichFacesColumntTemplate
RichFacesData*Template
RichFacesGMapTemplate
RichFacesInputNumber*Template
RichFacesPaint2DTemplate
RichFacesSuTableTemplate
RichFacesToolBarr*Template
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -207,6 +207,19 @@
}
}
+ /**
+ * Copies all attributes from source node to visual node.
+ * @param sourceNode
+ * @param visualNode
+ */
+ public static void copyAttributes(Node sourceNode, nsIDOMElement visualElement) {
+ NamedNodeMap namedNodeMap = sourceNode.getAttributes();
+ for (int i = 0; i < namedNodeMap.getLength(); i++) {
+ Node attribute = namedNodeMap.item(i);
+ visualElement.setAttribute(attribute.getNodeName(), attribute.getNodeValue());
+ }
+ }
+
/**
* Returns true if sourceNode is Facet
* @param sourceNode
@@ -248,6 +261,20 @@
}
/**
+ * Returns value of attribute.
+ * @param sourceElement
+ * @param attributeName
+ * @return
+ */
+ public static String getAttribute(nsIDOMElement sourceElement, String attributeName) {
+ String attribute = sourceElement.getAttribute(attributeName);
+ if(attribute==null) {
+ attribute = "";
+ }
+ return attribute;
+ }
+
+ /**
* @param style
* @param name
* @return
@@ -340,4 +367,26 @@
visualNode.removeAttribute(attrName);
}
+ /**
+ * Move attributes from sourceNode to html
+ * @param sourceNode
+ * @param visualNode
+ * @param attrName
+ * @param htmlAttrName
+ * @param prefValue
+ * @param defValue
+ */
+ public static void correctAttribute(Element sourceNode, nsIDOMElement visualNode,
+ String attrName, String htmlAttrName, String prefValue, String defValue) {
+ String attrValue = ((Element) sourceNode).getAttribute(attrName);
+ if (prefValue != null && prefValue.trim().length() > 0 && attrValue != null) {
+ attrValue = prefValue.trim() + " " + attrValue;
+ }
+ if (attrValue != null) {
+ visualNode.setAttribute(htmlAttrName, attrValue);
+ } else if (defValue != null) {
+ visualNode.setAttribute(htmlAttrName, defValue);
+ } else
+ visualNode.removeAttribute(attrName);
+ }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -64,6 +64,9 @@
public static final String HTML_HEIGHT_ATTR = "height";
/** HTML_CLASS_ATTR * */
+ public static final String HTML_STYLECLASS_ATTR = "styleClass";
+
+ /** HTML_CLASS_ATTR * */
public static final String HTML_CLASS_ATTR = "class";
/** HTML_CELLSPACING_ATTR * */
@@ -104,6 +107,9 @@
/** HTML_ROWSPAN_ATTR * */
public static final String HTML_ROWSPAN_ATTR = "rowspan";
+
+ /** HTML_ROW_ATTR * */
+ public static final String HTML_ROW_ATTR = "row";
/** HTML_SIZE_ATTR * */
public static final String HTML_SIZE_ATTR = "size";
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/AbstractRichFacesInputNumberTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/AbstractRichFacesInputNumberTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/AbstractRichFacesInputNumberTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -10,10 +10,11 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
public abstract class AbstractRichFacesInputNumberTemplate extends AbstractRichFacesTemplate {
/** INPUTSIZE_ATTRIBURE */
@@ -28,20 +29,17 @@
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String)
*/
- // TODO A. Yukhovich please fix it
- /*
@Override
public void removeAttribute(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
- Object data, String name) {
+ Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode,
+ Object data, String name) {
+
super.removeAttribute(pageContext, sourceElement, visualDocument,
visualNode, data, name);
setAttribute(pageContext, sourceElement, visualDocument, visualNode,
data, name, "");
-
}
- */
/**
* Return a input size
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -18,24 +18,17 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesColumnTemplate extends VpeAbstractTemplate {
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- Element td = visualDocument.createElement("td");
+ nsIDOMElement td = visualDocument.createElement("td");
if(isHeader(sourceElement)) {
td.setAttribute("class", "dr-table-headercell rich-table-headercell");
} else if(isFooter(sourceElement)) {
@@ -44,12 +37,10 @@
td.setAttribute("class", "dr-table-cell rich-table-cell");
}
ComponentUtil.copyAttributes(sourceNode, td);
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*td*/);
+ VpeCreationData creationData = new VpeCreationData(td);
// Create mapping to Encode body
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo tdInfo = new VpeChildrenInfo(null/*td*/);
+ VpeChildrenInfo tdInfo = new VpeChildrenInfo(td);
List<Node> children = ComponentUtil.getChildren(sourceElement);
for (Node child : children) {
tdInfo.addSourceChild(child);
@@ -79,22 +70,15 @@
return false;
}
- // TODO A. Yukhovich please fix it
- /*
@Override
- public void removeAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name) {
- ((Element)visualNode).removeAttribute(name);
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
+ nsIDOMElement visualElement = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.removeAttribute(name);
}
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- ((Element)visualNode).setAttribute(name, value);
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
+ nsIDOMElement visualElement = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.setAttribute(name, value);
}
- */
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -17,7 +17,9 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+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;
@@ -61,25 +63,23 @@
* The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
- Element listElement = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DL);
- ComponentUtil.setCSSLink(pageContext, STYLE_RESOURCES_PATH,
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+ nsIDOMElement listElement = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DL);
+ ComponentUtil.setCSSLink(
+ pageContext,
+ STYLE_RESOURCES_PATH,
"dataDefinitionList");
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*listElement*/);
+ VpeCreationData creationData = new VpeCreationData(listElement);
+
Element el = null;
Node tempNode = null;
NodeList list = sourceNode.getChildNodes();
+
// sets attributes for list
- correctAttribute((Element) sourceNode, listElement,
- HtmlComponentUtil.HTML_STYLE_ATTR,
- HtmlComponentUtil.HTML_STYLE_ATTR, null);
- correctAttribute((Element) sourceNode, listElement,
- HtmlComponentUtil.HTML_CLASS_ATTR,
- HtmlComponentUtil.HTML_CLASS_ATTR, "listClass");
+ ComponentUtil.correctAttribute((Element)sourceNode, listElement, HtmlComponentUtil.HTML_STYLE_ATTR, HtmlComponentUtil.HTML_STYLE_ATTR, null, null);
+
+ ComponentUtil.correctAttribute((Element)sourceNode, listElement, HtmlComponentUtil.HTML_CLASS_ATTR, HtmlComponentUtil.HTML_CLASS_ATTR, null, "listClass");
for (int i = 0; i < list.getLength(); i++) {
tempNode = list.item(i);
@@ -115,21 +115,15 @@
* @param parentList
* @param childElement
*/
- private void parseListElement(VpePageContext pageContext, Node sourceNode,
- Document visualDocument, VpeCreationData creationData,
- Element parentList, Element childElement) {
- Element dd = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DD);
- correctAttribute((Element) sourceNode, dd, ROWCLASSES_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, null);
- if (dd.getAttribute(HtmlComponentUtil.HTML_CLASS_ATTR) == null
- || dd.getAttribute(HtmlComponentUtil.HTML_CLASS_ATTR).length() == 0) {
- correctAttribute((Element) sourceNode, dd, COLUMNCLASSES_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "columnClass");
+ private void parseListElement(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, VpeCreationData creationData, nsIDOMElement parentList, Element childElement) {
+ nsIDOMElement dd = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DD);
+ ComponentUtil.correctAttribute((Element) sourceNode, dd, ROWCLASSES_ATTR_NAME, HtmlComponentUtil.HTML_CLASS_ATTR, null, null);
+ if (dd.getAttribute(HtmlComponentUtil.HTML_CLASS_ATTR) == null || dd.getAttribute(HtmlComponentUtil.HTML_CLASS_ATTR).length() == 0) {
+ ComponentUtil.correctAttribute((Element) sourceNode, dd, COLUMNCLASSES_ATTR_NAME, HtmlComponentUtil.HTML_CLASS_ATTR, null, "columnClass");
}
parentList.appendChild(dd);
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo vpeChildrenInfo = new VpeChildrenInfo(null/*dd*/);
+
+ VpeChildrenInfo vpeChildrenInfo = new VpeChildrenInfo(dd);
vpeChildrenInfo.addSourceChild(childElement);
creationData.addChildrenInfo(vpeChildrenInfo);
}
@@ -148,59 +142,33 @@
* @facet facetElement
*/
private void parseListFacetDefinitionElement(VpePageContext pageContext,
- Node sourceNode, Document visualDocument,
- VpeCreationData creationData, Element parentList,
+ Node sourceNode, nsIDOMDocument visualDocument,
+ VpeCreationData creationData, nsIDOMElement parentList,
Element facetElement) {
- Element dt = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DT);
- correctAttribute((Element) sourceNode, dt, HEADER_CLASS_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "headerClass");
+ nsIDOMElement dt = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DT);
+ ComponentUtil.correctAttribute(
+ (Element) sourceNode,
+ dt,
+ HEADER_CLASS_ATTR_NAME,
+ HtmlComponentUtil.HTML_CLASS_ATTR,
+ null,
+ "headerClass");
parentList.appendChild(dt);
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo child = new VpeChildrenInfo(null/*dt*/);
+ VpeChildrenInfo child = new VpeChildrenInfo(dt);
child.addSourceChild(facetElement);
creationData.addChildrenInfo(child);
}
- /**
- * Move attributes from sourceNode to html
- *
- * @param sourceNode
- * The current node of the source tree.
- * @param visualNode
- * @param attrName
- * @param htmlAttrName
- * @param defValue
- */
- private void correctAttribute(Element sourceNode, Element visualNode,
- String attrName, String htmlAttrName, String defValue) {
- String attrValue = ((Element) sourceNode).getAttribute(attrName);
- if (attrValue != null) {
- visualNode.setAttribute(htmlAttrName, attrValue);
- } else if (defValue != null) {
- visualNode.setAttribute(htmlAttrName, defValue);
- } else
- visualNode.removeAttribute(attrName);
- }
-
- // TODO A. Yukhovich please fix it
- /*
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name,
String value) {
- processAttributeChanges(pageContext, sourceElement, visualDocument,
- visualNode, data, name);
+ processAttributeChanges(pageContext, sourceElement, visualDocument, visualNode, data, name);
}
@Override
- public void removeAttribute(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
- Object data, String name) {
- processAttributeChanges(pageContext, sourceElement, visualDocument,
- visualNode, data, name);
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
+ processAttributeChanges(pageContext, sourceElement, visualDocument, visualNode, data, name);
}
- */
/**
* Correct list style accordinly parameters
@@ -215,61 +183,65 @@
* @param data
* @param name
*/
-
- private void processAttributeChanges(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
- Object data, String name) {
- Element el = (Element) visualNode;
+ private void processAttributeChanges(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
+ nsIDOMElement el = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
if (HtmlComponentUtil.HTML_STYLE_ATTR.equals(name)) {
- correctAttribute(sourceElement, el, name, name, null);
+ ComponentUtil.correctAttribute(sourceElement, el, name, name, null, null);
} else if (STYLECLASSES_ATTR_NAME.equals(name)) {
- correctAttribute(sourceElement, el, name,
- HtmlComponentUtil.HTML_CLASS_ATTR, "listClass");
+ ComponentUtil.correctAttribute(sourceElement, el, name,
+ HtmlComponentUtil.HTML_CLASS_ATTR, null, "listClass");
} else if (HEADER_CLASS_ATTR_NAME.equals(name)) {
- NodeList nodeList = el.getChildNodes();
- Node temp = null;
+ nsIDOMNodeList nodeList = el.getChildNodes();
+ nsIDOMNode temp = null;
for (int i = 0; i < nodeList.getLength(); i++) {
temp = nodeList.item(i);
- if ((temp instanceof Element)
+ if ((temp != null)
&& (temp.getNodeName()
.equalsIgnoreCase(HtmlComponentUtil.HTML_TAG_DT))) {
- correctAttribute(sourceElement, (Element) temp,
+ nsIDOMElement tempVisualElement = (nsIDOMElement)temp.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ ComponentUtil.correctAttribute(sourceElement,
+ tempVisualElement,
HEADER_CLASS_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "headerClass");
+ HtmlComponentUtil.HTML_CLASS_ATTR,
+ null,
+ "headerClass");
}
}
} else if (ROWCLASSES_ATTR_NAME.equals(name)) {
- NodeList nodeList = el.getChildNodes();
- Node temp = null;
+ nsIDOMNodeList nodeList = el.getChildNodes();
+ nsIDOMNode temp = null;
for (int i = 0; i < nodeList.getLength(); i++) {
temp = nodeList.item(i);
- if ((temp instanceof Element)
+ if ((temp != null )
&& (temp.getNodeName()
.equalsIgnoreCase(HtmlComponentUtil.HTML_TAG_DD))) {
- correctAttribute(sourceElement, (Element) temp,
+ nsIDOMElement tempVisualElement = (nsIDOMElement)temp.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ ComponentUtil.correctAttribute(sourceElement,
+ tempVisualElement,
ROWCLASSES_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "columnClass");
+ HtmlComponentUtil.HTML_CLASS_ATTR,
+ null,
+ "columnClass");
}
}
} else if (COLUMNCLASSES_ATTR_NAME.equals(name)) {
- NodeList nodeList = el.getChildNodes();
- Node temp = null;
+ nsIDOMNodeList nodeList = el.getChildNodes();
+ nsIDOMNode temp = null;
for (int i = 0; i < nodeList.getLength(); i++) {
temp = nodeList.item(i);
- if ((temp instanceof Element)
+ if ((temp != null)
&& (temp.getNodeName()
.equalsIgnoreCase(HtmlComponentUtil.HTML_TAG_DD))) {
- correctAttribute(sourceElement, (Element) temp,
+ nsIDOMElement tempVisualElement = (nsIDOMElement)temp.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ ComponentUtil.correctAttribute(
+ sourceElement,
+ tempVisualElement,
COLUMNCLASSES_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "columnClass");
+ HtmlComponentUtil.HTML_CLASS_ATTR,
+ null,
+ "columnClass");
}
}
}
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -15,10 +15,11 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+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;
/**
* Template for Rich Faces DataTableFilterSlider
@@ -82,16 +83,12 @@
* The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
int numWidth = 0;
- ComponentUtil.setCSSLink(pageContext, STYLE_PATH,
- "richFacesDataFilterSlider");
+ ComponentUtil.setCSSLink(pageContext, STYLE_PATH, "richFacesDataFilterSlider");
Element sourceElement = (Element) sourceNode;
- String style = ComponentUtil.getAttribute(sourceElement,
- HtmlComponentUtil.HTML_STYLE_ATTR);
- String width = sourceElement
- .getAttribute(HtmlComponentUtil.HTML_ATR_WIDTH);
+ String style = ComponentUtil.getAttribute(sourceElement, HtmlComponentUtil.HTML_STYLE_ATTR);
+ String width = sourceElement.getAttribute(HtmlComponentUtil.HTML_ATR_WIDTH);
if (width != null) {
numWidth = getSize(width);
if (numWidth < DEFAULT_WIDTH) {
@@ -100,43 +97,33 @@
} else {
numWidth = DEFAULT_WIDTH;
}
- String defaultStyle = style + ";" + HtmlComponentUtil.HTML_ATR_WIDTH
- + " : " + numWidth + "px ; ";
- Element parentDiv = createDIV(visualDocument, "slider-container",
- defaultStyle);
- String rangeStyleClass = ComponentUtil.getAttribute(sourceElement,
- RANGE_STYLE_CLASS_ATR);
- Element rangeDiv = createDIV(visualDocument,
- "range " + rangeStyleClass, HtmlComponentUtil.HTML_ATR_WIDTH
- + " : " + (numWidth - DEFAULT_PARAGRAPH) + "px;");
- Element rangeDecorDiv = createDIV(visualDocument, "range-decor", null);
+ String defaultStyle = style + ";" + HtmlComponentUtil.HTML_ATR_WIDTH + " : " + numWidth + "px ; ";
+ nsIDOMElement parentDiv = createDIV(visualDocument, "slider-container", defaultStyle);
+ String rangeStyleClass = ComponentUtil.getAttribute(sourceElement, RANGE_STYLE_CLASS_ATR);
+ nsIDOMElement rangeDiv = createDIV(visualDocument, "range " + rangeStyleClass,
+ HtmlComponentUtil.HTML_ATR_WIDTH + " : " + (numWidth - DEFAULT_PARAGRAPH) + "px;");
+ nsIDOMElement rangeDecorDiv = createDIV(visualDocument, "range-decor", null);
String trailerStyleClass = ComponentUtil.getAttribute(sourceElement,
TRAILER_STYLE_CLASS_ATR);
- Element trailerDiv = createDIV(visualDocument, "trailer "
+ nsIDOMElement trailerDiv = createDIV(visualDocument, "trailer "
+ trailerStyleClass, DEFAULT_SLIDER_POSITION);
String trackStyleClass = ComponentUtil.getAttribute(sourceElement,
TRACK_STYLE_CLASS_ATR);
- Element trackDiv = createDIV(visualDocument,
+ nsIDOMElement trackDiv = createDIV(visualDocument,
"track " + trackStyleClass, HtmlComponentUtil.HTML_ATR_WIDTH
+ " : " + (numWidth - DEFAULT_PARAGRAPH) + "px;");
String handleStyleClass = ComponentUtil.getAttribute(sourceElement,HANDLE_STYLE_CLASS_ATR);
- Element handleDiv = createDIV(visualDocument, "handle " + handleStyleClass, null);
+ nsIDOMElement handleDiv = createDIV(visualDocument, "handle " + handleStyleClass, null);
- Element img = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement img = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(img, CENTER_SLIDER);
- img
- .setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH,
- DEFAULT_SLIDER_WIDTH);
- img.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR,
- DEFAULT_SLIDER_BORDER);
- img.setAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT,
- DEFAULT_SLIDER_HEIGHT);
+ img.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH, DEFAULT_SLIDER_WIDTH);
+ img.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR,DEFAULT_SLIDER_BORDER);
+ img.setAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT, DEFAULT_SLIDER_HEIGHT);
/* Set input component */
- Element input = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ nsIDOMElement input = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
input.setAttribute(HtmlComponentUtil.HTML_TYPE_ATTR, "text");
setAttributesToInputElement(input, sourceElement);
@@ -149,21 +136,21 @@
trackDiv.appendChild(handleDiv);
handleDiv.appendChild(img);
- Element tableSpacer2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ nsIDOMElement tableSpacer2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
tableSpacer2.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0px");
tableSpacer2.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0px");
tableSpacer2.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0px");
tableSpacer2.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, "100%" );
tableSpacer2.setAttribute(HtmlComponentUtil.HTML_HEIGHT_ATTR, "100%" );
- Element trSpacer2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ nsIDOMElement trSpacer2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
- Element tdSpacer2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ nsIDOMElement tdSpacer2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
tdSpacer2.setAttribute(HtmlComponentUtil.HTML_ALIGN_ATTR, "right");
tdSpacer2.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,"font-family: Arial, Verdana, sans-serif; font-size: 5px; color: white;");
trSpacer2.appendChild(tdSpacer2);
- Element imageSpacer2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement imageSpacer2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(imageSpacer2, IMAGE_SPACER);
imageSpacer2.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, "100%");
imageSpacer2.setAttribute(HtmlComponentUtil.HTML_HEIGHT_ATTR, "100%");
@@ -174,12 +161,10 @@
parentDiv.appendChild(input);
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*parentDiv*/);
+ VpeCreationData creationData = new VpeCreationData(parentDiv);
return creationData;
}
- // TODO A. Yukhovich please fix it
/*
* (non-Javadoc)
*
@@ -187,40 +172,39 @@
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String)
*/
- /*
@Override
- public void removeAttribute(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode,
Object data, String name) {
int numWidth = 0;
super.removeAttribute(pageContext, sourceElement, visualDocument,
visualNode, data, name);
- Element element = (Element) visualNode;
- Element input = getInputElement(element);
+ nsIDOMElement element = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ nsIDOMElement input = getInputElement(element);
setAttributesToInputElement(input, sourceElement);
if (name.equalsIgnoreCase(RANGE_STYLE_CLASS_ATR)) {
- Element range = getRangeElement(element);
+ nsIDOMElement range = getRangeElement(element);
range.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
range.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "range");
} else if (name.equalsIgnoreCase(TRAILER_STYLE_CLASS_ATR)) {
- Element trailer = getTrailerElement(element);
+ nsIDOMElement trailer = getTrailerElement(element);
trailer.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
trailer.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "trailer");
} else if (name.equalsIgnoreCase(TRACK_STYLE_CLASS_ATR)) {
- Element track = getTrackElement(element);
+ nsIDOMElement track = getTrackElement(element);
track.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
track.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "track");
} else if (name.equalsIgnoreCase(HANDLE_STYLE_CLASS_ATR)) {
- Element handle = getHandleElement(element);
+ nsIDOMElement handle = getHandleElement(element);
handle.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
handle.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "handle");
} else if (name.equalsIgnoreCase(FIELD_STYLE_CLASS_ATR)) {
- Element field = getInputElement(element);
+ nsIDOMElement field = getInputElement(element);
setAttributesToInputElement( field, sourceElement );
} else if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_ATR_WIDTH)) {
- Element range = getRangeElement(element);
+ nsIDOMElement range = getRangeElement(element);
String style = ComponentUtil.getAttribute(sourceElement,
HtmlComponentUtil.HTML_STYLE_ATTR);
element.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style + ";"
@@ -249,9 +233,8 @@
element.removeAttribute(name);
}
}
-*/
+
- // TODO A. Yukhovich please fix it
/*
* (non-Javadoc)
*
@@ -259,16 +242,14 @@
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String, java.lang.String)
*/
- /*
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name,
String value) {
- super.setAttribute(pageContext, sourceElement, visualDocument,
- visualNode, data, name, value);
- Element parentDiv = (Element) visualNode;
+ super.setAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name, value);
- Element input = getInputElement(parentDiv);
+ nsIDOMElement parentDiv = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ nsIDOMElement input = getInputElement(parentDiv);
setAttributesToInputElement(input, sourceElement);
@@ -278,8 +259,8 @@
if (size < DEFAULT_WIDTH) {
size = DEFAULT_WIDTH;
}
- Element rangeDiv = getRangeElement(parentDiv);
- Element trackDiv = getTrackElement(parentDiv);
+ nsIDOMElement rangeDiv = getRangeElement(parentDiv);
+ nsIDOMElement trackDiv = getTrackElement(parentDiv);
String style = ComponentUtil.getAttribute(parentDiv,
HtmlComponentUtil.HTML_STYLE_ATTR);
@@ -298,19 +279,19 @@
+ (size - DEFAULT_PARAGRAPH) + "px;");
} else if (name.equalsIgnoreCase(RANGE_STYLE_CLASS_ATR)) {
- Element range = getRangeElement(parentDiv);
+ nsIDOMElement range = getRangeElement(parentDiv);
range.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "range "
+ value);
} else if (name.equalsIgnoreCase(TRACK_STYLE_CLASS_ATR)) {
- Element track = getTrackElement(parentDiv);
+ nsIDOMElement track = getTrackElement(parentDiv);
track.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "track "
+ value);
} else if (name.equalsIgnoreCase(TRAILER_STYLE_CLASS_ATR)) {
- Element trailer = getTrailerElement(parentDiv);
+ nsIDOMElement trailer = getTrailerElement(parentDiv);
trailer.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "trailer "
+ value);
} else if (name.equalsIgnoreCase(HANDLE_STYLE_CLASS_ATR)) {
- Element handle = getHandleElement(parentDiv);
+ nsIDOMElement handle = getHandleElement(parentDiv);
handle.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "handle "
+ value);
} else if (name.equalsIgnoreCase(FIELD_STYLE_CLASS_ATR)) {
@@ -332,7 +313,6 @@
parentDiv.setAttribute(name, value);
}
}
- */
/**
* Method for create DIV tag and set attributes
@@ -341,10 +321,8 @@
* @param styleClass
* @param style
*/
- private Element createDIV(Document visualDocument, String styleClass,
- String style) {
- Element div = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ private nsIDOMElement createDIV(nsIDOMDocument visualDocument, String styleClass, String style) {
+ nsIDOMElement div = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
if (styleClass != null) {
div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
}
@@ -387,25 +365,35 @@
* element
* @return range element
*/
- private Element getRangeElement(Element parent) {
- NodeList list = parent.getChildNodes();
- return (Element) list.item(0);
+ private nsIDOMElement getRangeElement(nsIDOMElement parent) {
+ nsIDOMNodeList list = parent.getChildNodes();
+ nsIDOMNode tempNode = list.item(0);
+ nsIDOMElement returnElement = (nsIDOMElement)tempNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ return returnElement;
}
/**
* Get Trailer element from parent element.
*
- * @param parent
- * element
+ * @param parent element
* @return trailer element
*/
- private Element getTrailerElement(Element parent) {
- NodeList list = parent.getChildNodes();
- Element slider = (Element) list.item(0);
- NodeList sliderList = slider.getChildNodes();
- Element trailer = (Element) sliderList.item(0);
- NodeList trailerList = trailer.getChildNodes();
- return (Element) trailerList.item(0);
+ private nsIDOMElement getTrailerElement(nsIDOMElement parent) {
+ // get a slider element
+ nsIDOMNodeList list = parent.getChildNodes();
+ nsIDOMNode tempNode = list.item(0);
+ nsIDOMElement slider = (nsIDOMElement)tempNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ // get a trailer element
+ nsIDOMNodeList sliderList = slider.getChildNodes();
+ nsIDOMNode tempTrailerNode = sliderList.item(0);
+ nsIDOMElement trailer = (nsIDOMElement)tempTrailerNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ // get a element
+ nsIDOMNodeList trailerList = trailer.getChildNodes();
+ nsIDOMNode temp2 = trailerList.item(0);
+ nsIDOMElement returnElement = (nsIDOMElement)temp2.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ return returnElement;
}
/**
@@ -415,15 +403,28 @@
* element
* @return track element
*/
- private Element getTrackElement(Element parent) {
- NodeList list = parent.getChildNodes();
- Element range = (Element) list.item(0);
- NodeList rangeList = range.getChildNodes();
- Element rangeDecor = (Element) rangeList.item(0);
- NodeList rangeDecorList = rangeDecor.getChildNodes();
- Element trailer = (Element) rangeDecorList.item(0);
- NodeList trailerList = trailer.getChildNodes();
- return (Element) trailerList.item(0);
+ private nsIDOMElement getTrackElement(nsIDOMElement parent) {
+
+ // get a range element
+ nsIDOMNodeList list = parent.getChildNodes();
+ nsIDOMNode tempRangeNode = list.item(0);
+ nsIDOMElement range = (nsIDOMElement)tempRangeNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ // get a range decoder element
+ nsIDOMNodeList rangeList = range.getChildNodes();
+ nsIDOMNode tempRangeDecorNode = rangeList.item(0);
+ nsIDOMElement rangeDecor = (nsIDOMElement)tempRangeDecorNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ // get a trailer
+ nsIDOMNodeList rangeDecorList = rangeDecor.getChildNodes();
+ nsIDOMNode tempTrailerNode = rangeDecorList.item(0);
+ nsIDOMElement trailer = (nsIDOMElement)tempTrailerNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ // get a element
+ nsIDOMNodeList trailerList = trailer.getChildNodes();
+ nsIDOMNode temp = trailerList.item(0);
+ nsIDOMElement returnElement = (nsIDOMElement)temp.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ return returnElement;
}
/**
@@ -433,17 +434,32 @@
* element
* @return handle element
*/
- private Element getHandleElement(Element parent) {
- NodeList list = parent.getChildNodes();
- Element range = (Element) list.item(0);
- NodeList rangeList = range.getChildNodes();
- Element rangeDecor = (Element) rangeList.item(0);
- NodeList rangeDecorList = rangeDecor.getChildNodes();
- Element trailer = (Element) rangeDecorList.item(0);
- NodeList trailerList = trailer.getChildNodes();
- Element track = (Element) trailerList.item(0);
- NodeList trackList = track.getChildNodes();
- return (Element) trackList.item(0);
+ private nsIDOMElement getHandleElement(nsIDOMElement parent) {
+ // get a range element
+ nsIDOMNodeList list = parent.getChildNodes();
+ nsIDOMNode tempRangeNode = list.item(0);
+ nsIDOMElement range = (nsIDOMElement)tempRangeNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ // get a range decoder element
+ nsIDOMNodeList rangeList = range.getChildNodes();
+ nsIDOMNode tempRangeDecorNode = rangeList.item(0);
+ nsIDOMElement rangeDecor = (nsIDOMElement)tempRangeDecorNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ // get a trailer
+ nsIDOMNodeList rangeDecorList = rangeDecor.getChildNodes();
+ nsIDOMNode tempTrailerNode = rangeDecorList.item(0);
+ nsIDOMElement trailer = (nsIDOMElement)tempTrailerNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ // get a track
+ nsIDOMNodeList trailerList = trailer.getChildNodes();
+ nsIDOMNode tempTrackNode = trailerList.item(0);
+ nsIDOMElement track = (nsIDOMElement)tempTrackNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ // get a element
+ nsIDOMNodeList trackList = track.getChildNodes();
+ nsIDOMNode temp = trackList.item(0);
+ nsIDOMElement returnElement = (nsIDOMElement)temp.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ return returnElement;
}
/**
@@ -453,13 +469,15 @@
* element
* @return input element
*/
- private Element getInputElement(Element parent) {
- NodeList list = parent.getChildNodes();
- return (Element) list.item(1);
+ private nsIDOMElement getInputElement(nsIDOMElement parent) {
+ nsIDOMNodeList list = parent.getChildNodes();
+ nsIDOMNode tempNode = list.item(1);
+ nsIDOMElement returnElement = (nsIDOMElement)tempNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ return returnElement;
}
- private void setAttributesToInputElement( Element inputElement, Element sourceElement) {
+ private void setAttributesToInputElement( nsIDOMElement inputElement, Element sourceElement) {
String styleClass = getAttribute(FIELD_STYLE_CLASS_ATR, sourceElement);
String value = getAttribute("handleValue", sourceElement);
@@ -477,10 +495,4 @@
value
);
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -18,7 +18,9 @@
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.w3c.dom.Document;
+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;
@@ -28,17 +30,16 @@
private String[] rowClasses;
private String[] columnClasses;
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
initStyleClasses(sourceElement);
- Element table = visualDocument.createElement("table");
+ nsIDOMElement table = visualDocument.createElement("table");
ComponentUtil.copyAttributes(sourceNode, table);
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*table*/);
+ VpeCreationData creationData = new VpeCreationData(table);
ComponentUtil.setCSSLink(pageContext, "dataTable/dataTable.css", "richFacesDataGrid");
String tableClass = sourceElement.getAttribute("styleClass");
@@ -46,7 +47,7 @@
// Encode colgroup definition.
int columnsLength = getColumnsCount(sourceElement);
- Element colgroup = visualDocument.createElement("colgroup");
+ nsIDOMElement colgroup = visualDocument.createElement("colgroup");
colgroup.setAttribute("span", String.valueOf(columnsLength));
table.appendChild(colgroup);
@@ -56,7 +57,7 @@
// Encode Header
Element header = ComponentUtil.getFacet(sourceElement, "header");
if(header!=null) {
- Element thead = visualDocument.createElement("thead");
+ nsIDOMElement thead = visualDocument.createElement("thead");
table.appendChild(thead);
String headerClass = (String) sourceElement.getAttribute("headerClass");
encodeTableHeaderOrFooterFacet(creationData, thead, columnsLength, visualDocument, header,
@@ -69,7 +70,7 @@
// Encode Footer
Element footer = ComponentUtil.getFacet(sourceElement, "footer");
if (footer != null) {
- Element tfoot = visualDocument.createElement("tfoot");
+ nsIDOMElement tfoot = visualDocument.createElement("tfoot");
table.appendChild(tfoot);
String footerClass = (String) sourceElement.getAttribute("footerClass");
encodeTableHeaderOrFooterFacet(creationData, tfoot, columnsLength, visualDocument, footer,
@@ -79,7 +80,7 @@
footerClass, "td");
}
- Element tbody = visualDocument.createElement("tbody");
+ nsIDOMElement tbody = visualDocument.createElement("tbody");
table.appendChild(tbody);
// Create mapping to Encode body
@@ -90,16 +91,15 @@
if(columnsLength>0) {
int rowIndex = 0;
for(int elementIndex = 0; elementIndex<elementsCount; rowIndex++) {
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
tbody.appendChild(tr);
tr.setAttribute("class", "dr-table-row rich-table-row " + getRowClass(rowIndex));
for(int columnIndex = 0; columnIndex<columnsLength && elementIndex<elementsCount; columnIndex++) {
- Element td = visualDocument.createElement("td");
+ nsIDOMElement td = visualDocument.createElement("td");
tr.appendChild(td);
td.setAttribute("class", "dr-table-cell rich-table-cell " + getColumnClass(columnIndex));
if(!children.isEmpty()) {
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo childInfo = new VpeChildrenInfo(null/*td*/);
+ VpeChildrenInfo childInfo = new VpeChildrenInfo(td);
for (Node child : children) {
childInfo.addSourceChild(child);
}
@@ -176,17 +176,17 @@
return elements;
}
-
- // TODO A. Yukhovich please fix it
- /*
+
@Override
- public void removeAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name) {
- ((Element)visualNode).removeAttribute(name);
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
+ nsIDOMElement visualElement = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.removeAttribute(name);
}
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- ((Element)visualNode).setAttribute(name, value);
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
+ nsIDOMElement visualElement = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.setAttribute(name, value);
}
- */
+
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataListTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataListTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataListTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -16,64 +16,53 @@
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
-// TODO A. Yukhovich please fix it
-//import org.jboss.tools.vpe.editor.util.MozillaSupports;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+/**
+ *
+ */
public class RichFacesDataListTemplate extends VpeAbstractTemplate {
+ /** CSS_FILE_NAME */
+ final static private String CSS_FILE_NAME = "dataList/dataList.css";
- static final String STYLECLASS_ATTR_NAME = "styleClass";
- static final String STYLE_ATTR_NAME = "style";
- static final String ROWS_ATTR_NAME = "rows";
- // TODO A. Yukhovich please fix if
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
-
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- Element unorderedList = visualDocument.createElement("ul");
+ nsIDOMElement unorderedList = visualDocument.createElement("ul");
- ComponentUtil.setCSSLink(pageContext, "dataList/dataList.css", "richFacesDataList");
+ ComponentUtil.setCSSLink(pageContext, CSS_FILE_NAME, "richFacesDataList");
ComponentUtil.copyAttributes(sourceNode, unorderedList);
ComponentUtil.correctAttribute(sourceElement, unorderedList,
- STYLECLASS_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "dr-list rich-datalist", "dr-list rich-datalist");
+ HtmlComponentUtil.HTML_STYLECLASS_ATTR,
+ HtmlComponentUtil.HTML_CLASS_ATTR,
+ "dr-list rich-datalist",
+ "dr-list rich-datalist");
ComponentUtil.correctAttribute(sourceElement, unorderedList,
- STYLE_ATTR_NAME,
+ HtmlComponentUtil.HTML_STYLE_ATTR,
HtmlComponentUtil.HTML_STYLE_ATTR, null, null);
- // TODO A. Yukhovich please fix if
- VpeCreationData creatorInfo = new VpeCreationData(null/*unorderedList*/);
+ VpeCreationData creatorInfo = new VpeCreationData(unorderedList);
int rows = -1;
try {
- rows = Integer.valueOf(sourceElement.getAttribute(ROWS_ATTR_NAME));
+ rows = Integer.valueOf(sourceElement.getAttribute(HtmlComponentUtil.HTML_ROW_ATTR));
} catch (Exception x) {
rows = -1;
}
for (int i = 0; i < (rows == -1 ? 3 : rows); i++) {
- Element listItem = visualDocument.createElement("li");
- listItem.setAttribute("class", "dr-list-item rich-list-item");
+ nsIDOMElement listItem = visualDocument.createElement("li");
+ listItem.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "dr-list-item rich-list-item");
unorderedList.appendChild(listItem);
- // TODO A. Yukhovich please fix if
- VpeChildrenInfo info = null /* new VpeChildrenInfo(listItem)*/;
+ VpeChildrenInfo info = new VpeChildrenInfo(listItem);
creatorInfo.addChildrenInfo(info);
encodeListItem(info, sourceElement);
-// TODO A. Yukhovich please fix if
-// MozillaSupports.release(listItem);
}
return creatorInfo;
@@ -100,11 +89,4 @@
}
}
}
-
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataOrderedListTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataOrderedListTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataOrderedListTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -17,63 +17,48 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-//TODO A. Yukhovich please fix if
-//import org.jboss.tools.vpe.editor.util.MozillaSupports;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class RichFacesDataOrderedListTemplate extends VpeAbstractTemplate {
+ /** CSS_FILE_NAME */
+ final static private String CSS_FILE_NAME = "dataOrderedList/dataOrderedList.css";
- static final String STYLECLASS_ATTR_NAME = "styleClass";
- static final String STYLE_ATTR_NAME = "style";
- static final String ROWS_ATTR_NAME = "rows";
-
-
- // TODO A. Yukhovich please fix if
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- Element orderedList = visualDocument.createElement("ol");
+ nsIDOMElement orderedList = visualDocument.createElement("ol");
- ComponentUtil.setCSSLink(pageContext, "dataOrderedList/dataOrderedList.css", "richFacesDataOrderList");
+ ComponentUtil.setCSSLink(pageContext, CSS_FILE_NAME, "richFacesDataOrderList");
ComponentUtil.copyAttributes(sourceNode, orderedList);
ComponentUtil.correctAttribute(sourceElement, orderedList,
- STYLECLASS_ATTR_NAME,
- HtmlComponentUtil.HTML_CLASS_ATTR, "dr-list rich-orderedlist", "dr-list rich-orderedlist");
+ HtmlComponentUtil.HTML_STYLECLASS_ATTR,
+ HtmlComponentUtil.HTML_CLASS_ATTR,
+ "dr-list rich-orderedlist",
+ "dr-list rich-orderedlist");
ComponentUtil.correctAttribute(sourceElement, orderedList,
- STYLE_ATTR_NAME,
+ HtmlComponentUtil.HTML_STYLE_ATTR,
HtmlComponentUtil.HTML_STYLE_ATTR, null, null);
- // TODO A. Yukhovich please fix if
- VpeCreationData creatorInfo = new VpeCreationData(null/*orderedList*/);
+ VpeCreationData creatorInfo = new VpeCreationData(orderedList);
int rows = -1;
try {
- rows = Integer.valueOf(sourceElement.getAttribute(ROWS_ATTR_NAME));
+ rows = Integer.valueOf(sourceElement.getAttribute(HtmlComponentUtil.HTML_ROW_ATTR));
} catch (Exception x) {
rows = -1;
}
for (int i = 0; i < (rows == -1 ? 3 : rows); i++) {
- Element listItem = visualDocument.createElement("li");
+ nsIDOMElement listItem = visualDocument.createElement("li");
listItem.setAttribute("class", "dr-list-item rich-list-item");
orderedList.appendChild(listItem);
- // TODO A. Yukhovich please fix if
- VpeChildrenInfo info = null /*new VpeChildrenInfo(listItem)*/;
+ VpeChildrenInfo info = new VpeChildrenInfo(listItem);
creatorInfo.addChildrenInfo(info);
encodeListItem(info, sourceElement);
- // TODO A. Yukhovich please fix if
- /*MozillaSupports.release(listItem);*/
}
return creatorInfo;
@@ -100,10 +85,4 @@
}
}
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -16,10 +16,12 @@
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+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;
/**
* Template for Rich Faces DataTableScroller
@@ -82,42 +84,34 @@
* The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element source = (Element) sourceNode;
ComponentUtil.setCSSLink(pageContext, STYLE_PATH,
"richFacesDataScrollerTable");
- Element div = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ nsIDOMElement div = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
String style = source.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
div.setAttribute("class", "dr-div-heigth");
if (style == null) {
style = DEFAULT_STYLE_WIDTH;
}
- Element table = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ nsIDOMElement table = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
"dr-dscr-t dr-tbpnl-cntnt");
table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "1");
table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
- Element tbody = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TBODY);
- Element tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ nsIDOMElement tbody = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TBODY);
+ nsIDOMElement tr = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
tbody.appendChild(tr);
table.appendChild(tbody);
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*div*/);
+ VpeCreationData creationData = new VpeCreationData(div);
/* Add scroll cells */
- Element child1 = createCell(visualDocument, false,
- LEFT_DOUBLE_SCROLL_SYMBOL, SCROLL_CELL);
- Element child2 = createCell(visualDocument, false,
- LEFT_SINGLE_SCROLL_SYMBOL, SCROLL_CELL);
+ nsIDOMElement child1 = createCell(visualDocument, false, LEFT_DOUBLE_SCROLL_SYMBOL, SCROLL_CELL);
+ nsIDOMElement child2 = createCell(visualDocument, false, LEFT_SINGLE_SCROLL_SYMBOL, SCROLL_CELL);
/* Add empty cells */
- Element child3 = createCell(visualDocument, false, "", EMPTY_CELL);
+ nsIDOMElement child3 = createCell(visualDocument, false, "", EMPTY_CELL);
tr.appendChild(child1);
tr.appendChild(child2);
tr.appendChild(child3);
@@ -133,8 +127,7 @@
size /= (minSize / MIN_NUM_CELLS);
/* Add number cells in datascroller */
for (int i = 0; i < (size - 6); i++) {
- Element child = createCell(visualDocument, (i == 0 ? true : false),
- "" + (i + 1), NUM_CELL);
+ nsIDOMElement child = createCell(visualDocument, (i == 0 ? true : false), "" + (i + 1), NUM_CELL);
tr.appendChild(child);
}
/* Add empty cell */
@@ -164,12 +157,10 @@
* text in cell
* @return Element
*/
- private Element createCell(Document visualDocument, boolean active,
- String text, int sellType) {
- Element td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ private nsIDOMElement createCell(nsIDOMDocument visualDocument, boolean active, String text, int sellType) {
+ nsIDOMElement td = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
td.setAttribute(HtmlComponentUtil.HTML_ALIGN_ATTR, "center");
- Node d = visualDocument.createTextNode(text);
+ nsIDOMText d = visualDocument.createTextNode(text);
if (sellType == NUM_CELL) {
td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
(active ? "dr-dscr-act" : "dr-dscr-inact"));
@@ -190,34 +181,25 @@
/**
* Method for remove attributes .
*/
- // TODO A. Yukhovich please fix it
- /*
@Override
- public void removeAttribute(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
- Object data, String name) {
- super.removeAttribute(pageContext, sourceElement, visualDocument,
- visualNode, data, name);
- Element element = (Element) visualNode;
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode,Object data, String name) {
+ super.removeAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name);
+ nsIDOMElement element = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
element.removeAttribute(name);
-
}
- */
+
/*
* @see com.exadel.vpe.editor.template.VpeAbstractTemplate#setAttribute(com.exadel.vpe.editor.context.VpePageContext,
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String, java.lang.String)
*/
- // TODO A. Yukhovich please fix it
- /*
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
- String value) {
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
super.setAttribute(pageContext, sourceElement, visualDocument,
visualNode, data, name, value);
- Element element = (Element) visualNode;
+ nsIDOMElement element = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
int size = 45;
if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_STYLE_ATTR)) {
String str = getWidth(value);
@@ -228,9 +210,9 @@
value = MIN_STYLE_WIDTH;
}
size /= (minSize / MIN_NUM_CELLS);
- Element tr = getTR(element);
- NodeList nodes = tr.getChildNodes();
- int nodesLength = nodes.getLength();
+ nsIDOMElement tr = getTR(element);
+ nsIDOMNodeList nodes = tr.getChildNodes();
+ long nodesLength = nodes.getLength();
if (nodesLength != size) {
if (size < nodesLength) {
// Remove cells in datascroller
@@ -244,16 +226,12 @@
}
// Add cells in datascroller
for (int i = 0; i < (size - nodesLength); i++) {
- Element cell = createCell(visualDocument, false, ""
- + (nodesLength - 5 + i), NUM_CELL);
+ nsIDOMElement cell = createCell(visualDocument, false, "" + (nodesLength - 5 + i), NUM_CELL);
tr.appendChild(cell);
}
- Element child1 = createCell(visualDocument, false, "",
- EMPTY_CELL);
- Element child2 = createCell(visualDocument, false,
- RIGHT_SINGLE_SCROLL_SYMBOL, SCROLL_CELL);
- Element child3 = createCell(visualDocument, false,
- RIGHT_DOUBLE_SCROLL_SYMBOL, SCROLL_CELL);
+ nsIDOMElement child1 = createCell(visualDocument, false, "", EMPTY_CELL);
+ nsIDOMElement child2 = createCell(visualDocument, false,RIGHT_SINGLE_SCROLL_SYMBOL, SCROLL_CELL);
+ nsIDOMElement child3 = createCell(visualDocument, false, RIGHT_DOUBLE_SCROLL_SYMBOL, SCROLL_CELL);
tr.appendChild(child1);
tr.appendChild(child2);
tr.appendChild(child3);
@@ -263,7 +241,7 @@
element.setAttribute(name, value);
}
- */
+
/**
* Method for parse style and get width.
*
@@ -318,18 +296,19 @@
* Element
* @return Element Tag TR
*/
- private Element getTR(Element parent) {
- NodeList list = parent.getChildNodes();
- Element table = (Element) list.item(0);
- NodeList tableList = table.getChildNodes();
- Element tbody = (Element) tableList.item(0);
- NodeList tbodyList = tbody.getChildNodes();
- return (Element) tbodyList.item(0);
- }
+ private nsIDOMElement getTR(nsIDOMElement parent) {
+ nsIDOMNodeList list = parent.getChildNodes();
+ nsIDOMNode tableNode = list.item(0);
+ nsIDOMElement table = (nsIDOMElement) tableNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ nsIDOMNodeList tableList = table.getChildNodes();
+ nsIDOMNode tbodyNode = tableList.item(0);
+ nsIDOMElement tbody = (nsIDOMElement) tbodyNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
+ nsIDOMNodeList tbodyList = tbody.getChildNodes();
+ nsIDOMNode tempNode = tbodyList.item(0);
+ nsIDOMElement returnElement = (nsIDOMElement) tempNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ return returnElement;
}
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -19,29 +19,23 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class RichFacesDataTableTemplate extends VpeAbstractTemplate {
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+
Element sourceElement = (Element)sourceNode;
- Element table = visualDocument.createElement("table");
+ nsIDOMElement table = visualDocument.createElement("table");
ComponentUtil.copyAttributes(sourceNode, table);
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*table*/);
+ VpeCreationData creationData = new VpeCreationData(table);
ComponentUtil.setCSSLink(pageContext, "dataTable/dataTable.css", "richFacesDataTable");
String tableClass = sourceElement.getAttribute("styleClass");
@@ -50,7 +44,7 @@
// Encode colgroup definition.
ArrayList<Element> columns = getColumns(sourceElement);
int columnsLength = getColumnsCount(sourceElement, columns);
- Element colgroup = visualDocument.createElement("colgroup");
+ nsIDOMElement colgroup = visualDocument.createElement("colgroup");
colgroup.setAttribute("span", String.valueOf(columnsLength));
table.appendChild(colgroup);
@@ -58,7 +52,7 @@
if (null != columnsWidth) {
String[] widths = columnsWidth.split(",");
for (int i = 0; i < widths.length; i++) {
- Element col = visualDocument.createElement("col");
+ nsIDOMElement col = visualDocument.createElement("col");
col.setAttribute("width", widths[i]);
colgroup.appendChild(col);
}
@@ -71,7 +65,7 @@
Element header = ComponentUtil.getFacet(sourceElement, "header");
ArrayList<Element> columnsHeaders = getColumnsWithFacet(columns, "header");
if(header!=null || !columnsHeaders.isEmpty()) {
- Element thead = visualDocument.createElement("thead");
+ nsIDOMElement thead = visualDocument.createElement("thead");
table.appendChild(thead);
String headerClass = (String) sourceElement.getAttribute("headerClass");
if(header != null) {
@@ -82,7 +76,7 @@
headerClass, "td");
}
if(!columnsHeaders.isEmpty()) {
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
thead.appendChild(tr);
String styleClass = encodeStyleClass(null, "dr-table-subheader rich-table-subheader", null, headerClass);
if(styleClass!=null) {
@@ -98,11 +92,11 @@
Element footer = ComponentUtil.getFacet(sourceElement, "footer");
ArrayList<Element> columnsFooters = getColumnsWithFacet(columns, "footer");
if (footer != null || !columnsFooters.isEmpty()) {
- Element tfoot = visualDocument.createElement("tfoot");
+ nsIDOMElement tfoot = visualDocument.createElement("tfoot");
table.appendChild(tfoot);
String footerClass = (String) sourceElement.getAttribute("footerClass");
if(!columnsFooters.isEmpty()) {
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
tfoot.appendChild(tr);
String styleClass = encodeStyleClass(null, "dr-table-subfooter rich-table-subfooter", null, footerClass);
if(styleClass!=null) {
@@ -121,13 +115,13 @@
}
}
- Element tbody = visualDocument.createElement("tbody");
+ nsIDOMElement tbody = visualDocument.createElement("tbody");
table.appendChild(tbody);
// Create mapping to Encode body
List<Node> children = ComponentUtil.getChildren(sourceElement);
boolean firstRow = true;
- Element tr = null;
+ nsIDOMElement tr = null;
VpeChildrenInfo trInfo = null;
for (Node child : children) {
if(child.getNodeName().endsWith(":column")) {
@@ -143,8 +137,7 @@
} else {
tr.setAttribute("class", "dr-table-row rich-table-row");
}
- // TODO A. Yukhovich please fix it
- trInfo = new VpeChildrenInfo(null/*tr*/);
+ trInfo = new VpeChildrenInfo(tr);
tbody.appendChild(tr);
creationData.addChildrenInfo(trInfo);
}
@@ -156,8 +149,7 @@
RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(creationData, (Element)child, visualDocument, tbody);
tr = null;
} else {
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo childInfo = new VpeChildrenInfo(null/*tbody*/);
+ VpeChildrenInfo childInfo = new VpeChildrenInfo(tbody);
childInfo.addSourceChild(child);
creationData.addChildrenInfo(childInfo);
tr = null;
@@ -167,14 +159,14 @@
return creationData;
}
- protected void encodeCaption(VpeCreationData creationData, Element sourceElement, Document visualDocument, Element table) {
+ protected void encodeCaption(VpeCreationData creationData, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement table) {
//Encode caption
Element captionFromFacet = ComponentUtil.getFacet(sourceElement, "caption");
if (captionFromFacet != null) {
String captionClass = (String) table.getAttribute("captionClass");
String captionStyle = (String) table.getAttribute("captionStyle");
- Element caption = visualDocument.createElement("caption");
+ nsIDOMElement caption = visualDocument.createElement("caption");
table.appendChild(caption);
if (captionClass != null && captionClass.length()>0) {
captionClass = "dr-table-caption rich-table-caption " + captionClass;
@@ -186,19 +178,18 @@
caption.setAttribute("style", captionStyle);
}
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo cap = new VpeChildrenInfo(null/*caption*/);
+ VpeChildrenInfo cap = new VpeChildrenInfo(caption);
cap.addSourceChild(captionFromFacet);
creationData.addChildrenInfo(cap);
}
}
- public static void encodeHeaderOrFooterFacets(VpeCreationData creationData, Element parentTr, Document visualDocument, ArrayList<Element> headersOrFooters, String skinCellClass, String headerClass, String facetName, String element) {
+ public static void encodeHeaderOrFooterFacets(VpeCreationData creationData, nsIDOMElement parentTr, nsIDOMDocument visualDocument, ArrayList<Element> headersOrFooters, String skinCellClass, String headerClass, String facetName, String element) {
for (Element column : headersOrFooters) {
String classAttribute = facetName + "Class";
String columnHeaderClass = column.getAttribute(classAttribute);
- Element td = visualDocument.createElement(element);
+ nsIDOMElement td = visualDocument.createElement(element);
parentTr.appendChild(td);
String styleClass = encodeStyleClass(null, skinCellClass, headerClass, columnHeaderClass);
td.setAttribute("class", styleClass);
@@ -209,14 +200,13 @@
}
Element facetBody = ComponentUtil.getFacet(column, facetName);
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo child = new VpeChildrenInfo(null/*td*/);
+ VpeChildrenInfo child = new VpeChildrenInfo(td);
child.addSourceChild(facetBody);
creationData.addChildrenInfo(child);
}
}
- protected void encodeTableHeaderOrFooterFacet(VpeCreationData creationData, Element parentTheadOrTfood, int columns, Document visualDocument, Element facetBody, String skinFirstRowClass, String skinRowClass, String skinCellClass, String facetBodyClass, String element) {
+ protected void encodeTableHeaderOrFooterFacet(VpeCreationData creationData, nsIDOMElement parentTheadOrTfood, int columns, nsIDOMDocument visualDocument, Element facetBody, String skinFirstRowClass, String skinRowClass, String skinCellClass, String facetBodyClass, String element) {
boolean isColumnGroup = facetBody.getNodeName().endsWith(":columnGroup");
boolean isSubTable = facetBody.getNodeName().endsWith(":subTable");
if(isColumnGroup) {
@@ -224,7 +214,7 @@
} else if(isSubTable) {
RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(creationData, facetBody, visualDocument, parentTheadOrTfood);
} else {
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
parentTheadOrTfood.appendChild(tr);
String styleClass = encodeStyleClass(null, skinFirstRowClass, facetBodyClass, null);
@@ -234,7 +224,7 @@
String style = ComponentUtil.getHeaderBackgoundImgStyle();
tr.setAttribute("style", style);
- Element td = visualDocument.createElement(element);
+ nsIDOMElement td = visualDocument.createElement(element);
tr.appendChild(td);
styleClass = encodeStyleClass(null, skinCellClass, facetBodyClass, null);
@@ -247,8 +237,7 @@
}
td.setAttribute("scope", "colgroup");
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo child = new VpeChildrenInfo(null/*td*/);
+ VpeChildrenInfo child = new VpeChildrenInfo(td);
child.addSourceChild(facetBody);
creationData.addChildrenInfo(child);
}
@@ -380,23 +369,17 @@
}
return count;
}
-
- // TODO A. Yukhovich please fix it
- /*
+
@Override
- public void removeAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name) {
- ((Element)visualNode).removeAttribute(name);
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
+ nsIDOMElement visualElement = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.removeAttribute(name);
}
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- ((Element)visualNode).setAttribute(name, value);
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
+ nsIDOMElement visualElement = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.setAttribute(name, value);
}
- */
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesGMapTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesGMapTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesGMapTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -16,7 +16,8 @@
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -39,21 +40,16 @@
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String)
*/
- /*
@Override
- public void removeAttribute(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
- Object data, String name) {
- super.removeAttribute(pageContext, sourceElement, visualDocument,
- visualNode, data, name);
- Element img = (Element) visualNode;
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
+ super.removeAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name);
+ nsIDOMElement img = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
if(STYLE_CLASS_ATTR_NAME.equals(name)){
- img.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
+ img.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
} else{
img.removeAttribute(name);
}
}
- */
/*
* (non-Javadoc)
@@ -62,15 +58,10 @@
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String, java.lang.String)
*/
- // TODO A. Yukhovich please fix it
- /*
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
- String value) {
- super.setAttribute(pageContext, sourceElement, visualDocument,
- visualNode, data, name, value);
- Element img = (Element) visualNode;
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
+ super.setAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name, value);
+ nsIDOMElement img = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
img.setAttribute(name, value);
if(STYLE_CLASS_ATTR_NAME.equals(name)){
img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,value);
@@ -78,7 +69,6 @@
img.setAttribute(name,value);
}
}
- */
/**
* Create html instead of rich:faces component.
@@ -91,30 +81,19 @@
* The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
- Element img = visualDocument.createElement("img");
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+ nsIDOMElement img = visualDocument.createElement("img");
ComponentUtil.setImg(img, IMAGE_NAME);
ComponentUtil.copyAttributes(sourceNode, img);
if(((Element)sourceNode).getAttribute(STYLE_CLASS_ATTR_NAME)!=null){
img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,((Element)sourceNode).getAttribute("styleClass"));
}
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*img*/);
+ VpeCreationData creationData = new VpeCreationData(img);
return creationData;
}
- // TODO A. Yukhovich please fix it
- public void resize(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Element visualElement, Object data,
- int resizerConstrains, int top, int left, int width, int height) {
-// super.resize(pageContext, sourceElement, visualDocument, visualElement,
-// data, resizerConstrains, top, left, width, height);
+ public void resize(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement visualElement, Object data, int resizerConstrains, int top, int left, int width, int height) {
+ super.resize(pageContext, sourceElement, visualDocument, visualElement, data, resizerConstrains, top, left, width, height);
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSliderTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -10,22 +10,23 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-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.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+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.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
+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;
/**
* Template for input number slider control
@@ -77,11 +78,11 @@
/** */
final private Map<String, Method> mapAttributeToMethod;
- final private static Class[] defaultArgsMappedMethods = new Class[2];
+ final private static Class<?>[] defaultArgsMappedMethods = new Class<?>[2];
static {
defaultArgsMappedMethods[0] = Element.class;
- defaultArgsMappedMethods[1] = Element.class;
+ defaultArgsMappedMethods[1] = nsIDOMElement.class;
}
/**
@@ -110,7 +111,7 @@
* @return
*/
private Method getMethodByName(String methodName) {
- Class clazz = this.getClass();
+ Class<?> clazz = this.getClass();
Method m1 = null;
try {
m1 = clazz.getMethod(methodName, defaultArgsMappedMethods);
@@ -149,25 +150,24 @@
* The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- Element table1 = null;
- Element table1Tr1 = null;
- Element table1Tr1Td1 = null;
- Text table1Tr1Td1Text = null;
- Element table1Tr1Td2 = null;
- Text table1Tr1Td2Text = null;
- Element table1Tr1Td3 = null;
- Element table1Tr1Td3input = null;
- Element table1Tr2 = null;
- Element table1Tr2Td1 = null;
- Element table1Tr2Td1Table2 = null;
- Element table1Tr2Td1Table2Tr1 = null;
- Element table1Tr2Td1Table2Tr1Td1 = null;
- Element table1Tr2Td1Table2Tr1Td2 = null;
- Element table1Tr2Td1Table2Tr1Td2Img = null;
- Element table1Tr2Td1Table2Tr1Td3 = null;
+ nsIDOMElement table1 = null;
+ nsIDOMElement table1Tr1 = null;
+ nsIDOMElement table1Tr1Td1 = null;
+ nsIDOMText table1Tr1Td1Text = null;
+ nsIDOMElement table1Tr1Td2 = null;
+ nsIDOMText table1Tr1Td2Text = null;
+ nsIDOMElement table1Tr1Td3 = null;
+ nsIDOMElement table1Tr1Td3input = null;
+ nsIDOMElement table1Tr2 = null;
+ nsIDOMElement table1Tr2Td1 = null;
+ nsIDOMElement table1Tr2Td1Table2 = null;
+ nsIDOMElement table1Tr2Td1Table2Tr1 = null;
+ nsIDOMElement table1Tr2Td1Table2Tr1Td1 = null;
+ nsIDOMElement table1Tr2Td1Table2Tr1Td2 = null;
+ nsIDOMElement table1Tr2Td1Table2Tr1Td2Img = null;
+ nsIDOMElement table1Tr2Td1Table2Tr1Td3 = null;
// sets css link
ComponentUtil.setCSSLink(pageContext, CSS_FILE, "inputNumberSlider");
@@ -282,8 +282,8 @@
}
}
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*table1*/);
+
+ VpeCreationData creationData = new VpeCreationData(table1);
return creationData;
}
@@ -293,11 +293,8 @@
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String, java.lang.String)
*/
- /*
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
- String value) {
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
Method function = mapAttributeToMethod.get(name);
if (function != null) {
@@ -313,10 +310,12 @@
} catch (InvocationTargetException e3) {
RichFacesTemplatesActivator.getPluginLog().logWarning("InvocationTargetException: " + name + ":"+ e3.getMessage() );
}
- }
- correctArrowPosition(sourceElement, visualNode);
+ }
+
+ nsIDOMElement visualtElement = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ correctArrowPosition(sourceElement, visualtElement);
}
- */
/**
*
@@ -337,7 +336,7 @@
*
* @param tree
*/
- private void addBasicTableAttributes(Element table) {
+ private void addBasicTableAttributes(nsIDOMElement table) {
table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
@@ -348,15 +347,16 @@
* @param visualNode
* @return
*/
- private Element getInputElement(Element visualNode) {
- Element table = (Element) visualNode;
- NodeList tableList = table.getChildNodes();
- Node tr = tableList.item(0);
- NodeList trList = tr.getChildNodes();
- Node td1 = trList.item(2);
- NodeList td1List = td1.getChildNodes();
- Element input = (Element) td1List.item(0);
- return input;
+ private nsIDOMElement getInputElement(nsIDOMElement visualNode) {
+ nsIDOMElement table = visualNode;
+ nsIDOMNodeList tableList = table.getChildNodes();
+ nsIDOMNode tr = tableList.item(0);
+ nsIDOMNodeList trList = tr.getChildNodes();
+ nsIDOMNode td1 = trList.item(2);
+ nsIDOMNodeList td1List = td1.getChildNodes();
+ nsIDOMNode input = td1List.item(0);
+ nsIDOMElement inputElement = (nsIDOMElement) input.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ return inputElement;
}
/**
@@ -364,15 +364,16 @@
* @param visualNode
* @return
*/
- private Node getMaxValueElement(Element visualNode) {
- Element table = (Element) visualNode;
- NodeList tableList = table.getChildNodes();
- Node tr = tableList.item(0);
- NodeList trList = tr.getChildNodes();
- Node td1 = trList.item(1);
- NodeList td1List = td1.getChildNodes();
- Node maxValue = td1List.item(0);
- return maxValue;
+ private nsIDOMElement getMaxValueElement(nsIDOMElement visualNode) {
+ nsIDOMElement table = visualNode;
+ nsIDOMNodeList tableList = table.getChildNodes();
+ nsIDOMNode tr = tableList.item(0);
+ nsIDOMNodeList trList = tr.getChildNodes();
+ nsIDOMNode td1 = trList.item(1);
+ nsIDOMNodeList td1List = td1.getChildNodes();
+ nsIDOMNode maxValue = td1List.item(0);
+ nsIDOMElement maxValueElement = (nsIDOMElement) maxValue.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ return maxValueElement;
}
/**
@@ -380,15 +381,16 @@
* @param visualNode
* @return
*/
- private Node getMinValueElement(Element visualNode) {
- Element table = (Element) visualNode;
- NodeList tableList = table.getChildNodes();
- Node tr = tableList.item(0);
- NodeList trList = tr.getChildNodes();
- Node td1 = trList.item(0);
- NodeList td1List = td1.getChildNodes();
- Node minValue = td1List.item(0);
- return minValue;
+ private nsIDOMElement getMinValueElement(nsIDOMElement visualNode) {
+ nsIDOMElement table = visualNode;
+ nsIDOMNodeList tableList = table.getChildNodes();
+ nsIDOMNode tr = tableList.item(0);
+ nsIDOMNodeList trList = tr.getChildNodes();
+ nsIDOMNode td1 = trList.item(0);
+ nsIDOMNodeList td1List = td1.getChildNodes();
+ nsIDOMNode minValue = td1List.item(0);
+ nsIDOMElement minValueElement = (nsIDOMElement) minValue.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ return minValueElement;
}
/**
@@ -396,8 +398,8 @@
* @param visualNode
* @param sourceNode
*/
- public void showInput(Element visualNode, Element sourceNode) {
- Element input = getInputElement(visualNode);
+ public void showInput(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
if (getAttribute(SLIDER_SHOWINPUT_ATTR, sourceNode).equalsIgnoreCase(
"false")) {
input.setAttribute(HtmlComponentUtil.HTML_TYPE_ATTR,
@@ -413,7 +415,7 @@
* @param visualNode
* @param sourceNode
*/
- public void showBoundaryValues(Element visualNode, Element sourceNode) {
+ public void showBoundaryValues(nsIDOMElement visualNode, Element sourceNode) {
setMaxValue(visualNode, sourceNode);
setMinValue(visualNode, sourceNode);
}
@@ -423,8 +425,8 @@
* @param visualNode
* @param sourceNode
*/
- public void setInputSize(Element visualNode, Element sourceNode) {
- Element input = getInputElement(visualNode);
+ public void setInputSize(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
if (input != null) {
input.setAttribute("size", getInputSize(sourceNode));
}
@@ -435,8 +437,8 @@
* @param visualNode
* @param sourceNode
*/
- public void setInputClass(Element visualNode, Element sourceNode) {
- Element input = getInputElement(visualNode);
+ public void setInputClass(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
if (input != null) {
String tmp = getInputClass(sourceNode);
input.setAttribute("class", tmp);
@@ -448,8 +450,8 @@
* @param visualNode
* @param sourceNode
*/
- public void setMaxValue(Element visualNode, Element sourceNode) {
- Node maxValue = getMaxValueElement(visualNode);
+ public void setMaxValue(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement maxValue = getMaxValueElement(visualNode);
if (maxValue != null) {
if (getAttribute(SLIDER_SHOWBOUNDARY_ATTR, sourceNode)
.equalsIgnoreCase("false")) {
@@ -472,8 +474,8 @@
* @param visualNode
* @param sourceNode
*/
- public void setMinValue(Element visualNode, Element sourceNode) {
- Node minValue = getMinValueElement(visualNode);
+ public void setMinValue(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement minValue = getMinValueElement(visualNode);
if (minValue != null) {
if (getAttribute(SLIDER_SHOWBOUNDARY_ATTR, sourceNode)
.equalsIgnoreCase("false")) {
@@ -526,9 +528,9 @@
* Corrects arrow position accordinlye max, min and inputValues
*
* @param sourceNode
- * @param visulaNode
+ * @param visualElement
*/
- private void correctArrowPosition(Element sourceNode, Node visulaNode) {
+ private void correctArrowPosition(Element sourceNode, nsIDOMElement visualElement) {
String minValue = sourceNode.getAttribute(SLIDER_MINVALUE_ATTR);
String maxValue = sourceNode.getAttribute(SLIDER_MAXVALUE_ATTR);
@@ -563,15 +565,28 @@
step = 1;
}
double h1 = ((roundForStep(step, value) - min) / (max - min)) * 100;
- double h2 = 100 - h1;
- Element table1Tr2Td1Table2Tr1Td1 = (Element) visulaNode.getChildNodes()
- .item(1).getChildNodes().item(0).getChildNodes().item(0)
- .getChildNodes().item(0).getChildNodes().item(0);
+ double h2 = 100 - h1;
+
+
+ nsIDOMNodeList nodeList = visualElement.getChildNodes();
+ nsIDOMNode node_01 = nodeList.item(1);
+ nsIDOMNodeList nodeList_01 = node_01.getChildNodes();
+ nsIDOMNode node_01_00 = nodeList_01.item(0);
+ nsIDOMNodeList nodeList_01_00 = node_01_00.getChildNodes();
+ nsIDOMNode node_01_00_00 = nodeList_01_00.item(0);
+ nsIDOMNodeList nodeList_01_00_00 = node_01_00_00.getChildNodes();
+ nsIDOMNode node_01_00_00_00 = nodeList_01_00_00.item(0);
+ nsIDOMNodeList nodeList_01_00_00_00 = node_01_00_00_00.getChildNodes();
+ nsIDOMNode node_01_00_00_00_00 = nodeList_01_00_00_00.item(0);
+ nsIDOMNode node_01_00_00_00_02 = nodeList_01_00_00_00.item(2);
+
+ nsIDOMElement table1Tr2Td1Table2Tr1Td1 = (nsIDOMElement)node_01_00_00_00_00.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
table1Tr2Td1Table2Tr1Td1.setAttribute(
- HtmlComponentUtil.HTML_WIDTH_ATTR, (int) h1 + "%");
- Element table1Tr2Td1Table2Tr1Td2 = (Element) visulaNode.getChildNodes()
- .item(1).getChildNodes().item(0).getChildNodes().item(0)
- .getChildNodes().item(0).getChildNodes().item(2);
+ HtmlComponentUtil.HTML_WIDTH_ATTR, (int) h1 + "%");
+
+ nsIDOMElement table1Tr2Td1Table2Tr1Td2 = (nsIDOMElement)node_01_00_00_00_02.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
table1Tr2Td1Table2Tr1Td2.setAttribute(
HtmlComponentUtil.HTML_WIDTH_ATTR, (int) h2 + "%");
}
@@ -604,8 +619,8 @@
* @param visualNode
* @param sourceNode
*/
- public void setInputValue(Element visualNode, Element sourceNode) {
- Element input = getInputElement(visualNode);
+ public void setInputValue(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
if (input != null) {
String tmp = getAttribute("value", sourceNode);
if (tmp.length() == 0) {
@@ -622,8 +637,8 @@
* @param visualNode
* @param sourceNode
*/
- public void setInputStyle(Element visualNode, Element sourceNode) {
- Element input = getInputElement(visualNode);
+ public void setInputStyle(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
if (input != null) {
String tmp = getAttribute("inputStyle", sourceNode);
input.setAttribute("style", tmp);
@@ -635,18 +650,11 @@
* @param visualNode
* @param sourceNode
*/
- public void setMaxlength(Element visualNode, Element sourceNode) {
- Element input = getInputElement(visualNode);
+ public void setMaxlength(nsIDOMElement visualNode, Element sourceNode) {
+ nsIDOMElement input = getInputElement(visualNode);
if (input != null) {
String tmp = getAttribute("maxlength", sourceNode);
input.setAttribute("maxlength", tmp);
}
- }
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
-
+ }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSpinnerTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSpinnerTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInputNumberSpinnerTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -10,15 +10,16 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
-import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+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;
/**
* Template for input number spinner control
@@ -61,22 +62,21 @@
* The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
// Set a css for this element
ComponentUtil.setCSSLink(pageContext, CSS_FILE_NAME,
"richFacesInputNumberSpinner");
- Element table = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ nsIDOMElement table = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0px");
table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
- Element row = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ nsIDOMElement row = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
// create input element
- Element cellInput = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ nsIDOMElement cellInput = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
cellInput.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "ins-dr-spnr-e");
cellInput.setAttribute("valign", "top");
cellInput.appendChild(createInputElement(visualDocument, sourceNode));
@@ -84,7 +84,7 @@
// create arrows cell
- Element cellArrows = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ nsIDOMElement cellArrows = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
cellArrows.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "dr-spnr-b");
cellArrows.setAttribute("valign", "middle");
cellArrows.appendChild(createArrowsElement(visualDocument, sourceNode));
@@ -96,8 +96,7 @@
table.setAttribute("style", tmp);
// Create return variable contain template
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*table*/);
+ VpeCreationData creationData = new VpeCreationData(table);
return creationData;
}
@@ -108,17 +107,17 @@
* @param sourceNode The document of the visual tree.
* @return a HTML-part containg arrows elements
*/
- private Element createArrowsElement(Document visualDocument, Node sourceNode) {
- Element table = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ private nsIDOMElement createArrowsElement(nsIDOMDocument visualDocument, Node sourceNode) {
+ nsIDOMElement table = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
- Element rowUp = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
- Element cellUp = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ nsIDOMElement rowUp = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ nsIDOMElement cellUp = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- Element imageUpElement = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ nsIDOMElement imageUpElement = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
ComponentUtil.setImg(imageUpElement, IMAGE_NAME_UP);
@@ -130,10 +129,10 @@
rowUp.appendChild(cellUp);
table.appendChild(rowUp);
- Element rowDown = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
- Element cellDown = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ nsIDOMElement rowDown = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ nsIDOMElement cellDown = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- Element imageDownElement = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ nsIDOMElement imageDownElement = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
ComponentUtil.setImg(imageDownElement, IMAGE_NAME_DOWN);
@@ -154,8 +153,8 @@
* @param sourceNode The document of the visual tree.
* @return a HTML-part containg input element
*/
- private Element createInputElement(Document visualDocument, Node sourceNode) {
- Element inputElement = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
+ private nsIDOMElement createInputElement(nsIDOMDocument visualDocument, Node sourceNode) {
+ nsIDOMElement inputElement = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
inputElement.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
getInputClass(sourceNode));
@@ -199,30 +198,24 @@
* java.lang.Object, java.lang.String, java.lang.String)
*/
@Override
- // TODO A. Yukhovich please fix it
- /*
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
- String value) {
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
// 1. Call super method
- super.setAttribute(pageContext, sourceElement, visualDocument,
- visualNode, data, name, value);
+ super.setAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name, value);
- Element table = (Element) visualNode;
- NodeList listTable = table.getChildNodes();
- Node nodeTr = listTable.item(0);
- NodeList listTr = nodeTr.getChildNodes();
- Node nodeTd = listTr.item(0);
+ nsIDOMElement table = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMNodeList listTable = table.getChildNodes();
+ nsIDOMNode nodeTr = listTable.item(0);
+ nsIDOMNodeList listTr = nodeTr.getChildNodes();
+ nsIDOMNode nodeTd = listTr.item(0);
- NodeList listTd = nodeTd.getChildNodes();
+ nsIDOMNodeList listTd = nodeTd.getChildNodes();
+ nsIDOMNode entry0 = listTd.item(0);
- Element inputElement = (Element) listTd.item(0);
+ nsIDOMElement inputElement = (nsIDOMElement) entry0.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- inputElement.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- getInputClass(sourceElement));
+ inputElement.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, getInputClass(sourceElement));
- inputElement.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- getInputStyle(sourceElement));
+ inputElement.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, getInputStyle(sourceElement));
inputElement.setAttribute(HtmlComponentUtil.HTML_SIZE_ATTR, getInputSize(sourceElement));
inputElement.setAttribute("value", getInputValue(sourceElement));
@@ -230,8 +223,7 @@
// 3. Set a style for main container
String strStyle = getAttribute("style", sourceElement);
table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, strStyle);
- }
- */
+ }
@@ -243,10 +235,4 @@
return DEFAULT_INPUT_STYLE;
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
-
}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -16,10 +16,9 @@
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
@@ -34,12 +33,6 @@
private String PAINT2D_CSS_FILE = "/paint2D/paint2D.css";
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
-
/*
* (non-Javadoc)
*
@@ -47,28 +40,18 @@
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String)
*/
- // TODO A. Yukhovich please fix it
- /*
@Override
- public void removeAttribute(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
- Object data, String name) {
- super.removeAttribute(pageContext, sourceElement, visualDocument,
- visualNode, data, name);
- Element img = (Element) visualNode;
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
+ super.removeAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name);
+ nsIDOMElement img = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
if (name.equals("styleClass")
- && sourceElement
- .getAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR) == null
- && sourceElement
- .getAttribute(HtmlComponentUtil.HTML_HEIGHT_ATTR) == null) {
- img
- .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "imgStyleClass");
+ && sourceElement.getAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR) == null
+ && sourceElement.getAttribute(HtmlComponentUtil.HTML_HEIGHT_ATTR) == null) {
+ img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,"imgStyleClass");
} else
img.removeAttribute(name);
}
- */
/*
* (non-Javadoc)
@@ -77,21 +60,15 @@
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String, java.lang.String)
*/
- // TODO A. Yukhovich please fix it
- /*
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
- String value) {
- super.setAttribute(pageContext, sourceElement, visualDocument,
- visualNode, data, name, value);
- Element img = (Element) visualNode;
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
+ super.setAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name, value);
+ nsIDOMElement img = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
if (name.equals("styleClass")) {
img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, value);
} else
img.setAttribute(name, value);
}
- */
/**
* Create html instead rich:faces component.
@@ -104,11 +81,8 @@
* The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- // TODO A. Yukhovich please fix it
- /*
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
- Element img = visualDocument.createElement("img");
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+ nsIDOMElement img = visualDocument.createElement("img");
ComponentUtil.setImg(img, IMAGE_NAME);
ComponentUtil.setCSSLink(pageContext, PAINT2D_CSS_FILE, "paint2d");
String attrValue = ((Element) sourceNode).getAttribute("styleClass");
@@ -122,35 +96,8 @@
.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
"imgStyleClass");
}
- copyAtrributes(sourceNode, img, visualDocument);
+ ComponentUtil.copyAttributes(sourceNode, img);
VpeCreationData creationData = new VpeCreationData(img);
return creationData;
}
- */
-
- /**
- * Copy attributes from one node to another node.
- *
- * @param sourceNode
- * @param distinitionNode
- */
- // TODO A. Yukhovich please fix it
- /*
- private void copyAtrributes(Node sourceNode, Element distinitionNode,
- Document visualDocument) {
- NamedNodeMap sourceAttrbutes = sourceNode.getAttributes();
- for (int i = 0; i < sourceAttrbutes.getLength(); i++) {
- Attr attr = visualDocument.createAttribute(sourceAttrbutes.item(i)
- .getNodeName());
- attr.setNodeValue(sourceAttrbutes.item(i).getNodeValue());
- distinitionNode.setAttributeNode(attr);
- }
- }
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
- */
}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -16,7 +16,8 @@
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -34,17 +35,13 @@
*
* @param pageContext
* Contains the information on edited page.
- * @param sourceNode
- * The current node of the source tree.
- * @param visualDocument
- * The document of the visual tree.
+ * @param sourceNode The current node of the source tree.
+ * @param visualDocument The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- Element img = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement img = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(img, IMAGE_NAME);
if(sourceNode instanceof Element) {
@@ -52,8 +49,7 @@
img.setAttribute("height", getSize((Element)sourceNode, "height"));
}
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*img*/);
+ VpeCreationData creationData = new VpeCreationData(img);
return creationData;
}
@@ -67,41 +63,19 @@
}
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
-
/**
*
* @see com.exadel.vpe.editor.template.VpeAbstractTemplate#setAttribute(com.exadel.vpe.editor.context.VpePageContext,
* org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
* java.lang.Object, java.lang.String, java.lang.String)
*/
- // TODO A. Yukhovich please fix it
- /*
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
- String value) {
- super.setAttribute(pageContext, sourceElement, visualDocument,
- visualNode, data, name, value);
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
+ super.setAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name, value);
- Element img = (Element) visualNode;
+ nsIDOMElement img = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
img.setAttribute("width", getSize(sourceElement, "width"));
img.setAttribute("height", getSize(sourceElement, "height"));
}
- */
-
-
- // TODO A. Yukhovich please fix it
- /*
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
- */
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -19,7 +19,8 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -31,13 +32,6 @@
super();
}
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
/**
* Encode columnGroup
@@ -47,13 +41,13 @@
* @param parentVisualNode
* @return
*/
- public VpeCreationData encode(VpeCreationData creationData, Element sourceElement, Document visualDocument, Element parentVisualNode) {
+ public VpeCreationData encode(VpeCreationData creationData, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement parentVisualNode) {
if(creationData!=null) {
// Encode header
encodeHeader(creationData, sourceElement, visualDocument, parentVisualNode);
}
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
ComponentUtil.copyAttributes(sourceElement, tr);
boolean header = false;
@@ -74,16 +68,14 @@
if(creationData==null) {
// Method was called from create()
- // TODO A. Yukhovich please fix it
- creationData = new VpeCreationData(null/*tr*/);
+ creationData = new VpeCreationData(tr);
} else {
// Method was called from dataTable
parentVisualNode.appendChild(tr);
}
// Create mapping to Encode body
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo trInfo = new VpeChildrenInfo(null/*tr*/);
+ VpeChildrenInfo trInfo = new VpeChildrenInfo(tr);
creationData.addChildrenInfo(trInfo);
List<Node> children = ComponentUtil.getChildren(sourceElement);
for (Node child : children) {
@@ -101,11 +93,9 @@
}
ComponentUtil.copyAttributes(sourceElement, tr);
if(parentVisualNode!=null) {
- // TODO A. Yukhovich please fix it
- parentVisualNode.appendChild(null/*tr*/);
+ parentVisualNode.appendChild(tr);
}
- // TODO A. Yukhovich please fix it
- trInfo = new VpeChildrenInfo(null/*tr*/);
+ trInfo = new VpeChildrenInfo(tr);
creationData.addChildrenInfo(trInfo);
}
}
@@ -120,26 +110,26 @@
return creationData;
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
VpeCreationData creationData = encode(null, sourceElement, visualDocument, null);
return creationData;
}
- protected void encodeHeader(VpeCreationData creationData, Element sourceElement, Document visualDocument, Element parentVisualNode) {
+ protected void encodeHeader(VpeCreationData creationData, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement parentVisualNode) {
encodeHeaderOrFooter(creationData, sourceElement, visualDocument, parentVisualNode, "header", "dr-subtable-header rich-subtable-header", "dr-subtable-headercell rich-subtable-headercell");
}
- protected void encodeFooter(VpeCreationData creationData, Element sourceElement, Document visualDocument, Element parentVisualNode) {
+ protected void encodeFooter(VpeCreationData creationData, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement parentVisualNode) {
encodeHeaderOrFooter(creationData, sourceElement, visualDocument, parentVisualNode, "footer", "dr-subtable-footer rich-subtable-footer", "dr-subtable-footercell rich-subtable-footercell");
}
- protected void encodeHeaderOrFooter(VpeCreationData creationData, Element sourceElement, Document visualDocument, Element parentVisualNode, String facetName, String trClass, String tdClass) {
+ protected void encodeHeaderOrFooter(VpeCreationData creationData, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement parentVisualNode, String facetName, String trClass, String tdClass) {
ArrayList<Element> columns = RichFacesDataTableTemplate.getColumns(sourceElement);
ArrayList<Element> columnsHeaders = RichFacesDataTableTemplate.getColumnsWithFacet(columns, facetName);
if(!columnsHeaders.isEmpty()) {
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
parentVisualNode.appendChild(tr);
String styleClass = trClass;
if(styleClass!=null) {
@@ -189,22 +179,15 @@
return null;
}
- // TODO A. Yukhovich please fix it
- /*
@Override
- public void removeAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name) {
- ((Element)visualNode).removeAttribute(name);
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
+ nsIDOMElement visualElement = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.removeAttribute(name);
}
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- ((Element)visualNode).setAttribute(name, value);
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
+ nsIDOMElement visualElement = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.setAttribute(name, value);
}
- */
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -11,24 +11,19 @@
package org.jboss.tools.jsf.vpe.richfaces.template;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
-import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-//TODO A. Yukhovich please fix if
-//import org.jboss.tools.vpe.editor.util.MozillaSupports;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -41,14 +36,6 @@
public static final String ATTR_LOCATION_RIGHT_VALUE = "right";
- // TODO A. Yukhovich please fix if
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
-
private class SourceToolBarGroupItem {
private Node toolBarGroupItem;
private String itemSeparator;
@@ -144,9 +131,8 @@
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
- Element visualNode = null;
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+ nsIDOMElement visualNode = null;
VpeCreationData creationData = null;
Element sourceElement = (Element)sourceNode;
@@ -154,14 +140,12 @@
if (!sourceNode.getParentNode().getNodeName().endsWith(":" + RichFacesToolBarTemplate.TAG_NAME)) {
visualNode = RichFacesToolBarTemplate.createExceptionNode(visualDocument, "Parent should be toolBar");
- // TODO A. Yukhovich please fix if
- creationData = new VpeCreationData(null/*visualNode*/);
+ creationData = new VpeCreationData(visualNode);
} else if (!RichFacesToolBarTemplate.isValidItemSeparatorName(itemSeparator)) {
visualNode = RichFacesToolBarTemplate.createExceptionNode(visualDocument,
"Unknown type of separator \"" + itemSeparator + "\"");
- // TODO A. Yukhovich please fix if
- creationData = new VpeCreationData(null/*visualNode*/);
+ creationData = new VpeCreationData(visualNode);
} else {
SourceToolBarGroupItems sourceToolBarGroupItems = new SourceToolBarGroupItems(sourceNode,
@@ -171,18 +155,17 @@
visualNode = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
visualNode.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "border: 0px none; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;");
- Element body = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TBODY);
- Element row = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ nsIDOMElement body = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TBODY);
+ nsIDOMElement row = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
row.setAttribute(HtmlComponentUtil.HTML_ATTR_VALIGN, HtmlComponentUtil.HTML_ATTR_VALIGN_MIDDLE_VALUE);
- // TODO A. Yukhovich please fix if
- creationData = new VpeCreationData(null/*visualNode*/);
+ creationData = new VpeCreationData(visualNode);
Iterator<SourceToolBarGroupItem> iterator = sourceToolBarGroupItems.iterator();
while(iterator.hasNext()) {
SourceToolBarGroupItem toolBarGroupItem = iterator.next();
- Element cell = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ nsIDOMElement cell = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
if (toolBarGroupItem.isItem()) {
ComponentUtil.correctAttribute(sourceElement, cell,
RichFacesToolBarTemplate.CONTENTCLASS_ATTR_NAME,
@@ -191,8 +174,7 @@
RichFacesToolBarTemplate.CONTENTSTYLE_ATTR_NAME,
HtmlComponentUtil.HTML_STYLE_ATTR, null, null);
- // TODO A. Yukhovich please fix if
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(null/*cell*/);
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(cell);
creationData.addChildrenInfo(childrenInfo);
childrenInfo.addSourceChild(toolBarGroupItem.getToolBarGroupItem());
} else {
@@ -202,35 +184,24 @@
HtmlComponentUtil.HTML_CLASS_ATTR, null, null);
String separatorImageUrl = RichFacesToolBarTemplate
.getSeparatorImageUrlString(toolBarGroupItem.getItemSeparator());
- Element separatorImage = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement separatorImage = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(separatorImage, separatorImageUrl);
cell.appendChild(separatorImage);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(separatorImage);
}
row.appendChild(cell);
- // TODO A. Yukhovich please fix if
- //MozillaSupports.release(cell);
}
body.appendChild(row);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(row);
visualNode.appendChild(body);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(body);
}
return creationData;
}
- // TODO A. Yukhovich please fix if
- /*
@Override
- public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode,
- Node visualNode, Object data) {
+ public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
String prefix = sourceNode.getPrefix();
if (prefix == null) {
return null;
@@ -249,13 +220,5 @@
return parent;
}
- */
-
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java 2007-08-13 07:26:17 UTC (rev 3082)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java 2007-08-13 09:23:03 UTC (rev 3083)
@@ -10,12 +10,9 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
@@ -24,14 +21,11 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-//TODO A. Yukhovich please fix if
-// import org.jboss.tools.vpe.editor.util.MozillaSupports;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMText;
import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
public class RichFacesToolBarTemplate extends VpeAbstractTemplate {
public static final String TAG_NAME = "toolBar";
@@ -58,26 +52,16 @@
static final String WIDTH_ATTR_NAME = "width";
static final String HEIGHT_ATTR_NAME = "height";
- // TODO A. Yukhovich please fix if
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
VpeCreationData creationData = null;
- Element visualNode = null;
+ nsIDOMElement visualNode = null;
Element sourceElement = (Element) sourceNode;
String itemSeparator = sourceElement.getAttribute(ITEMSEPARATOR_ATTR_NAME);
if (!isValidItemSeparatorName(itemSeparator)) {
visualNode = createExceptionNode(visualDocument,
"Unknown type of separator \"" + itemSeparator + "\"");
- // TODO A. Yukhovich please fix it
- creationData = new VpeCreationData(null/*visualNode*/);
+ creationData = new VpeCreationData(visualNode);
} else {
SourceToolBarItems sourceToolBarItems = new SourceToolBarItems(sourceNode, itemSeparator);
String itemSeparatorImageUrl = getSeparatorImageUrlString(sourceToolBarItems.getItemSeparator());
@@ -101,10 +85,11 @@
STYLE_ATTR_NAME,
HtmlComponentUtil.HTML_STYLE_ATTR, style, style);
- // TODO A. Yukhovich please fix if
- creationData = new VpeCreationData(null/*visualNode*/);
+ creationData = new VpeCreationData(visualNode);
- Element body = null, row = null, cell = null;
+ nsIDOMElement body = null;
+ nsIDOMElement row = null;
+ nsIDOMElement cell = null;
body = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TBODY);
row = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
@@ -125,8 +110,7 @@
toolBarItem.isToolBarGroupItem() ? "padding: 0px 0px 0px 0px;" : null,
toolBarItem.isToolBarGroupItem() ? "padding: 0px 0px 0px 0px;" : null);
- // TODO A. Yukhovich please fix if
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(null/*cell*/);
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(cell);
creationData.addChildrenInfo(childrenInfo);
childrenInfo.addSourceChild(toolBarItem.getToolBarItem());
} else {
@@ -136,25 +120,19 @@
ComponentUtil.correctAttribute(sourceElement, cell,
SEPARATORCLASS_ATTR_NAME,
HtmlComponentUtil.HTML_CLASS_ATTR, null, null);
- Element separatorImage = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement separatorImage = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(separatorImage, itemSeparatorImageUrl);
cell.appendChild(separatorImage);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(separatorImage);
}
}
row.appendChild(cell);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(cell);
}
// Empty column
cell = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
cell.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, "100%");
row.appendChild(cell);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(cell);
iterator = sourceToolBarItems.getRightItemsIterator();
while (iterator.hasNext()) {
@@ -170,8 +148,7 @@
toolBarItem.isToolBarGroupItem() ? "padding: 0px;" : null,
toolBarItem.isToolBarGroupItem() ? "padding: 0px;" : null);
- // TODO A. Yukhovich please fix if
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(null/*cell*/);
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(cell);
creationData.addChildrenInfo(childrenInfo);
childrenInfo.addSourceChild(toolBarItem.getToolBarItem());
} else {
@@ -181,39 +158,36 @@
ComponentUtil.correctAttribute(sourceElement, cell,
SEPARATORCLASS_ATTR_NAME,
HtmlComponentUtil.HTML_CLASS_ATTR, null, null);
- Element separatorImage = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement separatorImage = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(separatorImage, itemSeparatorImageUrl);
cell.appendChild(separatorImage);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(separatorImage);
}
}
row.appendChild(cell);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(cell);
}
body.appendChild(row);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(row);
visualNode.appendChild(body);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(body);
}
return creationData;
}
- static Element createExceptionNode(Document visualDocument, String message) {
- Element visualNode;
+ /**
+ *
+ * @param visualDocument
+ * @param message
+ * @return
+ */
+ static nsIDOMElement createExceptionNode(nsIDOMDocument visualDocument, String message) {
+ nsIDOMElement visualNode;
+
visualNode = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
visualNode.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, EXCEPTION_ATTR_STYLE_VALUE);
- Text text = visualDocument.createTextNode(message);
+ nsIDOMText text = visualDocument.createTextNode(message);
visualNode.appendChild(text);
- // TODO A. Yukhovich please fix if
- // MozillaSupports.release(text);
-
+
return visualNode;
}
@@ -513,10 +487,4 @@
return itemSeparator;
}
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
18 years, 4 months
JBoss Tools SVN: r3082 - branches/jbosstools_xulrunner/vpe/plugins.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2007-08-13 03:26:17 -0400 (Mon, 13 Aug 2007)
New Revision: 3082
Removed:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.mozilla.gtk/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.mozilla.win32/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.mozilla/
Log:
http://jira.jboss.org/jira/browse/EXIN-235 plugins org.jboss.tools.vpe.mozilla.* were replaced with org.jboss.tools.vpe.xulrunner.*
18 years, 4 months