JBoss Tools SVN: r23802 - in trunk/vpe/plugins/org.jboss.tools.vpe.spring: templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-07-29 12:17:01 -0400 (Thu, 29 Jul 2010)
New Revision: 23802
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringTextAreaTemplate.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
Log:
https://jira.jboss.org/browse/JBIDE-6711 , form:textarea template was added.
Added: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringTextAreaTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringTextAreaTemplate.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringTextAreaTemplate.java 2010-07-29 16:17:01 UTC (rev 23802)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.spring.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.mapping.NodeData;
+import org.jboss.tools.vpe.editor.mapping.VpeElementData;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.jboss.tools.vpe.spring.template.util.Spring;
+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;
+import org.w3c.dom.NodeList;
+
+/**
+ * Class for <form:textarea>
+ *
+ * @author dmaliarevich
+ */
+public class SpringTextAreaTemplate extends VpeAbstractTemplate {
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ final nsIDOMElement textarea = visualDocument.createElement(HTML.TAG_TEXTAREA);
+ VisualDomUtil.copyAttributes(sourceNode, textarea);
+ Element sourceElement = (Element) sourceNode;
+ /*
+ * Attributes "class" and "style" should correspond to the
+ * Spring's "cssClass" and "cssStyle"
+ */
+ textarea.setAttribute(
+ HTML.ATTR_CLASS,
+ (sourceElement.hasAttribute(Spring.ATTR_CSS_CLASS)
+ ? sourceElement.getAttribute(Spring.ATTR_CSS_CLASS)
+ : Constants.EMPTY));
+ textarea.setAttribute(
+ HTML.ATTR_STYLE,
+ (sourceElement.hasAttribute(Spring.ATTR_CSS_STYLE)
+ ? sourceElement.getAttribute(Spring.ATTR_CSS_STYLE)
+ : Constants.EMPTY));
+
+ /*
+ * Add text children to the text area
+ */
+ final NodeList childNodes = sourceNode.getChildNodes();
+ final int childNodesLength = childNodes.getLength();
+ for (int i = 0; i < childNodesLength; i++) {
+ final Node child = childNodes.item(i);
+ if (child.getNodeType() == Node.TEXT_NODE) {
+ final nsIDOMNode text = visualDocument.createTextNode(child.getNodeValue());
+ textarea.appendChild(text);
+ }
+ }
+
+ final VpeCreationData creationData = new VpeCreationData(textarea);
+
+ final VpeElementData textElementsData = new VpeElementData();
+ textElementsData.addNodeData(new NodeData(sourceNode.getLastChild(), textarea));
+ creationData.setElementData(textElementsData);
+
+ return creationData;
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 16:06:19 UTC (rev 23801)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 16:17:01 UTC (rev 23802)
@@ -106,7 +106,7 @@
<vpe:template children="no" modify="no">
<input type="text" id="{@id}" class="{@cssClass}"
style="{@cssStyle}" size="{@size}" dir="{@dir}"
- disabled="{@disabled}" />
+ disabled="{@disabled}" />
</vpe:template>
</vpe:tag>
@@ -115,6 +115,11 @@
<label id="{@id}" class="{@cssClass}" style="{@cssStyle}"
for="{@for}" dir="{@dir}">
</label>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
</vpe:template>
</vpe:tag>
@@ -136,6 +141,7 @@
</vpe:dnd>
</vpe:template>
</vpe:tag>
+
<vpe:tag name="form:option" case-sensitive="yes">
<vpe:if test="@disabled='true'">
<vpe:template children="yes" modify="yes">
@@ -152,4 +158,15 @@
</option>
</vpe:template>
</vpe:tag>
+
+ <vpe:tag name="form:textarea" case-sensitive="no">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.vpe.spring.template.SpringTextAreaTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="cssStyle.width" />
+ <vpe:height height-attr="cssStyle.height" />
+ </vpe:resize>
+ </vpe:template>
+ </vpe:tag>
+
</vpe:templates>
14 years, 5 months
JBoss Tools SVN: r23801 - in trunk/vpe/plugins/org.jboss.tools.vpe.spring: src/org/jboss/tools/vpe/spring/template/util and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-07-29 12:06:19 -0400 (Thu, 29 Jul 2010)
New Revision: 23801
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
Log:
https://jira.jboss.org/browse/JBIDE-6711
- form:option template is added
- a little refactoring of SpringSelectTemplate is done
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java 2010-07-29 15:51:15 UTC (rev 23800)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java 2010-07-29 16:06:19 UTC (rev 23801)
@@ -28,7 +28,7 @@
* @see <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-referen...">The select tag</>
*/
public class SpringFormSelectTemplate extends VpeAbstractTemplate {
-
+
/* (non-Javadoc)
* @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
*/
@@ -47,14 +47,15 @@
select.setAttribute(HTML.ATTR_DISABLED, HTML.ATTR_DISABLED);
}
- if (sourceElement.hasAttribute("items")) {
+ if (sourceElement.hasAttribute(Spring.ATTR_ITEMS)) {
// an inner 'option' tag has to be generated
- String optionBody = sourceElement.getAttribute("items");
- if (sourceElement.hasAttribute("itemLabel")) {
- optionBody += '.' + sourceElement.getAttribute("itemLabel");
+ String optionBody = sourceElement.getAttribute(Spring.ATTR_ITEMS);
+ if (sourceElement.hasAttribute(Spring.ATTR_ITEM_LABEL)) {
+ optionBody += '.' + sourceElement.getAttribute(Spring.ATTR_ITEM_LABEL);
}
nsIDOMElement option = visualDocument.createElement(HTML.TAG_OPTION);
+ option.appendChild(visualDocument.createTextNode(optionBody));
select.appendChild(option);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java 2010-07-29 15:51:15 UTC (rev 23800)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java 2010-07-29 16:06:19 UTC (rev 23801)
@@ -16,10 +16,12 @@
*
*/
public class Spring {
- public static String ATTR_CSS_CLASS = "cssClass"; //$NON-NLS-1$
- public static String ATTR_CSS_STYLE = "cssStyle"; //$NON-NLS-1$
+ public static final String ATTR_CSS_CLASS = "cssClass"; //$NON-NLS-1$
+ public static final String ATTR_CSS_STYLE = "cssStyle"; //$NON-NLS-1$
public static final String ATTR_DISABLED = "disabled"; //$NON-NLS-1$
- public static String ATTR_ID = "id"; //$NON-NLS-1$
+ public static final String ATTR_ID = "id"; //$NON-NLS-1$
+ public static final String ATTR_ITEMS = "items"; //$NON-NLS-1$
+ public static final String ATTR_ITEM_LABEL = "itemLabel"; //$NON-NLS-1$
public static final String VALUE_TRUE = "true"; //$NON-NLS-1$
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 15:51:15 UTC (rev 23800)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 16:06:19 UTC (rev 23801)
@@ -136,4 +136,20 @@
</vpe:dnd>
</vpe:template>
</vpe:tag>
+ <vpe:tag name="form:option" case-sensitive="yes">
+ <vpe:if test="@disabled='true'">
+ <vpe:template children="yes" modify="yes">
+ <option id="{@id}" class="{@cssClass}" style="{@cssStyle}"
+ dir="{@dir}" disabled="disabled">
+ <vpe:value expr="{@label}" />
+ </option>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="yes" modify="yes">
+ <option id="{@id}" class="{@cssClass}" style="{@cssStyle}"
+ dir="{@dir}">
+ <vpe:value expr="{@label}" />
+ </option>
+ </vpe:template>
+ </vpe:tag>
</vpe:templates>
14 years, 5 months
JBoss Tools SVN: r23800 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-07-29 11:51:15 -0400 (Thu, 29 Jul 2010)
New Revision: 23800
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6742 Corrected some CDI validation messages.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-07-29 15:36:33 UTC (rev 23799)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-07-29 15:51:15 UTC (rev 23800)
@@ -35,16 +35,16 @@
MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_PRODUCER_FIELD=Producer field specifies multiple scope type annotations
MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE=Bean does not explicitly declare a scope when there is no default scope
STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE=Stereotype declares more than one scope
-ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD=Managed bean with a public field declares any scope other than @Dependent
-ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE=Managed bean with a parameterized bean class declares any scope other than @Dependent
-ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE=Session bean with a parameterized bean class declares any scope other than @Dependent
+ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD=Managed bean with a with a public field must be @Dependent scoped
+ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE=Managed bean with a parameterized bean class must be @Dependent scoped
+ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE=Session bean with a parameterized bean class must be @Dependent scoped
ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN=Session bean specifies an illegal scope. A stateless session bean must belong to the @Dependent pseudo-scope.
ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN=Session bean specifies an illegal scope. A singleton bean must belong to either the @ApplicationScoped scope or to the @Dependent pseudo-scope.
-ILLEGAL_SCOPE_FOR_PRODUCER_METHOD=Producer method with a parameterized return type with a type variable declares any scope other than @Dependent
-ILLEGAL_SCOPE_FOR_PRODUCER_FIELD=Producer field with a parameterized type with a type variable declares any scope other than @Dependent
+ILLEGAL_SCOPE_FOR_PRODUCER_METHOD=Producer method with a parameterized return type with a type variable must be @Dependent scoped
+ILLEGAL_SCOPE_FOR_PRODUCER_FIELD=Producer field with a parameterized type with a type variable declares must be @Dependent scoped
ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED=Bean that declares any scope other than @Dependent has an injection point of type InjectionPoint and qualifier @Default
-ILLEGAL_SCOPE_FOR_INTERCEPTOR=Interceptor has any scope other than @Dependent
-ILLEGAL_SCOPE_FOR_DECORATOR=Decorator has any scope other than @Dependent
+ILLEGAL_SCOPE_FOR_INTERCEPTOR=Interceptor must be @Dependent scoped
+ILLEGAL_SCOPE_FOR_DECORATOR=Decorator must be @Dependent scoped
PRODUCER_ANNOTATED_INJECT=Producer method or field is annotated @Inject
PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES=Producer method has a parameter annotated @Disposes
14 years, 5 months
JBoss Tools SVN: r23799 - in trunk/vpe/plugins/org.jboss.tools.vpe.spring: src/org/jboss/tools/vpe/spring and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-07-29 11:36:33 -0400 (Thu, 29 Jul 2010)
New Revision: 23799
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/SpringTemplatePlugin.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/META-INF/MANIFEST.MF
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
Log:
https://jira.jboss.org/browse/JBIDE-6711
- form:select template is added
- plugin dependencies are updated
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/META-INF/MANIFEST.MF 2010-07-29 15:17:26 UTC (rev 23798)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/META-INF/MANIFEST.MF 2010-07-29 15:36:33 UTC (rev 23799)
@@ -3,9 +3,13 @@
Bundle-Name: %bundleName
Bundle-SymbolicName: org.jboss.tools.vpe.spring;singleton:=true
Bundle-Version: 3.1.0.qualifier
+Bundle-Activator: org.jboss.tools.vpe.spring.SpringTemplatePlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.jboss.tools.vpe
+ org.jboss.tools.vpe,
+ org.mozilla.xpcom,
+ org.eclipse.jface.text,
+ org.jboss.tools.jst.jsp
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %vendorName
Bundle-Localization: plugin
Added: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/SpringTemplatePlugin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/SpringTemplatePlugin.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/SpringTemplatePlugin.java 2010-07-29 15:36:33 UTC (rev 23799)
@@ -0,0 +1,49 @@
+package org.jboss.tools.vpe.spring;
+
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class SpringTemplatePlugin extends BaseUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jst.vpe.spring"; //$NON-NLS-1$
+
+ // The shared instance
+ private static SpringTemplatePlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public SpringTemplatePlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static SpringTemplatePlugin getDefault() {
+ return plugin;
+ }
+}
\ No newline at end of file
Added: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java 2010-07-29 15:36:33 UTC (rev 23799)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.vpe.spring.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.spring.template.util.Spring;
+import org.jboss.tools.vpe.spring.template.util.VpeSpringUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * VPE template for Spring form:select tag.
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ * @see <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-referen...">The select tag</>
+ */
+public class SpringFormSelectTemplate extends VpeAbstractTemplate {
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element sourceElement = (Element) sourceNode;
+ nsIDOMElement select = visualDocument.createElement(HTML.TAG_SELECT);
+
+ VpeSpringUtil.copyCommonAttributes(sourceElement, select);
+ VpeSpringUtil.copyAttribute(sourceElement, HTML.ATTR_SIZE,
+ select, HTML.ATTR_SIZE);
+ VpeSpringUtil.copyAttribute(sourceElement, HTML.ATTR_MULTIPLE,
+ select, HTML.ATTR_MULTIPLE);
+
+ if (sourceElement.getAttribute(Spring.ATTR_DISABLED).equals(Spring.VALUE_TRUE)) {
+ select.setAttribute(HTML.ATTR_DISABLED, HTML.ATTR_DISABLED);
+ }
+
+ if (sourceElement.hasAttribute("items")) {
+ // an inner 'option' tag has to be generated
+ String optionBody = sourceElement.getAttribute("items");
+ if (sourceElement.hasAttribute("itemLabel")) {
+ optionBody += '.' + sourceElement.getAttribute("itemLabel");
+ }
+
+ nsIDOMElement option = visualDocument.createElement(HTML.TAG_OPTION);
+ select.appendChild(option);
+ }
+
+ return new VpeCreationData(select);
+ }
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/Spring.java 2010-07-29 15:36:33 UTC (rev 23799)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.vpe.spring.template.util;
+
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ *
+ */
+public class Spring {
+ public static String ATTR_CSS_CLASS = "cssClass"; //$NON-NLS-1$
+ public static String ATTR_CSS_STYLE = "cssStyle"; //$NON-NLS-1$
+ public static final String ATTR_DISABLED = "disabled"; //$NON-NLS-1$
+ public static String ATTR_ID = "id"; //$NON-NLS-1$
+
+ public static final String VALUE_TRUE = "true"; //$NON-NLS-1$
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java 2010-07-29 15:36:33 UTC (rev 23799)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.vpe.spring.template.util;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ *
+ */
+public class VpeSpringUtil {
+
+ public static final Map<String, String> COMMON_SPRING_FORM_ATTRIBUTES_MAP
+ = new HashMap<String, String>() {{
+ put(Spring.ATTR_ID, HTML.ATTR_ID);
+ put(Spring.ATTR_CSS_STYLE, HTML.ATTR_STYLE);
+ put(Spring.ATTR_CSS_CLASS, HTML.ATTR_CLASS);
+ }};
+
+ public static void copyAttribute(Element sourceElement, String sourceAttrName,
+ nsIDOMElement visualElement, String visualAttrName) {
+ if (sourceElement.hasAttribute(sourceAttrName)) {
+ String attrValue = sourceElement.getAttribute(sourceAttrName);
+ visualElement.setAttribute(visualAttrName, attrValue);
+ }
+ }
+
+ public static void copyAttributes(Element sourceElement,
+ nsIDOMElement visualElement, Map<String, String> sourceToVisualMap) {
+ for (Entry<String, String> sourceToVisual : sourceToVisualMap.entrySet()) {
+ String sourceAttrName = sourceToVisual.getKey();
+ String visualAttrName = sourceToVisual.getValue();
+ copyAttribute(sourceElement, sourceAttrName, visualElement, visualAttrName);
+ }
+ }
+
+ public static void copyCommonAttributes(Element sourceElement,
+ nsIDOMElement visualElement) {
+ copyAttributes(sourceElement, visualElement,
+ COMMON_SPRING_FORM_ATTRIBUTES_MAP);
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 15:17:26 UTC (rev 23798)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 15:36:33 UTC (rev 23799)
@@ -123,4 +123,17 @@
</vpe:template>
</vpe:tag>
+ <vpe:tag name="form:select" case-sensetive="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.vpe.spring.template.SpringFormSelectTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="cssStyle.width" />
+ <vpe:height height-attr="cssStyle.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes"></vpe:drop>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
</vpe:templates>
14 years, 5 months
JBoss Tools SVN: r23797 - in trunk/vpe/plugins/org.jboss.tools.vpe.spring: src/org and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-07-29 10:35:26 -0400 (Thu, 29 Jul 2010)
New Revision: 23797
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
Log:
https://jira.jboss.org/browse/JBIDE-6711 , form:input, form:label, form:hidden templates were added.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 14:32:29 UTC (rev 23796)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 14:35:26 UTC (rev 23797)
@@ -101,4 +101,26 @@
</vpe:dnd>
</vpe:template>
</vpe:tag>
+
+ <vpe:tag name="form:input" case-sensitive="no">
+ <vpe:template children="no" modify="no">
+ <input type="text" id="{@id}" class="{@cssClass}"
+ style="{@cssStyle}" size="{@size}" dir="{@dir}"
+ disabled="{@disabled}" />
+ </vpe:template>
+ </vpe:tag>
+
+ <vpe:tag name="form:label" case-sensitive="no">
+ <vpe:template children="yes" modify="yes">
+ <label id="{@id}" class="{@cssClass}" style="{@cssStyle}"
+ for="{@for}" dir="{@dir}">
+ </label>
+ </vpe:template>
+ </vpe:tag>
+
+ <vpe:tag name="form:hidden" case-sensitive="no">
+ <vpe:template children="no" modify="no" >
+ </vpe:template>
+ </vpe:tag>
+
</vpe:templates>
14 years, 5 months
JBoss Tools SVN: r23796 - trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates.
by jbosstools-commits@lists.jboss.org
Author: dvinnichek
Date: 2010-07-29 10:32:29 -0400 (Thu, 29 Jul 2010)
New Revision: 23796
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
Log:
add template for <form:checkboxes> according to https://jira.jboss.org/browse/JBIDE-6711
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 14:20:12 UTC (rev 23795)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-07-29 14:32:29 UTC (rev 23796)
@@ -2,24 +2,21 @@
<vpe:templates xmlns:vpe="http://org.jboss.org/tools/vpe/template"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <vpe:template-taglib
- uri="http://www.springframework.org/tags/form"
+ <vpe:template-taglib uri="http://www.springframework.org/tags/form"
prefix="form" />
- <vpe:template-taglib
- uri="http://www.springframework.org/tags"
+ <vpe:template-taglib uri="http://www.springframework.org/tags"
prefix="spring" />
- <vpe:template-taglib
- uri="http://www.springframework.org/security/tags"
+ <vpe:template-taglib uri="http://www.springframework.org/security/tags"
prefix="security" />
<vpe:tag name="form:checkbox" case-sensitive="yes">
<vpe:if test="@disabled='true'">
<vpe:template children="no" modify="no">
<span class="vpe-text">
- <input type="checkbox" id="{@id}" style="{@cssStyle}"
- class="{@cssClass}" disabled="disabled"/>
+ <input type="checkbox" id="{@id}" style="{@cssStyle}" class="{@cssClass}"
+ disabled="disabled" />
<label>
- <vpe:value expr="{@label}"/>
+ <vpe:value expr="{@label}" />
</label>
</span>
<vpe:dnd>
@@ -29,10 +26,9 @@
</vpe:if>
<vpe:template children="no" modify="no">
<span class="vpe-text">
- <input type="checkbox" id="{@id}" style="{@cssStyle}"
- class="{@cssClass}"/>
+ <input type="checkbox" id="{@id}" style="{@cssStyle}" class="{@cssClass}" />
<label>
- <vpe:value expr="{@label}"/>
+ <vpe:value expr="{@label}" />
</label>
</span>
<vpe:dnd>
@@ -41,9 +37,64 @@
</vpe:template>
</vpe:tag>
+ <vpe:tag name="form:checkboxes" case-sensitive="yes">
+ <vpe:if test="@disabled='true'">
+ <vpe:if test="attrpresent('itemLabel')">
+ <vpe:template children="no" modify="no">
+ <span class="vpe-text">
+ <input type="checkbox" id="{@id}" style="{@cssStyle}" class="{@cssClass}"
+ disabled="disabled" />
+ <label>
+ <vpe:value expr="{@items}.{(a)itemLabel}" />
+ </label>
+ </span>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no">
+ <span class="vpe-text">
+ <input type="checkbox" id="{@id}" style="{@cssStyle}" class="{@cssClass}"
+ disabled="disabled" />
+ <label>
+ <vpe:value expr="{@items}" />
+ </label>
+ </span>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:if>
+ <vpe:if test="attrpresent('itemLabel')">
+ <vpe:template children="no" modify="no">
+ <span class="vpe-text">
+ <input type="checkbox" id="{@id}" style="{@cssStyle}" class="{@cssClass}" />
+ <label>
+ <vpe:value expr="{@items}.{(a)itemLabel}" />
+ </label>
+ </span>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no">
+ <span class="vpe-text">
+ <input type="checkbox" id="{@id}" style="{@cssStyle}" class="{@cssClass}" />
+ <label>
+ <vpe:value expr="{@items}" />
+ </label>
+ </span>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
+
<vpe:tag name="form:form" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
- <form id="{@id}" style="{@cssStyle}" class="{@cssClass}"/>
+ <form id="{@id}" style="{@cssStyle}" class="{@cssClass}" />
<vpe:dnd>
<vpe:drag start-enable="yes" />
<vpe:drop container="yes" />
14 years, 5 months
JBoss Tools SVN: r23795 - in trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main: webapp/WEB-INF/jsp and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dvinnichek
Date: 2010-07-29 10:20:12 -0400 (Thu, 29 Jul 2010)
New Revision: 23795
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/FormBean.java
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/checkboxes.jsp
Log:
some changes with template for <form:checkboxes>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/FormBean.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/FormBean.java 2010-07-29 14:03:20 UTC (rev 23794)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/FormBean.java 2010-07-29 14:20:12 UTC (rev 23795)
@@ -1,7 +1,9 @@
package org.jboss.tools.vpe.spring.test.springtest;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -15,12 +17,15 @@
private Map<Integer, String> availableCategories = new HashMap<Integer, String>();
private Set<Integer> selectedCategories = new HashSet<Integer>();
+ private List<CategoryType> favoriteCategories = new ArrayList<CategoryType>();
public FormBean() {
for (CategoryType categoryType : CategoryType.values()) {
availableCategories.put(categoryType.getId(), categoryType.getName());
}
selectedCategories.add(CategoryType.Books.getId());
+ favoriteCategories.add(CategoryType.Sport);
+ favoriteCategories.add(CategoryType.Books);
}
public boolean isChechbox1Selected() {
@@ -62,4 +67,12 @@
public void setSelectedCategories(Set<Integer> selectedCategories) {
this.selectedCategories = selectedCategories;
}
+
+ public List<CategoryType> getFavoriteCategories() {
+ return favoriteCategories;
+ }
+
+ public void setFavoriteCategories(List<CategoryType> favoriteCategories) {
+ this.favoriteCategories = favoriteCategories;
+ }
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/checkboxes.jsp
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/checkboxes.jsp 2010-07-29 14:03:20 UTC (rev 23794)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/checkboxes.jsp 2010-07-29 14:20:12 UTC (rev 23795)
@@ -24,9 +24,10 @@
<br/>form:checkboxes with id, cssStyle, cssClass, items and path attributes. (Must look as a big square.)
<br/><br/>
<form:checkboxes id="checkboxes3" disabled="true"
- items="${formBean.availableCategories}"
+ itemLabel="id" itemValue="id"
+ items="${formBean.favoriteCategories}"
path="selectedCategories" />
- <br/>disabled form:checkboxes
+ <br/>disabled form:checkboxes with itemLabel attribute
<br/><br/>
</form:form>
</body>
14 years, 5 months
JBoss Tools SVN: r23794 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui: icons/wizard and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-29 10:03:20 -0400 (Thu, 29 Jul 2010)
New Revision: 23794
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/icons/wizard/
trunk/cdi/plugins/org.jboss.tools.cdi.ui/icons/wizard/weld_icon_48x.gif
trunk/cdi/plugins/org.jboss.tools.cdi.ui/icons/wizard/weld_icon_64x.gif
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUiImages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationWizardPage.java
Log:
https://jira.jboss.org/browse/JBIDE-6737
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/icons/wizard/weld_icon_48x.gif
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/icons/wizard/weld_icon_48x.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/icons/wizard/weld_icon_64x.gif
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/icons/wizard/weld_icon_64x.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUiImages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUiImages.java 2010-07-29 13:56:39 UTC (rev 23793)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUiImages.java 2010-07-29 14:03:20 UTC (rev 23794)
@@ -32,9 +32,9 @@
public static final Image CDI_BEAN_IMAGE = getImage("search/cdi_bean.gif"); //$NON-NLS-1$
public static final Image WELD_IMAGE = getImage("search/weld_icon_16x.gif"); //$NON-NLS-1$
-
-
+ public static final String WELD_WIZARD_IMAGE_PATH = "wizard/weld_icon_64x.gif"; //$NON-NLS-1$
+
public static Image getImage(String key) {
return INSTANCE.createImageDescriptor(key).createImage();
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationWizardPage.java 2010-07-29 13:56:39 UTC (rev 23793)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationWizardPage.java 2010-07-29 14:03:20 UTC (rev 23794)
@@ -38,6 +38,7 @@
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.cdi.ui.CDIUiImages;
import org.jboss.tools.common.ui.widget.editor.CheckBoxFieldEditor;
import org.jboss.tools.common.ui.widget.editor.CompositeEditor;
import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
@@ -54,6 +55,10 @@
protected CheckBoxEditorWrapper inherited = null;
protected IFieldEditor target = null;
+
+ public NewCDIAnnotationWizardPage() {
+ setImageDescriptor(CDIUiImages.getImageDescriptor(CDIUiImages.WELD_WIZARD_IMAGE_PATH));
+ }
protected void createTypeMembers(IType newType, final ImportsManager imports, IProgressMonitor monitor) throws CoreException {
ISourceRange range = newType.getSourceRange();
14 years, 5 months