JBoss Tools SVN: r10167 - trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-10 04:05:03 -0400 (Wed, 10 Sep 2008)
New Revision: 10167
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF
Log:
change the lib reference
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF 2008-09-10 08:04:13 UTC (rev 10166)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF 2008-09-10 08:05:03 UTC (rev 10167)
@@ -19,18 +19,6 @@
org.eclipse.ui.ide,
org.jboss.tools.smooks.graphicalInfo
Eclipse-LazyStart: true
-Bundle-ClassPath: libs/commons-beanutils-1.8.0-BETA.jar,
- libs/commons-beanutils-1.8.0-BETA-javadoc.jar,
- libs/commons-beanutils-1.8.0-BETA-sources.jar,
- libs/commons-beanutils-bean-collections-1.8.0-BETA.jar,
- libs/commons-beanutils-core-1.8.0-BETA.jar,
- libs/commons-logging-1.1.1.jar,
- libs/commons-logging-1.1.1-javadoc.jar,
- libs/commons-logging-1.1.1-sources.jar,
- libs/commons-logging-adapters-1.1.1.jar,
- libs/commons-logging-api-1.1.1.jar,
- libs/commons-logging-tests.jar,
- .
Export-Package: org.jboss.tools.smooks.javabean,
org.jboss.tools.smooks.javabean.analyzer,
org.jboss.tools.smooks.javabean.commandprocessor,
17 years, 7 months
JBoss Tools SVN: r10166 - trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-10 04:04:13 -0400 (Wed, 10 Sep 2008)
New Revision: 10166
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-1.8.0-BETA-javadoc.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-1.8.0-BETA-sources.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-1.8.0-BETA.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-bean-collections-1.8.0-BETA.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-core-1.8.0-BETA.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-1.1.1-javadoc.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-1.1.1-sources.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-1.1.1.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-adapters-1.1.1.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-api-1.1.1.jar
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-tests.jar
Log:
remove all commons-beanutils jar files,don't need them
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-1.8.0-BETA-javadoc.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-1.8.0-BETA-sources.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-1.8.0-BETA.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-bean-collections-1.8.0-BETA.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-beanutils-core-1.8.0-BETA.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-1.1.1-javadoc.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-1.1.1-sources.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-1.1.1.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-adapters-1.1.1.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-api-1.1.1.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/libs/commons-logging-tests.jar
===================================================================
(Binary files differ)
17 years, 7 months
JBoss Tools SVN: r10165 - in trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean: uitils and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-10 04:02:51 -0400 (Wed, 10 Sep 2008)
New Revision: 10165
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/uitils/
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/uitils/JavaPropertyUtils.java
Log:
write a Util class to replace the commons-beanutils
Added: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/uitils/JavaPropertyUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/uitils/JavaPropertyUtils.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/uitils/JavaPropertyUtils.java 2008-09-10 08:02:51 UTC (rev 10165)
@@ -0,0 +1,45 @@
+package org.jboss.tools.smooks.javabean.uitils;
+
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+
+/**
+ *
+ * @author Dart Peng<br>
+ * Date : Sep 10, 2008
+ */
+public class JavaPropertyUtils {
+
+ private static JavaPropertyUtils instace = null;
+
+ public static PropertyDescriptor[] getPropertyDescriptor(Class clazz) {
+ try {
+ return getInstace().getPropertyDescriptorArray(clazz);
+ } catch (Exception e) {
+ // ignore
+ return new PropertyDescriptor[]{};
+ }
+ }
+
+ /**
+ *
+ * @param clazz
+ * @return
+ * @throws IntrospectionException
+ */
+ public PropertyDescriptor[] getPropertyDescriptorArray(Class clazz)
+ throws IntrospectionException {
+ // TODO should improve (use some catch to store the BeanInfo , right?)
+ return Introspector
+ .getBeanInfo(clazz, Introspector.IGNORE_ALL_BEANINFO)
+ .getPropertyDescriptors();
+ }
+
+ public static JavaPropertyUtils getInstace() {
+ if (instace == null) {
+ instace = new JavaPropertyUtils();
+ }
+ return instace;
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/uitils/JavaPropertyUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 7 months
JBoss Tools SVN: r10164 - trunk/smooks/plugins/org.jboss.tools.smooks.xml/META-INF.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-09 22:11:30 -0400 (Tue, 09 Sep 2008)
New Revision: 10164
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.xml/META-INF/MANIFEST.MF
Log:
change export-pacakge contents
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/META-INF/MANIFEST.MF 2008-09-10 02:10:37 UTC (rev 10163)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/META-INF/MANIFEST.MF 2008-09-10 02:11:30 UTC (rev 10164)
@@ -21,6 +21,5 @@
Export-Package: org.jboss.tools.smooks.xml,
org.jboss.tools.smooks.xml.model,
org.jboss.tools.smooks.xml.ui,
- org.jboss.tools.smooks.xml2java.model,
org.jboss.tools.smooks.xsd.model,
org.jboss.tools.smooks.xsd.ui
17 years, 7 months
JBoss Tools SVN: r10163 - in trunk/smooks/plugins/org.jboss.tools.smooks.xml: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-09 22:10:37 -0400 (Tue, 09 Sep 2008)
New Revision: 10163
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src_test/
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.xml/.classpath
trunk/smooks/plugins/org.jboss.tools.smooks.xml/META-INF/MANIFEST.MF
Log:
Remove the src_test folder , because the test codes all move to org.jboss.tools.smooks.test project
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/.classpath
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/.classpath 2008-09-10 02:09:45 UTC (rev 10162)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/.classpath 2008-09-10 02:10:37 UTC (rev 10163)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src_test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="lib" path="libs/dom4j-1.6.1.jar"/>
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/META-INF/MANIFEST.MF 2008-09-10 02:09:45 UTC (rev 10162)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/META-INF/MANIFEST.MF 2008-09-10 02:10:37 UTC (rev 10163)
@@ -11,7 +11,6 @@
org.jboss.tools.smooks.model.edit,
org.jboss.tools.smooks.ui,
org.eclipse.ui.views,
- org.junit,
org.eclipse.core.resources,
org.eclipse.ui.ide,
org.eclipse.xsd.edit,
17 years, 7 months
JBoss Tools SVN: r10162 - in trunk/smooks/plugins/org.jboss.tools.smooks.javabean: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-09-09 22:09:45 -0400 (Tue, 09 Sep 2008)
New Revision: 10162
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src_test/
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF
Log:
Remove the src_test folder , because the test codes all move to org.jboss.tools.smooks.test project
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath 2008-09-09 17:16:13 UTC (rev 10161)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/.classpath 2008-09-10 02:09:45 UTC (rev 10162)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src_test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="lib" path="libs/commons-beanutils-1.8.0-BETA.jar"/>
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF 2008-09-09 17:16:13 UTC (rev 10161)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/META-INF/MANIFEST.MF 2008-09-10 02:09:45 UTC (rev 10162)
@@ -17,8 +17,7 @@
org.jboss.tools.smooks.model,
org.jboss.tools.smooks.model.edit,
org.eclipse.ui.ide,
- org.jboss.tools.smooks.graphicalInfo,
- org.junit
+ org.jboss.tools.smooks.graphicalInfo
Eclipse-LazyStart: true
Bundle-ClassPath: libs/commons-beanutils-1.8.0-BETA.jar,
libs/commons-beanutils-1.8.0-BETA-javadoc.jar,
17 years, 7 months
JBoss Tools SVN: r10161 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-09-09 13:16:13 -0400 (Tue, 09 Sep 2008)
New Revision: 10161
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIPlugin.java
Log:
JBIDE-2733 Broken Eclipse Template
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIPlugin.java 2008-09-09 15:54:47 UTC (rev 10160)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIPlugin.java 2008-09-09 17:16:13 UTC (rev 10161)
@@ -64,13 +64,13 @@
public void start(BundleContext context) throws Exception {
super.start(context);
- configureJavaPlugin();
+ //configureJavaPlugin();
}
- private void configureJavaPlugin() {
+ /*private void configureJavaPlugin() {
TemplateContextType contextType = new ExtendedTemplateContextType();
JavaPlugin.getDefault().getTemplateContextRegistry().addContextType(contextType);
- }
+ }*/
protected void initializeDefaultPluginPreferences() {
Platform.getBundle(JavaUI.ID_PLUGIN);
17 years, 7 months
JBoss Tools SVN: r10159 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.facelets/templates and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-09 11:47:33 -0400 (Tue, 09 Sep 2008)
New Revision: 10159
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/templates/vpe-templates-facelets.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-1805
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-09-09 15:25:01 UTC (rev 10158)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-09-09 15:47:33 UTC (rev 10159)
@@ -33,7 +33,7 @@
</vpe:tag>
<vpe:tag name="a4j:ajaxListener" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes" >
+ <vpe:template children="no" modify="no" >
</vpe:template>
</vpe:tag>
@@ -44,11 +44,11 @@
</vpe:tag>
<vpe:tag name="a4j:support" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="a4j:poll" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes" >
+ <vpe:template children="no" modify="no" >
</vpe:template>
</vpe:tag>
@@ -132,7 +132,7 @@
</vpe:tag>
<vpe:tag name="a4j:actionparam" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes" >
+ <vpe:template children="no" modify="no" >
</vpe:template>
</vpe:tag>
@@ -151,18 +151,18 @@
</vpe:tag>
<vpe:tag name="a4j:loadStyle" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes" >
+ <vpe:template children="no" modify="no" >
<vpe:link rel="stylesheet" href="{href(@src)}" />
</vpe:template>
</vpe:tag>
<vpe:tag name="a4j:loadScript" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes" >
+ <vpe:template children="no" modify="no" >
</vpe:template>
</vpe:tag>
<vpe:tag name="a4j:jsFunction" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes">
+ <vpe:template children="no" modify="no" >
</vpe:template>
</vpe:tag>
@@ -174,7 +174,7 @@
</vpe:tag>
<vpe:tag name="a4j:log" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes">
+ <vpe:template children="no" modify="no" >
</vpe:template>
</vpe:tag>
@@ -227,7 +227,7 @@
</vpe:tag>
<vpe:tag name="a4j:push" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes" >
+ <vpe:template children="no" modify="no" >
</vpe:template>
</vpe:tag>
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/templates/vpe-templates-facelets.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/templates/vpe-templates-facelets.xml 2008-09-09 15:25:01 UTC (rev 10158)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/templates/vpe-templates-facelets.xml 2008-09-09 15:47:33 UTC (rev 10159)
@@ -56,7 +56,7 @@
</vpe:tag>
<vpe:tag name="ui:remove" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="ui:include" case-sensitive="yes">
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-09-09 15:25:01 UTC (rev 10158)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-09-09 15:47:33 UTC (rev 10159)
@@ -57,7 +57,7 @@
</vpe:tag>
<vpe:tag name="h:inputTextarea" case-sensitive="yes">
- <vpe:template children="yes" modify="no" class="org.jboss.tools.jsf.vpe.jsf.template.JsfInputTextAreaTemplate">
+ <vpe:template children="no" modify="no" class="org.jboss.tools.jsf.vpe.jsf.template.JsfInputTextAreaTemplate">
<!-- <textarea class="{@styleClass}" style="{@style}"
rows="{@rows}" cols="{@cols}" title="{tagstring()}" dir="{@dir}">
<vpe:value expr="{jsfvalue(@value)}" />
@@ -629,7 +629,7 @@
<vpe:tag name="f:facet" case-sensitive="yes">
<vpe:if test="@name='popup'">
- <vpe:template children="yes" modify="yes" invisible="yes" ></vpe:template>
+ <vpe:template children="yes" modify="yes" ></vpe:template>
</vpe:if>
<vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.jsf.template.JsfFacet" >
@@ -722,51 +722,51 @@
</vpe:tag>
<vpe:tag name="f:attribute" case-sensitive="yes">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:param">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:phaseListener">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:setPropertyActionListener">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:valueChangeListener">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:convertDateTime">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:converter">
- <vpe:template children="no" modify="no" invisible="yes"/>
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:convertNumber">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:validator">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:validateDoubleRange">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:validateLength">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="f:validateLongRange">
- <vpe:template children="no" modify="no" invisible="yes" />
+ <vpe:template children="no" modify="no" />
</vpe:tag>
<vpe:tag name="h:message">
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-09-09 15:25:01 UTC (rev 10158)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-09-09 15:47:33 UTC (rev 10159)
@@ -209,7 +209,7 @@
</vpe:tag>
<vpe:tag name="rich:modalPanel" case-sensitive="yes">
- <vpe:template children="no" modify="yes" invisible="yes" >
+ <vpe:template children="no" modify="yes" >
</vpe:template>
</vpe:tag>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2008-09-09 15:25:01 UTC (rev 10158)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2008-09-09 15:47:33 UTC (rev 10159)
@@ -1201,7 +1201,7 @@
</vpe:template>
</vpe:if>
<vpe:if test="@type='hidden'">
- <vpe:template children="no" modify="no" invisible="yes" >
+ <vpe:template children="no" modify="no" >
</vpe:template>
</vpe:if>
<vpe:if test="@type='image'">
17 years, 7 months
JBoss Tools SVN: r10158 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-09 11:25:01 -0400 (Tue, 09 Sep 2008)
New Revision: 10158
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeDropDownMenu.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/IVpeToolBar.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/IVpeToolBarManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeToolBarManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Constants.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1805
Modified: trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta 2008-09-09 15:25:01 UTC (rev 10158)
@@ -1193,7 +1193,7 @@
</Constraint>
<Editor name="CheckBox"/>
</XModelAttribute>
- <XModelAttribute default="no" name="show invisible tags" xmlname="show_invisible_tags">
+ <XModelAttribute default="no" name="show non-visual tags" xmlname="show_invisible_tags">
<Constraint loader="List">
<value name="yes"/>
<value name="no"/>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -1553,8 +1553,6 @@
});
}
- manager.add(new Separator());
- manager.add(new ShowInvisbleTagAction());
if (VpeDebug.VISUAL_CONTEXTMENU_DUMP_SOURCE) {
manager.add(new Action("Dump Source") { //$NON-NLS-1$
@@ -3316,19 +3314,12 @@
return sourceBuilder;
}
- class ShowInvisbleTagAction extends Action{
-
- public ShowInvisbleTagAction() {
- super("Show Invisible Tags", AS_CHECK_BOX);
- setChecked(visualBuilder.isShowInvisibleTags());
- }
-
- public void run() {
- visualBuilder.setShowInvisibleTags(isChecked());
- visualRefresh();
- }
-
-
+ /**
+ *
+ * @return visualBuilder
+ */
+ public VpeVisualDomBuilder getVisualBuilder() {
+ return visualBuilder;
}
-
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -473,14 +473,16 @@
getPageContext().setCurrentVisualNode(null);
nsIDOMNode visualNewNode = creationData.getNode();
+
+ if (sourceNode.getNodeType() == Node.ELEMENT_NODE && visualNewNode == null && isShowInvisibleTags())
+ visualNewNode = createInvisbleElementLabel(sourceNode);
nsIDOMElement border = null;
if (visualNewNode != null
&& visualNewNode.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
- nsIDOMElement visualNewElement = (nsIDOMElement) creationData
- .getNode().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement visualNewElement = (nsIDOMElement) visualNewNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
if ((visualNewElement != null) && template.hasImaginaryBorder()) {
@@ -550,18 +552,17 @@
addChildren(template, sourceNode, visualOldContainer,
childrenInfoList);
}
+ } else if(sourceNode.getNodeType() == Node.ELEMENT_NODE&&visualNewNode != null && isShowInvisibleTags()){
+ nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
+ span.appendChild(visualNewNode);
+ addChildren(template, sourceNode,span);
+ visualNewNode= span;
}
getPageContext().setCurrentVisualNode(visualOldContainer);
template.validate(getPageContext(), sourceNode, visualDocument,
creationData);
getPageContext().setCurrentVisualNode(null);
- // if showInvisibleTags mode
- if (isShowInvisibleTags() && (visualNewNode != null)
- && (sourceNode.getNodeType() == Node.ELEMENT_NODE)) {
- // add invisible children to node
- visualNewNode = addInvisibleChildren(sourceNode, visualNewNode);
- }
if (border != null)
return border;
@@ -613,8 +614,7 @@
int childrenCount = 0;
for (int i = 0; i < len; i++) {
Node sourceNode = sourceNodes.item(i);
- if ((!isInvisibleNode(sourceNode))
- && (addNode(sourceNode, null, visualContainer))) {
+ if ((addNode(sourceNode, null, visualContainer))) {
if (Node.ELEMENT_NODE == sourceNode.getNodeType()) {
}
childrenCount++;
@@ -2450,4 +2450,23 @@
public void setShowInvisibleTags(boolean showInvisibleTags) {
this.showInvisibleTags = showInvisibleTags;
}
+
+ /**
+ *
+ * @param sourceNode
+ * @return
+ */
+ public nsIDOMNode createInvisbleElementLabel(Node sourceNode) {
+ nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
+
+ span.setAttribute(HTML.TAG_STYLE,
+ "border: dashed 1px GREY;color:GREY;font-size:12px;");
+
+ nsIDOMText text = visualDocument.createTextNode(sourceNode
+ .getNodeName());
+
+ span.appendChild(text);
+
+ return span;
+ }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -26,7 +26,12 @@
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -37,6 +42,7 @@
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.IEditorInput;
@@ -48,13 +54,16 @@
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.part.EditorPart;
+import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage;
+import org.jboss.tools.vpe.editor.toolbar.VpeDropDownMenu;
import org.jboss.tools.vpe.editor.toolbar.IVpeToolBarManager;
import org.jboss.tools.vpe.editor.toolbar.VpeToolBarManager;
import org.jboss.tools.vpe.editor.toolbar.format.FormatControllerManager;
import org.jboss.tools.vpe.editor.toolbar.format.TextFormattingToolBar;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.DocTypeUtil;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.messages.VpeUIMessages;
@@ -137,7 +146,7 @@
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
public void createPartControl(final Composite parent) {
- vpeToolBarManager = new VpeToolBarManager();
+
//Setting Layout for the parent Composite
GridLayout layout = new GridLayout(2,false);
layout.marginHeight = 0;
@@ -167,17 +176,60 @@
cmpEdTl.setLayoutData(new GridData(GridData.FILL_BOTH));
- // Use vpeToolBarManager to create a horizontal toolbar.
- if(vpeToolBarManager!=null) {
+ ToolBar verBar = new ToolBar(cmpVerticalToolbar, SWT.VERTICAL|SWT.FLAT);
+ verBar.setLayoutData(new GridData(GridData.FILL_VERTICAL));
+
+ VpeDropDownMenu dropDownMenu = new VpeDropDownMenu(verBar,
+ VpeUIMessages.MENU);
+
+ // Use vpeToolBarManager to create a horizontal toolbar.
+ vpeToolBarManager = new VpeToolBarManager(dropDownMenu
+ .getDropDownMenu());
+ if (vpeToolBarManager != null) {
vpeToolBarManager.createToolBarComposite(cmpEdTl);
- vpeToolBarManager.addToolBar(new TextFormattingToolBar(formatControllerManager));
- // Create a Toolbar menu button
- vpeToolBarManager.createMenuComposite(cmpVerticalToolbar);
+ vpeToolBarManager.addToolBar(new TextFormattingToolBar(
+ formatControllerManager));
}
- // The Left standalone Vertical Tool Bar
- ToolBar verBar = new ToolBar(cmpVerticalToolbar, SWT.VERTICAL|SWT.FLAT);
- verBar.setLayoutData(new GridData(GridData.FILL_VERTICAL));
+ // add Invisible tags support to menu
+
+ // create menu item
+ MenuItem menuItem = new MenuItem(dropDownMenu.getDropDownMenu(),
+ SWT.PUSH);
+
+ // get default value of flag
+ boolean showInvisibleTags = Constants.YES_STRING
+ .equals(VpePreference.SHOW_INVISIBLE_TAGS.getValue());
+
+ // set text
+ menuItem.setText((showInvisibleTags ? VpeUIMessages.HIDE
+ : VpeUIMessages.SHOW)
+ + Constants.WHITE_SPACE + VpeUIMessages.NON_VISUAL_TAGS);
+
+ // add listener
+ menuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ MenuItem selectedItem = (MenuItem) e.widget;
+
+ // get current value of flag
+ boolean showInvisibleTags = !controller.getVisualBuilder()
+ .isShowInvisibleTags();
+
+ // change text
+ selectedItem
+ .setText((showInvisibleTags ? VpeUIMessages.HIDE
+ : VpeUIMessages.SHOW)
+ + Constants.WHITE_SPACE
+ + VpeUIMessages.NON_VISUAL_TAGS);
+
+ // change flag
+ controller.getVisualBuilder().setShowInvisibleTags(
+ showInvisibleTags);
+ // update vpe
+ controller.visualRefresh();
+ }
+ });
ToolItem item = null;
item = createToolItem(verBar, SWT.BUTTON1, "icons/preference.gif", VpeUIMessages.PREFERENCES); //$NON-NLS-1$
@@ -210,6 +262,8 @@
}
}
});
+
+
verBar.pack();
//Create a composite to the Editor
@@ -747,4 +801,48 @@
}
return editor;
}
+
+ /**
+ *
+ * @param menu
+ */
+ private void addInvisibleTagsSupportToMenu(Menu menu) {
+
+ // create menu item
+ MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
+
+ // get default value of flag
+ boolean showInvisibleTags = Constants.YES_STRING
+ .equals(VpePreference.SHOW_INVISIBLE_TAGS.getValue());
+
+ // set text
+ menuItem.setText((showInvisibleTags ? VpeUIMessages.HIDE
+ : VpeUIMessages.SHOW)
+ + Constants.WHITE_SPACE + VpeUIMessages.NON_VISUAL_TAGS);
+
+ // add listener
+ menuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ MenuItem selectedItem = (MenuItem) e.widget;
+
+ // get current value of flag
+ boolean showInvisibleTags = !controller.getVisualBuilder()
+ .isShowInvisibleTags();
+
+ // change text
+ selectedItem
+ .setText((showInvisibleTags ? VpeUIMessages.HIDE
+ : VpeUIMessages.SHOW)
+ + Constants.WHITE_SPACE
+ + VpeUIMessages.NON_VISUAL_TAGS);
+
+ // change flag
+ controller.getVisualBuilder().setShowInvisibleTags(
+ showInvisibleTags);
+ // update vpe
+ controller.visualRefresh();
+ }
+ });
+ }
}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -893,11 +893,6 @@
template = handleTemplateClassLoadException(template,
templateClassName, nameSpaceIdentifyer, e);
}
- } else if (isInvisibleTemplate != null
- && Constants.YES_STRING.equalsIgnoreCase(isInvisibleTemplate)) {
-
- template = new InvisibleTemplate();
-
} else {
template = new VpeHtmlTemplate();
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/IVpeToolBar.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/IVpeToolBar.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/IVpeToolBar.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -21,6 +21,11 @@
* Return the name of the ToolBar
*/
public String getName();
+
+ /**
+ * Return the id of the ToolBar
+ */
+ public String getId();
/**
* create toolbar control use given composite as parent for it
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/IVpeToolBarManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/IVpeToolBarManager.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/IVpeToolBarManager.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -35,12 +35,5 @@
*/
public void addToolBar(IVpeToolBar bar);
- /**
- * This method create and add a new menuitem to the toolbars Menu.
- * @param parent
- * @return
- */
- public Composite createMenuComposite(Composite parent);
-
public void dispose();
}
\ No newline at end of file
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeDropDownMenu.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeDropDownMenu.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeDropDownMenu.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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.vpe.editor.toolbar;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class VpeDropDownMenu {
+
+ private Menu dropDownMenu;
+
+ public VpeDropDownMenu(ToolBar bar, String toolTipText) {
+ ToolItem item = new ToolItem(bar, SWT.MENU);
+ item.setToolTipText(toolTipText);
+ item.setImage(ImageDescriptor.createFromFile(MozillaEditor.class,
+ "icons/arrow.gif").createImage()); //$NON-NLS-1$
+
+ item.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ ToolItem item = (ToolItem) event.widget;
+ Rectangle rect = item.getBounds();
+ Point pt = item.getParent().toDisplay(
+ new Point(rect.x, rect.y));
+ dropDownMenu.setLocation(pt.x, pt.y + rect.height);
+ dropDownMenu.setVisible(true);
+ }
+ });
+
+ item.addDisposeListener(new DisposeListener() {
+
+ public void widgetDisposed(DisposeEvent e) {
+ ((ToolItem) e.widget).getImage().dispose();
+ }
+
+ });
+
+ this.dropDownMenu = new Menu(item.getParent().getShell());
+
+ }
+
+ public Menu getDropDownMenu() {
+ return dropDownMenu;
+ }
+
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeToolBarManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeToolBarManager.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VpeToolBarManager.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -7,72 +7,66 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.vpe.editor.toolbar;
-import java.util.ArrayList;
-import java.util.List;
import org.eclipse.compare.Splitter;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
import org.jboss.tools.vpe.VpePlugin;
-import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.messages.VpeUIMessages;
/**
- * @author Erick
- * Created on 14.07.2005
- * @see IVpeToolBarManager
+ * @author Erick Created on 14.07.2005
+ * @see IVpeToolBarManager
*/
public class VpeToolBarManager implements IVpeToolBarManager {
- static String TOOLBAR = "VPE_TOOLBAR";
- static String HIDE = "HIDE";
-
private Splitter splitter;
- private Composite cmpTlEmpty;
- private List toolbarContainers = new ArrayList();
- private MenuItem hideMenuItem;
- private VpePlugin plugin = VpePlugin.getDefault();
- public VpeToolBarManager() {
+ private Menu dropDownMenu;
+
+ public static final String SHOW = "show"; //$NON-NLS-1$
+ public static final String HIDE = "hide"; //$NON-NLS-1$
+
+ public VpeToolBarManager(Menu dropDownMenu) {
+
+ this.dropDownMenu = dropDownMenu;
}
public Composite createToolBarComposite(Composite parent) {
- splitter = new Splitter(parent, SWT.NONE);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- splitter.setLayoutData(data);
+ splitter = new Splitter(parent, SWT.NONE) {
- /*
- * The empty composite
- */
- cmpTlEmpty = new Composite(splitter, SWT.NONE) {
- public Point computeSize (int wHint, int hHint, boolean changed) {
- Point point = super.computeSize(wHint, hHint, changed);
- point.y = 1;
- return point;
+ // if there is not visual children then return Point(0,0)
+ public Point computeSize(int hint, int hint2, boolean changed) {
+
+ int countVisibleChild = 0;
+ for (Control child : getChildren()) {
+ if (child.isVisible())
+ countVisibleChild++;
+ }
+
+ if (countVisibleChild == 0)
+ return new Point(0, 0);
+ else
+ return super.computeSize(hint, hint2, changed);
}
};
- cmpTlEmpty.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- splitter.setVisible(cmpTlEmpty, false);
return splitter;
+
}
public void addToolBar(IVpeToolBar bar) {
+
Composite cmpToolBar = new Composite(splitter, SWT.NONE);
GridLayout layoutTl = new GridLayout(2, false);
layoutTl.marginBottom = 0;
@@ -83,134 +77,142 @@
cmpToolBar.setLayout(layoutTl);
cmpToolBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ // create toolbar control
bar.createToolBarControl(cmpToolBar);
- toolbarContainers.add(new ToolbarContainer(cmpToolBar, bar));
+
+ // create tolbar container
+ ToolbarContainer toolbarContainer = new ToolbarContainer(cmpToolBar,
+ bar);
+
+ // show or hide toolbar
+ setStateToolbar(cmpToolBar, isShowedToolbar(bar));
+
+ // create item to manage show/hide toolbar
+ attachToMenu(dropDownMenu, toolbarContainer);
}
- public Composite createMenuComposite(final Composite parent) {
- /*
- * Menu for the menu bar
- */
- final Menu menu = new Menu(parent.getShell(), SWT.POP_UP);
- hideMenuItem = new MenuItem(menu, SWT.PUSH);
- String hideMenuText = VpeUIMessages.HIDE_TOOLBAR;
- hideMenuItem.setText(hideMenuText);
- for(int i=0; i<toolbarContainers.size(); i++) {
- final ToolbarContainer toolbarContainer = (ToolbarContainer)toolbarContainers.get(i);
- MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
- toolbarContainer.setMenuItem(menuItem);
- menuItem.setText(toolbarContainer.getToolbar().getName());
-
- menuItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- showToolbar(toolbarContainer);
- parent.getParent().layout(true, true);
- }
- });
- }
+ /**
+ * create item to manage show/hide toolbar
+ *
+ * @param menu
+ * @param toolbarContainer
+ */
+ public void attachToMenu(Menu menu, ToolbarContainer toolbarContainer) {
+ MenuItem menuItem = new MenuItem(dropDownMenu, SWT.PUSH);
- String defaultPreferenceValue = null;
- if(toolbarContainers.size()>0) {
- defaultPreferenceValue = ((ToolbarContainer)toolbarContainers.get(0)).getToolbar().getName();
- } else {
- defaultPreferenceValue = HIDE;
+ boolean showToolbar = isShowedToolbar(toolbarContainer.getToolbar());
+
+ // set text to menu item
+ menuItem
+ .setText((showToolbar ? VpeUIMessages.HIDE : VpeUIMessages.SHOW)
+ + Constants.WHITE_SPACE
+ + toolbarContainer.getToolbar().getName());
+
+ // add listener
+ menuItem.addSelectionListener(new ToolbarManagerSelectionListener(
+ toolbarContainer, showToolbar));
+
+ }
+
+ /**
+ *
+ * @param bar
+ * @return
+ */
+ protected boolean isShowedToolbar(IVpeToolBar bar) {
+
+ return !HIDE.equalsIgnoreCase(getPreference(bar.getId()));
+ }
+
+ /**
+ * show/hide toolbar
+ *
+ * @param toolBar
+ * @param show
+ */
+ protected void setStateToolbar(Control toolBar, boolean show) {
+ splitter.setVisible(toolBar, show);
+ splitter.getParent().layout(true, true);
+ }
+
+ public void dispose() {
+ if (splitter != null) {
+ splitter.dispose();
+ splitter = null;
}
- plugin.getPreferenceStore().setDefault(TOOLBAR, defaultPreferenceValue);
- String value = plugin.getPreferenceStore().getString(TOOLBAR);
- if (HIDE.equals(value)) {
- hideToolbars();
- } else {
-// Sets active toolbar
- for(int i = 0; i < toolbarContainers.size(); i++) {
- if( ((ToolbarContainer)toolbarContainers.get(i)).getToolbar().getName().equals(value)) {
- showToolbar((ToolbarContainer)toolbarContainers.get(i));
- }
- }
+ for (MenuItem menuItem : dropDownMenu.getItems()) {
+ menuItem.dispose();
}
- hideMenuItem.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- hideToolbars();
- parent.getParent().layout(true, true);
- }
- });
+ }
- /*
- * The menu ButtonBar
- */
- final ToolBar btnBar = new ToolBar(parent, SWT.FLAT);
- GridLayout layout = new GridLayout(1,false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.verticalSpacing = 0;
- btnBar.setLayout(layout);
- btnBar.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
- btnBar.setSize(23,22);
- btnBar.pack();
+ /**
+ * get preference by key
+ *
+ * @param key
+ * @return
+ */
+ private String getPreference(String key) {
- final ToolItem button = new ToolItem(btnBar, SWT.MENU);
- button.setImage(ImageDescriptor.createFromFile(MozillaEditor.class, "icons/arrow.gif").createImage()); //$NON-NLS-1$
- button.setToolTipText(VpeUIMessages.MENU);
- button.addListener(SWT.Selection, new Listener() {
+ return VpePlugin.getDefault().getPreferenceStore().getString(key);
+ }
- public void handleEvent(Event event) {
- Rectangle bounds = button.getBounds();
- Point point = btnBar.toDisplay( bounds.x + 15, bounds.y + 12);
- menu.setLocation(point);
- menu.setVisible(true);
- }
- });
-
- // add dispose listener
- button.addDisposeListener(new DisposeListener() {
+ /**
+ * set preference
+ *
+ * @param key
+ * @param value
+ */
+ private void setPreference(String key, String value) {
- public void widgetDisposed(DisposeEvent e) {
- // dispose tollitem's image
- ((ToolItem) e.widget).getImage().dispose();
+ VpePlugin.getDefault().getPreferenceStore().setValue(key, value);
+ }
- }
- });
+ /**
+ * selection listener to manage toolbars
+ *
+ * @author Sergey Dzmitrovich
+ *
+ */
+ private class ToolbarManagerSelectionListener extends SelectionAdapter {
- return btnBar;
- }
+ private ToolbarContainer toolbarContainer;
+ private boolean showBar;
- private void showToolbar(ToolbarContainer toolbarContainer) {
- plugin.getPreferenceStore().setValue(TOOLBAR, toolbarContainer.getToolbar().getName());
- plugin.savePluginPreferences();
- hideMenuItem.setEnabled(true);
- toolbarContainer.getMenuItem().setEnabled(false);
- splitter.setVisible(toolbarContainer.getParent(), true);
- for(int i=0; i<toolbarContainers.size(); i++) {
- ToolbarContainer container = (ToolbarContainer)toolbarContainers.get(i);
- if(container != toolbarContainer) {
- splitter.setVisible(container.getParent(), false);
- container.getMenuItem().setEnabled(true);
- }
+ public ToolbarManagerSelectionListener(
+ ToolbarContainer toolbarContainer, boolean showBar) {
+ this.toolbarContainer = toolbarContainer;
+ this.showBar = showBar;
}
- splitter.setVisible(cmpTlEmpty, false);
- }
- private void hideToolbars() {
- plugin.getPreferenceStore().setValue(TOOLBAR, HIDE);
- plugin.savePluginPreferences();
- hideMenuItem.setEnabled(false);
- for(int i=0; i<toolbarContainers.size(); i++) {
- ToolbarContainer container = (ToolbarContainer)toolbarContainers.get(i);
- splitter.setVisible(container.getParent(), false);
- container.getMenuItem().setEnabled(true);
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ MenuItem selectedItem = (MenuItem) e.widget;
+
+ // change flag
+ showBar = !showBar;
+
+ // set new value of preference
+ setPreference(toolbarContainer.getToolbar().getId(), showBar ? SHOW
+ : HIDE);
+ // change text
+ selectedItem.setText((showBar ? VpeUIMessages.HIDE
+ : VpeUIMessages.SHOW)
+ + Constants.WHITE_SPACE
+ + toolbarContainer.getToolbar().getName());
+ // show or hide toolbar
+ setStateToolbar(toolbarContainer.getParent(), showBar);
}
- splitter.setVisible(cmpTlEmpty, true);
}
/*
- * This class describe the container for toolbars
+ * This class describe the container for toolbars
*/
private static class ToolbarContainer {
private Composite parent;
private IVpeToolBar toolbar;
- private MenuItem menuItem;
public ToolbarContainer(Composite parent, IVpeToolBar toolbar) {
this.parent = parent;
@@ -225,27 +227,6 @@
return toolbar;
}
- public MenuItem getMenuItem() {
- return menuItem;
- }
-
- public void setMenuItem(MenuItem menuItem) {
- this.menuItem = menuItem;
- }
}
- public void dispose() {
- if (splitter != null) {
- splitter.dispose();
- splitter=null;
- }
- hideMenuItem.dispose();
-
- for(int i=0; i<toolbarContainers.size(); i++) {
- ToolbarContainer container = (ToolbarContainer)toolbarContainers.get(i);
- container.getMenuItem().dispose();
- }
- toolbarContainers.clear();
- toolbarContainers=null;
- }
}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/format/TextFormattingToolBar.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -37,6 +37,8 @@
public class TextFormattingToolBar extends SplitToolBar {
private static final String NORMAL_FONT = "Normal"; //$NON-NLS-1$
+
+ private static final String ID = "TEXT_FORMATTING_TOOLBAR"; //$NON-NLS-1$
private static String[] FONT_ARRAY = { "Arial", "Courier New", "Times New Roman", //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
"Comic Sans", "MS Serif", "Tahoma", "Verdana" }; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
@@ -51,6 +53,10 @@
public String getName() {
return VpeUIMessages.TEXT_FORMATTING;
}
+
+ public String getId() {
+ return ID;
+ }
private ToolItem createToolItem(ToolBar parent, int type, String image, String toolTipText) {
ToolItem item = new ToolItem(parent, type);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Constants.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Constants.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Constants.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -16,7 +16,7 @@
public static final String TRUE = "true"; //$NON-NLS-1$
public static final String FALSE = "false"; //$NON-NLS-1$
public static final String EMPTY = ""; //$NON-NLS-1$
+ public static final String WHITE_SPACE = " "; //$NON-NLS-1$
public static final String YES_STRING = "yes"; //$NON-NLS-1$
public static final String JSP_FILE_EXTENSION = "jsp"; //$NON-NLS-1$
-
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -72,6 +72,7 @@
public static String ERROR_OF_TYPE_CONVERSION;
public static String INCORRECT_PARAMETER_ERROR;
public static String HIDE_TOOLBAR;
+ public static String SHOW_TOOLBAR;
public static String MENU;
public static String SET_BACKGROUND_COLOR;
public static String SET_FOREGROUND_COLOR;
@@ -94,5 +95,8 @@
public static String CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE;
public static String VPE_UPDATE_JOB_TITLE;
public static String VPE_VISUAL_REFRESH_JOB;
+ public static String NON_VISUAL_TAGS;
+ public static String SHOW;
+ public static String HIDE;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-09-09 15:25:01 UTC (rev 10158)
@@ -32,7 +32,8 @@
BORDER_COLOR=Border Color
ERROR_OF_TYPE_CONVERSION=Error of type conversion
INCORRECT_PARAMETER_ERROR=Incorrect parameter error
-HIDE_TOOLBAR=Hide Toolbar
+HIDE_TOOLBAR=Hide Text Formatting Toolbar
+SHOW_TOOLBAR=Show Text Formatting Toolbar
MENU=Menu
SET_BACKGROUND_COLOR=Set Background Color
SET_FOREGROUND_COLOR=Set Foreground color
@@ -55,5 +56,6 @@
CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE=Always hide selection bar without prompt
VPE_UPDATE_JOB_TITLE=Visual Editor View Update
VPE_VISUAL_REFRESH_JOB=Visual Editor Refresh
-
-
+NON_VISUAL_TAGS=Non-visual tags
+SHOW=Show
+HIDE=Hide
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2008-09-09 14:42:38 UTC (rev 10157)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2008-09-09 15:25:01 UTC (rev 10158)
@@ -249,7 +249,7 @@
return;
}
Rectangle r = selBar.getItem(allItems - 1).getBounds();
- int width = r.x + r.width +1;
+ int width = r.x + r.width ;
int height = r.height;
if (allItems >= itemCount) {
17 years, 7 months
JBoss Tools SVN: r10157 - in trunk/seam/plugins: org.jboss.tools.seam.ui/META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-09-09 10:42:38 -0400 (Tue, 09 Sep 2008)
New Revision: 10157
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoring.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2008-09-09 14:42:38 UTC (rev 10157)
@@ -0,0 +1,144 @@
+ /*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
+import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class RenameComponentProcessor extends RenameProcessor {
+
+ private IFile file;
+ private ISeamComponent component;
+
+ /**
+ * @param component Renamed component
+ */
+ public RenameComponentProcessor(IFile file) {
+ super();
+ this.file = file;
+ IProject project = file.getProject();
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject != null) {
+ Set<ISeamComponent> components = seamProject.getComponentsByPath(file.getFullPath());
+ if (components.size() > 0) {
+ // This is a component which we want to rename.
+ component = components.iterator().next();
+ }
+ }
+ }
+
+ public ISeamComponent getComponent() {
+ return component;
+ }
+
+ public void setComponent(ISeamComponent component) {
+ this.component = component;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+ */
+ @Override
+ public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+ CheckConditionsContext context) throws CoreException,
+ OperationCanceledException {
+ return new RefactoringStatus();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
+ throws CoreException, OperationCanceledException {
+ RefactoringStatus result = new RefactoringStatus();
+ if(component==null) {
+ result.addFatalError("This is not a Seam Component.");
+ }
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException,
+ OperationCanceledException {
+ return new TextFileChange(file.getName(), file);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
+ */
+ @Override
+ public Object[] getElements() {
+ return new ISeamComponent[]{component};
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
+ */
+ @Override
+ public String getIdentifier() {
+ return getClass().getName();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
+ */
+ @Override
+ public String getProcessorName() {
+ return "Rename Seam Component";
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
+ */
+ @Override
+ public boolean isApplicable() throws CoreException {
+ return component!=null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus, org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
+ */
+ @Override
+ public RefactoringParticipant[] loadParticipants(RefactoringStatus status,
+ SharableParticipants sharedParticipants) throws CoreException {
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoring.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoring.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoring.java 2008-09-09 14:42:38 UTC (rev 10157)
@@ -0,0 +1,24 @@
+ /*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class RenameComponentRefactoring extends RenameRefactoring {
+
+ public RenameComponentRefactoring(RenameProcessor processor) {
+ super(processor);
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoring.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2008-09-09 12:25:57 UTC (rev 10156)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2008-09-09 14:42:38 UTC (rev 10157)
@@ -55,19 +55,23 @@
org.jboss.tools.jst.web,
org.eclipse.search,
org.jboss.tools.jst.jsp,
- org.eclipse.jst.jsf.core
+ org.eclipse.jst.jsf.core,
+ org.eclipse.ltk.core.refactoring;bundle-version="3.4.0",
+ org.eclipse.ltk.ui.refactoring;bundle-version="3.4.0"
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.actions,
org.jboss.tools.seam.ui.builder,
org.jboss.tools.seam.ui.internal.project.facet;x-internal:=true,
org.jboss.tools.seam.ui.preferences,
+ org.jboss.tools.seam.ui.refactoring,
org.jboss.tools.seam.ui.search,
org.jboss.tools.seam.ui.text.java;
uses:="org.eclipse.jface.text,
org.eclipse.jdt.ui.text.java,
org.eclipse.core.runtime,
org.eclipse.jface.text.contentassist",
+ org.jboss.tools.seam.ui.text.java.scanner,
org.jboss.tools.seam.ui.views,
org.jboss.tools.seam.ui.views.actions,
org.jboss.tools.seam.ui.views.properties,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2008-09-09 12:25:57 UTC (rev 10156)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2008-09-09 14:42:38 UTC (rev 10157)
@@ -1,53 +1,59 @@
- /*******************************************************************************
- * Copyright (c) 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
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.seam.ui.refactoring;
-import java.util.Set;
-
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.jboss.tools.seam.core.ISeamComponent;
-import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.refactoring.RenameComponentProcessor;
+import org.jboss.tools.seam.internal.core.refactoring.RenameComponentRefactoring;
+import org.jboss.tools.seam.ui.wizard.RenameComponentWizard;
/**
* @author Alexey Kazakov
- *
*/
public class SeamComponentRenameHandler extends AbstractHandler {
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
+ * ExecutionEvent)
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorPart editor = HandlerUtil.getActiveEditor(event);
IEditorInput input = editor.getEditorInput();
- if(input instanceof IFile) {
- IFile file = (IFile)input;
- IProject project = file.getProject();
- ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
- if(seamProject!=null) {
- Set<ISeamComponent> components = seamProject.getComponentsByPath(file.getFullPath());
- if(components.size() > 0) {
- ISeamComponent component = components.iterator().next();
- // TODO this is a component which we want to rename.
- }
+ if (input instanceof IFileEditorInput) {
+ IFile file = ((IFileEditorInput)input).getFile();
+ Shell activeShell = HandlerUtil.getActiveShell(event);
+ RenameComponentProcessor processor = new RenameComponentProcessor(file);
+ RenameComponentRefactoring refactoring = new RenameComponentRefactoring(processor);
+ RenameComponentWizard wizard = new RenameComponentWizard(refactoring, processor.getComponent());
+ RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
+ try {
+ String titleForFailedChecks = "TestTestTest"; //$NON-NLS-1$
+ op.run(activeShell, titleForFailedChecks);
+ } catch (final InterruptedException irex) {
+ // operation was canceled
}
+
}
return null;
}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java 2008-09-09 14:42:38 UTC (rev 10157)
@@ -0,0 +1,37 @@
+ /*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.wizard;
+
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.jboss.tools.seam.core.ISeamComponent;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class RenameComponentWizard extends RefactoringWizard {
+
+ private ISeamComponent component;
+
+ public RenameComponentWizard(Refactoring refactoring, ISeamComponent component) {
+ super(refactoring, WIZARD_BASED_USER_INTERFACE);
+ this.component = component;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.ui.refactoring.RefactoringWizard#addUserInputPages()
+ */
+ @Override
+ protected void addUserInputPages() {
+ setDefaultPageTitle(getRefactoring().getName());
+// addPage( new RenamePropertyInputPage( info ) );
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 7 months