JBoss Tools SVN: r13572 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-02-10 17:22:47 -0500 (Tue, 10 Feb 2009)
New Revision: 13572
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
Log:
JBIDE-3782 Move SeamProjectCreator.execute() to Seam facet install delegate
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2009-02-10 18:51:13 UTC (rev 13571)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2009-02-10 22:22:47 UTC (rev 13572)
@@ -286,4 +286,6 @@
* Default model source folder name;
*/
String DEFAULT_MODEL_SRC_FOLDER_NAME = "main"; //$NON-NLS-1$
+
+ String CREATE_EAR_PROJECTS = "create.ear.projects"; //$NON-NLS-1$
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2009-02-10 18:51:13 UTC (rev 13571)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2009-02-10 22:22:47 UTC (rev 13572)
@@ -254,4 +254,10 @@
// Security
addSecurityConstraint(webApp);
}
+
+ @Override
+ protected SeamProjectCreator getProjectCreator(IDataModel model,
+ IProject project) {
+ return new Seam2ProjectCreator(model,project);
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-02-10 18:51:13 UTC (rev 13571)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-02-10 22:22:47 UTC (rev 13572)
@@ -180,7 +180,13 @@
// untouched, this abstract class just listen to eclipse log and show an
// error dialog if there were records logged from seam.core plugin
startListening();
- doExecute(project,fv,config,monitor);
+ doExecute(project,fv,config,monitor);
+ IDataModel model = (IDataModel) config;
+ boolean createEarProjects = model.getBooleanProperty(ISeamFacetDataModelProperties.CREATE_EAR_PROJECTS);
+ if (createEarProjects) {
+ // Create ear, ejb, test projects JBIDE-3782
+ getProjectCreator(model, project).execute(monitor);
+ }
} finally {
stopListening();
}
@@ -1159,4 +1165,6 @@
}, modelPath);
}
+
+ protected abstract SeamProjectCreator getProjectCreator(IDataModel model, IProject project);
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2009-02-10 18:51:13 UTC (rev 13571)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2009-02-10 22:22:47 UTC (rev 13572)
@@ -85,6 +85,7 @@
names.add(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT);
names.add(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME);
names.add(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO);
+ names.add(ISeamFacetDataModelProperties.CREATE_EAR_PROJECTS);
return names;
}
@@ -117,6 +118,9 @@
} else if(JBOSS_AS_TARGET_RUNTIME.equals(propertyName)) {
return null;
}
+ else if(JBOSS_AS_TARGET_RUNTIME.equals(propertyName)) {
+ return null;
+ }
return super.getDefaultProperty(propertyName);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2009-02-10 18:51:13 UTC (rev 13571)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2009-02-10 22:22:47 UTC (rev 13572)
@@ -286,4 +286,10 @@
displayNameObj.setValue(displayName);
filter.getDisplayNames().add(displayNameObj);
}
+
+ @Override
+ protected SeamProjectCreator getProjectCreator(IDataModel model,
+ IProject project) {
+ return new SeamProjectCreator(model,project);
+ }
}
\ No newline at end of file
15 years, 2 months
JBoss Tools SVN: r13571 - in trunk/jsf/plugins: org.jboss.tools.jsf.vpe.jstl and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: izhukov
Date: 2009-02-10 13:51:13 -0500 (Tue, 10 Feb 2009)
New Revision: 13571
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/.classpath
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/.project
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/META-INF/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/about.html
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/build.properties
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/plugin.properties
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/AbstractOutputJstlTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlOutTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/templates/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/templates/vpe-templates-jstl.xml
Log:
vpe jstl project added
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/.classpath
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/.classpath (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/.classpath 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/.project
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/.project (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/.project 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jsf.vpe.jstl</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/META-INF/MANIFEST.MF 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.jboss.tools.jsf.vpe.jstl;singleton:=true
+Bundle-Version: 2.1.0
+Bundle-Activator: org.jboss.tools.jsf.vpe.jstl.JstlTemplatePlugin
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.common,
+ org.jboss.tools.vpe,
+ org.mozilla.xpcom,
+ org.jboss.tools.jst.jsp,
+ org.eclipse.wst.sse.core,
+ org.eclipse.jst.jsp.core,
+ org.eclipse.wst.html.core,
+ org.jboss.tools.vpe.html,
+ org.jboss.tools.jsf.vpe.jsf;bundle-version="2.1.0"
+Eclipse-LazyStart: true
+Export-Package: org.jboss.tools.jsf.vpe.jstl.template
+Bundle-Localization: plugin
+Import-Package: org.jboss.tools.jst.web.tld
+
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/about.html
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/about.html (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/about.html 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>©2007 Red Hat, Inc. All rights reserved</P>
+
+<H3>License</H3>
+
+<P>Red Hat Inc., through its JBoss division, makes available all content in this plug-in
+("Content"). Unless otherwise indicated below, the Content is provided to you
+under the terms and conditions of the Eclipse Public License Version 1.0
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from Red Hat Inc., the
+Content is being redistributed by another party ("Redistributor") and different
+terms and conditions may apply to your use of any object code in the Content.
+Check the Redistributor's license that was provided with the Content. If no such
+license exists, contact the Redistributor. Unless otherwise indicated below, the
+terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at
+ <A href="http://www.jboss.org/tools">http://www.jboss.org/tools</A>.</P>
+
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/build.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/build.properties (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/build.properties 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ templates/,\
+ about.html,\
+ plugin.properties
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/plugin.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/plugin.properties (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/plugin.properties 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,2 @@
+providerName=JBoss, a division of Red Hat
+pluginName=JSF support for JBoss Visual Page Editor Plug-in
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/plugin.xml (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/plugin.xml 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.3"?>
+<plugin>
+ <extension
+ point="org.jboss.tools.vpe.templates">
+ <templates
+ name="JSTL Reference Implementation"
+ path="templates/vpe-templates-jstl.xml"/>
+ </extension>
+</plugin>
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jsf.vpe.jstl;
+
+
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+
+
+/**
+ * The Class ComponentUtil.
+ */
+public class ComponentUtil {
+
+ /**
+ * Returns value of attribute.
+ *
+ * @param attributeName the attribute name
+ * @param sourceElement the source element
+ *
+ * @return the attribute
+ */
+ public static String getAttribute(Element sourceElement, String attributeName) {
+ String attribute = sourceElement.getAttribute(attributeName);
+ if (attribute == null) {
+ attribute = Constants.EMPTY;
+ }
+ return attribute;
+ }
+
+ /**
+ * Returns value of attribute.
+ *
+ * @param attributeName the attribute name
+ * @param sourceElement the source element
+ * @param defaultValue the default value
+ *
+ * @return the attribute
+ */
+ public static String getAttribute(Element sourceElement, String attributeName, String defaultValue) {
+ String attribute = sourceElement.getAttribute(attributeName);
+ if (attribute == null) {
+ attribute = defaultValue;
+ }
+ return attribute;
+ }
+
+ /**
+ * Returns value of attribute.
+ *
+ * @param attributeName the attribute name
+ * @param sourceElement the source element
+ *
+ * @return the attribute
+ */
+ public static String getAttribute(nsIDOMElement sourceElement, String attributeName) {
+ String attribute = sourceElement.getAttribute(attributeName);
+ if (attribute == null) {
+ attribute = Constants.EMPTY;
+ }
+ return attribute;
+ }
+}
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jstl;
+
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ *
+ * @author Igor Zhukov (izhukov(a)exadel.com)
+ */
+public class JstlTemplatePlugin extends BaseUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jsf.vpe.jstl"; //$NON-NLS-1$
+
+ // The shared instance
+ private static JstlTemplatePlugin plugin;
+
+ /**
+ * The default constructor.
+ */
+ public JstlTemplatePlugin() {
+ }
+
+ /*
+ * (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 JstlTemplatePlugin getDefault() {
+ return plugin;
+ }
+}
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/AbstractOutputJstlTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/AbstractOutputJstlTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/AbstractOutputJstlTemplate.java 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.vpe.jstl.template;
+
+import org.jboss.tools.jsf.vpe.jsf.template.util.model.VpeElementProxyData;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.mapping.NodeData;
+import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeElementData;
+import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+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.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public abstract class AbstractOutputJstlTemplate extends VpeAbstractTemplate {
+
+ /**
+ *
+ * @param element
+ * @return
+ */
+ public Attr getOutputAttributeNode(Element element) {
+ if (element.hasAttribute(HTML.ATTR_VALUE)) {
+ return element.getAttributeNode(HTML.ATTR_VALUE);
+ }
+
+ return null;
+ }
+
+ /**
+ *
+ * @param pageContext
+ * @param visualDocument
+ * @param sourceElement
+ * @param targetVisualElement
+ * @param creationData
+ */
+ protected void processOutputAttribute(VpePageContext pageContext,
+ nsIDOMDocument visualDocument, Element sourceElement,
+ nsIDOMElement targetVisualElement, VpeCreationData creationData) {
+
+ VpeElementProxyData elementData = new VpeElementProxyData();
+
+ Attr outputAttr = getOutputAttributeNode(sourceElement);
+
+ if (outputAttr != null) {
+
+ // prepare value
+ String newValue = prepareAttrValue(pageContext, sourceElement, outputAttr);
+ // if escape then contents of value (or other attribute) is only
+ // text
+// if (!sourceElement.hasAttribute(JSF.ATTR_ESCAPE)
+// || "true".equalsIgnoreCase(sourceElement //$NON-NLS-1$
+// .getAttribute(JSF.ATTR_ESCAPE))) {
+//
+// String value = outputAttr.getValue();
+//
+// nsIDOMText text;
+// // if bundleValue differ from value then will be represent
+// // bundleValue, but text will be not edit
+// boolean isEditable = value.equals(newValue);
+//
+// text = visualDocument.createTextNode(newValue);
+// // add attribute for ability of editing
+//
+// elementData.addNodeData(new AttributeData(outputAttr, text,
+// isEditable));
+//
+// targetVisualElement.appendChild(text);
+//
+// }
+ }
+
+ creationData.setElementData(elementData);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#setPseudoContent
+ * (org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node,
+ * org.mozilla.interfaces.nsIDOMNode, org.mozilla.interfaces.nsIDOMDocument)
+ */
+ @Override
+ public void setPseudoContent(VpePageContext pageContext,
+ Node sourceContainer, nsIDOMNode visualContainer,
+ nsIDOMDocument visualDocument) {
+ // Empty
+ }
+
+ @Override
+ public NodeData getNodeData(nsIDOMNode node, VpeElementData elementData,
+ VpeDomMapping domMapping) {
+ // TODO Auto-generated method stub
+ NodeData nodeData = super.getNodeData(node, elementData, domMapping);
+ if (nodeData == null) {
+
+ VpeNodeMapping nodeMapping = domMapping.getNodeMapping(node);
+
+ if (nodeMapping != null) {
+ if (nodeMapping instanceof VpeElementMapping) {
+ nodeData = super.getNodeData(node,
+ ((VpeElementMapping) nodeMapping).getElementData(),
+ domMapping);
+ }
+// else if (nodeMapping.getType() == VpeNodeMapping.TEXT_MAPPING) {
+// nodeData = new NodeData(nodeMapping.getSourceNode(), node,
+// true);
+// }
+ }
+ }
+ return nodeData;
+ }
+
+ @Override
+ public nsIDOMNode getVisualNodeByBySourcePosition(
+ VpeElementMapping elementMapping, int focusPosition,
+ int anchorPosition, VpeDomMapping domMapping) {
+ nsIDOMNode node = null;
+
+ if ((elementMapping.getElementData() instanceof VpeElementProxyData)
+ && (((VpeElementProxyData) elementMapping.getElementData())
+ .getNodelist() != null)) {
+ VpeElementProxyData elementProxyData = (VpeElementProxyData) elementMapping.getElementData();
+
+// VpeNodeMapping nodeMapping = NodeProxyUtil.findNodeByPosition(
+// domMapping, elementProxyData.getNodelist(), focusPosition,
+// anchorPosition);
+
+// if (nodeMapping != null) {
+//
+// if (nodeMapping instanceof VpeElementMapping) {
+// node = super.getVisualNodeByBySourcePosition(
+// (VpeElementMapping) nodeMapping, focusPosition,
+// anchorPosition, domMapping);
+// } else {
+// node = nodeMapping.getVisualNode();
+// }
+// }
+ }
+
+ if (node == null) {
+ node = super.getVisualNodeByBySourcePosition(elementMapping,
+ focusPosition, anchorPosition, domMapping);
+ }
+ return node;
+ }
+
+ protected String prepareAttrValue(VpePageContext pageContext, Element parent, Attr attr) {
+ return attr.getNodeValue();
+ }
+}
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlOutTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlOutTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlOutTemplate.java 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jstl.template;
+
+import org.jboss.tools.jsf.vpe.jsf.template.AbstractOutputJsfTemplate;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * Class for creating Out content
+ *
+ * @author Igor Zhukov
+ */
+public class JstlOutTemplate extends AbstractOutputJsfTemplate {
+
+ /**
+ * Create html instead c:out component.
+ *
+ * @param pageContext
+ * Contains the information on edited page.
+ * @param sourceNode
+ * The current node of the source tree.
+ * @param visualDocument
+ * The document of the visual tree.
+ * @return The information on the created node of the visual tree.
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+ // convert to Element
+ Element sourceElement = (Element) sourceNode;
+ // create span element
+ nsIDOMElement span = VisualDomUtil.createBorderlessContainer(visualDocument);
+
+ VpeCreationData creationData = new VpeCreationData(span);
+
+ processOutputAttribute(pageContext, visualDocument, sourceElement, span, creationData);
+
+ return creationData;
+ }
+}
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.vpe.jstl.template.util;
+
+
+/**
+ * Contains JSTL tags and general attributes.
+ *
+ * @author Igor Zhukov
+ */
+public class Jstl {
+
+ /**
+ * The Constructor.
+ */
+ private Jstl() {
+ }
+
+ /** The Constant ATTR_ADD_CONTROL_LABEL. */
+ public static final String ATTR_ADD_CONTROL_LABEL = "addControlLabel"; //$NON-NLS-1$
+
+ public static final String TAG_OUT = "out"; //$NON-NLS-1$
+}
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/templates/vpe-templates-jstl.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/templates/vpe-templates-jstl.xml (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/templates/vpe-templates-jstl.xml 2009-02-10 18:51:13 UTC (rev 13571)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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://java.sun.com/jstl/core" prefix="c" />
+
+ <vpe:tag name="c:out" case-sensitive="yes">
+ <vpe:template children="no" modify="no"
+ class="org.jboss.tools.jsf.vpe.jstl.template.JstlOutTemplate">
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
+ </vpe:tag>
+
+ <!-- Default template -->
+ <vpe:template children="yes" modify="no">
+ <vpe:any value="{name()}" title="{tagstring()}"/>
+ </vpe:template>
+</vpe:templates>
\ No newline at end of file
15 years, 2 months
JBoss Tools SVN: r13570 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-02-10 12:39:11 -0500 (Tue, 10 Feb 2009)
New Revision: 13570
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
Log:
JBIDE-3778 fix NPE
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2009-02-10 17:22:25 UTC (rev 13569)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2009-02-10 17:39:11 UTC (rev 13570)
@@ -955,13 +955,18 @@
public void storePropertyColumsWidth() {
+ if (propertySheet == null) {
+ return;
+ }
Control control = propertySheet.getControl();
- if (control instanceof Tree && !control.isDisposed()) {
- Tree tree = (Tree)control;
- IPreferenceStore preferenceStore = HibernateConsolePlugin.getDefault().getPreferenceStore();
- TreeColumn[] columns = tree.getColumns();
- preferenceStore.setValue(EXPORTERS_PROPERTIES_COLUMN_PROPERTY_WIDTH, columns[0].getWidth());
- preferenceStore.setValue(EXPORTERS_PROPERTIES_COLUMN_VALUE_WIDTH, columns[1].getWidth());
+ if (control != null) {
+ if (control instanceof Tree && !control.isDisposed()) {
+ Tree tree = (Tree)control;
+ IPreferenceStore preferenceStore = HibernateConsolePlugin.getDefault().getPreferenceStore();
+ TreeColumn[] columns = tree.getColumns();
+ preferenceStore.setValue(EXPORTERS_PROPERTIES_COLUMN_PROPERTY_WIDTH, columns[0].getWidth());
+ preferenceStore.setValue(EXPORTERS_PROPERTIES_COLUMN_VALUE_WIDTH, columns[1].getWidth());
+ }
}
}
15 years, 2 months
JBoss Tools SVN: r13569 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4: editpart and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-02-10 12:22:25 -0500 (Tue, 10 Feb 2009)
New Revision: 13569
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SequenceFlowEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HqlTask.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HumanTask.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/JavaTask.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ScriptTask.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SequenceFlow.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ServiceTask.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SqlTask.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Task.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/WaitTask.java
Log:
add conditional and default capabilities to sequence flow
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -225,7 +225,7 @@
}
StringBuffer labelBuffer = new StringBuffer();
LabelWrapper labelWrapper = wrapper.getLabel();
- if (labelWrapper != null) {
+ if (labelWrapper != null && !isEmpty(labelWrapper.getText())) {
Point location = labelWrapper.getLocation();
if (location != null) {
labelBuffer.append(location.x);
@@ -428,4 +428,8 @@
}
}
+ private boolean isEmpty(String str) {
+ return str == null || "".equals(str);
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SequenceFlowEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SequenceFlowEditPart.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SequenceFlowEditPart.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -1,15 +1,22 @@
package org.jboss.tools.flow.jpdl4.editpart;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.requests.DirectEditRequest;
import org.jboss.tools.flow.common.editpart.ConnectionEditPart;
+import org.jboss.tools.flow.common.figure.CrossHairDecoration;
+import org.jboss.tools.flow.common.figure.DiamondDecoration;
+import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.policy.ElementDirectEditPolicy;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.LabelWrapper;
import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.SequenceFlow;
public class SequenceFlowEditPart extends ConnectionEditPart {
@@ -18,6 +25,20 @@
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ElementDirectEditPolicy());
}
+ protected IFigure createFigure() {
+ PolylineConnection result = (PolylineConnection)super.createFigure();
+ Element element = ((Wrapper)getModel()).getElement();
+ if (element instanceof SequenceFlow) {
+ SequenceFlow sequenceFlow = (SequenceFlow)element;
+ if (sequenceFlow.isDefault()) {
+ result.setSourceDecoration(new CrossHairDecoration());
+ } else if (sequenceFlow.isConditional()) {
+ result.setSourceDecoration(new DiamondDecoration());
+ }
+ }
+ return result;
+ }
+
public void performRequest(Request request) {
if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
performDirectEdit();
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HqlTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HqlTask.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HqlTask.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -3,4 +3,8 @@
public class HqlTask extends Task {
+ protected boolean isPropagationExclusive() {
+ return true;
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HumanTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HumanTask.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/HumanTask.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -3,4 +3,8 @@
public class HumanTask extends Task {
+ protected boolean isPropagationExclusive() {
+ return true;
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/JavaTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/JavaTask.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/JavaTask.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -3,4 +3,8 @@
public class JavaTask extends Task {
+ protected boolean isPropagationExclusive() {
+ return true;
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ScriptTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ScriptTask.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ScriptTask.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -3,4 +3,8 @@
public class ScriptTask extends Task {
+ protected boolean isPropagationExclusive() {
+ return true;
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SequenceFlow.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SequenceFlow.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SequenceFlow.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -10,6 +10,7 @@
public class SequenceFlow extends DefaultConnection {
private String name;
+ private boolean conditional = false;
public SequenceFlow() {
this(null, null);
@@ -28,6 +29,18 @@
return name;
}
+ public void setConditional(boolean conditional) {
+ this.conditional = conditional;
+ }
+
+ public boolean isConditional() {
+ return conditional;
+ }
+
+ public boolean isDefault() {
+ return true;
+ }
+
private class PropertySource implements IPropertySource, IPropertyId {
private IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[] {
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ServiceTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ServiceTask.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/ServiceTask.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -3,4 +3,8 @@
public class ServiceTask extends Task {
+ protected boolean isPropagationExclusive() {
+ return true;
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SqlTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SqlTask.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SqlTask.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -3,4 +3,8 @@
public class SqlTask extends Task {
+ protected boolean isPropagationExclusive() {
+ return true;
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Task.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Task.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Task.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -6,6 +6,17 @@
public class Task extends ProcessNode {
+ protected boolean isPropagationExclusive() {
+ return false;
+ }
+
+ public void addOutgoingConnection(String type, Connection connection) {
+ super.addOutgoingConnection(type, connection);
+ if (isPropagationExclusive() && !((SequenceFlow)connection).isDefault()) {
+ ((SequenceFlow)connection).setConditional(true);
+ }
+ }
+
public void removeOutgoingConnection(String type, Connection connection) {
Jpdl4Helper.mergeLeadingNodes(connection);
super.removeOutgoingConnection(type, connection);
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/WaitTask.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/WaitTask.java 2009-02-10 17:19:59 UTC (rev 13568)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/WaitTask.java 2009-02-10 17:22:25 UTC (rev 13569)
@@ -3,4 +3,8 @@
public class WaitTask extends Task {
+ protected boolean isPropagationExclusive() {
+ return true;
+ }
+
}
15 years, 2 months
JBoss Tools SVN: r13568 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-02-10 12:19:59 -0500 (Tue, 10 Feb 2009)
New Revision: 13568
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/CrossHairDecoration.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondDecoration.java
Log:
add DiamondDecoration and CrossHairDecoration for connections
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/CrossHairDecoration.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/CrossHairDecoration.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/CrossHairDecoration.java 2009-02-10 17:19:59 UTC (rev 13568)
@@ -0,0 +1,28 @@
+package org.jboss.tools.flow.common.figure;
+
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+
+public class CrossHairDecoration extends PolygonDecoration {
+
+ public static final PointList CROSSHAIR_TIP = new PointList();
+
+ static {
+ CROSSHAIR_TIP.addPoint(0, 0);
+ CROSSHAIR_TIP.addPoint(-1, 0);
+ CROSSHAIR_TIP.addPoint(-1, -1);
+ CROSSHAIR_TIP.addPoint(-1, 0);
+ CROSSHAIR_TIP.addPoint(-2, 0);
+ CROSSHAIR_TIP.addPoint(-1, 0);
+ CROSSHAIR_TIP.addPoint(-1, 1);
+ CROSSHAIR_TIP.addPoint(-1, 0);
+
+ }
+
+ public CrossHairDecoration() {
+ setTemplate(CROSSHAIR_TIP);
+ setScale(3.5, 2);
+ setFill(false);
+ }
+
+}
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondDecoration.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondDecoration.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondDecoration.java 2009-02-10 17:19:59 UTC (rev 13568)
@@ -0,0 +1,26 @@
+package org.jboss.tools.flow.common.figure;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+
+public class DiamondDecoration extends PolygonDecoration {
+
+ public static final PointList DIAMOND_TIP = new PointList();
+
+ static {
+ DIAMOND_TIP.addPoint(0, 0);
+ DIAMOND_TIP.addPoint(-2, 2);
+ DIAMOND_TIP.addPoint(-4, 0);
+ DIAMOND_TIP.addPoint(-2, -2);
+ }
+
+ public DiamondDecoration() {
+ setTemplate(DIAMOND_TIP);
+ setScale(3.5, 2);
+ setFill(true);
+ setBackgroundColor(ColorConstants.white);
+ setOpaque(true);
+ }
+
+}
15 years, 2 months
JBoss Tools SVN: r13567 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-02-10 12:05:02 -0500 (Tue, 10 Feb 2009)
New Revision: 13567
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssFileNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/HtmlFileNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsFileNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JspFileNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3500
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssFileNewWizardTest.java 2009-02-10 16:53:58 UTC (rev 13566)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssFileNewWizardTest.java 2009-02-10 17:05:02 UTC (rev 13567)
@@ -1,6 +1,8 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jface.wizard.IWizard;
+import org.jboss.tools.test.util.JobUtils;
public class CssFileNewWizardTest extends WizardTest {
@@ -22,4 +24,21 @@
public void testCssFileNewWizardValidation2() {
validateFolderAndName();
}
+
+ public void testCssFileNewWizardResults() {
+ // Assert file with name from Name field created in folder with name form Folder field
+ IWizard wizard = getWizardOnProject("aaa");
+
+ boolean canFinish = wizard.canFinish();
+
+ assertTrue("Finish button is disabled.", canFinish);
+
+ wizard.performFinish();
+
+ JobUtils.waitForIdle();
+
+ IResource res = project.findMember("aaa.css");
+
+ assertNotNull(res);
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/HtmlFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/HtmlFileNewWizardTest.java 2009-02-10 16:53:58 UTC (rev 13566)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/HtmlFileNewWizardTest.java 2009-02-10 17:05:02 UTC (rev 13567)
@@ -1,6 +1,8 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jface.wizard.IWizard;
+import org.jboss.tools.test.util.JobUtils;
public class HtmlFileNewWizardTest extends WizardTest {
@@ -21,5 +23,23 @@
}
public void testHtmlFileNewWizardValidation2() {
- validateFolderAndName(); }
+ validateFolderAndName();
+ }
+
+ public void testHtmlFileNewWizardResults() {
+ // Assert file with name from Name field created in folder with name form Folder field
+ IWizard wizard = getWizardOnProject("aaa");
+
+ boolean canFinish = wizard.canFinish();
+
+ assertTrue("Finish button is disabled.", canFinish);
+
+ wizard.performFinish();
+
+ JobUtils.waitForIdle();
+
+ IResource res = project.findMember("aaa.html");
+
+ assertNotNull(res);
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsFileNewWizardTest.java 2009-02-10 16:53:58 UTC (rev 13566)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsFileNewWizardTest.java 2009-02-10 17:05:02 UTC (rev 13567)
@@ -1,6 +1,8 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jface.wizard.IWizard;
+import org.jboss.tools.test.util.JobUtils;
public class JsFileNewWizardTest extends WizardTest {
@@ -23,4 +25,21 @@
public void testJsFileNewWizardValidation2() {
validateFolderAndName();
}
+
+ public void testJsFileNewWizardResults() {
+ // Assert file with name from Name field created in folder with name form Folder field
+ IWizard wizard = getWizardOnProject("aaa");
+
+ boolean canFinish = wizard.canFinish();
+
+ assertTrue("Finish button is disabled.", canFinish);
+
+ wizard.performFinish();
+
+ JobUtils.waitForIdle();
+
+ IResource res = project.findMember("aaa.js");
+
+ assertNotNull(res);
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JspFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JspFileNewWizardTest.java 2009-02-10 16:53:58 UTC (rev 13566)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JspFileNewWizardTest.java 2009-02-10 17:05:02 UTC (rev 13567)
@@ -1,6 +1,8 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jface.wizard.IWizard;
+import org.jboss.tools.test.util.JobUtils;
public class JspFileNewWizardTest extends WizardTest {
@@ -23,4 +25,21 @@
public void testJspFileNewWizardValidation2() {
validateFolderAndName();
}
+
+ public void testJspFileNewWizardResults() {
+ // Assert file with name from Name field created in folder with name form Folder field
+ IWizard wizard = getWizardOnProject("aaa");
+
+ boolean canFinish = wizard.canFinish();
+
+ assertTrue("Finish button is disabled.", canFinish);
+
+ wizard.performFinish();
+
+ JobUtils.waitForIdle();
+
+ IResource res = project.findMember("aaa.jsp");
+
+ assertNotNull(res);
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java 2009-02-10 16:53:58 UTC (rev 13566)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java 2009-02-10 17:05:02 UTC (rev 13567)
@@ -1,6 +1,8 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jface.wizard.IWizard;
+import org.jboss.tools.test.util.JobUtils;
public class PropertiesNewWizardTest extends WizardTest {
@@ -23,4 +25,21 @@
public void testPropertiesFileNewWizardValidation2() {
validateFolderAndName();
}
+
+ public void testPropertiesFileNewWizardResults() {
+ // Assert file with name from Name field created in folder with name form Folder field
+ IWizard wizard = getWizardOnProject("aaa");
+
+ boolean canFinish = wizard.canFinish();
+
+ assertTrue("Finish button is disabled.", canFinish);
+
+ wizard.performFinish();
+
+ JobUtils.waitForIdle();
+
+ IResource res = project.findMember("aaa.properties");
+
+ assertNotNull(res);
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java 2009-02-10 16:53:58 UTC (rev 13566)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java 2009-02-10 17:05:02 UTC (rev 13567)
@@ -1,6 +1,8 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jface.wizard.IWizard;
+import org.jboss.tools.test.util.JobUtils;
public class XhtmlFileNewWizardTest extends WizardTest {
@@ -23,4 +25,21 @@
public void testXhtmlFileNewWizardValidation2() {
validateFolderAndName();
}
+
+ public void testXhtmlFileNewWizardResults() {
+ // Assert file with name from Name field created in folder with name form Folder field
+ IWizard wizard = getWizardOnProject("aaa");
+
+ boolean canFinish = wizard.canFinish();
+
+ assertTrue("Finish button is disabled.", canFinish);
+
+ wizard.performFinish();
+
+ JobUtils.waitForIdle();
+
+ IResource res = project.findMember("aaa.xhtml");
+
+ assertNotNull(res);
+ }
}
\ No newline at end of file
15 years, 2 months
JBoss Tools SVN: r13566 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-02-10 11:53:58 -0500 (Tue, 10 Feb 2009)
New Revision: 13566
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3738 New runtime server doesn't appear in the wizard immediately - Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-02-10 16:42:47 UTC (rev 13565)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-02-10 16:53:58 UTC (rev 13566)
@@ -43,6 +43,7 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
@@ -57,6 +58,8 @@
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
+import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.ui.ServerUIUtil;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.tools.jst.web.server.RegistrationHelper;
@@ -379,13 +382,35 @@
return pageComplete;
}
- public boolean launchNewServerWizard(Shell shell, IDataModel model, String serverTypeID) {
+ public boolean launchNewServerWizard(Shell shell, final IDataModel model, String serverTypeID) {
DataModelPropertyDescriptor[] preAdditionDescriptors = model.getValidPropertyDescriptors(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
IRuntime rt = (IRuntime)model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
- boolean isOK = ServerUIUtil.showNewServerWizard(shell, serverTypeID, null, (rt == null ? null : null));
+ IServerLifecycleListener serverListener = new IServerLifecycleListener() {
+ public void serverAdded(IServer server) {
+ DataModelPropertyDescriptor[] descriptors = model.getValidPropertyDescriptors(IFacetProjectCreationDataModelProperties.FACET_RUNTIME);
+ for (int i = 0; i < descriptors.length; i++) {
+ if(server.getRuntime().getName().equals(descriptors[i].getPropertyDescription())) {
+ model.setProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME, descriptors[i].getPropertyValue());
+ model.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, descriptors[i].getPropertyValue());
+ }
+ }
+ model.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, server);
+ }
+ public void serverChanged(IServer server) {
+ }
+ public void serverRemoved(IServer server) {
+ }
+ };
+
+ ServerCore.addServerLifecycleListener(serverListener);
+ boolean isOK = false;
+ try {
+ isOK = ServerUIUtil.showNewServerWizard(shell, serverTypeID, null, (rt == null ? null : null));
+ } finally {
+ ServerCore.removeServerLifecycleListener(serverListener);
+ }
if (isOK && model != null) {
-
DataModelPropertyDescriptor[] postAdditionDescriptors = model.getValidPropertyDescriptors(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
Object[] preAddition = new Object[preAdditionDescriptors.length];
for (int i = 0; i < preAddition.length; i++) {
15 years, 2 months
JBoss Tools SVN: r13565 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-02-10 11:42:47 -0500 (Tue, 10 Feb 2009)
New Revision: 13565
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/topGroupBkgImg.png
Log:
https://jira.jboss.org/jira/browse/JBIDE-3740, background image for panelMenuGroup
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/topGroupBkgImg.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/topGroupBkgImg.png
___________________________________________________________________
Name: svn:mime-type
+ image/png
15 years, 2 months
JBoss Tools SVN: r13564 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: resources/panelMenu and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-02-10 11:40:37 -0500 (Tue, 10 Feb 2009)
New Revision: 13564
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/style.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3740, styles and css classes were updated.
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css 2009-02-10 16:40:37 UTC (rev 13564)
@@ -0,0 +1,4 @@
+.rich-pmenu {
+ overflow:hidden;
+ padding-right:4px;
+}
\ No newline at end of file
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenu/style.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/style.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/style.css 2009-02-10 15:34:26 UTC (rev 13563)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/panelMenuGroup/style.css 2009-02-10 16:40:37 UTC (rev 13564)
@@ -1,3 +1,8 @@
+.rich-pmenu-group{
+ /*padding: 0px;
+ height: 20px;
+ width: 100%;*/
+}
.rich-pmenu-group-icon {
width: 16;
height: 16;
@@ -7,15 +12,13 @@
}
.dr-pmenu-top-group-div, .dr-pmenu-group-div {
- margin-bottom: 3px;
- padding: 1px;
+ border:1px solid #C4C0B9;
+ margin-bottom:3px;
+ overflow:hidden;
+ padding:1px;
+ width:100%;
cursor: pointer;
}
-.rich-pmenu-group{
- padding: 0px;
- height: 20px;
- width: 100%;
-}
.dr-pmenu-top-group, .dr-pmenu-group {
background-color: #D4CFC7;
@@ -24,11 +27,15 @@
font-weight: bold;
background-position: left top;
background-repeat: repeat-x;
- padding: 0px;
+ cursor: pointer;
height: 20px;
- width: 100%;
+ adding:2px 1px 2px 2px;
}
+.dr-pmenu-top-group {
+ background-image: url(topGroupBkgImg.png);
+}
+
.rich-pmenu-top-group-self-label, .rich-pmenu-group-self-label {
padding-left: 5px;
width: 100%;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2009-02-10 15:34:26 UTC (rev 13563)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2009-02-10 16:40:37 UTC (rev 13564)
@@ -18,6 +18,7 @@
import java.util.Map;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
@@ -25,6 +26,7 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.ResourceUtil;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
@@ -68,6 +70,8 @@
private static final String CSS_TOP_GROUP_LABEL = "rich-pmenu-top-group-self-label"; //$NON-NLS-1$
private static final String CSS_DR_GROUP_DIV = "dr-pmenu-group-div"; //$NON-NLS-1$
private static final String CSS_GROUP = "rich-pmenu-group"; //$NON-NLS-1$
+ private static final String CSS_TOP_GROUP = "rich-pmenu-top-group"; //$NON-NLS-1$
+ private static final String CSS_TOP_GROUP_DIV = "rich-pmenu-top-group-div"; //$NON-NLS-1$
private static final String CSS_GROUP_ICON = "rich-pmenu-group-self-icon"; //$NON-NLS-1$
private static final String CSS_GROUP_LABEL = "rich-pmenu-group-self-label"; //$NON-NLS-1$
private static final String CSS_HOVERED_ELEMENT = "rich-pmenu-hovered-element"; //$NON-NLS-1$
@@ -87,12 +91,8 @@
private static final String TRUE = "true"; //$NON-NLS-1$
private static final String RIGHT = "right"; //$NON-NLS-1$
private static final String LEFT = "right"; //$NON-NLS-1$
- private static final String SPACE = " "; //$NON-NLS-1$
- private static final String EMPTY = ""; //$NON-NLS-1$
private static final String WIDTH_100_PERSENTS = "width: 100%; "; //$NON-NLS-1$
- private static final String MARGIN_TOP = "margin-top: 3px; "; //$NON-NLS-1$
- private static final String NO_SIZE_VALUE = "0"; //$NON-NLS-1$
private static final String DEFAULT_SIZE_VALUE = "16"; //$NON-NLS-1$
/*
@@ -160,9 +160,9 @@
// && (groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) instanceof Element)) {
// srcNode = (Element) groupSourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE);
// }
- nsIDOMElement creationDataDiv = visualDocument
- .createElement(HTML.TAG_DIV);
- VpeCreationData creationData = new VpeCreationData(creationDataDiv);
+// nsIDOMElement creationDataDiv = visualDocument
+// .createElement(HTML.TAG_DIV);
+// VpeCreationData creationData = new VpeCreationData(creationDataDiv);
//added by estherbin fixed https://jira.jboss.org/jira/browse/JBIDE-1605 issue.
final Element elementToPass = (srcNode != null ? srcNode : groupSourceElement);
@@ -175,8 +175,8 @@
int childGroupCount = 1;
- Element anySuitableParent = getGroupParent(elementToPass, false);
- Element panelMenuParent = getGroupParent(elementToPass, true);
+ Element anySuitableParent = getGroupParent(elementToPass, false);
+ Element panelMenuParent = getGroupParent(elementToPass, true);
readPanelMenuGroupAttributes(groupSourceElement);
readPanelMenuAttributes(panelMenuParent);
@@ -188,7 +188,8 @@
}
nsIDOMElement div = visualDocument
.createElement(HTML.TAG_DIV);
- creationDataDiv.appendChild(div);
+ VpeCreationData creationData = new VpeCreationData(div);
+// creationDataDiv.appendChild(div);
div.setAttribute(COMPONENT_ATTR_VPE_SUPPORT, NAME_COMPONENT);
div.setAttribute(VpeVisualDomBuilder.VPE_USER_TOGGLE_ID, childId);
@@ -240,21 +241,21 @@
Element anySuitableParent, Element groupSourceElement,
nsIDOMDocument visualDocument, nsIDOMElement div,
boolean expanded, String activeChildId) {
- String tableStyle = MARGIN_TOP;
- String tableClass = EMPTY;
- String iconCellClass = EMPTY;
- String iconCellStyle = EMPTY;
- String labelCellClass = EMPTY;
- String emptyCellClass = EMPTY;
- String divClass = EMPTY;
+ String tableStyle = Constants.EMPTY;
+ String tableClass = Constants.EMPTY;
+ String iconCellClass = Constants.EMPTY;
+ String iconCellStyle = Constants.EMPTY;
+ String labelCellClass = Constants.EMPTY;
+ String emptyCellClass = Constants.EMPTY;
+ String divClass = Constants.EMPTY;
nsIDOMElement table = visualDocument
.createElement(HTML.TAG_TABLE);
div.appendChild(table);
- table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
- table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
- table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CELLSPACING, Constants.ZERO_STRING);
+ table.setAttribute(HTML.ATTR_CELLPADDING, Constants.ZERO_STRING);
+ table.setAttribute(HTML.ATTR_BORDER, Constants.ZERO_STRING);
nsIDOMElement tableBodyRow = visualDocument
.createElement(HTML.TAG_TR);
@@ -304,9 +305,9 @@
* Group Label Routine.
*/
Attr labelAttr = null;
- String labelValue = EMPTY;
- String bundleValue = EMPTY;
- String resultValue = EMPTY;
+ String labelValue = Constants.EMPTY;
+ String bundleValue = Constants.EMPTY;
+ String resultValue = Constants.EMPTY;
if (groupSourceElement.hasAttribute(LABEL)) {
labelAttr = groupSourceElement.getAttributeNode(LABEL);
}
@@ -330,7 +331,7 @@
if (ComponentUtil.isNotBlank(bundleValue)) {
resultValue = bundleValue;
} else {
- resultValue = EMPTY;
+ resultValue = Constants.EMPTY;
}
}
nsIDOMText text = visualDocument.createTextNode(resultValue);
@@ -386,91 +387,95 @@
/*
* Group Style Classes Routine
*/
- tableClass += SPACE + CSS_GROUP + SPACE + CSS_DR_GROUP;
+ if (childOfPanelMenu) {
+ tableClass += Constants.WHITE_SPACE + CSS_DR_TOP_GROUP
+ + Constants.WHITE_SPACE + CSS_TOP_GROUP
+ + Constants.WHITE_SPACE + CSS_GROUP;
+ divClass += Constants.WHITE_SPACE + CSS_DR_TOP_GROUP_DIV
+ + Constants.WHITE_SPACE + CSS_TOP_GROUP_DIV;
+ } else {
+ tableClass += Constants.WHITE_SPACE + CSS_GROUP
+ + Constants.WHITE_SPACE + CSS_DR_GROUP;
+ divClass += Constants.WHITE_SPACE + CSS_DR_GROUP_DIV;
+ }
+
if (TRUE.equalsIgnoreCase(pm_disabled)) {
if (childOfPanelMenu) {
- tableClass = SPACE + CSS_DR_TOP_GROUP + SPACE + CSS_GROUP;
- tableClass += SPACE + CSS_DISABLED_ELEMENT;
- divClass += SPACE + CSS_DR_TOP_GROUP_DIV;
+ tableClass += Constants.WHITE_SPACE + CSS_DISABLED_ELEMENT;
if (ComponentUtil.isNotBlank(pm_disabledGroupClass)) {
- tableClass += SPACE + pm_disabledGroupClass;
+ tableClass += Constants.WHITE_SPACE + pm_disabledGroupClass;
}
if (ComponentUtil.isNotBlank(pm_topGroupStyle)) {
- tableStyle += SPACE + pm_topGroupStyle;
+ tableStyle += Constants.WHITE_SPACE + pm_topGroupStyle;
}
}
}
if ((TRUE.equalsIgnoreCase(pmg_disabled))) {
- tableClass += SPACE + CSS_GROUP + SPACE + CSS_DR_GROUP;
-
if (!(TRUE.equalsIgnoreCase(pm_disabled))) {
- tableClass += SPACE + CSS_DISABLED_ELEMENT;
+ tableClass += Constants.WHITE_SPACE + CSS_DISABLED_ELEMENT;
if (ComponentUtil.isNotBlank(pm_disabledGroupClass)){
- tableClass += SPACE + pm_disabledGroupClass;
+ tableClass += Constants.WHITE_SPACE + pm_disabledGroupClass;
}
}
if (ComponentUtil.isNotBlank(pmg_disabledClass)) {
- tableClass += SPACE + pmg_disabledClass;
+ tableClass += Constants.WHITE_SPACE + pmg_disabledClass;
}
if (ComponentUtil.isNotBlank(pm_disabledGroupStyle)) {
- tableStyle += SPACE + pm_disabledGroupStyle;
+ tableStyle += Constants.WHITE_SPACE + pm_disabledGroupStyle;
}
if (ComponentUtil.isNotBlank(pmg_disabledStyle)) {
- tableStyle += SPACE + pmg_disabledStyle;
+ tableStyle += Constants.WHITE_SPACE + pmg_disabledStyle;
}
}
if (!(TRUE.equalsIgnoreCase(pm_disabled))
&& (!(TRUE.equalsIgnoreCase(pmg_disabled)))) {
- tableClass = SPACE + CSS_DR_GROUP + SPACE + CSS_GROUP;
- iconCellClass = SPACE + CSS_GROUP_ICON;
- labelCellClass += SPACE + CSS_GROUP_LABEL;
- emptyCellClass += SPACE + CSS_GROUP_ICON;
- divClass += SPACE + CSS_DR_GROUP_DIV;
- if (ComponentUtil.isNotBlank(pm_groupClass)) {
- tableClass += SPACE + pm_groupClass;
- }
- if (ComponentUtil.isNotBlank(pm_groupStyle)) {
- tableStyle += SPACE + pm_groupStyle;
- }
+ tableClass = Constants.WHITE_SPACE + CSS_DR_GROUP + Constants.WHITE_SPACE + CSS_GROUP;
+ iconCellClass = Constants.WHITE_SPACE + CSS_GROUP_ICON;
+ labelCellClass += Constants.WHITE_SPACE + CSS_GROUP_LABEL;
+ emptyCellClass += Constants.WHITE_SPACE + CSS_GROUP_ICON;
+
if (ComponentUtil.isNotBlank(pmg_iconClass)) {
- iconCellClass += SPACE + pmg_iconClass;
+ iconCellClass += Constants.WHITE_SPACE + pmg_iconClass;
}
if (ComponentUtil.isNotBlank(pmg_iconStyle)) {
- iconCellStyle += SPACE + pmg_iconStyle;
+ iconCellStyle += Constants.WHITE_SPACE + pmg_iconStyle;
}
if (childOfPanelMenu) {
- tableClass = SPACE + CSS_DR_TOP_GROUP + SPACE + CSS_GROUP;
- iconCellClass = SPACE + CSS_GROUP_ICON + SPACE + CSS_TOP_GROUP_ICON;
- labelCellClass = SPACE + CSS_TOP_GROUP_LABEL;
- emptyCellClass = SPACE + CSS_TOP_GROUP_ICON;
- divClass += SPACE + CSS_DR_TOP_GROUP_DIV;
+ tableClass = Constants.WHITE_SPACE + CSS_DR_TOP_GROUP + Constants.WHITE_SPACE + CSS_GROUP;
+ iconCellClass = Constants.WHITE_SPACE + CSS_GROUP_ICON + Constants.WHITE_SPACE + CSS_TOP_GROUP_ICON;
+ labelCellClass = Constants.WHITE_SPACE + CSS_TOP_GROUP_LABEL;
+ emptyCellClass = Constants.WHITE_SPACE + CSS_TOP_GROUP_ICON;
if (ComponentUtil.isNotBlank(pm_topGroupClass)) {
- tableClass += SPACE + pm_topGroupClass;
+ tableClass += Constants.WHITE_SPACE + pm_topGroupClass;
}
if (ComponentUtil.isNotBlank(pm_topGroupStyle)) {
tableStyle += pm_topGroupStyle;
}
if (ComponentUtil.isNotBlank(pmg_iconClass)) {
- iconCellClass += SPACE + pmg_iconClass;
+ iconCellClass += Constants.WHITE_SPACE + pmg_iconClass;
}
if (ComponentUtil.isNotBlank(pmg_iconStyle)) {
- iconCellStyle += SPACE + pmg_iconStyle;
+ iconCellStyle += Constants.WHITE_SPACE + pmg_iconStyle;
}
- }
+ } else {
+ if (ComponentUtil.isNotBlank(pm_groupClass)) {
+ tableClass += Constants.WHITE_SPACE + pm_groupClass;
+ }
+ if (ComponentUtil.isNotBlank(pm_groupStyle)) {
+ tableStyle += Constants.WHITE_SPACE + pm_groupStyle;
+ }
+ }
}
-
- if (ComponentUtil.isNotBlank(pm_styleClass)) {
- tableClass += SPACE + pm_styleClass;
- }
+
if (ComponentUtil.isNotBlank(pmg_styleClass)) {
- tableClass += SPACE + pmg_styleClass;
+ tableClass += Constants.WHITE_SPACE + pmg_styleClass;
}
if (ComponentUtil.isNotBlank(pmg_style)) {
- tableStyle += SPACE + pmg_style;
+ tableStyle += Constants.WHITE_SPACE + pmg_style;
}
iconCell.setAttribute(HTML.ATTR_CLASS, iconCellClass);
@@ -490,8 +495,8 @@
private static void setDefaultImgAttributes(nsIDOMElement element) {
element.setAttribute(HTML.ATTR_WIDTH,
DEFAULT_SIZE_VALUE);
- element.setAttribute(VSPACE, NO_SIZE_VALUE);
- element.setAttribute(HSPACE, NO_SIZE_VALUE);
+ element.setAttribute(VSPACE, Constants.ZERO_STRING);
+ element.setAttribute(HSPACE, Constants.ZERO_STRING);
element.setAttribute(HTML.ATTR_HEIGHT,
DEFAULT_SIZE_VALUE);
}
@@ -626,15 +631,15 @@
/*
* rich:panelMenu style classes for groups
*/
- pm_disabled = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED);
+ pm_disabled = sourceParentElement.getAttribute(HTML.ATTR_DISABLED);
pm_disabledGroupClass = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED_GROUP_CLASS);
pm_disabledGroupStyle = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED_GROUP_STYLE);
pm_topGroupClass = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.TOP_GROUP_CLASS);
pm_topGroupStyle = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.TOP_GROUP_STYLE);
pm_groupClass = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.GROUP_CLASS);
pm_groupStyle = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.GROUP_STYLE);
- pm_style = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.STYLE);
- pm_styleClass = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.STYLE_CLASS);
+ pm_style = sourceParentElement.getAttribute(RichFaces.ATTR_STYLE);
+ pm_styleClass = sourceParentElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
}
/**
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2009-02-10 15:34:26 UTC (rev 13563)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2009-02-10 16:40:37 UTC (rev 13564)
@@ -585,7 +585,7 @@
/*
* rich:panelMenu attributes for items
*/
- pm_disabled = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.DISABLED);
+ pm_disabled = sourceParentElement.getAttribute(HTML.ATTR_DISABLED);
pm_iconItem = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_ITEM);
pm_iconDisabledItem = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_DISABLED_ITEM);
pm_iconItemPosition = sourceParentElement.getAttribute(RichFacesPanelMenuTemplate.ICON_ITEM_POSITION);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java 2009-02-10 15:34:26 UTC (rev 13563)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java 2009-02-10 16:40:37 UTC (rev 13564)
@@ -14,12 +14,13 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
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.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -33,12 +34,20 @@
*/
public class RichFacesPanelMenuTemplate extends VpeAbstractTemplate {
+ /*
+ * Path to default css style sheet.
+ */
+ private static final String CSS_STYLE_PATH = "/panelMenu/style.css"; //$NON-NLS-1$
+
+ /*
+ * Component name
+ */
+ private static final String COMPONENT_NAME = "panelMenu"; //$NON-NLS-1$
+
/*
* rich:panelMenu attributes
*/
- public static final String DISABLED = "disabled"; //$NON-NLS-1$
public static final String EXPAND_SINGLE = "expandSingle"; //$NON-NLS-1$
- public static final String WIDTH = "width"; //$NON-NLS-1$
/*
* rich:panelMenu attributes for groups
@@ -63,12 +72,6 @@
public static final String ICON_ITEM_TOP_POSITION = "iconItemTopPosition"; //$NON-NLS-1$
/*
- * rich:panelMenu style classes
- */
- public static final String STYLE = "style"; //$NON-NLS-1$
- public static final String STYLE_CLASS = "styleClass"; //$NON-NLS-1$
-
- /*
* rich:panelMenu style classes for groups
*/
public static final String DISABLED_GROUP_CLASS = "disabledGroupClass"; //$NON-NLS-1$
@@ -91,7 +94,7 @@
/*
* rich:panelMenu css styles
*/
- public static final String CSS_PANEL_MENU = "rich-panel-menu"; //$NON-NLS-1$
+ public static final String CSS_PMENU = "rich-pmenu"; //$NON-NLS-1$
private static final String PANEL_MENU_GROUP_END = ":panelMenuGroup"; //$NON-NLS-1$
private static final String PANEL_MENU_ITEM_END = ":panelMenuItem"; //$NON-NLS-1$
@@ -102,26 +105,31 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ ComponentUtil.setCSSLink(pageContext, CSS_STYLE_PATH, COMPONENT_NAME);
+
Element sourceElement = (Element) sourceNode;
- String width = sourceElement.getAttribute(WIDTH);
- String style = sourceElement.getAttribute(STYLE);
- String styleClass = sourceElement.getAttribute(STYLE_CLASS);
-
- if (width != null) {
- style = "width:" + width + ";" + style; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
+ String widthAttr = sourceElement.getAttribute(HTML.ATTR_WIDTH);
+ String styleAttr = sourceElement.getAttribute(RichFaces.ATTR_STYLE);
+ String styleClassAttr = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+ String style = Constants.EMPTY;
+ String styleClass = CSS_PMENU;
+
nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
VpeCreationData vpeCreationData = new VpeCreationData(div);
- div.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0"); //$NON-NLS-1$
-
- if (style != null) {
- div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, MARGIN_TOP + style);
+ div.setAttribute(HTML.ATTR_BORDER, Constants.ZERO_STRING);
+
+ if (widthAttr != null) {
+ style += "width:" + widthAttr + "; "; //$NON-NLS-1$ //$NON-NLS-2$
}
+ if (styleAttr != null) {
+ style += styleAttr;
+ }
+ div.setAttribute(HTML.ATTR_STYLE, style);
- if (styleClass != null) {
- div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
+ if (styleClassAttr != null) {
+ styleClass += Constants.WHITE_SPACE + styleClassAttr;
}
+ div.setAttribute(HTML.ATTR_CLASS, styleClass);
List<Node> children = ComponentUtil.getChildren(sourceElement);
int i = 1;
15 years, 2 months
JBoss Tools SVN: r13563 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse: launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-02-10 10:34:26 -0500 (Tue, 10 Feb 2009)
New Revision: 13563
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
Log:
JBIDE-3604
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2009-02-10 15:27:40 UTC (rev 13562)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2009-02-10 15:34:26 UTC (rev 13563)
@@ -366,12 +366,16 @@
//
public static String AddPropertyDialog_add_exporter_property;
public static String AddPropertyDialog_add_property_to;
+ public static String AddPropertyDialog_edit_exporter_property;
+ public static String AddPropertyDialog_edit_property_to;
public static String AddPropertyDialog_name;
public static String AddPropertyDialog_the_property_is_already_set;
public static String AddPropertyDialog_the_property_name_may_not_contain_whitespaces;
public static String AddPropertyDialog_the_property_name_must_be_chosen_or_entered;
public static String AddPropertyDialog_the_property_value_must_be_non_empty;
public static String AddPropertyDialog_value;
+ public static String AddPropertyDialog_add_path;
+ public static String AddPropertyDialog_browse;
public static String CodeGenerationLaunchDelegate_console_configuration_not_found_in;
public static String CodeGenerationLaunchDelegate_console_configuration_name_is_empty_in;
public static String CodeGenerationLaunchDelegate_could_not_create_or_find_with_default_noarg_constructor;
@@ -485,6 +489,7 @@
public static String ExporterSettingsTab_description;
public static String ExporterSettingsTab_deselect_all;
public static String ExporterSettingsTab_does_not_exist;
+ public static String ExporterSettingsTab_edit;
public static String ExporterSettingsTab_exporters;
public static String ExporterSettingsTab_exporters_2;
public static String ExporterSettingsTab_general_settings;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-02-10 15:27:40 UTC (rev 13562)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-02-10 15:34:26 UTC (rev 13563)
@@ -358,12 +358,16 @@
AddPropertyDialog_add_exporter_property=Add exporter property
AddPropertyDialog_add_property_to=Add property to
+AddPropertyDialog_edit_exporter_property=Edit exporter property
+AddPropertyDialog_edit_property_to=Edit property to
AddPropertyDialog_name=Name:
AddPropertyDialog_the_property_is_already_set=The property {0} is already set, pressing ok will overwrite the current value
AddPropertyDialog_the_property_name_may_not_contain_whitespaces=The property name may not contain whitespaces
AddPropertyDialog_the_property_name_must_be_chosen_or_entered=The property name must be chosen or entered
AddPropertyDialog_the_property_value_must_be_non_empty=The property value must be non-empty
AddPropertyDialog_value=Value:
+AddPropertyDialog_add_path=Add path...
+AddPropertyDialog_browse=Browse
CodeGenerationLaunchDelegate_console_configuration_not_found_in=Console configuration {0} not found in {1}
CodeGenerationLaunchDelegate_console_configuration_name_is_empty_in=Console configuration name is empty in
CodeGenerationLaunchDelegate_could_not_create_or_find_with_default_noarg_constructor=Could not create or find {0} with default no-arg constructor
@@ -476,6 +480,7 @@
ExporterSettingsTab_description=Description
ExporterSettingsTab_deselect_all=Deselect all
ExporterSettingsTab_does_not_exist=\ does not exist
+ExporterSettingsTab_edit=Edit...
ExporterSettingsTab_exporters=Exporters:
ExporterSettingsTab_exporters_2=Exporters
ExporterSettingsTab_general_settings=General settings:
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2009-02-10 15:27:40 UTC (rev 13562)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2009-02-10 15:34:26 UTC (rev 13563)
@@ -1,6 +1,5 @@
package org.hibernate.eclipse.launch;
-import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -49,6 +48,8 @@
public class AddPropertyDialog extends TitleAreaDialog {
private final ExporterFactory ef;
+ private final String selectedPropertyId;
+ private final boolean flagEdit;
private ComboViewer propertyCombo;
private Control value;
private Button addPathButton;
@@ -62,14 +63,23 @@
};
- protected AddPropertyDialog(Shell parentShell, ExporterFactory ef) {
+ protected AddPropertyDialog(Shell parentShell, ExporterFactory ef, String selectedPropertyId, boolean flagEdit) {
super( parentShell );
this.ef = ef;
+ this.selectedPropertyId = selectedPropertyId;
+ this.flagEdit = flagEdit;
}
protected Control createDialogArea(Composite parent) {
- getShell().setText(HibernateConsoleMessages.AddPropertyDialog_add_exporter_property);
- setTitle(HibernateConsoleMessages.AddPropertyDialog_add_property_to + ef.getExporterDefinition().getDescription());
+
+ String dialogTitle = HibernateConsoleMessages.AddPropertyDialog_add_exporter_property;
+ String editTitle = HibernateConsoleMessages.AddPropertyDialog_add_property_to;
+ if (flagEdit) {
+ dialogTitle = HibernateConsoleMessages.AddPropertyDialog_edit_exporter_property;
+ editTitle = HibernateConsoleMessages.AddPropertyDialog_edit_property_to;
+ }
+ getShell().setText(dialogTitle);
+ setTitle(editTitle + ef.getExporterDefinition().getDescription());
Composite control = (Composite) super.createDialogArea( parent );
Composite composite = new Composite(control,SWT.NONE);
@@ -117,6 +127,9 @@
});
+ if (flagEdit) {
+ propertyCombo.getControl().setEnabled(false);
+ }
label = new Label(composite, SWT.NONE);
label.setText( HibernateConsoleMessages.AddPropertyDialog_value );
@@ -224,7 +237,7 @@
} else if (answer == 1){ // workspace
IPath[] paths = DialogSelectionHelper.chooseFileEntries(getShell(), (IPath)null, new Path[0],
title, description,
- new String[0], isPath, true, false);//$NON-NLS-1$
+ new String[0], isPath, true, false);
if (paths != null && paths.length > 0){
strPath = paths[0].toOSString();
if (isPath){
@@ -272,7 +285,14 @@
} );
viewer.setInput( ef );
if(viewer.getCombo().getItemCount()>0) {
- viewer.setSelection( new StructuredSelection(viewer.getElementAt( 0 )));
+ Object selected = null;
+ if (selectedPropertyId != null) {
+ selected = ef.getExporterProperty(selectedPropertyId);
+ }
+ else {
+ selected = viewer.getElementAt( 0 );
+ }
+ viewer.setSelection(new StructuredSelection(selected));
}
}
@@ -288,10 +308,10 @@
private void createBrowseButton(SelectionListener listener, ExporterProperty prop){
disposeBrowseButton();
addPathButton = new Button(value.getParent(), SWT.PUSH);
- if ("path".equals(prop.getType())){
- addPathButton.setText("Add path...");
+ if ("path".equals(prop.getType())){ //$NON-NLS-1$
+ addPathButton.setText(HibernateConsoleMessages.AddPropertyDialog_add_path);
} else {
- addPathButton.setText("Browse");
+ addPathButton.setText(HibernateConsoleMessages.AddPropertyDialog_browse);
}
addPathButton.setLayoutData(new GridData(GridData.END));
addPathButton.addSelectionListener(listener);
@@ -347,7 +367,7 @@
} else if(StringHelper.isEmpty( getPropertyValue() )) {
setMessage( HibernateConsoleMessages.AddPropertyDialog_the_property_value_must_be_non_empty, IMessageProvider.ERROR);
} else {
- if (ef.hasLocalValueFor( getPropertyName() )) {
+ if (!flagEdit && ef.hasLocalValueFor( getPropertyName() )) {
String out = NLS.bind(HibernateConsoleMessages.AddPropertyDialog_the_property_is_already_set, getPropertyName());
setMessage(out, IMessageProvider.WARNING);
} else {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2009-02-10 15:27:40 UTC (rev 13562)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2009-02-10 15:34:26 UTC (rev 13563)
@@ -42,10 +42,6 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -61,7 +57,6 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
@@ -85,6 +80,7 @@
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySheetEntry;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.IPropertySourceProvider;
import org.eclipse.ui.views.properties.PropertySheetEntry;
@@ -124,6 +120,8 @@
private Button remove;
+ private Button edit;
+
/**
* Constructor for SampleNewWizardPage.
*
@@ -184,7 +182,7 @@
gr.setLayout( gridLayout );
gd = new GridData( SWT.FILL, SWT.FILL, true, true );
- gd.verticalSpan = 2;
+ gd.verticalSpan = 3;
gr.setLayoutData( gd );
Control sheet = createPropertySheet( gr );
@@ -205,7 +203,7 @@
ExporterFactory ef = (ExporterFactory) ss.getFirstElement();
if(ef!=null) {
- AddPropertyDialog dialog = new AddPropertyDialog(getShell(), ef);
+ AddPropertyDialog dialog = new AddPropertyDialog(getShell(), ef, null, false);
if(dialog.open()==Dialog.OK) {
ef.setProperty( dialog.getPropertyName(), dialog.getPropertyValue() );
dialogChanged();
@@ -238,6 +236,34 @@
gd.horizontalIndent = 5;
remove.setLayoutData( gd );
+ edit = new Button( exportersComposite, SWT.PUSH );
+ edit.setEnabled( false );
+ edit.setText( HibernateConsoleMessages.ExporterSettingsTab_edit );
+ gd = new GridData( GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_BEGINNING );
+ gd.horizontalIndent = 5;
+ edit.setLayoutData( gd );
+ edit.addSelectionListener( new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ IStructuredSelection ss = (IStructuredSelection) getExporterTable().getSelection();
+ ExporterFactory ef = (ExporterFactory) ss.getFirstElement();
+
+ if(ef!=null) {
+ String selectedPropertyId = null;
+ if(currentDescriptor!=null) {
+ selectedPropertyId = (String) currentDescriptor.getId();
+ }
+ AddPropertyDialog dialog =
+ new AddPropertyDialog(getShell(), ef, selectedPropertyId, true);
+ if(dialog.open()==Dialog.OK) {
+ ef.setProperty( dialog.getPropertyName(), dialog.getPropertyValue() );
+ dialogChanged();
+ refreshPropertySheet();
+ }
+ }
+ }
+ } );
+
}
public class MyPropertySheetEntry extends PropertySheetEntry {
@@ -265,6 +291,7 @@
hasSelection = true;
}
if (remove != null) remove.setEnabled(hasSelection);
+ if (edit != null) edit.setEnabled(hasSelection);
}
private Control createPropertySheet(Composite exportersComposite) {
@@ -317,6 +344,7 @@
if(s.isEmpty()) {
if(add!=null) add.setEnabled( false );
if(remove!=null) remove.setEnabled( false );
+ if(edit!=null) edit.setEnabled( false );
propertySheetEntry.setValues(new Object[0]);
@@ -327,6 +355,7 @@
hasSelection = true;
}
if(remove!=null) remove.setEnabled( hasSelection );
+ if(edit!=null) edit.setEnabled( hasSelection );
ExporterFactory ep = (ExporterFactory) s
.getFirstElement();
15 years, 2 months