JBoss Tools SVN: r16132 - in trunk/bpel/tests: org.eclipse.bpel.ui.tests and 14 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-23 05:22:43 -0400 (Tue, 23 Jun 2009)
New Revision: 16132
Added:
trunk/bpel/tests/org.eclipse.bpel.ui.tests/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/.classpath
trunk/bpel/tests/org.eclipse.bpel.ui.tests/.project
trunk/bpel/tests/org.eclipse.bpel.ui.tests/.settings/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/.settings/org.eclipse.jdt.core.prefs
trunk/bpel/tests/org.eclipse.bpel.ui.tests/META-INF/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/META-INF/MANIFEST.MF
trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/bpel/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/bpel/ui/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/bpel/ui/tests/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/bpel/ui/tests/Activator.class
trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/bpel/ui/tests/BpelUIAllTests.class
trunk/bpel/tests/org.eclipse.bpel.ui.tests/build.properties
trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/tests/
trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/tests/Activator.java
trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/tests/BpelUIAllTests.java
Log:
add tests for bpel module
Added: trunk/bpel/tests/org.eclipse.bpel.ui.tests/.classpath
===================================================================
--- trunk/bpel/tests/org.eclipse.bpel.ui.tests/.classpath (rev 0)
+++ trunk/bpel/tests/org.eclipse.bpel.ui.tests/.classpath 2009-06-23 09:22:43 UTC (rev 16132)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/bpel/tests/org.eclipse.bpel.ui.tests/.project
===================================================================
--- trunk/bpel/tests/org.eclipse.bpel.ui.tests/.project (rev 0)
+++ trunk/bpel/tests/org.eclipse.bpel.ui.tests/.project 2009-06-23 09:22:43 UTC (rev 16132)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.bpel.ui.tests</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/bpel/tests/org.eclipse.bpel.ui.tests/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/bpel/tests/org.eclipse.bpel.ui.tests/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/bpel/tests/org.eclipse.bpel.ui.tests/.settings/org.eclipse.jdt.core.prefs 2009-06-23 09:22:43 UTC (rev 16132)
@@ -0,0 +1,8 @@
+#Mon Jun 22 14:50:28 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/bpel/tests/org.eclipse.bpel.ui.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/bpel/tests/org.eclipse.bpel.ui.tests/META-INF/MANIFEST.MF (rev 0)
+++ trunk/bpel/tests/org.eclipse.bpel.ui.tests/META-INF/MANIFEST.MF 2009-06-23 09:22:43 UTC (rev 16132)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.jboss.bpel.ui.tests
+Bundle-SymbolicName: org.jboss.bpel.ui.tests
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.bpel.ui.tests.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit;bundle-version="3.8.2"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/bpel/ui/tests/Activator.class
===================================================================
(Binary files differ)
Property changes on: trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/bpel/ui/tests/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/bpel/ui/tests/BpelUIAllTests.class
===================================================================
(Binary files differ)
Property changes on: trunk/bpel/tests/org.eclipse.bpel.ui.tests/bin/org/jboss/bpel/ui/tests/BpelUIAllTests.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/tests/org.eclipse.bpel.ui.tests/build.properties
===================================================================
--- trunk/bpel/tests/org.eclipse.bpel.ui.tests/build.properties (rev 0)
+++ trunk/bpel/tests/org.eclipse.bpel.ui.tests/build.properties 2009-06-23 09:22:43 UTC (rev 16132)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/tests/Activator.java
===================================================================
--- trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/tests/Activator.java (rev 0)
+++ trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/tests/Activator.java 2009-06-23 09:22:43 UTC (rev 16132)
@@ -0,0 +1,50 @@
+package org.jboss.bpel.ui.tests;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.bpel.ui.tests";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (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 Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/tests/BpelUIAllTests.java
===================================================================
--- trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/tests/BpelUIAllTests.java (rev 0)
+++ trunk/bpel/tests/org.eclipse.bpel.ui.tests/src/org/jboss/bpel/ui/tests/BpelUIAllTests.java 2009-06-23 09:22:43 UTC (rev 16132)
@@ -0,0 +1,15 @@
+package org.jboss.bpel.ui.tests;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+
+public class BpelUIAllTests extends TestCase {
+ public static final String PLUGIN_ID = "org.jboss.bpel.ui.tests";
+ public static Test suite ()
+ {
+ TestSuite suite = new TestSuite(BpelUIAllTests.class.getName());
+ return suite;
+ }
+}
16 years, 10 months
JBoss Tools SVN: r16131 - in trunk/bpel/features: org.jboss.bpel.feature and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-23 05:21:51 -0400 (Tue, 23 Jun 2009)
New Revision: 16131
Added:
trunk/bpel/features/org.jboss.bpel.feature/
trunk/bpel/features/org.jboss.bpel.feature/.project
trunk/bpel/features/org.jboss.bpel.feature/build.properties
trunk/bpel/features/org.jboss.bpel.feature/feature.properties
trunk/bpel/features/org.jboss.bpel.feature/feature.xml
trunk/bpel/features/org.jboss.bpel.feature/license.html
Log:
add features for bpel module
Added: trunk/bpel/features/org.jboss.bpel.feature/.project
===================================================================
--- trunk/bpel/features/org.jboss.bpel.feature/.project (rev 0)
+++ trunk/bpel/features/org.jboss.bpel.feature/.project 2009-06-23 09:21:51 UTC (rev 16131)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.bpel.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/bpel/features/org.jboss.bpel.feature/build.properties
===================================================================
--- trunk/bpel/features/org.jboss.bpel.feature/build.properties (rev 0)
+++ trunk/bpel/features/org.jboss.bpel.feature/build.properties 2009-06-23 09:21:51 UTC (rev 16131)
@@ -0,0 +1,4 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ license.html
+
Added: trunk/bpel/features/org.jboss.bpel.feature/feature.properties
===================================================================
--- trunk/bpel/features/org.jboss.bpel.feature/feature.properties (rev 0)
+++ trunk/bpel/features/org.jboss.bpel.feature/feature.properties 2009-06-23 09:21:51 UTC (rev 16131)
@@ -0,0 +1,44 @@
+###############################################################################
+# Copyright (c) 2008 JBoss, a division of Red Hat and others.
+# All rights reserved. This program and the accompanying materials
+# are 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:
+# JBoss, a division of Red Hat - Initial implementation.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss BPEL Editor
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss, a division of Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+discoverySiteName=JBossTools Development Update Site
+
+# "description" property - description of the feature
+description=JBoss BPEL Editor
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2008 JBoss, a division of Red Hat and others.\nAll rights reserved. This program and the accompanying materials\n
+are made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp\://www.eclipse.org/legal/epl-v10.html\n\nContributors\:\nJBoss, a division of Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\nMarch 17, 2005\n\nUsage Of Content\n\nTHE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\nOTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\nUSE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\nAGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\nNOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\nAGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\nAND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\nOR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\nTERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\nOF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\nBELOW, THEN YOU MAY NOT USE THE CONTENT.\n\nApplicable Licenses\n\nUnless otherwise indicated, all Content made available by the Eclipse Foundation\nis provided to you under the terms and conditio!
ns of the Eclipse Public\nLicense Version 1.0 ("EPL"). A copy of the EPL is provided with this\nContent and is also available at http\://www.eclipse.org/legal/epl-v10.html.\nFor purposes of the EPL, "Program" will mean the Content.\n\nContent includes, but is not limited to, source code, object code,\ndocumentation and other files maintained in the Eclipse.org CVS\nrepository ("Repository") in CVS modules ("Modules") and made available\nas downloadable archives ("Downloads").\n\n- Content may be structured and packaged into modules to facilitate delivering,\nextending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\nplug-in fragments ("Fragments"), and features ("Features").\n- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\nin a directory named "plugins".\n- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\nEach Feature may be packaged as a sub-directory in a directory!
named "features".\nWithin a Feature, files named "feature.xml" may co
ntain a list of the names and version\nnumbers of the Plug-ins and/or Fragments associated with that Feature.\n- Features may also include other Features ("Included Features"). Within a Feature, files\nnamed "feature.xml" may contain a list of the names and version numbers of Included Features.\n\nFeatures may also include other Features ("Included Features"). Files named\n"feature.xml" may contain a list of the names and version numbers of\nIncluded Features.\n\nThe terms and conditions governing Plug-ins and Fragments should be\ncontained in files named "about.html" ("Abouts"). The terms and\nconditions governing Features and Included Features should be contained\nin files named "license.html" ("Feature Licenses"). Abouts and Feature\nLicenses may be located in any directory of a Download or Module\nincluding, but not limited to the following locations\:\n\n- The top-level (root) directory\n- Plug-in and Fragment directories\n- Inside Plug-ins and Fragments packaged as JAR!
s\n- Sub-directories of the directory named "src" of certain Plug-ins\n- Feature directories\n\nNote\: if a Feature made available by the Eclipse Foundation is installed using the\nEclipse Update Manager, you must agree to a license ("Feature Update\nLicense") during the installation process. If the Feature contains\nIncluded Features, the Feature Update License should either provide you\nwith the terms and conditions governing the Included Features or inform\nyou where you can locate them. Feature Update Licenses may be found in\nthe "license" property of files named "feature.properties". Such Abouts,\nFeature Licenses and Feature Update Licenses contain the terms and\nconditions (or references to such terms and conditions) that govern your\nuse of the associated Content in that directory.\n\nTHE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\nTO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\nSOME OF THESE OTHER LICENSE AGREEMENTS MA!
Y INCLUDE (BUT ARE NOT LIMITED TO)\:\n\n- Common Public License Versio
n 1.0 (available at http\://www.eclipse.org/legal/cpl-v10.html)\n- Apache Software License 1.1 (available at http\://www.apache.org/licenses/LICENSE)\n- Apache Software License 2.0 (available at http\://www.apache.org/licenses/LICENSE-2.0)\n- IBM Public License 1.0 (available at http\://oss.software.ibm.com/developerworks/opensource/license10.html)\n- Metro Link Public License 1.00 (available at http\://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n- Mozilla Public License Version 1.1 (available at http\://www.mozilla.org/MPL/MPL-1.1.html)\n\nIT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\nTO USE OF THE CONTENT. If no About, Feature License or Feature Update License\nis provided, please contact the Eclipse Foundation to determine what terms and conditions\ngovern that particular Content.\n\nCryptography\n\nContent may contain encryption software. The country in which you are\ncurrently may have restrictions on the import, posse!
ssion, and use,\nand/or re-export to another country, of encryption software. BEFORE\nusing any encryption software, please check the country's laws,\nregulations and policies concerning the import, possession, or use,\nand re-export of encryption software, to see if this is permitted.\n\nJava and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/bpel/features/org.jboss.bpel.feature/feature.xml
===================================================================
--- trunk/bpel/features/org.jboss.bpel.feature/feature.xml (rev 0)
+++ trunk/bpel/features/org.jboss.bpel.feature/feature.xml 2009-06-23 09:21:51 UTC (rev 16131)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.bpel.feature"
+ label="%featureName"
+ version="1.0.0"
+ provider-name="%providerName">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="%updateSiteName" url="http://download.jboss.org/jbosstools/updates/stable"/>
+ </url>
+
+ <plugin
+ id="org.jboss.bpel.apache.ode.deploy.model"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.bpel.apache.ode.deploy.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.bpel.apache.ode.runtime"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.bpel.common.model"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.bpel.common.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.bpel.model"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.bpel.runtimes"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.bpel.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.bpel.validator"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.bpel.wsil.model"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.bpel.xpath10"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
Added: trunk/bpel/features/org.jboss.bpel.feature/license.html
===================================================================
--- trunk/bpel/features/org.jboss.bpel.feature/license.html (rev 0)
+++ trunk/bpel/features/org.jboss.bpel.feature/license.html 2009-06-23 09:21:51 UTC (rev 16131)
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+<title>Eclipse.org Software User Agreement</title>
+</head>
+
+<body lang="EN-US" link=blue vlink=purple>
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>March 17, 2005</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
+ modules ("Modules") and made available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
+</body>
+</html>
16 years, 10 months
JBoss Tools SVN: r16130 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-06-23 05:14:04 -0400 (Tue, 23 Jun 2009)
New Revision: 16130
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/TextTypeSwicher.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java
Log:
JBIDE-4283
Add two radio button to control the "Text value text" and "CDATA value text".
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-06-23 09:01:15 UTC (rev 16129)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-06-23 09:14:04 UTC (rev 16130)
@@ -285,8 +285,11 @@
public static String getAnyTypeText(AnyType anyType) {
Object value = anyType.getMixed().get(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT, true);
if (value != null) {
- if (value instanceof List && !((List) value).isEmpty()) {
- return ((List) value).get(0).toString().trim();
+ if (value instanceof List && !((List<?>) value).isEmpty()) {
+ Object v = ((List<?>) value).get(0);
+ if (v != null) {
+ return v.toString().trim();
+ }
}
// return value.toString();
}
@@ -297,7 +300,10 @@
Object value = anyType.getMixed().get(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA, true);
if (value != null) {
if (value instanceof List && !((List) value).isEmpty()) {
- return ((List) value).get(0).toString().trim();
+ Object v = ((List) value).get(0);
+ if (v != null) {
+ return v.toString().trim();
+ }
}
// return value.toString();
}
@@ -307,8 +313,11 @@
public static String getAnyTypeComment(AnyType anyType) {
Object value = anyType.getMixed().get(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__COMMENT, true);
if (value != null) {
- if (value instanceof List && !((List) value).isEmpty()) {
- return ((List) value).get(0).toString().trim();
+ if (value instanceof List && !((List<?>) value).isEmpty()) {
+ Object v = ((List<?>) value).get(0);
+ if (v != null) {
+ return v.toString().trim();
+ }
}
// return value.toString();
}
@@ -417,11 +426,21 @@
smooksModel.getMixed().add(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA, text);
}
+ /**
+ * @deprecated
+ * @param smooksModel
+ * @param text
+ */
public static void setTextToAnyType(AnyType smooksModel, String text) {
cleanTextToSmooksType(smooksModel);
appendTextToSmooksType(smooksModel, text);
}
+ /**
+ * @deprecated
+ * @param smooksModel
+ * @param text
+ */
public static void setCDATAToAnyType(AnyType smooksModel, String text) {
cleanCDATAToSmooksType(smooksModel);
appendCDATAToSmooksType(smooksModel, text);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-06-23 09:01:15 UTC (rev 16129)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-06-23 09:14:04 UTC (rev 16130)
@@ -30,6 +30,7 @@
import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
import org.jboss.tools.smooks.configuration.editors.uitls.FieldAssistDisposer;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.configuration.editors.uitls.TextTypeSwicher;
import org.jboss.tools.smooks.model.freemarker.FreemarkerPackage;
/**
@@ -63,6 +64,9 @@
// OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model,
// SmooksUIUtils.VALUE_TYPE_COMMENT, "flt");
+ TextTypeSwicher swicher = new TextTypeSwicher();
+ swicher.createSwicherGUI("External Template File", "Inline Template", parent, toolkit);
+
AttributeFieldEditPart cdatatext = SmooksUIUtils.createCDATAFieldEditor("Inline Template", editingdomain,
toolkit, parent, model, openCDATAEditorAction, true);
Control c = cdatatext.getContentControl();
@@ -93,8 +97,14 @@
openCDATAEditorAction.setRelateText((Text) cdatatext.getContentControl());
// openCommentEditorAction.setRelateText((Text)commenttext.getContentControl());
- list.add(SmooksUIUtils.createFileSelectionTextFieldEditor("External Template File", parent, editingdomain,
- toolkit, null, model, SmooksUIUtils.VALUE_TYPE_TEXT, null, null));
+ AttributeFieldEditPart textFieldEditPart = SmooksUIUtils.createFileSelectionTextFieldEditor(
+ "External Template File", parent, editingdomain, toolkit, null, model, SmooksUIUtils.VALUE_TYPE_TEXT,
+ null, null);
+
+ list.add(textFieldEditPart);
+
+ swicher.hookSwicher(textFieldEditPart, cdatatext, editingdomain, model);
+
list.add(SmooksUIUtils.createStringFieldEditor(parent, toolkit, getPropertyDescriptor(editingdomain,
FreemarkerPackage.eINSTANCE.getTemplate_Encoding(), model), model, false, false, null));
return list;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java 2009-06-23 09:01:15 UTC (rev 16129)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java 2009-06-23 09:14:04 UTC (rev 16130)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.smooks;
-import java.util.Collections;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EAttribute;
@@ -22,6 +22,7 @@
import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.configuration.editors.uitls.TextTypeSwicher;
import org.jboss.tools.smooks.model.smooks.SmooksPackage;
/**
@@ -39,7 +40,8 @@
* org.eclipse.emf.ecore.EAttribute)
*/
public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,SmooksMultiFormEditor formEditor) {
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (feature == SmooksPackage.eINSTANCE.getParamType_Name()) {
}
if (feature == SmooksPackage.eINSTANCE.getParamType_Type()) {
@@ -48,11 +50,109 @@
}
@Override
- public List<AttributeFieldEditPart> createExtendUIOnBottom(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
- Composite parent, Object model, SmooksMultiFormEditor formEditor) {
- SmooksUIUtils.createMixedTextFieldEditor("Text Value", editingdomain, toolkit, parent, model , false , 500,false,false,null,null);
- SmooksUIUtils.createCDATAFieldEditor("CDATA Value", editingdomain, toolkit, parent, model,null);
+ public List<AttributeFieldEditPart> createExtendUIOnBottom(AdapterFactoryEditingDomain editingdomain,
+ FormToolkit toolkit, Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ List<AttributeFieldEditPart> list = new ArrayList<AttributeFieldEditPart>();
+ TextTypeSwicher swicher = new TextTypeSwicher();
+ swicher.createSwicherGUI("Text Value", "CDATA Value", parent, toolkit);
+// GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+// gd.horizontalSpan = 2;
+// gd.heightHint = 2;
+// toolkit.createCompositeSeparator(parent).setLayoutData(gd);
+//
+// final Button textButton = toolkit.createButton(parent, "Text Value", SWT.RADIO);
+// final Button cdataButton = toolkit.createButton(parent, "CDATA Value", SWT.RADIO);
+// String cdata = SmooksModelUtils.getAnyTypeCDATA((AnyType) model);
+// String text = SmooksModelUtils.getAnyTypeText((AnyType) model);
+
+ final AttributeFieldEditPart tp = SmooksUIUtils.createMixedTextFieldEditor("Text Value", editingdomain,
+ toolkit, parent, model, false, 500, false, false, null, null);
+ final AttributeFieldEditPart cp = SmooksUIUtils.createCDATAFieldEditor("CDATA Value", editingdomain, toolkit,
+ parent, model, null);
+ list.add(tp);
+ list.add(cp);
+ swicher.hookSwicher(tp, cp, editingdomain, model);
- return Collections.emptyList();
+
+// textButton.setSelection(true);
+// cdataButton.setSelection(false);
+// if ((cdata == null || cdata.length() == 0) && (text == null || text.length() == 0)) {
+// textButton.setSelection(true);
+// cdataButton.setSelection(false);
+// } else {
+// if ((text == null || text.length() == 0)) {
+// textButton.setSelection(false);
+// cdataButton.setSelection(true);
+// }
+// }
+// tp.getContentControl().setEnabled(textButton.getSelection());
+// cp.getContentControl().setEnabled(cdataButton.getSelection());
+// final AnyType fm = (AnyType) model;
+// final AdapterFactoryEditingDomain fd = editingdomain;
+// textButton.addSelectionListener(new SelectionListener() {
+//
+// /*
+// * (non-Javadoc)
+// *
+// * @see
+// * org.eclipse.swt.events.SelectionListener#widgetDefaultSelected
+// * (org.eclipse.swt.events.SelectionEvent)
+// */
+// public void widgetDefaultSelected(SelectionEvent e) {
+//
+// }
+//
+// /*
+// * (non-Javadoc)
+// *
+// * @see
+// * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse
+// * .swt.events.SelectionEvent)
+// */
+// public void widgetSelected(SelectionEvent e) {
+// tp.getContentControl().setEnabled(textButton.getSelection());
+// cp.getContentControl().setEnabled(cdataButton.getSelection());
+// SmooksModelUtils.setCDATAToSmooksType(fd, fm, null);
+// Text t = (Text) tp.getContentControl();
+// String text = t.getText();
+// if(text != null && text.length() == 0) text = null;
+// SmooksModelUtils.setTextToSmooksType(fd,fm, text);
+// }
+//
+// });
+//
+// cdataButton.addSelectionListener(new SelectionListener() {
+//
+// /*
+// * (non-Javadoc)
+// *
+// * @see
+// * org.eclipse.swt.events.SelectionListener#widgetDefaultSelected
+// * (org.eclipse.swt.events.SelectionEvent)
+// */
+// public void widgetDefaultSelected(SelectionEvent e) {
+//
+// }
+//
+// /*
+// * (non-Javadoc)
+// *
+// * @see
+// * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse
+// * .swt.events.SelectionEvent)
+// */
+// public void widgetSelected(SelectionEvent e) {
+// tp.getContentControl().setEnabled(textButton.getSelection());
+// cp.getContentControl().setEnabled(cdataButton.getSelection());
+// SmooksModelUtils.setTextToSmooksType(fd,fm, null);
+// Text t = (Text) cp.getContentControl();
+// String text = t.getText();
+// if(text != null && text.length() == 0) text = null;
+// SmooksModelUtils.setCDATAToSmooksType(fd,fm, text);
+// }
+//
+// });
+
+ return list;
}
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-06-23 09:01:15 UTC (rev 16129)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-06-23 09:14:04 UTC (rev 16130)
@@ -221,22 +221,22 @@
return beanIdList;
}
- public static void createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ public static AttributeFieldEditPart createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
FormToolkit toolkit, Composite parent, Object model, boolean linkLabel, IHyperlinkListener listener) {
- createMixedTextFieldEditor(label, editingdomain, toolkit, parent, model, false, 0, linkLabel, false, listener,
+ return createMixedTextFieldEditor(label, editingdomain, toolkit, parent, model, false, 0, linkLabel, false, listener,
null);
}
- public static void createMultiMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ public static AttributeFieldEditPart createMultiMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
FormToolkit toolkit, Composite parent, Object model, int height, OpenEditorEditInnerContentsAction action) {
- createMixedTextFieldEditor(label, editingdomain, toolkit, parent, model, true, height, false, false, null,
+ return createMixedTextFieldEditor(label, editingdomain, toolkit, parent, model, true, height, false, false, null,
action);
}
- public static void createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
+ public static AttributeFieldEditPart createMixedTextFieldEditor(String label, AdapterFactoryEditingDomain editingdomain,
FormToolkit toolkit, Composite parent, Object model, boolean multiText, int height, boolean linkLabel,
boolean openFile, IHyperlinkListener listener, OpenEditorEditInnerContentsAction action) {
- createStringFieldEditor(label, parent, editingdomain, toolkit, null, model, multiText, linkLabel, openFile,
+ return createStringFieldEditor(label, parent, editingdomain, toolkit, null, model, multiText, linkLabel, openFile,
height, listener, VALUE_TYPE_TEXT, action);
}
@@ -623,9 +623,9 @@
}
if (editValue != null && valueIsSet) {
valueText.setText(editValue);
- // if (editValue.length() > 0 && section != null) {
- // section.setExpanded(true);
- // }
+ if (editValue.length() > 0 && section != null) {
+ section.setExpanded(true);
+ }
}
if (valueType == VALUE_TYPE_TEXT && model instanceof AnyType && fEditingDomain != null) {
valueText.addModifyListener(new ModifyListener() {
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/TextTypeSwicher.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/TextTypeSwicher.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/TextTypeSwicher.java 2009-06-23 09:14:04 UTC (rev 16130)
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * 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.smooks.configuration.editors.uitls;
+
+import org.eclipse.emf.ecore.xml.type.AnyType;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.editors.AttributeFieldEditPart;
+import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ *
+ */
+public class TextTypeSwicher {
+
+ private Button textButton;
+ private Button cdataButton;
+
+ public void hookSwicher(AttributeFieldEditPart textFieldEditPart, AttributeFieldEditPart cdataFieldEditPart,
+ AdapterFactoryEditingDomain editingdomain, Object model) {
+ String cdata = SmooksModelUtils.getAnyTypeCDATA((AnyType) model);
+ String text = SmooksModelUtils.getAnyTypeText((AnyType) model);
+
+ textButton.setSelection(true);
+ cdataButton.setSelection(false);
+ if ((cdata == null || cdata.length() == 0) && (text == null || text.length() == 0)) {
+ textButton.setSelection(true);
+ cdataButton.setSelection(false);
+ } else {
+ if ((text == null || text.length() == 0)) {
+ textButton.setSelection(false);
+ cdataButton.setSelection(true);
+ }
+ }
+ final AttributeFieldEditPart tp = textFieldEditPart;
+ final AttributeFieldEditPart cp = cdataFieldEditPart;
+ tp.getContentControl().setEnabled(textButton.getSelection());
+ cp.getContentControl().setEnabled(cdataButton.getSelection());
+ final AnyType fm = (AnyType) model;
+ final AdapterFactoryEditingDomain fd = editingdomain;
+ textButton.addSelectionListener(new SelectionListener() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetDefaultSelected
+ * (org.eclipse.swt.events.SelectionEvent)
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse
+ * .swt.events.SelectionEvent)
+ */
+ public void widgetSelected(SelectionEvent e) {
+ tp.getContentControl().setEnabled(textButton.getSelection());
+ cp.getContentControl().setEnabled(cdataButton.getSelection());
+ SmooksModelUtils.setCDATAToSmooksType(fd, fm, null);
+ Text t = (Text) tp.getContentControl();
+ String text = t.getText();
+ if (text != null) {
+ text = text.replaceAll("\r", "");
+ }
+ if (text.length() == 0)
+ text = null;
+ SmooksModelUtils.setTextToSmooksType(fd, fm, text);
+ }
+
+ });
+
+ cdataButton.addSelectionListener(new SelectionListener() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetDefaultSelected
+ * (org.eclipse.swt.events.SelectionEvent)
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse
+ * .swt.events.SelectionEvent)
+ */
+ public void widgetSelected(SelectionEvent e) {
+ tp.getContentControl().setEnabled(textButton.getSelection());
+ cp.getContentControl().setEnabled(cdataButton.getSelection());
+ SmooksModelUtils.setTextToSmooksType(fd, fm, null);
+ Text t = (Text) cp.getContentControl();
+ String text = t.getText();
+ if (text != null) {
+ text = text.replaceAll("\r", "");
+ }
+ if (text.length() == 0)
+ text = null;
+ SmooksModelUtils.setCDATAToSmooksType(fd, fm, text);
+ }
+
+ });
+ }
+
+ public void createSwicherGUI(String textString, String cdataString, Composite parent, FormToolkit toolkit) {
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ gd.heightHint = 15;
+
+ toolkit.createSeparator(parent, SWT.HORIZONTAL).setLayoutData(gd);
+
+ textButton = toolkit.createButton(parent, textString, SWT.RADIO);
+ cdataButton = toolkit.createButton(parent, cdataString, SWT.RADIO);
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/TextTypeSwicher.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-06-23 09:01:15 UTC (rev 16129)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-06-23 09:14:04 UTC (rev 16130)
@@ -25,6 +25,7 @@
import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.configuration.editors.uitls.TextTypeSwicher;
import org.jboss.tools.smooks.model.xsl.XslPackage;
/**
@@ -79,16 +80,23 @@
// OpenEditorEditInnerContentsAction openCommentEditorAction = new
// OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model,
// SmooksUIUtils.VALUE_TYPE_COMMENT, "xsl");
- AttributeFieldEditPart text1 = SmooksUIUtils.createCDATAFieldEditor("Inline Template", editingdomain, toolkit,
- parent, model, openCdataEditorAction,true);
+ TextTypeSwicher swicher = new TextTypeSwicher();
+ swicher.createSwicherGUI("External Template File", "Inline Template", parent, toolkit);
+ AttributeFieldEditPart cdataFieldEditPart = SmooksUIUtils.createCDATAFieldEditor("Inline Template", editingdomain, toolkit,
+ parent, model, openCdataEditorAction, true);
// AttributeFieldEditPart text2 =
// SmooksUIUtils.createCommentFieldEditor("Template Contents (Comment)",
// editingdomain, toolkit, parent, model, openCommentEditorAction);
- openCdataEditorAction.setRelateText((Text) text1.getContentControl());
+ openCdataEditorAction.setRelateText((Text) cdataFieldEditPart.getContentControl());
// openCommentEditorAction.setRelateText((Text)text2.getContentControl());
- list.add(SmooksUIUtils.createFileSelectionTextFieldEditor("External Template File", parent, editingdomain,
- toolkit, null, model, SmooksUIUtils.VALUE_TYPE_TEXT, null, null));
- list.add(text1);
+ AttributeFieldEditPart textFieldEditPart = SmooksUIUtils.createFileSelectionTextFieldEditor(
+ "External Template File", parent, editingdomain, toolkit, null, model, SmooksUIUtils.VALUE_TYPE_TEXT,
+ null, null);
+ list.add(textFieldEditPart);
+ list.add(cdataFieldEditPart);
+
+ swicher.hookSwicher(textFieldEditPart, cdataFieldEditPart, editingdomain, model);
+
list.add(SmooksUIUtils.createStringFieldEditor(parent, toolkit, getPropertyDescriptor(editingdomain,
XslPackage.eINSTANCE.getTemplate_Encoding(), model), model, false, false, null));
return list;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java 2009-06-23 09:01:15 UTC (rev 16129)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java 2009-06-23 09:14:04 UTC (rev 16130)
@@ -41,7 +41,7 @@
*/
@Override
protected void preStartValidation() {
-
+
}
/*
@@ -59,10 +59,12 @@
if (obj instanceof DocumentRoot) {
SmooksResourceListType listType = ((DocumentRoot) obj).getSmooksResourceList();
List<String> ids = SmooksUIUtils.getBeanIdStringList(listType);
- idList.addAll(ids);
+ if (ids != null){
+ idList.addAll(ids);
+ }
}
if (idList.isEmpty()) {
-// return null;
+ // return null;
}
return super.validate(selectedObjects, editingDomain);
}
@@ -83,9 +85,9 @@
JavabeanPackage.Literals.WIRING_TYPE__BEAN_ID_REF);
}
}
-
- if(model instanceof JmsRouter){
- String idRef = ((JmsRouter)model).getBeanId();
+
+ if (model instanceof JmsRouter) {
+ String idRef = ((JmsRouter) model).getBeanId();
if (!idList.contains(idRef)) {
return newWaringDiagnostic("Reference BeanId '" + idRef + "' dosen't exist.", model,
JmsroutingPackage.Literals.JMS_ROUTER__BEAN_ID);
16 years, 10 months
JBoss Tools SVN: r16129 - in trunk/hibernatetools/plugins: org.hibernate.eclipse/src/org/hibernate/console/execution and 13 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-06-23 05:01:15 -0400 (Tue, 23 Jun 2009)
New Revision: 16129
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/FileFilter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalConfigurationEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/ConfigurationEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/GraphNodeEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/TableEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationEntitiesNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4357
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -77,7 +77,7 @@
if(model.getMaxResults()!=null) {
criteria.setMaxResults( model.getMaxResults().intValue() );
}
- } else if (o instanceof List) {
+ } else if (o instanceof List<?>) {
list = (List<Object>) o;
if(model.getMaxResults()!=null) {
list = list.subList( 0, Math.min( list.size(), model.getMaxResults().intValue() ) );
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -33,7 +33,7 @@
final private URLClassLoader configurationClassLoader;
private volatile int installs;
- private Map previousLoaders = new WeakHashMap();
+ private Map<Thread, ClassLoader> previousLoaders = new WeakHashMap<Thread, ClassLoader>();
final String key;
@@ -76,7 +76,7 @@
installs--; // TODO: make more safe (synchronized) bookkeeping of the classloader installation.
if(installs==0) {
- ClassLoader cl = (ClassLoader) previousLoaders.get(Thread.currentThread() );
+ ClassLoader cl = previousLoaders.get(Thread.currentThread() );
if(configurationClassLoader!=null && Thread.currentThread().getContextClassLoader() != configurationClassLoader) {
String out = NLS.bind(ConsoleMessages.DefaultExecutionContext_existing_classloader, Thread.currentThread().getContextClassLoader(), configurationClassLoader);
throw new IllegalStateException(out);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationEntitiesNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationEntitiesNode.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationEntitiesNode.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -31,10 +31,10 @@
*/
public class ConfigurationEntitiesNode extends BaseNode {
- public ConfigurationEntitiesNode(String name, NodeFactory factory, List classes) {
+ public ConfigurationEntitiesNode(String name, NodeFactory factory, List<String> classes) {
super(factory,null);
for (int i = 0; i < classes.size(); i++) {
- children.add(factory.createClassNode(this,(String)classes.get(i) ) );
+ children.add(factory.createClassNode(this,classes.get(i) ) );
}
iconName = ImageConstants.TYPES;
this.name = name;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -246,7 +246,7 @@
* Returns all the loggers in this manager.
* @return Enumeration logger enumeration
*/
- public Enumeration getCurrentLoggers() {
+ public Enumeration<?> getCurrentLoggers() {
return this.hierarchy.getCurrentLoggers();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -6,7 +6,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import java.util.Properties;
@@ -114,17 +113,16 @@
return getAttribute( IConsoleConfigurationLaunchConstants.ENTITY_RESOLVER, null );
}
+ @SuppressWarnings("unchecked")
public File[] getMappingFiles() {
try {
- List mappings = launchConfiguration.getAttribute( IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, Collections.EMPTY_LIST );
+ List<String> mappings = launchConfiguration.getAttribute( IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, Collections.EMPTY_LIST );
File[] result = new File[mappings.size()];
int i = 0;
- Iterator iter = mappings.iterator();
- while ( iter.hasNext() ) {
- String element = (String) iter.next();
+ for (String element : mappings) {
result[i++] = strToFile( element );
}
- return result;
+ return result;
}
catch (CoreException e) {
throw new HibernateConsoleRuntimeException(e);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/FileFilter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/FileFilter.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/FileFilter.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -44,7 +44,7 @@
private final String[] fileExtensions;
- private List excludedFiles;
+ private List<IResource> excludedFiles;
private boolean recursive ;
private final boolean allowDirectories;
@@ -55,7 +55,7 @@
* @param recusive Folders are only shown if, searched recursively, contain
* a matching file
*/
- public FileFilter(String[] fileExtensions, IFile[] excludedFiles, boolean recusive) {
+ public FileFilter(String[] fileExtensions, IResource[] excludedFiles, boolean recusive) {
this.fileExtensions = fileExtensions;
if (excludedFiles != null) {
this.excludedFiles= Arrays.asList(excludedFiles);
@@ -66,10 +66,10 @@
allowDirectories = false;
}
- public FileFilter(String[] fileExtensions, List excludedFiles, boolean recusive, boolean allowDirectories) {
+ public FileFilter(String[] fileExtensions, List<IResource> usedFiles, boolean recusive, boolean allowDirectories) {
this.fileExtensions = fileExtensions;
- this.excludedFiles= excludedFiles;
+ this.excludedFiles= usedFiles;
recursive = recusive;
this.allowDirectories = allowDirectories;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -44,11 +44,9 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
import org.hibernate.SessionFactory;
-import org.hibernate.classic.Session;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
-import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.eclipse.console.utils.QLFormatHelper;
import org.hibernate.eclipse.hqleditor.HQLEditor;
import org.hibernate.eclipse.hqleditor.HQLEditorDocumentSetupParticipant;
@@ -178,7 +176,7 @@
QueryTranslator translator = translators[i];
if(translator.isManipulationStatement()) {
str.append(HibernateConsoleMessages.DynamicSQLPreviewView_manipulation_of + i + ":"); //$NON-NLS-1$
- Iterator iterator = translator.getQuerySpaces().iterator();
+ Iterator<?> iterator = translator.getQuerySpaces().iterator();
while ( iterator.hasNext() ) {
Object qspace = iterator.next();
str.append(qspace);
@@ -195,7 +193,7 @@
}
}
str.append("\n-----------------\n"); //$NON-NLS-1$
- Iterator sqls = translator.collectSqlStrings().iterator();
+ Iterator<?> sqls = translator.collectSqlStrings().iterator();
while ( sqls.hasNext() ) {
String sql = (String) sqls.next();
str.append(QLFormatHelper.formatForScreen(sql));
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -120,7 +120,7 @@
if(qp.getExceptions().isEmpty() ) {
return ensureNotNull(objects);
} else {
- Throwable[] throwables = (Throwable[])qp.getExceptions().toArray(new Throwable[0]);
+ Throwable[] throwables = qp.getExceptions().toArray(new Throwable[0]);
HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.QueryPageViewer_exception_while_executing_hql_query, throwables);
return throwables; // TODO: provide actual error page
}
@@ -261,7 +261,7 @@
private int addColumnsToTable(final Table table) {
table.setHeaderVisible(true);
table.setLinesVisible(true);
- List columns = this.queryPage.getPathNames();
+ List<String> columns = this.queryPage.getPathNames();
int columnCount = columns.size();
for (int i = 0; i < columnCount; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -23,7 +23,7 @@
}
protected void doRun() {
- for (Iterator i = getSelectedNonResources().iterator(); i.hasNext();) {
+ for (Iterator<?> i = getSelectedNonResources().iterator(); i.hasNext();) {
try {
Object node = i.next();
if (node instanceof ConsoleConfiguration) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -58,12 +58,13 @@
}
public void doRun() {
- for (Iterator i = getSelectedNonResources().iterator(); i.hasNext();) {
+ for (Iterator<?> i = getSelectedNonResources().iterator(); i.hasNext();) {
try {
Object node = i.next();
if ( node instanceof ConsoleConfiguration ) {
final ConsoleConfiguration config = (ConsoleConfiguration) node;
config.execute( new Command() {
+ @SuppressWarnings("unchecked")
public Object execute() {
String out = NLS.bind(HibernateConsoleMessages.SchemaExportAction_sure_run_schemaexport, config.getName());
if ( config.getConfiguration() != null
@@ -74,11 +75,10 @@
.getConfiguration() );
export.create( false, true );
if ( !export.getExceptions().isEmpty() ) {
- Iterator iterator = export.getExceptions()
- .iterator();
+ Iterator<Throwable> iterator = export.getExceptions().iterator();
int cnt = 1;
while ( iterator.hasNext() ) {
- Throwable element = (Throwable) iterator.next();
+ Throwable element = iterator.next();
String outStr = NLS.bind(HibernateConsoleMessages.SchemaExportAction_errornum_while_performing_schemaexport, cnt++);
HibernateConsolePlugin.getDefault().logErrorMessage(outStr, element );
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -135,7 +135,7 @@
if ( !selection.isEmpty() ) {
StructuredSelection ss = (StructuredSelection) selection;
- Iterator iterator = ss.iterator();
+ Iterator<?> iterator = ss.iterator();
while ( iterator.hasNext() ) {
Object sel = iterator.next();
ITableFilter filter = null;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -292,9 +292,7 @@
protected void handleRemove() {
IStructuredSelection selection = (IStructuredSelection) tableView.getSelection();
if (selection != null) {
- int numSelected= selection.size();
-
- Iterator iterator= selection.iterator();
+ Iterator<?> iterator= selection.iterator();
while (iterator.hasNext() ) {
Object item= iterator.next();
tableView.remove(item);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalConfigurationEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalConfigurationEditPart.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalConfigurationEditPart.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -23,18 +23,16 @@
import java.util.List;
-import org.eclipse.gef.EditPart;
import org.hibernate.eclipse.graph.model.ConfigurationViewAdapter;
import org.hibernate.eclipse.graph.parts.ConfigurationEditPart;
-public class RelationalConfigurationEditPart extends ConfigurationEditPart
- implements EditPart {
+public class RelationalConfigurationEditPart extends ConfigurationEditPart {
public RelationalConfigurationEditPart(ConfigurationViewAdapter configuration) {
super( configuration );
}
- protected List getModelChildren() {
+ protected List<?> getModelChildren() {
if ( getConfigurationViewAdapter() == null )
return super.getModelChildren();
return getConfigurationViewAdapter().getSelectedTables();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/ConfigurationEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/ConfigurationEditPart.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/ConfigurationEditPart.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -59,7 +59,7 @@
setModel( configuration );
}
- protected List getModelChildren() {
+ protected List<?> getModelChildren() {
if ( getConfigurationViewAdapter() == null )
return super.getModelChildren();
return getConfigurationViewAdapter().getPersistentClasses();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/GraphNodeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/GraphNodeEditPart.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/GraphNodeEditPart.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -34,6 +34,7 @@
import org.eclipse.gef.NodeEditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.hibernate.eclipse.graph.model.AssociationViewAdapter;
import org.hibernate.eclipse.graph.model.GraphNode;
public abstract class GraphNodeEditPart extends AbstractGraphicalEditPart implements Observer, NodeEditPart {
@@ -51,7 +52,7 @@
}
}
- protected List getModelSourceConnections() {
+ protected List<AssociationViewAdapter> getModelSourceConnections() {
return getGraphNode().getSourceAssociations();
}
@@ -59,7 +60,7 @@
return (GraphNode)getModel();
}
- protected List getModelTargetConnections() {
+ protected List<AssociationViewAdapter> getModelTargetConnections() {
return getGraphNode().getTargetAssociations();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/TableEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/TableEditPart.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/TableEditPart.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -26,6 +26,7 @@
import org.eclipse.draw2d.IFigure;
import org.hibernate.eclipse.graph.figures.EditableLabel;
import org.hibernate.eclipse.graph.figures.TableFigure;
+import org.hibernate.eclipse.graph.model.ColumnViewAdapter;
import org.hibernate.eclipse.graph.model.TableViewAdapter;
public class TableEditPart extends GraphNodeEditPart {
@@ -53,7 +54,7 @@
return figure.getColumnsFigure();
}
- protected List getModelChildren() {
+ protected List<ColumnViewAdapter> getModelChildren() {
TableViewAdapter tableViewAdapter = getTableViewAdapter();
return tableViewAdapter.getColumns();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -336,13 +336,13 @@
@SuppressWarnings("unchecked")
private ReverseEngineeringStrategy loadreverseEngineeringStrategy(final String className, ReverseEngineeringStrategy delegate) {
try {
- Class clazz = ReflectHelper.classForName(className);
+ Class<ReverseEngineeringStrategy> clazz = ReflectHelper.classForName(className);
Constructor<ReverseEngineeringStrategy> constructor = clazz.getConstructor(new Class[] { ReverseEngineeringStrategy.class });
return constructor.newInstance(new Object[] { delegate });
}
catch (NoSuchMethodException e) {
try {
- Class clazz = ReflectHelper.classForName(className);
+ Class<?> clazz = ReflectHelper.classForName(className);
ReverseEngineeringStrategy rev = (ReverseEngineeringStrategy) clazz.newInstance();
return rev;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -77,14 +77,15 @@
return str;
}
+ @SuppressWarnings("unchecked")
public void initializeFrom(ILaunchConfiguration configuration) {
try {
mappingFilesViewer.clear();
- List mappings = configuration.getAttribute( IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, Collections.EMPTY_LIST );
+ List<String> mappings = configuration.getAttribute( IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, Collections.EMPTY_LIST );
IPath[] mapA = new IPath[mappings.size()];
int i=0;
- for (Iterator iter = mappings.iterator(); iter.hasNext();) {
- String file = (String) iter.next();
+ for (Iterator<String> iter = mappings.iterator(); iter.hasNext();) {
+ String file = iter.next();
mapA[i++] = Path.fromPortableString( file );
}
mappingFilesViewer.add(mapA, false);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -79,6 +79,7 @@
return isAttributesAffected(config, oldPath) || isClassPathAffected(config, oldPath);
}
+ @SuppressWarnings("unchecked")
private static boolean isAttributesAffected(ILaunchConfiguration config, IPath oldPath) throws CoreException{
String attrib = null;
for (int i = 0; i < pathKeys.length; i++) {
@@ -146,6 +147,7 @@
return path.isPrefixOf(new Path(attrib));
}
+ @SuppressWarnings("unchecked")
public static ILaunchConfiguration updateLaunchConfig(ILaunchConfiguration config, IPath oldPath, IPath newPath) throws CoreException{
final ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
updateAttributes(oldPath, newPath, wc);
@@ -153,7 +155,7 @@
//classpath
try {
IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedRuntimeClasspath(config);
- List oldMementos = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, Collections.EMPTY_LIST);
+ List<String> oldMementos = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, Collections.EMPTY_LIST);
List<String> newMementos = new ArrayList<String>();
boolean isChanged = updateClasspathEntries(entries, oldMementos, newMementos, oldPath, newPath);
if (isChanged) wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, newMementos);
@@ -281,6 +283,7 @@
}
}
+ @SuppressWarnings("unchecked")
private static void updateAttributes(IPath oldPath, IPath newPath,
final ILaunchConfigurationWorkingCopy wc) throws CoreException {
String attrib = null;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -331,7 +331,7 @@
}
}
}
- ITypeBinding tb = node.resolveBinding();
+ node.resolveBinding();
return true;
}
@@ -340,8 +340,8 @@
if (node.getBody() == null) {
return res;
}
- List bodyStatemants = node.getBody().statements();
- Iterator it = bodyStatemants.iterator();
+ List<?> bodyStatemants = node.getBody().statements();
+ Iterator<?> it = bodyStatemants.iterator();
for ( ; it.hasNext(); ) {
Object obj = it.next();
if (obj instanceof ReturnStatement) {
@@ -409,9 +409,9 @@
public boolean visit(FieldDeclaration node) {
Type type = node.getType();
List<String> list = new ArrayList<String>();
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
list.add(name);
}
@@ -444,9 +444,9 @@
PrimitiveType pt = (PrimitiveType)type;
if (!pt.getPrimitiveTypeCode().equals(PrimitiveType.BOOLEAN)) {
// this is candidate for primary id
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
if ("version".equalsIgnoreCase(name)) { //$NON-NLS-1$
FieldGetterType versionFieldGetter =
updateFieldGetter(entityInfo.getVersionFieldGetter(), fieldFlag);
@@ -472,9 +472,9 @@
HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
}
entityInfo.addDependency(entityFullyQualifiedName);
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
entityInfo.addReference(name, entityFullyQualifiedName, RefType.MANY2ONE);
}
}
@@ -483,9 +483,9 @@
if (tbParent != null) {
if ("java.lang.Number".equals(tbParent.getBinaryName())) { //$NON-NLS-1$
// this is candidate for primary id
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
if ("version".equalsIgnoreCase(name)) { //$NON-NLS-1$
FieldGetterType versionFieldGetter =
updateFieldGetter(entityInfo.getVersionFieldGetter(), fieldFlag);
@@ -498,9 +498,9 @@
}
else if ("java.util.Date".equals(tbParent.getBinaryName())) { //$NON-NLS-1$
// this is candidate for version
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
if ("version".equalsIgnoreCase(name)) { //$NON-NLS-1$
FieldGetterType versionFieldGetter =
updateFieldGetter(entityInfo.getVersionFieldGetter(), fieldFlag);
@@ -510,9 +510,9 @@
}
}
if ("java.lang.String".equals(tb.getBinaryName())) { //$NON-NLS-1$
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
entityInfo.updateAnnotationColumn(name, null, false);
entityInfo.addPrimaryIdCandidate(name);
}
@@ -538,9 +538,9 @@
HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
}
entityInfo.addDependency(entityFullyQualifiedName);
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2MANY);
}
}
@@ -570,9 +570,9 @@
}
}*/
if (fullyQualifiedNameTypeName.length() > 0) {
- Iterator typeArgsIt = pt.typeArguments().iterator();
+ Iterator<Type> typeArgsIt = pt.typeArguments().iterator();
while (typeArgsIt.hasNext()) {
- typeP = (Type)typeArgsIt.next();
+ typeP = typeArgsIt.next();
tb = typeP.resolveBinding();
String entityFullyQualifiedName = ""; //$NON-NLS-1$
if (tb.getJavaElement() instanceof SourceType) {
@@ -583,9 +583,9 @@
HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
}
entityInfo.addDependency(entityFullyQualifiedName);
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2MANY);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -479,7 +479,7 @@
}
if (node != null) {
Map<String, Expression> rciValues = rci.getValues();
- Iterator it = node.values().iterator();
+ Iterator<?> it = node.values().iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof MemberValuePair) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -129,7 +129,7 @@
ListRewrite lrw = rewriter.getListRewrite(node, CompilationUnit.IMPORTS_PROPERTY);
// insert import declaration in the proper place
// prefer alphabetic order and package separation
- Iterator it = lrw.getRewrittenList().iterator();
+ Iterator<?> it = lrw.getRewrittenList().iterator();
ASTNode insertBeforeNode = null;
for ( ; it.hasNext(); ) {
Object obj = it.next();
@@ -152,6 +152,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean visit(TypeDeclaration node) {
if (entityInfo.isAddMappedSuperclassFlag()) {
MarkerAnnotation matd = rewriter.getAST().newMarkerAnnotation();
@@ -195,9 +196,9 @@
SimpleName sn = rewriter.getAST().newSimpleName(entityInfo.getName());
md.setName(sn);
ListRewrite lrw = rewriter.getListRewrite(node, TypeDeclaration.BODY_DECLARATIONS_PROPERTY);
- List list = lrw.getOriginalList();
+ List<?> list = lrw.getOriginalList();
MethodDeclaration insertBeforeNode = null;
- Iterator it = list.iterator();
+ Iterator<?> it = list.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof MethodDeclaration) {
@@ -296,6 +297,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean visit(FieldDeclaration node) {
if (annotationStyle != AnnotStyle.FIELDS) {
return true;
@@ -307,10 +309,10 @@
if (type.isSimpleType() || type.isPrimitiveType()) {
if (entityInfo.isAddGeneratedValueFlag()) {
String primaryIdName = entityInfo.getPrimaryIdName();
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
boolean addGeneratedValueMarker = false;
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
if (primaryIdName.equals(name)) {
addGeneratedValueMarker = true;
@@ -326,10 +328,10 @@
}
if (entityInfo.isAddPrimaryIdFlag()) {
String primaryIdName = entityInfo.getPrimaryIdName();
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
boolean addIdMarker = false;
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
if (primaryIdName.equals(name)) {
addIdMarker = true;
@@ -344,10 +346,10 @@
}
}
if (enableOptLock && entityInfo.isAddVersionFlag() && !entityInfo.hasVersionAnnotation()) {
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
boolean addVersionMarker = false;
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
if ("version".equals(name)) { //$NON-NLS-1$
addVersionMarker = true;
@@ -367,9 +369,9 @@
String typeName = simpleType.getName().getFullyQualifiedName();
if ("java.lang.String".equals(typeName) || "String".equals(typeName)) { //$NON-NLS-1$ //$NON-NLS-2$
String fieldId = null;
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
fieldId = var.getName().getIdentifier();
if (fieldId != null) {
break;
@@ -392,13 +394,13 @@
}
}
if (type.isSimpleType() || type.isParameterizedType() || type.isArrayType()) {
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
String fieldId = ""; //$NON-NLS-1$
RefType refType = RefType.UNDEF;
boolean annotated = false;
String fullyQualifiedName2 = ""; //$NON-NLS-1$
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
fieldId = name;
refType = entityInfo.getFieldIdRelValue(fieldId);
@@ -439,6 +441,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean visit(MethodDeclaration node) {
if (annotationStyle != AnnotStyle.GETTERS) {
return true;
@@ -609,6 +612,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean addComplexNormalAnnotation(BodyDeclaration node, String name, RefEntityInfo rei) {
if (name == null || name.length() == 0) {
return false;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -270,6 +270,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean visit(FieldDeclaration node) {
Type type = node.getType();
if (type == null) {
@@ -277,9 +278,9 @@
}
String primaryIdName = entityInfo.getPrimaryIdName();
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
Property prop = createProperty(var);
if (prop == null) {
continue;
@@ -399,7 +400,6 @@
array.setElement(oValue);
}
- if (array == null) return true;
SimpleValue key = new SimpleValue();
if (StringHelper.isNotEmpty(entityInfo.getPrimaryIdName())) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-06-23 07:51:27 UTC (rev 16128)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-06-23 09:01:15 UTC (rev 16129)
@@ -231,7 +231,7 @@
throws InvocationTargetException,
InterruptedException {
monitor.beginTask(HibernateConsoleMessages.NewHibernateMappingFileWizard_finding_dependent_cu, selection.size() + 1);
- Iterator it = selection.iterator();
+ Iterator<?> it = selection.iterator();
int done = 1;
while (it.hasNext()) {
Object obj = it.next();
16 years, 10 months
JBoss Tools SVN: r16128 - in trunk: jst/plugins/org.jboss.tools.jst.web.kb/taglibs and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-06-23 03:51:27 -0400 (Tue, 23 Jun 2009)
New Revision: 16128
Modified:
trunk/common/plugins/org.jboss.tools.common.kb/schemas/tld/Richfaces3_3.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/Richfaces.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4520 Fixed
Modified: trunk/common/plugins/org.jboss.tools.common.kb/schemas/tld/Richfaces3_3.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.kb/schemas/tld/Richfaces3_3.xml 2009-06-23 06:07:33 UTC (rev 16127)
+++ trunk/common/plugins/org.jboss.tools.common.kb/schemas/tld/Richfaces3_3.xml 2009-06-23 07:51:27 UTC (rev 16128)
@@ -15257,6 +15257,11 @@
<proposal type="beanProperty"/>
<proposal type="bundleProperty"/>
<proposal type="jsfVariables"/>
+ <proposal type="enumeration">
+ <param value="body"/>
+ <param value="form"/>
+ <param value="parent"/>
+ </proposal>
</attribute-type>
<attribute type="domElementAttachment"/>
<attribute-type name="trimOverlayedElements" required="false">
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/Richfaces.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/Richfaces.xml 2009-06-23 06:07:33 UTC (rev 16127)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/Richfaces.xml 2009-06-23 07:51:27 UTC (rev 16128)
@@ -558,6 +558,13 @@
<param value="false" />
</proposal>
</attribute>
+ <attribute name="domElementAttachment">
+ <proposal type="enumeration">
+ <param value="body"/>
+ <param value="form"/>
+ <param value="parent"/>
+ </proposal>
+ </attribute>
</component>
<component name="orderingList">
<attribute name="showButtonLabels">
16 years, 10 months
JBoss Tools SVN: r16127 - trunk/as/features/org.jboss.ide.eclipse.as.feature.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-06-23 02:07:33 -0400 (Tue, 23 Jun 2009)
New Revision: 16127
Modified:
trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml
Log:
JBIDE-4519
Modified: trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml
===================================================================
--- trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml 2009-06-23 05:33:05 UTC (rev 16126)
+++ trunk/as/features/org.jboss.ide.eclipse.as.feature/feature.xml 2009-06-23 06:07:33 UTC (rev 16127)
@@ -417,7 +417,7 @@
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
</license>
-
+
<url>
<update label="%updateSiteName" url="http://download.jboss.org/jbosstools/updates/stable"/>
</url>
@@ -518,4 +518,18 @@
install-size="0"
version="0.0.0"/>
+ <plugin
+ id="org.jboss.ide.eclipse.as.wtp.override.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.ide.eclipse.as.wtp.override.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
16 years, 10 months
JBoss Tools SVN: r16126 - trunk/bpel/plugins.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-23 01:33:05 -0400 (Tue, 23 Jun 2009)
New Revision: 16126
Removed:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/
trunk/bpel/plugins/org.eclipse.bpel.common.model/
trunk/bpel/plugins/org.eclipse.bpel.common.ui/
trunk/bpel/plugins/org.eclipse.bpel.model/
trunk/bpel/plugins/org.eclipse.bpel.runtimes/
trunk/bpel/plugins/org.eclipse.bpel.ui/
trunk/bpel/plugins/org.eclipse.bpel.validator/
trunk/bpel/plugins/org.eclipse.bpel.wsil.model/
trunk/bpel/plugins/org.eclipse.bpel.xpath10/
Log:
delete these plugins
16 years, 10 months
JBoss Tools SVN: r16125 - in trunk/bpel/plugins: org.eclipse.bpel.apache.ode.deploy.ui/src and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-23 01:28:41 -0400 (Tue, 23 Jun 2009)
New Revision: 16125
Removed:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.model/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/
trunk/bpel/plugins/org.eclipse.bpel.common.model/src/model/
trunk/bpel/plugins/org.eclipse.bpel.common.model/src/org/
trunk/bpel/plugins/org.eclipse.bpel.common.ui/src/org/
trunk/bpel/plugins/org.eclipse.bpel.model/src/model/
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/
trunk/bpel/plugins/org.eclipse.bpel.runtimes/src/org/
trunk/bpel/plugins/org.eclipse.bpel.ui/src/bpelexpression.properties
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/
trunk/bpel/plugins/org.eclipse.bpel.wsil.model/src/org/
trunk/bpel/plugins/org.eclipse.bpel.xpath10/src/org/
Log:
remove these plugins
Deleted: trunk/bpel/plugins/org.eclipse.bpel.ui/src/bpelexpression.properties
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/bpelexpression.properties 2009-06-22 17:12:39 UTC (rev 16124)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/bpelexpression.properties 2009-06-23 05:28:41 UTC (rev 16125)
@@ -1,2 +0,0 @@
-# Stub file for text
-ContentAssistProposal.defaulttext=Default Text
16 years, 10 months
JBoss Tools SVN: r16124 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-22 13:12:39 -0400 (Mon, 22 Jun 2009)
New Revision: 16124
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
AbstractELCompletionEngine
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java 2009-06-22 17:11:56 UTC (rev 16123)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java 2009-06-22 17:12:39 UTC (rev 16124)
@@ -12,48 +12,29 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.el.core.model.ELArgumentInvocation;
-import org.jboss.tools.common.el.core.model.ELExpression;
-import org.jboss.tools.common.el.core.model.ELInstance;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.model.ELMethodInvocation;
-import org.jboss.tools.common.el.core.model.ELModel;
-import org.jboss.tools.common.el.core.model.ELObjectType;
-import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
-import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
-import org.jboss.tools.common.el.core.parser.LexicalToken;
import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.el.core.resolver.ELOperandResolveStatus;
import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
-import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.model.pv.JSFPromptingProvider;
-import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.AbstractELCompletionEngine;
/**
* Utility class used to collect info for EL
*
* @author Viacheslav Kabanovich
*/
-public class JSFELCompletionEngine implements ELResolver, ELCompletionEngine {
+public class JSFELCompletionEngine extends AbstractELCompletionEngine<JSFELCompletionEngine.IJSFVariable> implements ELResolver, ELCompletionEngine {
private static final Image JSF_EL_PROPOSAL_IMAGE = JSFModelPlugin.getDefault().getImage(JSFModelPlugin.CA_JSF_EL_IMAGE_PATH);
public Image getELProposalImage() {
@@ -62,568 +43,25 @@
private static ELParserFactory factory = ELParserUtil.getDefaultFactory();
- //copied
- public List<TextProposal> getCompletions(String elString,
- boolean returnEqualedVariablesOnly, int position, ELContext context) {
- IDocument document = null;
- if(context instanceof IPageContext) {
- IPageContext pageContext = (IPageContext)context;
- document = pageContext.getDocument();
- }
- List<Var> vars = new ArrayList<Var>();
- Var[] array = context.getVars();
- for (int i = 0; i < array.length; i++) {
- vars.add(array[i]);
- }
- List<TextProposal> proposals = null;
- try {
- proposals = getCompletions(context.getResource(), document, elString.subSequence(0, elString.length()), position, returnEqualedVariablesOnly, vars);
- } catch (StringIndexOutOfBoundsException e) {
- JSFModelPlugin.getPluginLog().logError(e);
- } catch (BadLocationException e) {
- JSFModelPlugin.getPluginLog().logError(e);
- }
- return proposals;
- }
+ public JSFELCompletionEngine() {}
- //copied
- public List<TextProposal> getCompletions(IFile file, IDocument document, CharSequence prefix,
- int position, boolean returnEqualedVariablesOnly, List<Var> vars) throws BadLocationException, StringIndexOutOfBoundsException {
- List<TextProposal> completions = new ArrayList<TextProposal>();
-
- ELOperandResolveStatus status = resolveELOperand(file, parseOperand("" + prefix), returnEqualedVariablesOnly, vars, new ElVarSearcher(file, this));
- if (status.isOK()) {
- completions.addAll(status.getProposals());
- }
-
- return completions;
+ protected void log(Exception e) {
+ JSFModelPlugin.getPluginLog().logError(e);
}
- //copied
- public ELExpression parseOperand(String operand) {
- if(operand == null) return null;
- String el = (operand.indexOf("#{") < 0 && operand.indexOf("${") < 0) ? "#{" + operand + "}" : operand;
- ELParser p = factory.createParser();
- ELModel model = p.parse(el);
- List<ELInstance> is = model.getInstances();
- if(is.isEmpty()) return null;
- return is.get(0).getExpression();
- }
-
- public ELOperandResolveStatus resolveELOperand(ELExpression operand,
- ELContext context, boolean returnEqualedVariablesOnly) {
- return null;
- }
-
public ELParserFactory getParserFactory() {
return factory;
}
- //copied
- private static final String collectionAdditionForCollectionDataModel = ".iterator().next()";
- private static final String collectionAdditionForMapDataModel = ".entrySet().iterator().next()";
+ protected ELOperandResolveStatus newELOperandResolveStatus(ELInvocationExpression tokens) {
+ return new ELOperandResolveStatus(tokens);
+ }
- //copied
- public ELOperandResolveStatus resolveELOperand(IFile file,
- ELExpression operand, boolean returnEqualedVariablesOnly,
- List<Var> vars, ElVarSearcher varSearcher)
- throws BadLocationException, StringIndexOutOfBoundsException {
- if(operand == null) {
- //TODO
- return new ELOperandResolveStatus(null);
- }
- String oldEl = operand.getText();
- Var var = varSearcher.findVarForEl(oldEl, vars, true);
- String suffix = "";
- String newEl = oldEl;
- TypeInfoCollector.MemberInfo member = null;
- boolean isArray = false;
- if(var!=null) {
- member = resolveJSFEL(file, var.getElToken(), true);
- if(member!=null) {
- if(!member.getType().isArray()) {
- IType type = member.getMemberType();
- if(type!=null) {
- try {
- if(TypeInfoCollector.isInstanceofType(type, "java.util.Map")) {
- suffix = collectionAdditionForMapDataModel;
- } else if(TypeInfoCollector.isInstanceofType(type, "java.util.Collection")) {
- suffix = collectionAdditionForCollectionDataModel;
- }
- } catch (JavaModelException e) {
- JSFModelPlugin.getPluginLog().logError(e);
- }
- }
- } else {
- isArray = true;
- }
- }
- if(var.getElToken() != null) {
- newEl = var.getElToken().getText() + suffix + oldEl.substring(var.getName().length());
- }
- }
- boolean prefixWasChanged = !oldEl.equals(newEl);
- if(prefixWasChanged && isArray) {
- member.setDataModel(true);
- }
- ELExpression newOperand = (prefixWasChanged) ? parseOperand(newEl) : operand;
-
- ELOperandResolveStatus status = resolveELOperand(file, newOperand, returnEqualedVariablesOnly, prefixWasChanged);
-
- if(prefixWasChanged) {
- ELInvocationExpression newLastResolvedToken = status.getLastResolvedToken();
- status.setTokens((ELInvocationExpression)operand);
- if(newLastResolvedToken != null) {
- if(status.getUnresolvedTokens() != null
- && status.getUnresolvedTokens().getInvocationStartPosition() - status.getUnresolvedTokens().getStartPosition() < var.getElToken().getLength() + suffix.length()) {
- // Last resolved token is token from "var". Set first token of original EL as last resolved one.
- status.setLastResolvedToken(null);
- } else {
- // Last resolved token is token outside "var" prefix. Correct last resolved token.
- int oldLastResolvedTokenStart = newLastResolvedToken.getInvocationStartPosition() - var.getElToken().getText().length() - suffix.length() + var.getName().length();
- if(newLastResolvedToken.getLeft() == null) {
- //In this case we do not need to take into account difference in length of var and its expression.
- oldLastResolvedTokenStart = newLastResolvedToken.getInvocationStartPosition();
- }
- ELInvocationExpression l = (ELInvocationExpression)operand;
- while(l != null) {
- if(l.getInvocationStartPosition() - l.getStartPosition() <= oldLastResolvedTokenStart) {
- status.setLastResolvedToken(l);
- break;
- }
- l = l.getLeft();
- }
- }
- }
- }
-
- if(prefixWasChanged) {
- var.resolveValue("#{" + var.getElToken().getText() + suffix + "}");
- }
-
- if(!returnEqualedVariablesOnly && vars!=null) {
- List<String> varNameProposals = getVarNameProposals(vars, operand.toString());
- if (varNameProposals != null) {
- for (String varNameProposal : varNameProposals) {
- TextProposal proposal = new TextProposal();
- proposal.setReplacementString(varNameProposal);
- proposal.setImage(getELProposalImage());
- status.getProposals().add(proposal);
- }
- }
- }
- return status;
- }
-
- //copied - JSF
- public TypeInfoCollector.MemberInfo resolveJSFEL(IFile file, ELExpression operand, boolean varIsUsed) throws BadLocationException, StringIndexOutOfBoundsException {
- if(!(operand instanceof ELInvocationExpression)) return null;
- ELOperandResolveStatus status = resolveELOperand(file, operand, true, varIsUsed);
- return status.getMemberOfResolvedOperand();
- }
-
- //copied
- private List<String> getVarNameProposals(List <Var> vars, String prefix) {
- List<String> proposals = new ArrayList<String>();
- for (Var var : vars) {
- if(var.getName().startsWith(prefix)) {
- String proposal = var.getName().substring(prefix.length());
- proposals.add(proposal);
- }
- }
- return proposals;
- }
-
-
-
-
-
- public ELOperandResolveStatus resolveELOperand(IFile file, ELExpression operand,
- boolean returnEqualedVariablesOnly, boolean varIsUsed) throws BadLocationException, StringIndexOutOfBoundsException {
- if(!(operand instanceof ELInvocationExpression) || file == null) {
- return new ELOperandResolveStatus(null);
- }
-
- ELInvocationExpression expr = (ELInvocationExpression)operand;
- boolean isIncomplete = expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION
- && ((ELPropertyInvocation)expr).getName() == null;
- boolean isArgument = expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION;
-
- ELOperandResolveStatus status = new ELOperandResolveStatus(expr);
- ELInvocationExpression left = expr;
-
- List<IJSFVariable> resolvedVariables = new ArrayList<IJSFVariable>();
+ public List<IJSFVariable> resolveVariables(IFile file, ELInvocationExpression expr, boolean isFinal, boolean onlyEqualNames) {
IModelNature project = EclipseResourceUtil.getModelNature(file.getProject());
-
- if (expr.getLeft() != null && isArgument) {
- left = expr.getLeft();
- resolvedVariables = resolveVariables(project, left, false,
- true); // is Final and equal names are because of
- // we have no more to resolve the parts of expression,
- // but we have to resolve arguments of probably a message component
- } else if (expr.getLeft() == null && isIncomplete) {
- resolvedVariables = resolveVariables(project, expr, true,
- returnEqualedVariablesOnly);
- } else {
- while(left != null) {
- List<IJSFVariable>resolvedVars = new ArrayList<IJSFVariable>();
- resolvedVars = resolveVariables(project,
- left, left == expr,
- returnEqualedVariablesOnly);
- if (resolvedVars != null && !resolvedVars.isEmpty()) {
- resolvedVariables = resolvedVars;
- status.setLastResolvedToken(left);
- break;
- }
- left = (ELInvocationExpression)left.getLeft();
- }
- }
-
- // Save all resolved variables. It's useful for incremental validation.
- if(resolvedVariables != null && !resolvedVariables.isEmpty()) {
-// status.setUsedVariables(resolvedVariables);
- }
-
- if (status.getResolvedTokens() == null &&
- !returnEqualedVariablesOnly &&
- expr != null &&
- isIncomplete) {
- // no vars are resolved
- // the tokens are the part of var name ended with a separator (.)
- resolvedVariables = resolveVariables(project, expr, true, returnEqualedVariablesOnly);
- Set<TextProposal> proposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
- for (IJSFVariable var : resolvedVariables) {
- String varName = var.getName();
- if(varName.startsWith(operand.getText())) {
- TextProposal proposal = new TextProposal();
- proposal.setReplacementString(varName.substring(operand.getLength()));
- {
- proposal.setImage(getELProposalImage());
- }
- proposals.add(proposal);
- }
- }
- status.setProposals(proposals);
- return status;
- }
-
- // Here we have a list of vars for some part of expression
- // OK. we'll proceed with members of these vars
- if (status.getResolvedTokens() == status.getTokens()) {
- // First segment is the last one
- Set<TextProposal> proposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
- // In some cases there may be a few references to the same variable name.
- // For example @Factory and @DataModel. We should use @DataModel instead of @Factory
- // method which returns null.
- // See https://jira.jboss.org/jira/browse/JBIDE-3694
- for (IJSFVariable var : resolvedVariables) {
- String varName = var.getName();
- if(operand.getLength()<=varName.length()) {
- TextProposal proposal = new TextProposal();
- proposal.setReplacementString(varName.substring(operand.getLength()));
- {
- proposal.setImage(getELProposalImage());
- }
- proposals.add(proposal);
- } else if(returnEqualedVariablesOnly) {
- TextProposal proposal = new TextProposal();
- proposal.setReplacementString(varName);
- proposal.setImage(getELProposalImage());
- proposals.add(proposal);
- }
- status.setMemberOfResolvedOperand(getMemberInfoByVariable(var, true));
- }
- status.setLastResolvedToken(expr);
- status.setProposals(proposals);
- return status;
- }
-
- // First segment is found - proceed with next tokens
- List<TypeInfoCollector.MemberInfo> members = new ArrayList<TypeInfoCollector.MemberInfo>();
- for (IJSFVariable var : resolvedVariables) {
- TypeInfoCollector.MemberInfo member = getMemberInfoByVariable(var, returnEqualedVariablesOnly);
- if (member != null && !members.contains(member))
- members.add(member);
- }
- //process segments one by one
- if(left != null) while(left != expr) {
- left = (ELInvocationExpression)left.getParent();
- if (left != expr) { // inside expression
- if(left instanceof ELArgumentInvocation) {
- String s = "#{" + left.getLeft().toString() + collectionAdditionForCollectionDataModel + "}";
- ELParser p = factory.createParser();
- ELInvocationExpression expr1 = (ELInvocationExpression)p.parse(s).getInstances().get(0).getExpression();
- members = resolveSegment(expr1.getLeft(), members, status, returnEqualedVariablesOnly, varIsUsed);
- members = resolveSegment(expr1, members, status, returnEqualedVariablesOnly, varIsUsed);
- if(status.getLastResolvedToken() == expr1) {
- status.setLastResolvedToken(left);
- }
- } else {
- members = resolveSegment(left, members, status, returnEqualedVariablesOnly, varIsUsed);
- }
- } else { // Last segment
- resolveLastSegment((ELInvocationExpression)operand, members, status, returnEqualedVariablesOnly, varIsUsed);
- break;
- }
- }
-
- if(status.getProposals().isEmpty() && status.getUnpairedGettersOrSetters()!=null) {
- status.clearUnpairedGettersOrSetters();
- }
- return status;
+ return resolveVariables(project, expr, isFinal, onlyEqualNames);
}
-
-
-
-
-
-
-
-
-
-
-
-//resolving segments
- //copied , removed MessagesInfo case
- private List<TypeInfoCollector.MemberInfo> resolveSegment(ELInvocationExpression expr,
- List<TypeInfoCollector.MemberInfo> members,
- ELOperandResolveStatus status,
- boolean returnEqualedVariablesOnly, boolean varIsUsed) {
- LexicalToken lt = (expr instanceof ELPropertyInvocation)
- ? ((ELPropertyInvocation)expr).getName()
- : (expr instanceof ELMethodInvocation)
- ? ((ELMethodInvocation)expr).getName()
- : null;
- String name = lt != null ? lt.getText() : ""; // token.getText();
- if (expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION) {
- // Find properties for the token
- List<TypeInfoCollector.MemberInfo> newMembers = new ArrayList<TypeInfoCollector.MemberInfo>();
- for (TypeInfoCollector.MemberInfo mbr : members) {
- if (mbr.getMemberType() == null) continue;
- TypeInfoCollector infos = mbr.getTypeCollector(varIsUsed);
- if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
- status.setMapOrCollectionOrBundleAmoungTheTokens();
- }
- List<TypeInfoCollector.MemberInfo> properties = infos.getProperties();
- for (TypeInfoCollector.MemberInfo property : properties) {
- StringBuffer propertyName = new StringBuffer(property.getName());
- if (property instanceof TypeInfoCollector.MethodInfo) { // Setter or getter
- propertyName.delete(0, (propertyName.charAt(0) == 'i' ? 2 : 3));
- propertyName.setCharAt(0, Character.toLowerCase(propertyName.charAt(0)));
- }
- if (name.equals(propertyName.toString())) {
- newMembers.add(property);
- }
- }
- }
- members = newMembers;
- if (members != null && !members.isEmpty())
- status.setLastResolvedToken(expr);
- }
- if (expr.getType() == ELObjectType.EL_METHOD_INVOCATION) {
- // Find methods for the token
- if (name.indexOf('(') != -1) {
- name = name.substring(0, name.indexOf('('));
- }
- List<TypeInfoCollector.MemberInfo> newMembers = new ArrayList<TypeInfoCollector.MemberInfo>();
- for (TypeInfoCollector.MemberInfo mbr : members) {
- if (mbr.getMemberType() == null) continue;
- TypeInfoCollector infos = mbr.getTypeCollector();
- if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
- status.setMapOrCollectionOrBundleAmoungTheTokens();
- }
- List<TypeInfoCollector.MemberInfo> methods = infos.getMethods();
- for (TypeInfoCollector.MemberInfo method : methods) {
- if (name.equals(method.getName())) {
- newMembers.add(method);
- }
- }
- }
- members = newMembers;
- if (members != null && !members.isEmpty())
- status.setLastResolvedToken(expr);
- }
- return members;
- }
-
- private void resolveLastSegment(ELInvocationExpression expr,
- List<TypeInfoCollector.MemberInfo> members,
- ELOperandResolveStatus status,
- boolean returnEqualedVariablesOnly, boolean varIsUsed) {
- Set<TextProposal> kbProposals = new TreeSet<TextProposal>(TextProposal.KB_PROPOSAL_ORDER);
-
- if (expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION && ((ELPropertyInvocation)expr).getName() == null) {
- // return all the methods + properties
- for (TypeInfoCollector.MemberInfo mbr : members) {
- //removed MessagesInfo case
- if (mbr.getMemberType() == null) {
- continue;
- }
- TypeInfoCollector infos = mbr.getTypeCollector(varIsUsed);
- if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
- status.setMapOrCollectionOrBundleAmoungTheTokens();
- }
-
- Set<String> methodPresentations =
- infos.getMethodPresentationStrings();
- if (methodPresentations != null) {
- for (String presentation : methodPresentations) {
- TextProposal proposal = new TextProposal();
- proposal.setReplacementString(presentation);
- proposal.setImage(getELProposalImage());
-
- kbProposals.add(proposal);
- }
- }
- Set<String> propertyPresentations =
- infos.getPropertyPresentationStrings(status.getUnpairedGettersOrSetters());
- if (propertyPresentations != null) {
- for (String presentation : propertyPresentations) {
- TextProposal proposal = new TextProposal();
- proposal.setReplacementString(presentation);
- proposal.setImage(getELProposalImage());
-
- kbProposals.add(proposal);
- }
- }
- }
- } else
- if(expr.getType() != ELObjectType.EL_ARGUMENT_INVOCATION)
- //actually any case
-// if (token.getType() == ELOperandToken.EL_VARIABLE_NAME_TOKEN ||
-// token.getType() == ELOperandToken.EL_PROPERTY_NAME_TOKEN ||
-// token.getType() == ELOperandToken.EL_METHOD_TOKEN)
- {
- // return filtered methods + properties
- Set<TypeInfoCollector.MemberPresentation> proposalsToFilter = new TreeSet<TypeInfoCollector.MemberPresentation>(TypeInfoCollector.MEMBER_PRESENTATION_COMPARATOR);
- for (TypeInfoCollector.MemberInfo mbr : members) {
- //removed MessagesInfo case
- if (mbr.getMemberType() == null) continue;
- TypeInfoCollector infos = mbr.getTypeCollector();
- if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
- status.setMapOrCollectionOrBundleAmoungTheTokens();
- }
- proposalsToFilter.addAll(infos.getMethodPresentations());
- proposalsToFilter.addAll(infos.getPropertyPresentations(status.getUnpairedGettersOrSetters()));
- status.setMemberOfResolvedOperand(mbr);
- }
- for (TypeInfoCollector.MemberPresentation proposal : proposalsToFilter) {
- // We do expect nothing but name for method tokens (No round brackets)
- String filter = expr.getMemberName();
- if(filter == null) filter = "";
- if(returnEqualedVariablesOnly) {
- // This is used for validation.
- if (proposal.getPresentation().equals(filter)) {
- TextProposal kbProposal = new TextProposal();
- kbProposal.setReplacementString(proposal.getPresentation());
-
- //removed MessagesInfo case
- {
- kbProposal.setImage(getELProposalImage());
- }
-
- kbProposals.add(kbProposal);
-
- status.setMemberOfResolvedOperand(proposal.getMember());
- if(status.getUnpairedGettersOrSetters()!=null) {
- TypeInfoCollector.MethodInfo unpirMethod = status.getUnpairedGettersOrSetters().get(filter);
- status.clearUnpairedGettersOrSetters();
- if(unpirMethod!=null) {
- status.getUnpairedGettersOrSetters().put(filter, unpirMethod);
- }
- }
- break;
- }
- } else if (proposal.getPresentation().startsWith(filter)) {
- // This is used for CA.
- TextProposal kbProposal = new TextProposal();
- kbProposal.setReplacementString(proposal.getPresentation().substring(filter.length()));
- kbProposal.setImage(getELProposalImage());
-
- kbProposals.add(kbProposal);
- }
- }
- } else if(expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION) {
- Set<TypeInfoCollector.MemberPresentation> proposalsToFilter = new TreeSet<TypeInfoCollector.MemberPresentation>(TypeInfoCollector.MEMBER_PRESENTATION_COMPARATOR);
- boolean isMessages = false;
- for (TypeInfoCollector.MemberInfo mbr : members) {
- //removed MessagesInfo case
- if (mbr.getMemberType() == null) continue;
- try {
- if(TypeInfoCollector.isInstanceofType(mbr.getMemberType(), "java.util.Map")) {
- status.setMapOrCollectionOrBundleAmoungTheTokens();
- //if map/collection is parameterized, we might return member info for value type.
- return;
- }
- } catch (JavaModelException jme) {
- //ignore
- }
- status.setMemberOfResolvedOperand(mbr);
- }
-
- String filter = expr.getMemberName();
- boolean bSurroundWithQuotes = false;
- if(filter == null) {
- filter = "";
- bSurroundWithQuotes = true;
- } else {
- if((filter.startsWith("'") || filter.startsWith("\""))
- && (filter.endsWith("'") || filter.endsWith("\""))) {
- filter = filter.substring(1, filter.length() - 1);
- } else {
- //Value is set as expression itself, we cannot compute it
- if(isMessages) status.setMapOrCollectionOrBundleAmoungTheTokens();
- return;
- }
- }
-
- for (TypeInfoCollector.MemberPresentation proposal : proposalsToFilter) {
- if(returnEqualedVariablesOnly) {
- // This is used for validation.
- if (proposal.getPresentation().equals(filter)) {
- TextProposal kbProposal = new TextProposal();
- kbProposal.setReplacementString(proposal.getPresentation());
-
- //removed MessagesInfo case
- {
- kbProposal.setImage(getELProposalImage());
- }
-
- kbProposals.add(kbProposal);
-
- status.setMemberOfResolvedOperand(proposal.getMember());
- if(status.getUnpairedGettersOrSetters()!=null) {
- TypeInfoCollector.MethodInfo unpirMethod = status.getUnpairedGettersOrSetters().get(filter);
- status.clearUnpairedGettersOrSetters();
- if(unpirMethod!=null) {
- status.getUnpairedGettersOrSetters().put(filter, unpirMethod);
- }
- }
- break;
- }
- } else if (proposal.getPresentation().startsWith(filter)) {
- // This is used for CA.
- TextProposal kbProposal = new TextProposal();
-
- String replacementString = proposal.getPresentation().substring(filter.length());
- if (bSurroundWithQuotes) {
- replacementString = "'" + replacementString + "']";
- }
-
- kbProposal.setReplacementString(replacementString);
- kbProposal.setImage(getELProposalImage());
-
- kbProposals.add(kbProposal);
- }
- }
- }
- status.setProposals(kbProposals);
- if (status.isOK()){
- status.setLastResolvedToken(expr);
- }
- }
-
public List<IJSFVariable> resolveVariables(IModelNature project, ELInvocationExpression expr, boolean isFinal, boolean onlyEqualNames) {
List<IJSFVariable>resolvedVars = new ArrayList<IJSFVariable>();
@@ -672,13 +110,13 @@
return resolvedVariables;
}
- public static interface IJSFVariable {
+ public static interface IJSFVariable extends IVariable {
public String getName();
public IMember getSourceMember();
}
- TypeInfoCollector.MemberInfo getMemberInfoByVariable(IJSFVariable var, boolean onlyEqualNames) {
- return TypeInfoCollector.createMemberInfo(var.getSourceMember());
+ protected TypeInfoCollector.MemberInfo getMemberInfoByVariable(IJSFVariable var, boolean onlyEqualNames) {
+ return TypeInfoCollector.createMemberInfo(((IJSFVariable)var).getSourceMember());
}
}
16 years, 10 months
JBoss Tools SVN: r16123 - in trunk/seam/tests/org.jboss.tools.seam.core.test: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-22 13:11:56 -0400 (Mon, 22 Jun 2009)
New Revision: 16123
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/.classpath
trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
AbstractELCompletionEngine
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/.classpath
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/.classpath 2009-06-22 17:10:32 UTC (rev 16122)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/.classpath 2009-06-22 17:11:56 UTC (rev 16123)
@@ -1,7 +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="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF 2009-06-22 17:10:32 UTC (rev 16122)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/META-INF/MANIFEST.MF 2009-06-22 17:11:56 UTC (rev 16123)
@@ -13,6 +13,7 @@
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.jboss.tools.common.model,
+ org.jboss.tools.common.el.core,
org.jboss.tools.seam.core,
org.jboss.tools.seam.xml,
org.jboss.tools.common.test,
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java 2009-06-22 17:10:32 UTC (rev 16122)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java 2009-06-22 17:11:56 UTC (rev 16123)
@@ -28,13 +28,13 @@
TestSuite suite = new TestSuite();
suite.setName("All tests for " + PLUGIN_ID);
suite.addTestSuite(ScannerTest.class);
- suite.addTestSuite(SerializationTest.class);
- suite.addTestSuite(SeamBigProjectTest.class);
- suite.addTestSuite(SeamEARTest.class);
- suite.addTestSuite(SeamRuntimeListConverterTest.class);
- suite.addTestSuite(SeamRuntimeManagerTest.class);
- suite.addTest(SeamValidatorsAllTests.suite());
- suite.addTest(SeamRefactoringAllTests.suite());
+// suite.addTestSuite(SerializationTest.class);
+// suite.addTestSuite(SeamBigProjectTest.class);
+// suite.addTestSuite(SeamEARTest.class);
+// suite.addTestSuite(SeamRuntimeListConverterTest.class);
+// suite.addTestSuite(SeamRuntimeManagerTest.class);
+// suite.addTest(SeamValidatorsAllTests.suite());
+// suite.addTest(SeamRefactoringAllTests.suite());
return suite;
}
}
\ No newline at end of file
16 years, 10 months