JBoss Tools SVN: r6643 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-28 11:05:23 -0500 (Thu, 28 Feb 2008)
New Revision: 6643
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java
Log:
JBIDE-509 internal method getLocationFor(String) moved to new interface ISeamDeclaration
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java 2008-02-28 15:58:34 UTC (rev 6642)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java 2008-02-28 16:05:23 UTC (rev 6643)
@@ -14,13 +14,8 @@
* Represents declaration of seam component.
* @author Alexey Kazakov
*/
-public interface ISeamComponentDeclaration extends ISeamElement, ISeamTextSourceReference {
+public interface ISeamComponentDeclaration extends ISeamDeclaration, ISeamTextSourceReference {
- /**
- * @return name of component.
- */
- public String getName();
-
public ISeamComponentDeclaration clone() throws CloneNotSupportedException;
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java 2008-02-28 15:58:34 UTC (rev 6642)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextVariable.java 2008-02-28 16:05:23 UTC (rev 6643)
@@ -14,14 +14,9 @@
* Represents Seam Context Variable.
* @author Alexey Kazakov
*/
-public interface ISeamContextVariable extends ISeamElement {
+public interface ISeamContextVariable extends ISeamDeclaration {
/**
- * @return name of context variable
- */
- public String getName();
-
- /**
* Sets name
* @param name
*/
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java 2008-02-28 16:05:23 UTC (rev 6643)
@@ -0,0 +1,31 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public interface ISeamDeclaration extends ISeamElement {
+
+ /**
+ * @return name of this declaration
+ */
+ public String getName();
+
+ /**
+ * @param path
+ * @return source reference for some member of declaration.
+ * e.g. if you need source reference for @Name you have to
+ * invoke getLocationFor("name");
+ */
+ public ISeamTextSourceReference getLocationFor(String path);
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java 2008-02-28 15:58:34 UTC (rev 6642)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java 2008-02-28 16:05:23 UTC (rev 6643)
@@ -15,14 +15,9 @@
/**
* A property of Seam Component defined in component.xml or seam.properties files
*/
-public interface ISeamProperty extends ISeamElement, ISeamTextSourceReference {
+public interface ISeamProperty extends ISeamDeclaration, ISeamTextSourceReference {
/**
- * @return name of this property
- */
- public String getName();
-
- /**
* @return value of this property
*/
public ISeamValue getValue();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java 2008-02-28 15:58:34 UTC (rev 6642)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java 2008-02-28 16:05:23 UTC (rev 6643)
@@ -17,6 +17,7 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.seam.core.IOpenableElement;
+import org.jboss.tools.seam.core.ISeamDeclaration;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
@@ -27,7 +28,7 @@
/**
* @author Viacheslav Kabanovich
*/
-public abstract class AbstractSeamDeclaration extends SeamObject implements ISeamTextSourceReference, IOpenableElement {
+public abstract class AbstractSeamDeclaration extends SeamObject implements ISeamDeclaration, ISeamTextSourceReference, IOpenableElement {
public static final String PATH_OF_NAME = "name"; //$NON-NLS-1$
protected String name;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2008-02-28 15:58:34 UTC (rev 6642)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2008-02-28 16:05:23 UTC (rev 6643)
@@ -27,6 +27,7 @@
import org.jboss.tools.seam.core.ISeamPackage;
import org.jboss.tools.seam.core.ISeamPropertiesDeclaration;
import org.jboss.tools.seam.core.ISeamProperty;
+import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamComponentMethodType;
@@ -88,6 +89,18 @@
return null;
}
+ public ISeamTextSourceReference getLocationFor(String path) {
+ ISeamJavaComponentDeclaration javaDeclaration = getJavaDeclaration();
+ if(javaDeclaration != null) return javaDeclaration.getLocationFor(path);
+ Set<ISeamXmlComponentDeclaration> xml = getXmlDeclarations();
+ for(ISeamXmlComponentDeclaration d: xml) {
+ if(d.getLocationFor(path) != null) {
+ return d.getLocationFor(path);
+ }
+ }
+ return null;
+ }
+
/**
*
*/
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java 2008-02-28 15:58:34 UTC (rev 6642)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java 2008-02-28 16:05:23 UTC (rev 6643)
@@ -2,6 +2,7 @@
import org.jboss.tools.seam.core.ISeamContextShortVariable;
import org.jboss.tools.seam.core.ISeamContextVariable;
+import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ScopeType;
public class SeamContextShortVariable extends SeamObject implements ISeamContextShortVariable {
@@ -34,4 +35,8 @@
public SeamContextShortVariable clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException();
}
+
+ public ISeamTextSourceReference getLocationFor(String path) {
+ return original.getLocationFor(path);
+ }
}
16 years, 10 months
JBoss Tools SVN: r6642 - trunk/hibernatetools/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-02-28 10:58:34 -0500 (Thu, 28 Feb 2008)
New Revision: 6642
Modified:
trunk/hibernatetools/docs/reference/en/modules/ant.xml
trunk/hibernatetools/docs/reference/en/modules/codegen.xml
trunk/hibernatetools/docs/reference/en/modules/plugins.xml
trunk/hibernatetools/docs/reference/en/modules/reverseengineering.xml
trunk/hibernatetools/docs/reference/en/modules/setup.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-238 - fixing some spelling mistakes & making some small corrections
Modified: trunk/hibernatetools/docs/reference/en/modules/ant.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/ant.xml 2008-02-28 15:22:31 UTC (rev 6641)
+++ trunk/hibernatetools/docs/reference/en/modules/ant.xml 2008-02-28 15:58:34 UTC (rev 6642)
@@ -604,7 +604,7 @@
</entry>
<entry>
- <para>The default package name to use when mappings for classes are created.</para>
+ <para>The default package name to use when mappings for classes are created</para>
</entry>
<entry>
@@ -618,7 +618,7 @@
</entry>
<entry>
- <para>The name of a property file, e.g. "hibernate.properties".</para>
+ <para>The name of a property file, e.g. "hibernate.properties"</para>
</entry>
<entry>
@@ -942,7 +942,7 @@
</entry>
<entry>
- <para>Code will contain JDK 5 constructs such as generics and static imports.</para>
+ <para>Code will contain JDK 5 constructs such as generics and static imports</para>
</entry>
<entry>
@@ -957,7 +957,7 @@
<entry>
<para>Code will contain EJB 3 features, e.g. using annotations from
- javax.persistence and org.hibernate.annotations.</para>
+ javax.persistence and org.hibernate.annotations</para>
</entry>
<entry>
Modified: trunk/hibernatetools/docs/reference/en/modules/codegen.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/codegen.xml 2008-02-28 15:22:31 UTC (rev 6641)
+++ trunk/hibernatetools/docs/reference/en/modules/codegen.xml 2008-02-28 15:58:34 UTC (rev 6642)
@@ -5,7 +5,7 @@
<para>When using <emphasis>
<property><hbm2java></property>
</emphasis> or the eclipse plugin to generate POJO java code you have the possibility to control
- certain aspects of the code generation. This is primarily done through the <emphasis>
+ certain aspects of the code generation. This is primarily done with the <emphasis>
<property><meta></property>
</emphasis> tag in the mapping files. The following section describes the possible <emphasis>
<property><meta></property>
@@ -137,7 +137,7 @@
<literal>interface</literal>
</entry>
- <entry>If true an interface is generated instead of an class.</entry>
+ <entry>If true, an interface is generated instead of an class.</entry>
</row>
<row>
@@ -153,7 +153,7 @@
<literal>extends</literal>
</entry>
- <entry>class the class should extend (ignored for subclasses)</entry>
+ <entry>class that the current class should extend (ignored for subclasses)</entry>
</row>
<row>
@@ -437,7 +437,7 @@
<section>
<title>Generate pre/post-conditions for methods</title>
- <para>With an <emphasis> <meta attribute="class-code"></emphasis>, you can add
+ <para>With a <emphasis> <meta attribute="class-code"></emphasis>, you can add
additional methods on a given class, nevertheless such <emphasis>
<property><meta></property>
</emphasis> attribute can not be used at a property scope level and <property>Hibernate
@@ -445,13 +445,13 @@
<property><meta></property>
</emphasis> attributes.</para>
- <para>A possibly solution for this is to modify the freemarker templates responsible for
+ <para>A possible solution for this is to modify the freemarker templates responsible for
generating the POJO's. If you look inside <emphasis>
<property>hibernate-tools.jar</property>, </emphasis> you can find the template: <emphasis>
<property>pojo/PojoPropertyAccessor.ftl</property>
</emphasis></para>
- <para>This file is as the named indicates used to generate property accessors for pojo's.</para>
+ <para>This file is as the name indicates used to generate property accessors for pojo's.</para>
<para>Extract the <emphasis>
<property>PojoPropertyAccessor.ftl</property>
@@ -510,7 +510,7 @@
contents will be generated into the body of the relevant <literal>set</literal> method.</para>
<para>As an example let us add a pre-condition for property <literal>name</literal>
- preventing no <property>Person</property> can have an empty name. So we have to modify the <emphasis>
+ preventing no <property>Person</property> can have an empty name. Hence we have to modify the <emphasis>
<property>Person.hbm.xml</property>
</emphasis> file like this:</para>
@@ -530,7 +530,7 @@
</hibernate-mapping>]]></programlisting>
<note>
- <para>I) To scape the & symbol we put &amp;. You can use
+ <para>I) To escape the & symbol we put &amp;. You can use
<![CDATA[]]> instead.</para>
<para>II) Note that we are referring to "firstName" directly and this is the parameter
name not the actual field name. If you want to refer the field you have to use
Modified: trunk/hibernatetools/docs/reference/en/modules/plugins.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/plugins.xml 2008-02-28 15:22:31 UTC (rev 6641)
+++ trunk/hibernatetools/docs/reference/en/modules/plugins.xml 2008-02-28 15:58:34 UTC (rev 6642)
@@ -98,7 +98,7 @@
<property>hibernate.cfg.xml</property>
</emphasis> will be automatically opened in an editor. The last option <emphasis>
<property>Create Console Configuration</property>
- </emphasis> is enabled by default and when enabled it will automatically use the <emphasis>
+ </emphasis> is enabled by default and when enabled, it will automatically use the <emphasis>
<property>hibernate.cfg.xml</property>
</emphasis> for the basis of a Console configuration.</para>
</section>
@@ -111,7 +111,7 @@
classpath are needed to load the POJO's, JDBC drivers etc. It is required to make usage of
query prototyping, reverse engineering and code generation. You can have multiple named
console configurations. Normally you would just need one per project, but more is definitely
- possible.</para>
+ possible if your project requires this.</para>
<para>You create a console configuration by running the <property>Console Configuration
Wizard</property>, shown in the following screenshot. The same wizard will also be used if you
@@ -323,6 +323,8 @@
</mediaobject>
</figure>
+
+ <para>The fallowing table specifies the parameters of the Classpath tab of the wizard.</para>
<table>
<title>Hibernate Console Configuration Classpath</title>
@@ -1037,7 +1039,7 @@
</figure>
<important>
- <para>Note that it requires a proper configured hibernate console configuration and this
+ <para>Table/Column completion requires a proper configured hibernate console configuration and this
configuration should be the default for the project where the <emphasis>
<property>hbm.xml</property>
</emphasis> resides.</para>
@@ -1093,15 +1095,17 @@
<para>The editor is intended to allow easy definition of type mappings, table include/excludes
and specific override settings for columns, e.g. define an explicit name for a column when the
- default naming rules is not applicable.</para>
+ default naming rules are not applicable.</para>
- <para>Note that not all the features of the <emphasis>
+ <note><para>
+ Not all the features of the <emphasis>
<property>.reveng.xml </property>
- </emphasis> file is exposed or fully implemented in the editor, but the main functionality is
+ </emphasis> file are exposed or fully implemented in the editor, but the main functionality is
there. To understand the full flexibility of the <emphasis>
<property>reveng.xml</property>
- </emphasis>, please see <xref linkend="hibernaterevengxmlfile"/></para>
-
+ </emphasis>, please see <xref linkend="hibernaterevengxmlfile"/> </para>
+ </note>
+
<para>The editor is activated as soon as an <emphasis>
<property>.reveng.xml </property>
</emphasis> file is opened. To get an initial <emphasis>
@@ -1172,7 +1176,7 @@
<para>The <emphasis>
<property>Type Mappings</property>
- </emphasis> page is used for specifying type mappings from JBDS types to any Hibernate type
+ </emphasis> page is used for specifying type mappings from JBDC types to any Hibernate type
(including usertypes) if the default rules are not applicable. Here again to see the database
tables press <emphasis>
<property>Refresh</property>
@@ -1195,7 +1199,7 @@
<para>The <emphasis>
<property>Table and Columns</property>
- </emphasis> page allow the user to explicit set e.g. which hibernatetype and propertyname that
+ </emphasis> page allows you to explicit set e.g. which hibernatetype and propertyname that
should be used in the reverse engineered model. For more details on how to configure the
tables while reverse engineering read the <link linkend="tab_and_col">Specific table
configuration</link> section.</para>
@@ -1259,7 +1263,7 @@
<section>
<title>Mapping Diagram</title>
- <para>To get a visual feel on how entities are related and view their structure a
+ <para>In order to get a visual feel on how entities are related as well as view their structures, a
<property>Mapping Diagram</property> is provided. It is available by right clicking on
the entity you want a mapping diagram for and then choose <emphasis>
<property>Open Mapping Diagram</property>
@@ -1290,7 +1294,7 @@
Editor</property> or <property>Hibernate Criteria Editor</property>. The editors
automatically detect the chosen configuration.</para>
- <para>If the menu item is disabled then you need at first to create an <property>Session
+ <para>If the menu item is disabled then you need at first to create a <property>Session
Factory</property>. That is done by simply expanding the <property>Session
Factory</property> node.</para>
Modified: trunk/hibernatetools/docs/reference/en/modules/reverseengineering.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/reverseengineering.xml 2008-02-28 15:22:31 UTC (rev 6641)
+++ trunk/hibernatetools/docs/reference/en/modules/reverseengineering.xml 2008-02-28 15:58:34 UTC (rev 6642)
@@ -80,7 +80,7 @@
<table-filter match-catalog="BAD" match-schema="SCHEMA" match-name=".*" exclude="true" />
<!-- table allows you to override/define how reverse engineering
- are done for a specific table -->
+ is done for a specific table -->
<table name="ORDERS">
<primary-key>
<!-- setting up a specific id generator for a table -->
@@ -154,7 +154,7 @@
</section>
</section>
- <section>
+ <section id="type_map">
<title>Type mappings (<type-mapping>)</title>
<para>The <emphasis>
@@ -436,7 +436,7 @@
</section>
- <section>
+ <section id="tab_and_col">
<title>Specific table configuration (<table>)</title>
<para><emphasis>
@@ -638,7 +638,7 @@
<row>
<entry><para>name</para></entry>
- <entry><para>Column name.</para></entry>
+ <entry><para>Column name</para></entry>
<entry><para>Required</para></entry>
</row>
@@ -656,7 +656,7 @@
<row>
<entry><para>type</para></entry>
- <entry><para>Which hibernate-type to use for this specific column.</para></entry>
+ <entry><para>Which hibernate-type to use for this specific column</para></entry>
<entry><para>Optional</para></entry>
</row>
@@ -666,7 +666,7 @@
<entry><para>property</para></entry>
<entry><para>What property name will be generated for this
- column.</para></entry>
+ column</para></entry>
<entry><para>Optional</para></entry>
</row>
@@ -674,7 +674,7 @@
<row>
<entry><para>exclude</para></entry>
- <entry><para>Set to true if this column should be ignored.</para></entry>
+ <entry><para>Set to true if this column should be ignored</para></entry>
<entry><para>default: false</para></entry>
</row>
Modified: trunk/hibernatetools/docs/reference/en/modules/setup.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/setup.xml 2008-02-28 15:22:31 UTC (rev 6641)
+++ trunk/hibernatetools/docs/reference/en/modules/setup.xml 2008-02-28 15:58:34 UTC (rev 6642)
@@ -36,8 +36,10 @@
<property>/feature</property>
</emphasis> directory into your eclipse directory or eclipse extensions directory. Sometimes
Eclipse does not automatically detect new plugins and thus the tools will not be activated. To
- ensure eclipse sees these changes run eclipse with the -clean option. E.g. <literal>eclipse
- -clean</literal> Using the updatesite does not require any additional steps.</para>
+ ensure eclipse sees these changes just clean up the cached plugin information by running eclipse with the <emphasis>
+ <property>-clean</property></emphasis> option, e.g. <emphasis>
+ <property>eclipse
+ -clean</property>.</emphasis> Using the updatesite does not require any additional steps.</para>
<note>
<para>If you need more basic instructions on installing plugins and general usage of eclipse
16 years, 10 months
JBoss Tools SVN: r6641 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-02-28 10:22:31 -0500 (Thu, 28 Feb 2008)
New Revision: 6641
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1827
Use console configuration instead it name to find JavaProject
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2008-02-28 14:21:12 UTC (rev 6640)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2008-02-28 15:22:31 UTC (rev 6641)
@@ -93,7 +93,7 @@
String prefix = "Session session;"; // has to do this because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=141518
try {
- IJavaProject javaProject = ProjectUtils.findJavaProject( editor.getConsoleConfiguration().getName() );
+ IJavaProject javaProject = ProjectUtils.findJavaProject( editor.getConsoleConfiguration() );
collector = new CompletionProposalCollector( javaProject );
collector.acceptContext( new CompletionContext() );
16 years, 10 months
JBoss Tools SVN: r6640 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: context and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-02-28 09:21:12 -0500 (Thu, 28 Feb 2008)
New Revision: 6640
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeChildrenInfo.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreationData.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-675, cashing of templates results was added to visual editor.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-02-28 13:57:40 UTC (rev 6639)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-02-28 14:21:12 UTC (rev 6640)
@@ -446,6 +446,8 @@
break;
case INodeNotifier.ADD:
+ //we should remove all parent nodes from vpe cash
+ visualBuilder.removeNode((Node)newValue);
break;
case INodeNotifier.REMOVE:
@@ -473,11 +475,6 @@
}
break;
}
- //TODO Max Areshkau JBIDE-1457
-// if (visualBuilder.rebuildFlag) {
-//// pageContext.fireTaglibsChanged();
-// }
-
switcher.stopActiveEditor();
}
@@ -1186,27 +1183,12 @@
visualRefresh();
}
- // VpeTaglibListener implementation
-// public void taglibPrefixChanged(String[] prefixs) {
-// if (VpeDebug.printSourceMutationEvent) {
-// String s = ""; //$NON-NLS-1$
-// for (int i = 0; i < prefixs.length; i++) {
-// if (i > 0) {
-// s += ", "; //$NON-NLS-1$
-// }
-// s += prefixs[i];
-// }
-// }
-// queryVisualRefresh = true;
-//// visualRefreshImpl();
-// }
-
+
public void visualRefresh() {
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
visualRefreshImpl();
-// pageContext.fireTaglibsChanged();
switcher.stopActiveEditor();
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-02-28 13:57:40 UTC (rev 6639)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-02-28 14:21:12 UTC (rev 6640)
@@ -234,6 +234,7 @@
private boolean addNode(Node sourceNode, nsIDOMNode visualNextNode,
nsIDOMNode visualContainer) {
+
nsIDOMNode visualNewNode = createNode(sourceNode, visualContainer);
// Fix for JBIDE-1097
try {
@@ -384,18 +385,35 @@
VpeCreationData creationData = null;
// FIX FOR JBIDE-1568, added by Max Areshkau
try {
- creationData = template.create(getPageContext(), sourceNode,
- getVisualDocument());
+ if(getPageContext().isCreationDataExistInCash(sourceNode)) {
+
+ creationData = getPageContext().getVpeCreationDataFromCash(sourceNode).createHashCopy();
+ } else {
+ creationData = template.create(getPageContext(), sourceNode,
+ getVisualDocument());
+ if(creationData.getNode()!=null) {
+
+ getPageContext().addCreationDataToCash(sourceNode, creationData.createHashCopy());
+
+ }
+ }
} catch (XPCOMException ex) {
VpePlugin.getPluginLog().logError(ex);
VpeTemplate defTemplate = templateManager.getDefTemplate();
creationData = defTemplate.create(getPageContext(), sourceNode,
getVisualDocument());
}
+
pageContext.setCurrentVisualNode(null);
- nsIDOMElement visualNewElement = (nsIDOMElement) creationData
- .getNode();
+ nsIDOMElement visualNewElement = null;
+ if(creationData.getNode()!=null) {
+
+ visualNewElement = (nsIDOMElement) creationData
+ .getNode().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ }
+
+
if (visualNewElement != null)
correctVisualAttribute(visualNewElement);
@@ -842,6 +860,8 @@
}
public void removeNode(Node sourceNode) {
+ //remove from cash should be called first
+ getPageContext().removeNodeFromVpeCash(sourceNode);
domMapping.remove(sourceNode);
getSourceNodes().remove(sourceNode);
if (sourceNode instanceof INodeNotifier) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-02-28 13:57:40 UTC (rev 6639)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-02-28 14:21:12 UTC (rev 6640)
@@ -10,9 +10,11 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.context;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.IDocument;
@@ -43,6 +45,8 @@
import org.jboss.tools.vpe.editor.css.ResourceReference;
import org.jboss.tools.vpe.editor.css.TaglibReferenceList;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
import org.jboss.tools.vpe.editor.util.FileUtil;
import org.jboss.tools.vpe.editor.util.XmlUtil;
@@ -62,8 +66,11 @@
private VpeVisualDomBuilder visualBuilder;
private VpeEditorPart editPart;
WtpKbConnector connector;
- private nsIDOMNode currentVisualNode;
+ private nsIDOMNode currentVisualNode;
+ //Added by Max Areshkau to increase perfomance of VPE JBIDE-675
+ private Map<Node,VpeCreationData> vpeCash;
+
public VpePageContext(VpeTemplateManager templateManager, BundleMap bundle, VpeEditorPart editPart) {
this.bundle = bundle;
this.editPart = editPart;
@@ -107,6 +114,8 @@
public void clearAll() {
bundleDependencySet.clear();
bundle.clearAll();
+ //clean a cash nodes
+ clearVpeCash();
}
public void dispose() {
@@ -267,53 +276,7 @@
return null;
}
-// public List<TaglibData> getTagLibs() {
-// List<TaglibData> clone = new ArrayList<TaglibData>();
-// Iterator iter = taglibs.iterator();
-// while (iter.hasNext()) {
-// TaglibData taglib = (TaglibData)iter.next();
-// if (!taglib.inList(clone)) {
-// clone.add(taglib);
-// }
-// }
-// return clone;
-// }
-// private boolean buildTaglibsDifferences(List newTaglibs, List delTaglibs) {
-// Iterator lastIter = lastTaglibs.iterator();
-// while (lastIter.hasNext()) {
-// TaglibData oldTaglib = (TaglibData)lastIter.next();
-// Iterator newIter = newTaglibs.iterator();
-// while (newIter.hasNext()) {
-// if (oldTaglib.isEquals((TaglibData)newIter.next())) {
-// newIter.remove();
-// oldTaglib = null;
-// break;
-// }
-// }
-// if (oldTaglib != null) {
-// delTaglibs.add(oldTaglib);
-// }
-// }
-// return newTaglibs.size() > 0 || delTaglibs.size() > 0;
-// }
-
-// public void fireTaglibsChanged() {
-// List newTaglibs = getTagLibs();
-// List delTaglibs = new ArrayList();
-// if (buildTaglibsDifferences(newTaglibs, delTaglibs)) {
-// if (VpeDebug.PRINT_SOURCE_MUTATION_EVENT) {
-// System.out.println(">>> TaglibsChanged");
-// }
-// for (int i = 0; i < taglibListeners.length; i++) {
-// taglibListeners[i].taglibPrefixChanged(null);
-// fireTaglibChanged(taglibListeners[i], newTaglibs, delTaglibs);
-// }
-// lastTaglibs = getTagLibs();
-// }
-// taglibChanged = false;
-// }
-
private void fireTaglibChanged(VpeTaglibListener taglibListener, List newTaglibs, List delTaglibs) {
Iterator iter = delTaglibs.iterator();
while (iter.hasNext()) {
@@ -327,13 +290,6 @@
}
}
-// public boolean isTaglibChanged() {
-// if (!taglibChanged) return false;
-// List newTaglibs = getTagLibs();
-// List delTaglibs = new ArrayList();
-// return buildTaglibsDifferences(newTaglibs, delTaglibs);
-// }
-
public WtpKbConnector getConnector() {
return connector;
}
@@ -372,41 +328,77 @@
this.currentVisualNode = currentVisualNode;
}
-// boolean registerTaglibs(WtpKbConnector wtpKbConnector, VpeTaglibManager taglibManager, IDocument document) {
-// if(wtpKbConnector == null) return false;
-// TLDCMDocumentManager manager = TaglibController.getTLDCMDocumentManager(document);
-// if(taglibManager != null) {
-// List list = taglibManager.getTagLibs();
-// if(list != null) {
-// Iterator it = list.iterator();
-// while(it.hasNext()) {
-// TaglibData data = (TaglibData)it.next();
-// IEditorInput ei = editPart.getEditorInput();
-// TLDRegisterHelper.registerTld(data, (JspWtpKbConnector)wtpKbConnector, document, ei);
-// }
-// return true;
-// }
-// }
-// if(manager != null) {
-// List list = manager.getTaglibTrackers();
-// for (int i = 0; i < list.size(); i++) {
-// TaglibTracker tracker = (TaglibTracker)list.get(i);
-// if(tracker == null) continue;
-// String version = TLDVersionHelper.getTldVersion(tracker);
-// KbTldResource resource = new KbTldResource(tracker.getURI(), "", tracker.getPrefix(), version);
-// wtpKbConnector.registerResource(resource);
-// }
-// return true;
-// }
-// return false;
-// }
-
-// public nsIDOMNode getCurrentVisualNode() {
-// return currentVisualNode;
-// }
-//
-// public void setCurrentVisualNode(nsIDOMNode currentVisualNode) {
-// this.currentVisualNode = currentVisualNode;
-// }
+ /**
+ * Removes information about source node from vpe cash
+ * @param sourceNode
+ */
+ public void removeNodeFromVpeCash(Node sourceNode) {
+
+ getVpeCash().remove(sourceNode);
+ Node parentNode = sourceNode.getParentNode();
+ //we should on change remove also parent nodes because information for
+ //this nodes doen't actual when we change child
+ while(parentNode!=null) {
+ getVpeCash().remove(parentNode);
+ parentNode=parentNode.getParentNode();
+ }
+ }
+ /**
+ * Clears all information in cash
+ */
+ public void clearVpeCash() {
+
+ getVpeCash().clear();
+ }
+ /**
+ * Checs is creation data exist in cash
+ * @param sourceNode
+ * @return true - if date exist
+ * false -otherwise
+ */
+ public boolean isCreationDataExistInCash(Node sourceNode){
+
+// Iterator<Node> keys = getVpeCash().keySet().iterator();
+//
+// //Map.get() doesn't work correctly for this situation
+//// while(keys.hasNext()){
+//// Node key= keys.next();
+//// if(sourceNode.isEqu alNode(key)) {
+//// return true;
+//// }
+//// }
+//// return false;
+ return getVpeCash().containsKey(sourceNode);
+ }
+ /**
+ * Inserts creation data into cash
+ * @param sourceNode
+ * @param creationData
+ */
+ public void addCreationDataToCash(Node sourceNode,VpeCreationData creationData) {
+ //TODO Max Areshkau JBIDE-675 Adds data to cash, think about cloning creationData
+ getVpeCash().put(sourceNode, creationData);
+ }
+ /**
+ * Looks creates data in cash
+ * @param sourceNode
+ * @return returns creation data
+ */
+ public VpeCreationData getVpeCreationDataFromCash(Node sourceNode) {
+
+ return getVpeCash().get(sourceNode);
+ }
+ /**
+ * Return vpe Cash
+ * @return the vpeCash
+ */
+ private Map<Node, VpeCreationData> getVpeCash() {
+
+ if(vpeCash ==null) {
+
+ vpeCash = new HashMap<Node, VpeCreationData>();
+ }
+ return vpeCash;
+ }
}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeChildrenInfo.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeChildrenInfo.java 2008-02-28 13:57:40 UTC (rev 6639)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeChildrenInfo.java 2008-02-28 14:21:12 UTC (rev 6640)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.List;
+import org.jboss.tools.vpe.editor.util.XmlUtil;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Node;
@@ -59,4 +60,16 @@
}
return sourceChildren;
}
+ /**
+ * Creates a copy of element for vpe cash.
+ * We should clone nsI* elements and copy all others
+ * added by Max Aresahkau
+ */
+ public VpeChildrenInfo createCashCopy(){
+
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(visualParent!=null?(nsIDOMElement)(XmlUtil.createClone(this.visualParent)).
+ queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID):null);
+ childrenInfo.sourceChildren=this.sourceChildren;
+ return childrenInfo;
+ }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreationData.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreationData.java 2008-02-28 13:57:40 UTC (rev 6639)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreationData.java 2008-02-28 14:21:12 UTC (rev 6640)
@@ -13,6 +13,9 @@
import java.util.ArrayList;
import java.util.List;
+import org.jboss.tools.common.model.util.XMLUtil;
+import org.jboss.tools.vpe.editor.util.VpeDebugUtil;
+import org.jboss.tools.vpe.editor.util.XmlUtil;
import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Node;
@@ -30,7 +33,7 @@
return node;
}
- public void addChildrenInfo(VpeChildrenInfo info) {
+ public void addChildrenInfo(VpeChildrenInfo info) {
if (childrenInfoList == null) {
childrenInfoList = new ArrayList<VpeChildrenInfo>();
}
@@ -59,4 +62,34 @@
public Object getData() {
return data;
}
+
+ /**
+ * Added method for creation copy which will
+ * placed in cash to improve perfomance of VPE
+ * Added by Max Areshkau JBIDE-675.
+ * Here copyed only nsI****
+ * @return
+ */
+ public VpeCreationData createHashCopy() {
+ nsIDOMNode node=null;
+ if(this.node!=null) {
+ node = XmlUtil.createClone(this.node);
+ } else {
+ VpeDebugUtil.debugInfo("Node is Null");
+ }
+ if(node.getNodeType()!=nsIDOMNode.ELEMENT_NODE) {
+ VpeDebugUtil.debugInfo("It's Not Element");
+ }
+
+ VpeCreationData data = new VpeCreationData(node);
+ if(this.childrenInfoList!=null) {
+ data.childrenInfoList= new ArrayList<VpeChildrenInfo>();
+ for (VpeChildrenInfo childrenInfo : this.childrenInfoList) {
+ data.childrenInfoList.add(childrenInfo.createCashCopy());
+ }
+ }
+ data.illegalChildren =this.illegalChildren;
+ data.data = this.data;
+ return data;
+ }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2008-02-28 13:57:40 UTC (rev 6639)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2008-02-28 14:21:12 UTC (rev 6640)
@@ -160,7 +160,8 @@
}
@Override
public void validate(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, VpeCreationData creationdata) {
- validateVisualElement(pageContext, (Element)sourceNode, visualDocument, null, (nsIDOMElement)creationdata.getNode(), (Map<VpeTemplate,ModifyInfo>)creationdata.getData());
+ validateVisualElement(pageContext, (Element)sourceNode, visualDocument, null, creationdata.getNode()==null?null:
+ (nsIDOMElement)(creationdata.getNode().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID)), (Map<VpeTemplate,ModifyInfo>)creationdata.getData());
}
@Override
public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2008-02-28 13:57:40 UTC (rev 6639)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/XmlUtil.java 2008-02-28 14:21:12 UTC (rev 6640)
@@ -21,7 +21,10 @@
import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.jboss.tools.jst.web.tld.TaglibData;
+import org.jboss.tools.vpe.VpeDebug;
import org.jboss.tools.vpe.VpePlugin;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -109,7 +112,8 @@
public static List<TaglibData> getTaglibsForNode(Node source,IDocument document) {
List<TaglibData> taglibData = new ArrayList<TaglibData>();
-
+ //TODO Max Areshkau Looks like exist possability to check is it jsp document
+ //node.getOwnerDocument return null for jsp apply it for CA
TLDCMDocumentManager tldcmDocumentManager= TaglibController.getTLDCMDocumentManager(document);
if(tldcmDocumentManager!=null) {
List<TaglibTracker> taglibs_JSP = tldcmDocumentManager.getTaglibTrackers();
@@ -183,5 +187,16 @@
}
}
return null;
- }
+ }
+ /**
+ * Creates clone node
+ * @param cloneNode
+ * @return
+ */
+ public static final nsIDOMNode createClone(nsIDOMNode nodeToClone){
+ nsIDOMNode result = nodeToClone.cloneNode(true);
+ return result;
+ }
+
+
}
16 years, 10 months
JBoss Tools SVN: r6639 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-02-28 08:57:40 -0500 (Thu, 28 Feb 2008)
New Revision: 6639
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1706, Attribute "dir" was added
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-28 13:40:46 UTC (rev 6638)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-28 13:57:40 UTC (rev 6639)
@@ -22,7 +22,7 @@
<vpe:tag name="h:inputText" case-sensitive="yes">
<vpe:template children="no" modify="no">
- <input type="text" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}" size="{@size}" />
+ <input type="text" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}" size="{@size}" dir="{@dir}"/>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
@@ -67,7 +67,7 @@
<vpe:tag name="h:inputTextarea" case-sensitive="yes">
<vpe:template children="yes" modify="no">
- <textarea class="{@styleClass}" style="{@style}" rows="{@rows}" cols="{@cols}" title="{tagstring()}">
+ <textarea class="{@styleClass}" style="{@style}" rows="{@rows}" cols="{@cols}" title="{tagstring()}" dir="{@dir}">
<vpe:value expr="{jsfvalue(@value)}"/>
</textarea>
<vpe:resize>
@@ -105,7 +105,7 @@
<vpe:tag name="h:inputSecret" case-sensitive="yes">
<vpe:template children="no" modify="no">
- <input type="password" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}" size="{@size}" />
+ <input type="password" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}" size="{@size}" dir="{@dir}" />
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
16 years, 10 months
JBoss Tools SVN: r6638 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf: templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-02-28 08:40:46 -0500 (Thu, 28 Feb 2008)
New Revision: 6638
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1719, Attribute "dir" was added
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java 2008-02-28 12:22:22 UTC (rev 6637)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java 2008-02-28 13:40:46 UTC (rev 6638)
@@ -41,6 +41,7 @@
private static final String SPAN_STYLE_VALUE = "-moz-user-modify: read-write;"; //$NON-NLS-1$
/*h:SelectManyCheckbox attributes*/
+ private static final String DIR = "dir";
private static final String DISABLED = "disabled";
private static final String ENABLED_CLASS = "enabledClass";
private static final String DISABLED_CLASS = "disabledClass";
@@ -50,6 +51,7 @@
private static final String ESCAPE = "escape";
private String escape;
+ private String dir;
private String disabled;
private String enabledClass;
private String disabledClass;
@@ -85,6 +87,10 @@
input.setAttribute(HTML.ATTR_TYPE, TYPE_CHECKBOX);
+ if (attrPresents(dir)) {
+ input.setAttribute(HTML.ATTR_DIR, dir);
+ }
+
if (attrPresents(disabled) && "true".equalsIgnoreCase(disabled)) {
label.setAttribute(CLASS, disabledClass);
} else if (attrPresents(enabledClass)) {
@@ -167,6 +173,7 @@
return;
}
Element source = (Element) sourceNode;
+ dir = source.getAttribute(DIR);
disabled = source.getAttribute(DISABLED);
enabledClass = source.getAttribute(ENABLED_CLASS);
disabledClass = source.getAttribute(DISABLED_CLASS);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java 2008-02-28 12:22:22 UTC (rev 6637)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java 2008-02-28 13:40:46 UTC (rev 6638)
@@ -40,9 +40,6 @@
// common part of the name of element
private static final String ATTR_NAME_VALUE = "radio_name_"; //$NON-NLS-1$
- // name of attribute which need represent
- private static final String ITEM_LABEL_ATTR = "itemLabel"; //$NON-NLS-1$
-
// style of span
private static final String SPAN_STYLE_VALUE = "-moz-user-modify: read-write;"; //$NON-NLS-1$
@@ -52,6 +49,10 @@
/* "escape" attribute of f:selectItem */
private static final String ESCAPE = "escape";
+ /* "dir" attribute of f:selectSelectOneRadio */
+ private static final String DIR = "dir";
+
+ private String dir;
private String escape;
/**
@@ -82,6 +83,11 @@
span.appendChild(radio);
span.appendChild(labelSpan);
+ if (null != element) {
+ escape = element.getAttribute(ESCAPE);
+ dir = element.getAttribute(DIR);
+ }
+
VpeCreationData creationData = new VpeCreationData(span);
// set attributes
@@ -90,16 +96,16 @@
radio.setAttribute(HTML.ATTR_TITLE, getTitle(sourceNode));
radio.setAttribute(HTML.ATTR_NAME, ATTR_NAME_VALUE
+ getNameSuffix(sourceNode));
+
+ if (attrPresents(dir)) {
+ radio.setAttribute(HTML.ATTR_DIR, dir);
+ }
Attr attr = null;
if (element.hasAttribute(ITEM_LABEL)) {
attr = element.getAttributeNode(ITEM_LABEL);
}
- if (null != element) {
- escape = element.getAttribute(ESCAPE);
- }
-
if (null != attr) {
if (null == escape || "true".equalsIgnoreCase(escape)) {
// show text as is
@@ -146,25 +152,6 @@
}
/**
- * get Label of element
- *
- * @param sourceNode
- * @return
- */
- private String getLabel(Node sourceNode) {
-
- // get value of "itemLabeL" from jsf tag
- Node attrNode = sourceNode.getAttributes()
- .getNamedItem(ITEM_LABEL_ATTR);
-
- // if attribute exist return value
- if (attrNode != null)
- return attrNode.getNodeValue();
-
- return null;
- }
-
- /**
* generate unique suffix of name for radio as unique suffix use start
* position of parent tag ( "h:selectOneRadio" or "x:selectOneRadio")
*
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java 2008-02-28 12:22:22 UTC (rev 6637)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfSelectManyListbox.java 2008-02-28 13:40:46 UTC (rev 6638)
@@ -38,6 +38,11 @@
private static final String ATTR_SIZE = "size"; //$NON-NLS-1$
/**
+ * "dir" attribute
+ */
+ private static final String ATTR_DIR = "dir";
+
+ /**
* "size" attribute
*/
private static final String ATTR_MULTIPLE_VALUE = "multiple"; //$NON-NLS-1$
@@ -101,6 +106,13 @@
// get "size" attribute
String size = element.getAttribute(ATTR_SIZE);
+ // get "dir" attribute
+ String dir = element.getAttribute(ATTR_DIR);
+
+ if (null != dir) {
+ select.setAttribute(HTML.ATTR_DIR, dir);
+ }
+
// add "size" attribute to "select"
if (size != null)
// if source has "size" attribute import it
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-28 12:22:22 UTC (rev 6637)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-28 13:40:46 UTC (rev 6638)
@@ -710,7 +710,7 @@
<vpe:tag name="h:selectManyMenu" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
- <select style="{@style}" multiple="multiple" class="{@styleClass}" title="{tagstring()}" size="1"/>
+ <select style="{@style}" multiple="multiple" class="{@styleClass}" title="{tagstring()}" size="1" dir="{@dir}"/>
<vpe:dnd>
<vpe:drag start-enable="yes"/>
<vpe:drop container="yes">
16 years, 10 months
JBoss Tools SVN: r6637 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf: templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-02-28 07:22:22 -0500 (Thu, 28 Feb 2008)
New Revision: 6637
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1719, <f:selectItem> Attribute "escape" doesn't work
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java 2008-02-28 12:02:59 UTC (rev 6636)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCheckboxSelectItemTemplate.java 2008-02-28 12:22:22 UTC (rev 6637)
@@ -10,16 +10,22 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.template;
+import org.jboss.tools.jsf.vpe.jsf.template.util.NodeProxyUtil;
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* @author dmaliarevich
@@ -39,6 +45,11 @@
private static final String ENABLED_CLASS = "enabledClass";
private static final String DISABLED_CLASS = "disabledClass";
+
+ /* "escape" attribute of f:selectItem */
+ private static final String ESCAPE = "escape";
+
+ private String escape;
private String disabled;
private String enabledClass;
private String disabledClass;
@@ -54,13 +65,17 @@
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
-
- readAttributes(sourceNode.getParentNode());
-
+
+ readParentAttributes(sourceNode.getParentNode());
+ readAttributes(sourceNode);
+
+ Element element = (Element) sourceNode;
+
nsIDOMElement input = visualDocument.createElement(HTML.TAG_INPUT);
nsIDOMElement label = visualDocument.createElement(HTML.TAG_LABEL);
// create span element
nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
+ nsIDOMElement labelSpan = visualDocument.createElement(HTML.TAG_SPAN);
VpeCreationData creationData = new VpeCreationData(span);
@@ -76,12 +91,35 @@
label.setAttribute(CLASS, enabledClass);
}
- String itemLabel = getLabel(sourceNode);
- label.appendChild(visualDocument.createTextNode(itemLabel));
-
+ label.appendChild(labelSpan);
span.appendChild(input);
span.appendChild(label);
+
+ Attr attr = null;
+ if (element.hasAttribute(ITEM_LABEL)) {
+ attr = element.getAttributeNode(ITEM_LABEL);
+ }
+ if (null != attr) {
+ if (null == escape || "true".equalsIgnoreCase(escape)) {
+ // show text as is
+ String itemLabel = attr.getNodeValue();
+ labelSpan.appendChild(visualDocument.createTextNode(itemLabel));
+ } else {
+ // show formatted text
+ VpeChildrenInfo labelSpanInfo = new VpeChildrenInfo(labelSpan);
+ // re-parse attribute's value
+ NodeList list = NodeProxyUtil.reparseAttributeValue(attr);
+ // add children to info
+ for (int i = 0; i < list.getLength(); i++) {
+ Node child = list.item(i);
+ // add info to creation data
+ labelSpanInfo.addSourceChild(child);
+ }
+ creationData.addChildrenInfo(labelSpanInfo);
+ }
+ }
+
return creationData;
}
@@ -120,19 +158,18 @@
}
/**
- * get Label of element
+ * Read attributes from the h:SelectManyCheckbox element.
*
- * @param sourceNode
- * @return
+ * @param sourceNode the source node
*/
- private String getLabel(Node sourceNode) {
- // get value of "itemLabeL" from jsf tag
- Node attrNode = sourceNode.getAttributes().getNamedItem(ITEM_LABEL);
- // if attribute exist return value
- if (attrNode != null) {
- return attrNode.getNodeValue();
+ private void readParentAttributes(Node sourceNode) {
+ if (null == sourceNode) {
+ return;
}
- return "";
+ Element source = (Element) sourceNode;
+ disabled = source.getAttribute(DISABLED);
+ enabledClass = source.getAttribute(ENABLED_CLASS);
+ disabledClass = source.getAttribute(DISABLED_CLASS);
}
/**
@@ -145,9 +182,7 @@
return;
}
Element source = (Element) sourceNode;
- disabled = source.getAttribute(DISABLED);
- enabledClass = source.getAttribute(ENABLED_CLASS);
- disabledClass = source.getAttribute(DISABLED_CLASS);
+ escape = source.getAttribute(ESCAPE);
}
@Override
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java 2008-02-28 12:02:59 UTC (rev 6636)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOptionSelectItemTemplate.java 2008-02-28 12:22:22 UTC (rev 6637)
@@ -10,15 +10,19 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.template;
+import org.jboss.tools.jsf.vpe.jsf.template.util.NodeProxyUtil;
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* @author dmaliarevich
@@ -33,6 +37,10 @@
private static final String ENABLED_CLASS = "enabledClass";
private static final String DISABLED_CLASS = "disabledClass";
+ /* "escape" attribute of f:selectItem */
+ private static final String ESCAPE = "escape";
+
+ private String escape;
private String disabled;
private String enabledClass;
private String disabledClass;
@@ -49,9 +57,14 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
- readAttributes(sourceNode.getParentNode());
-
+ readParentAttributes(sourceNode.getParentNode());
+ readAttributes(sourceNode);
+ Element element = (Element) sourceNode;
+
nsIDOMElement option = visualDocument.createElement(HTML.TAG_OPTION);
+ nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
+ option.appendChild(span);
+
VpeCreationData creationData = new VpeCreationData(option);
if (attrPresents(disabled) && "true".equalsIgnoreCase(disabled)) {
@@ -59,30 +72,36 @@
} else if (attrPresents(enabledClass)) {
option.setAttribute(CLASS, enabledClass);
}
+
+ Attr attr = null;
+ if (element.hasAttribute(ITEM_LABEL)) {
+ attr = element.getAttributeNode(ITEM_LABEL);
+ }
+
+ if (null != attr) {
+ if (null == escape || "true".equalsIgnoreCase(escape)) {
+ // show text as is
+ String itemLabel = attr.getNodeValue();
+ span.appendChild(visualDocument.createTextNode(itemLabel));
+ } else {
+ // show formatted text
+ VpeChildrenInfo spanInfo = new VpeChildrenInfo(span);
+ // re-parse attribute's value
+ NodeList list = NodeProxyUtil.reparseAttributeValue(attr);
+ // add children to info
+ for (int i = 0; i < list.getLength(); i++) {
+ Node child = list.item(i);
+ // add info to creation data
+ spanInfo.addSourceChild(child);
+ }
+ creationData.addChildrenInfo(spanInfo);
+ }
+ }
- String itemLabel = getLabel(sourceNode);
- option.appendChild(visualDocument.createTextNode(itemLabel));
-
return creationData;
}
/**
- * get Label of element
- *
- * @param sourceNode
- * @return
- */
- private String getLabel(Node sourceNode) {
- // get value of "itemLabeL" from jsf tag
- Node attrNode = sourceNode.getAttributes().getNamedItem(ITEM_LABEL);
- // if attribute exist return value
- if (attrNode != null) {
- return attrNode.getNodeValue();
- }
- return "";
- }
-
- /**
* Checks is attribute presents.
*
* @param attr the attribute
@@ -94,11 +113,11 @@
}
/**
- * Read attributes from the source element.
+ * Read attributes from the h:SelectManyCheckbox element.
*
* @param sourceNode the source node
*/
- private void readAttributes(Node sourceNode) {
+ private void readParentAttributes(Node sourceNode) {
if (null == sourceNode) {
return;
}
@@ -108,6 +127,19 @@
disabledClass = source.getAttribute(DISABLED_CLASS);
}
+ /**
+ * Read attributes from the source element.
+ *
+ * @param sourceNode the source node
+ */
+ private void readAttributes(Node sourceNode) {
+ if (null == sourceNode) {
+ return;
+ }
+ Element source = (Element) sourceNode;
+ escape = source.getAttribute(ESCAPE);
+ }
+
@Override
public void setSourceAttributeSelection(VpePageContext pageContext,
Element sourceElement, int offset, int length, Object data) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java 2008-02-28 12:02:59 UTC (rev 6636)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfRadioSelectItemTemplate.java 2008-02-28 12:22:22 UTC (rev 6637)
@@ -11,15 +11,20 @@
package org.jboss.tools.jsf.vpe.jsf.template;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.jboss.tools.jsf.vpe.jsf.template.util.NodeProxyUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* @author sdzmitrovich
@@ -41,6 +46,14 @@
// style of span
private static final String SPAN_STYLE_VALUE = "-moz-user-modify: read-write;"; //$NON-NLS-1$
+ /* "itemLabel" attribute of f:selectItem */
+ private static final String ITEM_LABEL = "itemLabel";
+
+ /* "escape" attribute of f:selectItem */
+ private static final String ESCAPE = "escape";
+
+ private String escape;
+
/**
*
*/
@@ -58,39 +71,55 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ Element element = (Element) sourceNode;
+
// create span element
nsIDOMElement span = visualDocument.createElement(HTML.TAG_TABLE);
// add title attribute to span
span.setAttribute(HTML.ATTR_TITLE, getTitle(sourceNode));
+ nsIDOMElement radio = visualDocument.createElement(HTML.TAG_INPUT);
+ nsIDOMElement labelSpan = visualDocument.createElement(HTML.TAG_SPAN);
+ span.appendChild(radio);
+ span.appendChild(labelSpan);
+
+ VpeCreationData creationData = new VpeCreationData(span);
+
+ // set attributes
span.setAttribute(HTML.ATTR_STYLE, SPAN_STYLE_VALUE);
-
- // create radio element
- nsIDOMElement radio = visualDocument.createElement(HTML.TAG_INPUT);
radio.setAttribute(HTML.ATTR_TYPE, ATTR_TYPE_VALUE);
-
- // set title
radio.setAttribute(HTML.ATTR_TITLE, getTitle(sourceNode));
-
- // set name
radio.setAttribute(HTML.ATTR_NAME, ATTR_NAME_VALUE
+ getNameSuffix(sourceNode));
- // add radio to span
- span.appendChild(radio);
+ Attr attr = null;
+ if (element.hasAttribute(ITEM_LABEL)) {
+ attr = element.getAttributeNode(ITEM_LABEL);
+ }
- // get label for element
- String label = getLabel(sourceNode);
+ if (null != element) {
+ escape = element.getAttribute(ESCAPE);
+ }
- // label exist
- if (null != label) {
- // add label to span
- nsIDOMElement labelElement = visualDocument.createElement(HTML.TAG_LABEL);
- nsIDOMText text = visualDocument.createTextNode(label);
- span.appendChild(labelElement);
- labelElement.appendChild(text);
+ if (null != attr) {
+ if (null == escape || "true".equalsIgnoreCase(escape)) {
+ // show text as is
+ String itemLabel = attr.getNodeValue();
+ labelSpan.appendChild(visualDocument.createTextNode(itemLabel));
+ } else {
+ // show formatted text
+ VpeChildrenInfo labelSpanInfo = new VpeChildrenInfo(labelSpan);
+ // re-parse attribute's value
+ NodeList list = NodeProxyUtil.reparseAttributeValue(attr);
+ // add children to info
+ for (int i = 0; i < list.getLength(); i++) {
+ Node child = list.item(i);
+ // add info to creation data
+ labelSpanInfo.addSourceChild(child);
+ }
+ creationData.addChildrenInfo(labelSpanInfo);
+ }
}
-
- return new VpeCreationData(span);
+ return creationData;
}
/**
@@ -160,5 +189,16 @@
return name_suffix;
}
+
+ /**
+ * Checks is attribute presents.
+ *
+ * @param attr the attribute
+ *
+ * @return true, if successful
+ */
+ private boolean attrPresents(String attr) {
+ return ((null != attr) && (!"".equals(attr)));
+ }
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-28 12:02:59 UTC (rev 6636)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-28 12:22:22 UTC (rev 6637)
@@ -745,44 +745,49 @@
</vpe:tag>
<vpe:tag name="f:selectItem" case-sensitive="yes">
- <vpe:if test="hasinparents('h:selectManyCheckbox')">
- <vpe:template children="no" modify="yes"
+ <vpe:if test="hasinparents('h:selectManyCheckbox')">
+ <vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.jsf.template.JsfCheckboxSelectItemTemplate">
- </vpe:template>
- </vpe:if>
- <vpe:if test="hasinparents('h:selectManyListbox')|hasinparents('h:selectManyMenu')">
- <vpe:template children="no" modify="yes"
- class="org.jboss.tools.jsf.vpe.jsf.template.JsfOptionSelectItemTemplate">
- </vpe:template>
- </vpe:if>
- <vpe:if test="hasinparents('x:selectManyCheckbox')|hasinparents('t:selectManyCheckbox')">
- <vpe:template children="no" modify="yes">
- <span title="{tagstring()}">
- <input type="checkbox" />
- <vpe:value expr="{jsfvalue(@itemLabel)}"/>
- </span>
- <vpe:dnd>
- <vpe:drag start-enable="yes"/>
- </vpe:dnd>
- <vpe:breaker type="selectItem"/>
- </vpe:template>
- </vpe:if>
- <vpe:if test="hasinparents('h:selectOneRadio')|hasinparents('x:selectOneRadio')">
- <vpe:template children="no" modify="yes" class="org.jboss.tools.jsf.vpe.jsf.template.JsfRadioSelectItemTemplate">
-
- </vpe:template>
- </vpe:if>
- <vpe:if test="hasinparents('h:selectOneListbox')|
+ </vpe:template>
+ </vpe:if>
+ <vpe:if
+ test="hasinparents('h:selectManyListbox')|hasinparents('h:selectManyMenu')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.jsf.template.JsfOptionSelectItemTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:if
+ test="hasinparents('h:selectOneRadio')|hasinparents('x:selectOneRadio')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.jsf.template.JsfRadioSelectItemTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:if
+ test="hasinparents('x:selectManyCheckbox')|hasinparents('t:selectManyCheckbox')">
+ <vpe:template children="no" modify="yes">
+ <span title="{tagstring()}">
+ <input type="checkbox" />
+ <vpe:value expr="{jsfvalue(@itemLabel)}" />
+ </span>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ <vpe:breaker type="selectItem" />
+ </vpe:template>
+ </vpe:if>
+ <vpe:if
+ test="hasinparents('h:selectOneListbox')|
hasinparents('h:selectOneMenu')|
hasinparents('t:selectManyMenu')|
hasinparents('x:selectOneRadio')|
- hasinparents('x:selectOneMenu')"> <!-- Gavr --><!-- added x: 8.02.05 -->
- <vpe:template children="no" modify="yes">
- <option value="{@itemValue}" title="{tagstring()}">
- <vpe:value expr="{jsfvalue(@itemLabel)}"/>
- </option>
- </vpe:template>
- </vpe:if>
+ hasinparents('x:selectOneMenu')">
+<!-- Gavr --><!-- added x: 8.02.05 -->
+ <vpe:template children="no" modify="yes">
+ <option value="{@itemValue}" title="{tagstring()}">
+ <vpe:value expr="{jsfvalue(@itemLabel)}" />
+ </option>
+ </vpe:template>
+ </vpe:if>
</vpe:tag>
<vpe:tag name="f:selectItems" case-sensitive="yes">
16 years, 10 months
JBoss Tools SVN: r6636 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-02-28 07:02:59 -0500 (Thu, 28 Feb 2008)
New Revision: 6636
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1718
created tests
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-02-28 12:00:30 UTC (rev 6635)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-02-28 12:02:59 UTC (rev 6636)
@@ -28,6 +28,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1467Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1501Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1568Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1718Test;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
import org.jboss.tools.vpe.ui.test.beans.ImportBean;
@@ -57,7 +58,7 @@
suite.addTestSuite(JBIDE675Test.class);
suite.addTestSuite(JBIDE1460Test.class);
suite.addTestSuite(JBIDE1720Test.class);
-
+ suite.addTestSuite(JsfJbide1718Test.class) ;
// $JUnit-END$
//added by Max Areshkau
//add here projects which should be imported for junit tests
16 years, 10 months
JBoss Tools SVN: r6635 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-02-28 07:00:30 -0500 (Thu, 28 Feb 2008)
New Revision: 6635
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputFormatTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1718
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputFormatTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputFormatTemplate.java 2008-02-28 12:00:03 UTC (rev 6634)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputFormatTemplate.java 2008-02-28 12:00:30 UTC (rev 6635)
@@ -229,7 +229,7 @@
// get "choice" as value
String choice = getChoice(parametres[2]);
if (choice != null)
- value = choice;
+ value = choice.replaceAll("[\\{\\}]", "");;
}
}
16 years, 10 months
JBoss Tools SVN: r6634 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-02-28 07:00:03 -0500 (Thu, 28 Feb 2008)
New Revision: 6634
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1718
created tests
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-02-28 11:58:05 UTC (rev 6633)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-02-28 12:00:03 UTC (rev 6634)
@@ -57,6 +57,8 @@
public static final String TAG_I = "I"; //$NON-NLS-1$
public static final String TAG_U = "U"; //$NON-NLS-1$
public static final String TAG_LABEL = "LABEL";
+ public static final String TAG_A = "A";
+ public static final String TAG_H1 = "H1";
public static final String ATTR_ID = "ID"; //$NON-NLS-1$
public static final String ATTR_TYPE = "TYPE"; //$NON-NLS-1$
16 years, 10 months