JBoss Tools SVN: r11812 - in trunk/birt/plugins/org.jboss.tools.birt.core: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-15 13:41:30 -0500 (Sat, 15 Nov 2008)
New Revision: 11812
Added:
trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/Messages.java
trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/messages.properties
Modified:
trunk/birt/plugins/org.jboss.tools.birt.core/META-INF/MANIFEST.MF
trunk/birt/plugins/org.jboss.tools.birt.core/plugin.properties
trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/BirtCoreActivator.java
trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/internal/project/facet/BirtPostInstallListener.java
trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/internal/project/facet/JBossBirtFacetInstallDelegate.java
Log:
JBIDE-3000 Internationalize BIRT component
Modified: trunk/birt/plugins/org.jboss.tools.birt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.core/META-INF/MANIFEST.MF 2008-11-15 18:41:16 UTC (rev 11811)
+++ trunk/birt/plugins/org.jboss.tools.birt.core/META-INF/MANIFEST.MF 2008-11-15 18:41:30 UTC (rev 11812)
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: JBoss BIRT Core
+Bundle-Name: %BundleName
Bundle-SymbolicName: org.jboss.tools.birt.core;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.jboss.tools.birt.core.BirtCoreActivator
-Bundle-Vendor: JBoss, a division of Red Hat
+Bundle-Vendor: %BundleVendor
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Modified: trunk/birt/plugins/org.jboss.tools.birt.core/plugin.properties
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.core/plugin.properties 2008-11-15 18:41:16 UTC (rev 11811)
+++ trunk/birt/plugins/org.jboss.tools.birt.core/plugin.properties 2008-11-15 18:41:30 UTC (rev 11812)
@@ -1,3 +1,6 @@
JBOSS_BIRT_FACET_LABEL=JBoss BIRT Reporting Runtime Component
JBOSS_BIRT_FACET_DESCRIPTION=JBoss BIRT Reporting Runtime Component
JBOSS_BIRT_FACET_TEMPLATE_LABEL=JBoss BIRT Integration Web Project
+
+BundleVendor = JBoss, a division of Red Hat
+BundleName = JBoss BIRT Core
\ No newline at end of file
Modified: trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/BirtCoreActivator.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/BirtCoreActivator.java 2008-11-15 18:41:16 UTC (rev 11811)
+++ trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/BirtCoreActivator.java 2008-11-15 18:41:30 UTC (rev 11812)
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.dialogs.IOverwriteQuery;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
@@ -29,7 +30,7 @@
public class BirtCoreActivator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.birt.core";
+ public static final String PLUGIN_ID = "org.jboss.tools.birt.core"; //$NON-NLS-1$
public static final IOverwriteQuery OVERWRITE_ALL_QUERY = new IOverwriteQuery()
{
@@ -42,11 +43,11 @@
private static BirtCoreActivator plugin;
// The facet id
- public static final String JBOSS_BIRT__FACET_ID = "jboss.birt";
+ public static final String JBOSS_BIRT__FACET_ID = "jboss.birt"; //$NON-NLS-1$
- public static final String BIRT_FACET_ID = "birt.runtime";
+ public static final String BIRT_FACET_ID = "birt.runtime"; //$NON-NLS-1$
- public static final String SEAM_FACET_ID = "jst.seam";
+ public static final String SEAM_FACET_ID = "jst.seam"; //$NON-NLS-1$
/**
@@ -85,12 +86,12 @@
public static void copyPlugin(IProject project,String pluginId, String destination, IProgressMonitor monitor) {
IResource destResource = project.findMember(destination);
if (!destResource.exists()) {
- IStatus status = new Status(IStatus.WARNING,BirtCoreActivator.PLUGIN_ID,"The " + destination + " folder doesn't exist");
+ IStatus status = new Status(IStatus.WARNING,BirtCoreActivator.PLUGIN_ID,NLS.bind(Messages.BirtCoreActivator_The_folder_doesnt_exists, destination));
BirtCoreActivator.getDefault().getLog().log(status);
return;
}
if (destResource.getType() != IResource.FOLDER ) {
- IStatus status = new Status(IStatus.WARNING,BirtCoreActivator.PLUGIN_ID,"The " + destination + " resource is not a folder");
+ IStatus status = new Status(IStatus.WARNING,BirtCoreActivator.PLUGIN_ID,NLS.bind(Messages.BirtCoreActivator_The_resource_is_not_folder, destination));
BirtCoreActivator.getDefault().getLog().log(status);
return;
}
@@ -102,7 +103,7 @@
File file = null;
List<File> filesToImport = new ArrayList<File>();
if (bundleFile.isDirectory()) {
- URL url = bundle.getEntry("/");
+ URL url = bundle.getEntry("/"); //$NON-NLS-1$
String fileName = FileLocator.toFileURL(url).getFile();
file = new File(fileName);
filesToImport.addAll(Arrays.asList(file.listFiles()));
Added: trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/Messages.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/Messages.java (rev 0)
+++ trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/Messages.java 2008-11-15 18:41:30 UTC (rev 11812)
@@ -0,0 +1,19 @@
+package org.jboss.tools.birt.core;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.birt.core.messages"; //$NON-NLS-1$
+ public static String BirtCoreActivator_The_folder_doesnt_exists;
+ public static String BirtCoreActivator_The_resource_is_not_folder;
+ public static String BirtPostInstallListener_Error_while_creating_JBoss_BIRT_artifacts;
+ public static String BirtPostInstallListener_The_config_ini_file_doesnt_exist;
+ public static String BirtPostInstallListener_The_resource_is_not_a_folder;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Modified: trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/internal/project/facet/BirtPostInstallListener.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/internal/project/facet/BirtPostInstallListener.java 2008-11-15 18:41:16 UTC (rev 11811)
+++ trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/internal/project/facet/BirtPostInstallListener.java 2008-11-15 18:41:30 UTC (rev 11812)
@@ -35,6 +35,7 @@
import org.eclipse.jst.javaee.web.ServletMapping;
import org.eclipse.jst.javaee.web.WebApp;
import org.eclipse.jst.javaee.web.WebFactory;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
@@ -45,11 +46,12 @@
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
import org.jboss.tools.birt.core.BirtCoreActivator;
+import org.jboss.tools.birt.core.Messages;
import org.osgi.framework.Bundle;
public class BirtPostInstallListener implements IFacetedProjectListener {
- private static final String JBossBirtCorePluginId = "org.jboss.tools.birt.core";
+ private static final String JBossBirtCorePluginId = "org.jboss.tools.birt.core"; //$NON-NLS-1$
private String configFolder;
public void handleEvent(IFacetedProjectEvent event) {
@@ -83,7 +85,7 @@
configFolder = dataModel
.getStringProperty("IJ2EEFacetInstallDataModelProperties.CONFIG_FOLDER"); //$NON-NLS-1$
if (configFolder == null) {
- String message = BirtWTPMessages.BIRTErrors_wrong_webcontent;
+ String message = ""; //$NON-NLS-1$
Logger.log(Logger.ERROR, message);
return;
}
@@ -93,12 +95,12 @@
}
if (isJBossBirtProject || isBirtProject) {
String configIniString = configFolder
- + "/WEB-INF/platform/configuration/config.ini";
+ + "/WEB-INF/platform/configuration/config.ini"; //$NON-NLS-1$
IProject project = facetedProject.getProject();
IResource configFile = project
.findMember(new Path(configIniString));
if (!configFile.exists()) {
- String message = "The config.ini file doesn't exist";
+ String message = Messages.BirtPostInstallListener_The_config_ini_file_doesnt_exist;
Logger.log(Logger.ERROR, message);
return;
}
@@ -109,13 +111,13 @@
URL url = configFile.getLocation().toFile().toURL();
inputStream = url.openStream();
properties.load(inputStream);
- String bootDelegation = "org.osgi.framework.bootdelegation";
- String loader = "osgi.parentClassloader";
+ String bootDelegation = "org.osgi.framework.bootdelegation"; //$NON-NLS-1$
+ String loader = "osgi.parentClassloader"; //$NON-NLS-1$
properties
.put(
bootDelegation,
- "org.hibernate,org.hibernate.type,org.hibernate.metadata,org.hibernate.ejb, javax.persistence");
- properties.put(loader, "fwk");
+ "org.hibernate,org.hibernate.type,org.hibernate.metadata,org.hibernate.ejb, javax.persistence"); //$NON-NLS-1$
+ properties.put(loader, "fwk"); //$NON-NLS-1$
// FIXME
// String compatibility = "osgi.compatibility.bootdelegation";
// properties.put(compatibility,"false");
@@ -146,29 +148,28 @@
}
if (isBirtProject && !isJBossBirtProject) {
- String platformFolder = configFolder + "/WEB-INF/platform/plugins";
+ String platformFolder = configFolder + "/WEB-INF/platform/plugins"; //$NON-NLS-1$
IProject project = facetedProject.getProject();
IProgressMonitor monitor = new NullProgressMonitor();
- BirtCoreActivator.copyPlugin(project, "org.jboss.tools.birt.oda",
+ BirtCoreActivator.copyPlugin(project, "org.jboss.tools.birt.oda", //$NON-NLS-1$
platformFolder, monitor);
}
if (isSeamProject && (isBirtProject || isJBossBirtProject)) {
IProject project = facetedProject.getProject();
- String libFolder = configFolder + "/WEB-INF/lib";
+ String libFolder = configFolder + "/WEB-INF/lib"; //$NON-NLS-1$
IResource destResource = project.findMember(libFolder);
if (destResource.getType() != IResource.FOLDER) {
IStatus status = new Status(IStatus.WARNING,
- BirtCoreActivator.PLUGIN_ID, "The " + libFolder
- + " resource is not a folder");
+ BirtCoreActivator.PLUGIN_ID, NLS.bind(Messages.BirtPostInstallListener_The_resource_is_not_a_folder,libFolder));
BirtCoreActivator.getDefault().getLog().log(status);
return;
}
IFolder folder = (IFolder) destResource;
Bundle bundle = Platform.getBundle(JBossBirtCorePluginId);
URL entryComponent = bundle
- .getEntry("/resources/jboss-seam-birt.jar");
+ .getEntry("/resources/jboss-seam-birt.jar"); //$NON-NLS-1$
URL entryServlet = bundle
- .getEntry("/resources/jboss-birt-servlet.jar");
+ .getEntry("/resources/jboss-birt-servlet.jar"); //$NON-NLS-1$
try {
copyEntry(entryComponent, folder);
copyEntry(entryServlet, folder);
@@ -176,7 +177,7 @@
} catch (Exception e) {
IStatus status = new Status(IStatus.WARNING,
BirtCoreActivator.PLUGIN_ID,
- "Error while creating JBoss BIRT artifacts", e);
+ Messages.BirtPostInstallListener_Error_while_creating_JBoss_BIRT_artifacts, e);
BirtCoreActivator.getDefault().getLog().log(status);
} finally {
configFolder = null;
@@ -209,8 +210,8 @@
return;
}
WebApp webApp = (WebApp) modelObject;
- String servletClass = "org.jboss.tools.birt.servlet.JBossBirtServlet";
- String servletName = "JBoss BIRT Servlet";
+ String servletClass = "org.jboss.tools.birt.servlet.JBossBirtServlet"; //$NON-NLS-1$
+ String servletName = "JBoss BIRT Servlet"; //$NON-NLS-1$
List servlets = webApp.getServlets();
boolean added = false;
for (Iterator iterator = servlets.iterator(); iterator
@@ -230,7 +231,7 @@
}
String name = servletName;
- String value="/embed";
+ String value="/embed"; //$NON-NLS-1$
List servletMappings = webApp.getServletMappings();
added = false;
for (Iterator iterator = servletMappings.iterator(); iterator.hasNext();) {
Modified: trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/internal/project/facet/JBossBirtFacetInstallDelegate.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/internal/project/facet/JBossBirtFacetInstallDelegate.java 2008-11-15 18:41:16 UTC (rev 11811)
+++ trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/internal/project/facet/JBossBirtFacetInstallDelegate.java 2008-11-15 18:41:30 UTC (rev 11812)
@@ -33,6 +33,7 @@
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.jboss.tools.birt.core.BirtCoreActivator;
+import org.jboss.tools.birt.core.Messages;
import org.osgi.framework.Bundle;
public class JBossBirtFacetInstallDelegate extends BirtFacetInstallDelegate {
@@ -45,8 +46,8 @@
IDataModel masterDataModel = (IDataModel) facetDataModel
.getProperty(FacetInstallDataModelProvider.MASTER_PROJECT_DM);
String configFolder = BirtWizardUtil.getConfigFolder(masterDataModel);
- String platformFolder = configFolder + "/WEB-INF/platform/plugins";
- BirtCoreActivator.copyPlugin(project,"org.jboss.tools.birt.oda",platformFolder,monitor);
+ String platformFolder = configFolder + "/WEB-INF/platform/plugins"; //$NON-NLS-1$
+ BirtCoreActivator.copyPlugin(project,"org.jboss.tools.birt.oda",platformFolder,monitor); //$NON-NLS-1$
//copyPlugin(project,"org.hibernate.eclipse",platformFolder,monitor);
//copyPlugin(project,"org.eclipse.ui.console",platformFolder,monitor);
//copyPlugin(project,"org.eclipse.jface",platformFolder,monitor);
Added: trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/messages.properties
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/messages.properties (rev 0)
+++ trunk/birt/plugins/org.jboss.tools.birt.core/src/org/jboss/tools/birt/core/messages.properties 2008-11-15 18:41:30 UTC (rev 11812)
@@ -0,0 +1,5 @@
+BirtCoreActivator_The_folder_doesnt_exists=The {0} folder doesn''t exist.
+BirtCoreActivator_The_resource_is_not_folder=The {0} resource is not a folder.
+BirtPostInstallListener_Error_while_creating_JBoss_BIRT_artifacts=Error while creating JBoss BIRT artifacts
+BirtPostInstallListener_The_config_ini_file_doesnt_exist=The config.ini file doesn't exist
+BirtPostInstallListener_The_resource_is_not_a_folder=The {0} resource is not a folder
17 years, 5 months
JBoss Tools SVN: r11811 - trunk/birt/features/org.jboss.tools.birt.feature.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-15 13:41:16 -0500 (Sat, 15 Nov 2008)
New Revision: 11811
Added:
trunk/birt/features/org.jboss.tools.birt.feature/license.html
Removed:
trunk/birt/features/org.jboss.tools.birt.feature/feature.properties
Modified:
trunk/birt/features/org.jboss.tools.birt.feature/feature.xml
Log:
JBIDE-3000 Internationalize BIRT component
Deleted: trunk/birt/features/org.jboss.tools.birt.feature/feature.properties
===================================================================
Modified: trunk/birt/features/org.jboss.tools.birt.feature/feature.xml
===================================================================
--- trunk/birt/features/org.jboss.tools.birt.feature/feature.xml 2008-11-15 18:41:05 UTC (rev 11810)
+++ trunk/birt/features/org.jboss.tools.birt.feature/feature.xml 2008-11-15 18:41:16 UTC (rev 11811)
@@ -1,228 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.jboss.tools.birt.feature"
- label="JBoss BIRT Integration"
+ label="%featureName"
version="1.0.0"
- provider-name="JBoss, a division of Red Hat"
+ provider-name="%providerName"
plugin="org.jboss.tools.birt.oda.ui">
- <description url="http://www.example.com/description">
- JBoss BIRT Integration
+ <description>
+ %description
</description>
<copyright>
- Copyright (c) 2008 Red Hat, Inc.
-Distributed under license by Red Hat, Inc. All rights reserved.
-This program is made available under the terms of the
-Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
-Contributors:
-Red Hat, Inc. - initial API and implementation
+ %copyright
</copyright>
- <license url="http://www.eclipse.org/legal/epl-v10.html">
- Eclipse Public License - v 1.0
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
-ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
-DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.
-1. DEFINITIONS
-"Contribution" means:
-a) in the case of the initial Contributor, the initial code and
-documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate
-from and are distributed by that particular Contributor. A Contribution
-'originates' from a Contributor if it was added to the Program
-by such Contributor itself or anyone acting on such Contributor's
-behalf. Contributions do not include additions to the Program
-which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii)
-are not derivative works of the Program.
-"Contributor" means any person or entity that distributes the
-Program.
-"Licensed Patents " mean patent claims licensable by a Contributor
-which are necessarily infringed by the use or sale of its Contribution
-alone or when combined with the Program.
-"Program" means the Contributions distributed in accordance with
-this Agreement.
-"Recipient" means anyone who receives the Program under this
-Agreement, including all Contributors.
-2. GRANT OF RIGHTS
-a) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free copyright
-license to reproduce, prepare derivative works of, publicly display,
-publicly perform, distribute and sublicense the Contribution
-of such Contributor, if any, and such derivative works, in source
-code and object code form.
-b) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free patent
-license under Licensed Patents to make, use, sell, offer to sell,
-import and otherwise transfer the Contribution of such Contributor,
-if any, in source code and object code form. This patent license
-shall apply to the combination of the Contribution and the Program
-if, at the time the Contribution is added by the Contributor,
-such addition of the Contribution causes such combination to
-be covered by the Licensed Patents. The patent license shall
-not apply to any other combinations which include the Contribution.
-No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants
-the licenses to its Contributions set forth herein, no assurances
-are provided by any Contributor that the Program does not infringe
-the patent or other intellectual property rights of any other
-entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement
-of intellectual property rights or otherwise. As a condition
-to exercising the rights and licenses granted hereunder, each
-Recipient hereby assumes sole responsibility to secure any other
-intellectual property rights needed, if any. For example, if
-a third party patent license is required to allow Recipient to
-distribute the Program, it is Recipient's responsibility to acquire
-that license before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient
-copyright rights in its Contribution, if any, to grant the copyright
-license set forth in this Agreement.
-3. REQUIREMENTS
-A Contributor may choose to distribute the Program in object
-code form under its own license agreement, provided that:
-a) it complies with the terms and conditions of this Agreement;
-and
-b) its license agreement:
-i) effectively disclaims on behalf of all Contributors all warranties
-and conditions, express and implied, including warranties or
-conditions of title and non-infringement, and implied warranties
-or conditions of merchantability and fitness for a particular
-purpose;
-ii) effectively excludes on behalf of all Contributors all liability
-for damages, including direct, indirect, special, incidental
-and consequential damages, such as lost profits;
-iii) states that any provisions which differ from this Agreement
-are offered by that Contributor alone and not by any other party;
-and
-iv) states that source code for the Program is available from
-such Contributor, and informs licensees how to obtain it in a
-reasonable manner on or through a medium customarily used for
-software exchange.
-When the Program is made available in source code form:
-a) it must be made available under this Agreement; and
-b) a copy of this Agreement must be included with each copy of
-the Program.
-Contributors may not remove or alter any copyright notices contained
-within the Program.
-Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.
-4. COMMERCIAL DISTRIBUTION
-Commercial distributors of software may accept certain responsibilities
-with respect to end users, business partners and the like. While
-this license is intended to facilitate the commercial use of
-the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create
-potential liability for other Contributors. Therefore, if a Contributor
-includes the Program in a commercial product offering, such Contributor
-("Commercial Contributor") hereby agrees to defend and indemnify
-every other Contributor ("Indemnified Contributor") against any
-losses, damages and costs (collectively "Losses") arising from
-claims, lawsuits and other legal actions brought by a third party
-against the Indemnified Contributor to the extent caused by the
-acts or omissions of such Commercial Contributor in connection
-with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any
-claims or Losses relating to any actual or alleged intellectual
-property infringement. In order to qualify, an Indemnified Contributor
-must: a) promptly notify the Commercial Contributor in writing
-of such claim, and b) allow the Commercial Contributor to control,
-and cooperate with the Commercial Contributor in, the defense
-and any related settlement negotiations. The Indemnified Contributor
-may participate in any such claim at its own expense.
-For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor's responsibility
-alone. Under this section, the Commercial Contributor would have
-to defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any
-other Contributor to pay any damages as a result, the Commercial
-Contributor must pay those damages.
-5. NO WARRANTY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM
-IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
-OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
-ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
-OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and
-distributing the Program and assumes all risks associated with
-its exercise of rights under this Agreement , including but not
-limited to the risks and costs of program errors, compliance
-with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations.
-6. DISCLAIMER OF LIABILITY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
-NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE
-OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGES.
-7. GENERAL
-If any provision of this Agreement is invalid or unenforceable
-under applicable law, it shall not affect the validity or enforceability
-of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be
-reformed to the minimum extent necessary to make such provision
-valid and enforceable.
-If Recipient institutes patent litigation against any entity
-(including a cross-claim or counterclaim in a lawsuit) alleging
-that the Program itself (excluding combinations of the Program
-with other software or hardware) infringes such Recipient's patent(s),
-then such Recipient's rights granted under Section 2(b) shall
-terminate as of the date such litigation is filed.
-All Recipient's rights under this Agreement shall terminate if
-it fails to comply with any of the material terms or conditions
-of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If
-all Recipient's rights under this Agreement terminate, Recipient
-agrees to cease use and distribution of the Program as soon as
-reasonably practicable. However, Recipient's obligations under
-this Agreement and any licenses granted by Recipient relating
-to the Program shall continue and survive.
-Everyone is permitted to copy and distribute copies of this Agreement,
-but in order to avoid inconsistency the Agreement is copyrighted
-and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including
-revisions) of this Agreement from time to time. No one other
-than the Agreement Steward has the right to modify this Agreement.
-The Eclipse Foundation is the initial Agreement Steward. The
-Eclipse Foundation may assign the responsibility to serve as
-the Agreement Steward to a suitable separate entity. Each new
-version of the Agreement will be given a distinguishing version
-number. The Program (including Contributions) may always be distributed
-subject to the version of the Agreement under which it was received.
-In addition, after a new version of the Agreement is published,
-Contributor may elect to distribute the Program (including its
-Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights
-or licenses to the intellectual property of any Contributor under
-this Agreement, whether expressly, by implication, estoppel or
-otherwise. All rights in the Program not expressly granted under
-this Agreement are reserved.
-This Agreement is governed by the laws of the State of New York
-and the intellectual property laws of the United States of America.
-No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose.
-Each party waives its rights to a jury trial in any resulting
-litigation.
+ <license url="%licenseURL">
+ %license
</license>
<url>
- <update label="JBossTools Update Site" url="http://download.jboss.org/jbosstools/updates/stable"/>
+ <update label="%updateSiteName" url="http://download.jboss.org/jbosstools/updates/stable"/>
</url>
-
+
<plugin
id="org.jboss.tools.birt.oda"
download-size="0"
Added: trunk/birt/features/org.jboss.tools.birt.feature/license.html
===================================================================
--- trunk/birt/features/org.jboss.tools.birt.feature/license.html (rev 0)
+++ trunk/birt/features/org.jboss.tools.birt.feature/license.html 2008-11-15 18:41:16 UTC (rev 11811)
@@ -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>
17 years, 5 months
JBoss Tools SVN: r11810 - in trunk/birt/plugins/org.jboss.tools.birt.oda: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-15 13:41:05 -0500 (Sat, 15 Nov 2008)
New Revision: 11810
Added:
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/Messages.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/messages.properties
Modified:
trunk/birt/plugins/org.jboss.tools.birt.oda/META-INF/MANIFEST.MF
trunk/birt/plugins/org.jboss.tools.birt.oda/plugin.properties
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/Activator.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/IOdaFactory.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/AbstractOdaFactory.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ConsoleConfigurationOdaFactory.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/DataTypes.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateConnection.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateDataSetMetaData.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateDriver.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateOdaQuery.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateResultSet.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateResultSetMetaData.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ReflectServerOdaFactory.java
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ServerOdaFactory.java
Log:
JBIDE-3000 Internationalize BIRT component
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/META-INF/MANIFEST.MF
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/META-INF/MANIFEST.MF 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/META-INF/MANIFEST.MF 2008-11-15 18:41:05 UTC (rev 11810)
@@ -5,7 +5,7 @@
Bundle-Version: 1.0.0
Bundle-ClassPath: .
Bundle-Activator: org.jboss.tools.birt.oda.Activator
-Bundle-Vendor: JBoss, a division of Red Hat
+Bundle-Vendor: %BundleVendor
Bundle-Localization: plugin
Export-Package: org.jboss.tools.birt.oda,
org.jboss.tools.birt.oda.impl
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/plugin.properties
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/plugin.properties 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/plugin.properties 2008-11-15 18:41:05 UTC (rev 11810)
@@ -11,3 +11,5 @@
data.source.name=Hibernate Data Source
data.set.name=Hibernate Data Set
connection.profile.name=Hibernate Data Source Connection Profile
+
+BundleVendor = JBoss, a division of Red Hat
\ No newline at end of file
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/Activator.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/Activator.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/Activator.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -19,7 +19,7 @@
public class Activator extends Plugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.birt.oda";
+ public static final String PLUGIN_ID = "org.jboss.tools.birt.oda"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/IOdaFactory.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/IOdaFactory.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/IOdaFactory.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -24,10 +24,10 @@
*/
public interface IOdaFactory {
- public static final String MAX_ROWS = "maxRows";
- public static final String CONFIGURATION = "configuration";
- public static final String JNDI_NAME = "jndiName";
- public static final String ORG_HIBERNATE_ECLIPSE_BUNDLE_ID = "org.hibernate.eclipse";
+ public static final String MAX_ROWS = "maxRows"; //$NON-NLS-1$
+ public static final String CONFIGURATION = "configuration"; //$NON-NLS-1$
+ public static final String JNDI_NAME = "jndiName"; //$NON-NLS-1$
+ public static final String ORG_HIBERNATE_ECLIPSE_BUNDLE_ID = "org.hibernate.eclipse"; //$NON-NLS-1$
void close();
boolean isOpen();
Added: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/Messages.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/Messages.java (rev 0)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/Messages.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -0,0 +1,27 @@
+package org.jboss.tools.birt.oda;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.birt.oda.messages"; //$NON-NLS-1$
+ public static String AbstractOdaFactory_The_type_is_not_valid;
+ public static String ConsoleConfigurationOdaFactory_Invalid_configuration;
+ public static String DataTypes_Invalid_type_name;
+ public static String HibernateConnection_Invalid_AppContext;
+ public static String HibernateDataSetMetaData_Hibernate_Data_Source;
+ public static String HibernateDriver_Non_defined;
+ public static String HibernateResultSet_Cursor_has_not_been_initialized;
+ public static String HibernateResultSet_The_data_type_is_not_valid;
+ public static String HibernateResultSetMetaData_Argument_cannot_be_null;
+ public static String HibernateResultSetMetaData_Invalid_index;
+ public static String ReflectServerOdaFactory_Cannot_create_Hibernate_session_factory;
+ public static String ReflectServerOdaFactory_The_type_is_not_valid;
+ public static String ServerOdaFactory_Cannot_create_Hibernate_session_factory;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/AbstractOdaFactory.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/AbstractOdaFactory.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/AbstractOdaFactory.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -9,6 +9,7 @@
import org.eclipse.datatools.connectivity.oda.IParameterMetaData;
import org.eclipse.datatools.connectivity.oda.IResultSetMetaData;
import org.eclipse.datatools.connectivity.oda.OdaException;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.Query;
@@ -19,6 +20,7 @@
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.type.Type;
import org.jboss.tools.birt.oda.IOdaFactory;
+import org.jboss.tools.birt.oda.Messages;
public abstract class AbstractOdaFactory implements IOdaFactory {
@@ -81,7 +83,7 @@
//throw new OdaException("Data Type is Not Valid");
arColsType.add(DataTypes.UNKNOWN);
arCols.add(props[x]);
- arColClass.add("java.lang.String");
+ arColClass.add("java.lang.String"); //$NON-NLS-1$
}
}
}
@@ -92,9 +94,7 @@
arColsType.add(qryReturnTypes[t].getName());
arCols.add(props[t]);
} else {
- throw new OdaException("'"
- + qryReturnTypes[t].getName()
- + "' is not a valid type.");
+ throw new OdaException(NLS.bind(Messages.AbstractOdaFactory_The_type_is_not_valid,qryReturnTypes[t].getName()));
}
}
@@ -120,11 +120,11 @@
}
private static String[] extractColumns(final String query) {
- int fromPosition = query.toLowerCase().indexOf("from");
- int selectPosition = query.toLowerCase().indexOf("select");
+ int fromPosition = query.toLowerCase().indexOf("from"); //$NON-NLS-1$
+ int selectPosition = query.toLowerCase().indexOf("select"); //$NON-NLS-1$
if (selectPosition >= 0) {
String columns = query.substring(selectPosition + 6, fromPosition);
- StringTokenizer st = new StringTokenizer(columns, ",");
+ StringTokenizer st = new StringTokenizer(columns, ","); //$NON-NLS-1$
List columnList = new ArrayList();
while (st.hasMoreTokens()) {
columnList.add(st.nextToken().trim());
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ConsoleConfigurationOdaFactory.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ConsoleConfigurationOdaFactory.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ConsoleConfigurationOdaFactory.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -13,11 +13,13 @@
import java.util.Properties;
import org.eclipse.datatools.connectivity.oda.OdaException;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.HibernateException;
import org.hibernate.SessionFactory;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.jboss.tools.birt.oda.IOdaFactory;
+import org.jboss.tools.birt.oda.Messages;
/**
*
@@ -59,7 +61,7 @@
throw new OdaException(e.getLocalizedMessage());
}
} else {
- throw new OdaException("Invalid configuration '" + configurationName + "'");
+ throw new OdaException(NLS.bind(Messages.ConsoleConfigurationOdaFactory_Invalid_configuration, configurationName));
}
return sessionFactory;
}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/DataTypes.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/DataTypes.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/DataTypes.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -16,6 +16,8 @@
import java.util.Map;
import org.eclipse.datatools.connectivity.oda.OdaException;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.birt.oda.Messages;
/**
* This class hosts the information of data types that are supported by flat
@@ -25,7 +27,7 @@
public final class DataTypes
{
- public static final String UNKNOWN = "UNKNOWN";
+ public static final String UNKNOWN = "UNKNOWN"; //$NON-NLS-1$
public static final int INT = Types.INTEGER;
public static final int LONG = Types.INTEGER;
public static final int SHORT = Types.INTEGER;
@@ -55,7 +57,7 @@
typeStringIntPair.put( "BIGDECIMAL", new Integer( BIGDECIMAL ) ); //$NON-NLS-1$
typeStringIntPair.put( "BIG_DECIMAL", new Integer( BIGDECIMAL ) ); //$NON-NLS-1$
typeStringIntPair.put( "BIG_INTEGER", new Integer( INT ) ); //$NON-NLS-1$
- typeStringIntPair.put( "NULL", new Integer ( NULL ) );
+ typeStringIntPair.put( "NULL", new Integer ( NULL ) ); //$NON-NLS-1$
typeStringIntPair.put( UNKNOWN, new Integer ( STRING ) );
}
@@ -72,12 +74,12 @@
public static int getType( String typeName ) throws OdaException
{
String name = typeName.trim( ).toUpperCase( );
- while (name.indexOf(".") > 0) {
- name = name.substring(name.indexOf(".")+1);
+ while (name.indexOf(".") > 0) { //$NON-NLS-1$
+ name = name.substring(name.indexOf(".")+1); //$NON-NLS-1$
}
if ( typeStringIntPair.containsKey( name ) )
return ( (Integer) typeStringIntPair.get( name ) ).intValue( );
- throw new OdaException( "Invalid type name : " + typeName);
+ throw new OdaException( NLS.bind(Messages.DataTypes_Invalid_type_name, typeName));
}
/**
@@ -93,8 +95,8 @@
if (valid) {
return true;
}
- while (name.indexOf(".") > 0) {
- name = name.substring(name.indexOf(".")+1);
+ while (name.indexOf(".") > 0) { //$NON-NLS-1$
+ name = name.substring(name.indexOf(".")+1); //$NON-NLS-1$
}
return typeStringIntPair.containsKey( name );
}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateConnection.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateConnection.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateConnection.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -17,6 +17,7 @@
import org.eclipse.datatools.connectivity.oda.IQuery;
import org.eclipse.datatools.connectivity.oda.OdaException;
import org.jboss.tools.birt.oda.IOdaFactory;
+import org.jboss.tools.birt.oda.Messages;
import org.osgi.framework.Bundle;
/**
@@ -51,7 +52,7 @@
*/
public void setAppContext(Object context) throws OdaException {
if (!(context instanceof Map)) {
- throw new OdaException("Invalid AppContext");
+ throw new OdaException(Messages.HibernateConnection_Invalid_AppContext);
}
this.appContext = (Map) context;
}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateDataSetMetaData.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateDataSetMetaData.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateDataSetMetaData.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -13,6 +13,7 @@
import org.eclipse.datatools.connectivity.oda.IDataSetMetaData;
import org.eclipse.datatools.connectivity.oda.IResultSet;
import org.eclipse.datatools.connectivity.oda.OdaException;
+import org.jboss.tools.birt.oda.Messages;
/**
* Implementation class of IDataSetMetaData for an ODA runtime driver.
@@ -65,7 +66,7 @@
*/
public String getDataSourceProductName() throws OdaException
{
- return "Hibernate Data Source";
+ return Messages.HibernateDataSetMetaData_Hibernate_Data_Source;
}
/*
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateDriver.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateDriver.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateDriver.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -15,6 +15,7 @@
import org.eclipse.datatools.connectivity.oda.util.manifest.DataTypeMapping;
import org.eclipse.datatools.connectivity.oda.util.manifest.ExtensionManifest;
import org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer;
+import org.jboss.tools.birt.oda.Messages;
/**
* Implementation class of IDriver for an ODA runtime driver.
@@ -86,7 +87,7 @@
.getDataTypeMapping( nativeDataTypeCode );
if( typeMapping != null )
return typeMapping.getNativeType();
- return "Non-defined";
+ return Messages.HibernateDriver_Non_defined;
}
}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateOdaQuery.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateOdaQuery.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateOdaQuery.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -20,6 +20,7 @@
import org.eclipse.datatools.connectivity.oda.IResultSetMetaData;
import org.eclipse.datatools.connectivity.oda.OdaException;
import org.eclipse.datatools.connectivity.oda.SortSpec;
+import org.jboss.tools.birt.oda.Messages;
/**
* Implementation class of IQuery for an ODA runtime driver.
@@ -150,7 +151,7 @@
private void setParameter(int parameterId,int type,Object value) {
List<Parameter> parameters = parameterMetaData.getParameters();
- String parameterName = "parameter" + parameterId;
+ String parameterName = "parameter" + parameterId; //$NON-NLS-1$
if (parameters.size() < parameterId) {
Parameter parameter = new Parameter(type, parameterName,
value);
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateResultSet.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateResultSet.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateResultSet.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -24,6 +24,8 @@
import org.eclipse.datatools.connectivity.oda.IResultSet;
import org.eclipse.datatools.connectivity.oda.IResultSetMetaData;
import org.eclipse.datatools.connectivity.oda.OdaException;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.birt.oda.Messages;
/**
* Implementation class of IResultSet for an ODA runtime driver.
@@ -37,7 +39,7 @@
private int rowNumber = -1;
private boolean wasNull;
- private static DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
+ private static DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); //$NON-NLS-1$
public HibernateResultSet(HibernateOdaQuery query) throws OdaException {
this.query = query;
@@ -154,7 +156,7 @@
else if (rObj instanceof Short)
result = ((Short) rObj).intValue();
else
- throw new RuntimeException("The " + rObj.getClass() + " data type is not valid.");
+ throw new RuntimeException(NLS.bind(Messages.HibernateResultSet_The_data_type_is_not_valid, rObj.getClass()));
}
return result;
@@ -372,7 +374,7 @@
private void testFetchStarted() throws OdaException {
if (rowNumber < 0)
- throw new OdaException("Cursor has not been initialized");
+ throw new OdaException(Messages.HibernateResultSet_Cursor_has_not_been_initialized);
}
}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateResultSetMetaData.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateResultSetMetaData.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/HibernateResultSetMetaData.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -13,6 +13,8 @@
import org.eclipse.datatools.connectivity.oda.IResultSetMetaData;
import org.eclipse.datatools.connectivity.oda.OdaException;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.birt.oda.Messages;
/**
* Implementation class of IResultSetMetaData for an ODA runtime driver.
@@ -32,7 +34,7 @@
throws OdaException
{
if ( cName == null )
- throw new OdaException( "Argument cannot be null" );
+ throw new OdaException( Messages.HibernateResultSetMetaData_Argument_cannot_be_null );
this.columnName = cName;
this.columnType = cType;
this.columnLabel = cLabel;
@@ -54,8 +56,8 @@
{
assertIndexValid( index );
String name = this.columnName[index - 1].trim( );
- if (name.indexOf(" ") > 0) {
- StringTokenizer tokenizer = new StringTokenizer(name," ");
+ if (name.indexOf(" ") > 0) { //$NON-NLS-1$
+ StringTokenizer tokenizer = new StringTokenizer(name," "); //$NON-NLS-1$
String prettyName = null;
while (tokenizer.hasMoreTokens()) {
prettyName = tokenizer.nextToken();
@@ -151,7 +153,7 @@
private void assertIndexValid( int index ) throws OdaException
{
if ( index > getColumnCount( ) || index < 1 )
- throw new OdaException( "Invalid index " + index );
+ throw new OdaException( NLS.bind(Messages.HibernateResultSetMetaData_Invalid_index, new Integer(index).toString()) );
}
public String getColumnClass( int index ) throws OdaException
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ReflectServerOdaFactory.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ReflectServerOdaFactory.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ReflectServerOdaFactory.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -23,9 +23,11 @@
import org.eclipse.datatools.connectivity.oda.IResultSetMetaData;
import org.eclipse.datatools.connectivity.oda.OdaException;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.SessionFactory;
import org.jboss.tools.birt.oda.Activator;
import org.jboss.tools.birt.oda.IOdaFactory;
+import org.jboss.tools.birt.oda.Messages;
/**
*
@@ -64,14 +66,14 @@
InitialContext ctx = null;
try {
ctx = new InitialContext();
- Object obj = ctx.lookup("java:/" + configurationName);
+ Object obj = ctx.lookup("java:/" + configurationName); //$NON-NLS-1$
sessionFactory = obj;
SessionFactory sf = (SessionFactory) obj;
System.out.println(sf);
} catch (Exception e) {
e.printStackTrace();
throw new OdaException(
- "Cannot create Hibernate session factory");
+ Messages.ReflectServerOdaFactory_Cannot_create_Hibernate_session_factory);
}
}
@@ -91,7 +93,7 @@
return false;
boolean isClosed = true;
try {
- Method method = sessionFactory.getClass().getMethod("isClosed", new Class[0]);
+ Method method = sessionFactory.getClass().getMethod("isClosed", new Class[0]); //$NON-NLS-1$
if (method != null) {
Object closed = method.invoke(sessionFactory, new Object[0]);
isClosed = ((Boolean) closed).booleanValue();
@@ -119,12 +121,12 @@
session = openSession();
Object query = createQuery(session, queryText);
if (maxRows > 0) {
- Method setFirstResult = query.getClass().getMethod("setFirstResult", new Class[] {Integer.TYPE});
+ Method setFirstResult = query.getClass().getMethod("setFirstResult", new Class[] {Integer.TYPE}); //$NON-NLS-1$
setFirstResult.invoke(query, new Object[] {INTZERO});
- Method setMaxResults = query.getClass().getMethod("setMaxResults", new Class[] {Integer.TYPE});
+ Method setMaxResults = query.getClass().getMethod("setMaxResults", new Class[] {Integer.TYPE}); //$NON-NLS-1$
setMaxResults.invoke(query, new Object[] {new Integer(maxRows)});
}
- Method getReturnTypes = query.getClass().getMethod("getReturnTypes", emptyClassArg);
+ Method getReturnTypes = query.getClass().getMethod("getReturnTypes", emptyClassArg); //$NON-NLS-1$
Object returnType = getReturnTypes.invoke(query, emptyObjectArg);
Object[] qryReturnTypes = (Object[]) returnType;
if (checkEntityType(qryReturnTypes)) {
@@ -141,7 +143,7 @@
} else {
arColsType.add(DataTypes.UNKNOWN);
arCols.add(props[x]);
- arColClass.add("java.lang.String");
+ arColClass.add("java.lang.String"); //$NON-NLS-1$
}
}
}
@@ -153,9 +155,7 @@
arColsType.add(typeName);
arCols.add(props[t]);
} else {
- throw new OdaException("'"
- + typeName
- + "' is not a valid type.");
+ throw new OdaException(NLS.bind(Messages.ReflectServerOdaFactory_The_type_is_not_valid, typeName));
}
}
}
@@ -180,7 +180,7 @@
private void closeSession(Object session) {
if (session != null) {
try {
- Method close = session.getClass().getMethod("close", emptyClassArg);
+ Method close = session.getClass().getMethod("close", emptyClassArg); //$NON-NLS-1$
close.invoke(session, emptyObjectArg);
session = null;
} catch (Exception e) {
@@ -191,7 +191,7 @@
private boolean checkEntityType(Object[] qryReturnTypes) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
Object first = qryReturnTypes[0];
- Method isEntityType = first.getClass().getMethod("isEntityType", emptyClassArg);
+ Method isEntityType = first.getClass().getMethod("isEntityType", emptyClassArg); //$NON-NLS-1$
Object ret = isEntityType.invoke(first, emptyObjectArg);
boolean isEntity = ((Boolean)ret).booleanValue();
return qryReturnTypes.length > 0 && isEntity;
@@ -200,7 +200,7 @@
private Object createQuery(Object session, String queryText)
throws NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
- Method createQuery = session.getClass().getMethod("createQuery", new Class[] {String.class});
+ Method createQuery = session.getClass().getMethod("createQuery", new Class[] {String.class}); //$NON-NLS-1$
Object query = createQuery.invoke(session, new Object[] {queryText});
return query;
}
@@ -208,17 +208,17 @@
private Object openSession() throws NoSuchMethodException,
IllegalAccessException, InvocationTargetException {
Object session;
- Method openSession = sessionFactory.getClass().getMethod("openSession", emptyClassArg);
+ Method openSession = sessionFactory.getClass().getMethod("openSession", emptyClassArg); //$NON-NLS-1$
session = openSession.invoke(sessionFactory, emptyObjectArg);
return session;
}
private static String[] extractColumns(final String query) {
- int fromPosition = query.toLowerCase().indexOf("from");
- int selectPosition = query.toLowerCase().indexOf("select");
+ int fromPosition = query.toLowerCase().indexOf("from"); //$NON-NLS-1$
+ int selectPosition = query.toLowerCase().indexOf("select"); //$NON-NLS-1$
if (selectPosition >= 0) {
String columns = query.substring(selectPosition + 6, fromPosition);
- StringTokenizer st = new StringTokenizer(columns, ",");
+ StringTokenizer st = new StringTokenizer(columns, ","); //$NON-NLS-1$
List columnList = new ArrayList();
while (st.hasMoreTokens()) {
columnList.add(st.nextToken().trim());
@@ -230,14 +230,14 @@
}
private String getReturnTypeName(Object returnType) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
- Method getName = returnType.getClass().getMethod("getName", emptyClassArg);
+ Method getName = returnType.getClass().getMethod("getName", emptyClassArg); //$NON-NLS-1$
Object name = getName.invoke(returnType, emptyObjectArg);
return (String) name;
}
private String[] getHibernateProp(String className) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException{
Object classMetadata = getClassMetadata(className);
- Method getPropertyNames = classMetadata.getClass().getMethod("getPropertyNames", emptyClassArg);
+ Method getPropertyNames = classMetadata.getClass().getMethod("getPropertyNames", emptyClassArg); //$NON-NLS-1$
String[] properties = (String[]) getPropertyNames.invoke(classMetadata, emptyObjectArg);
return properties;
}
@@ -245,7 +245,7 @@
private Object getClassMetadata(String className)
throws NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
- Method getClassMetadata = sessionFactory.getClass().getMethod("getClassMetadata", new Class[] {String.class});
+ Method getClassMetadata = sessionFactory.getClass().getMethod("getClassMetadata", new Class[] {String.class}); //$NON-NLS-1$
Object classMetadata = getClassMetadata.invoke(sessionFactory, new Object[] {className});
return classMetadata;
}
@@ -253,7 +253,7 @@
private Object getClassMetadata(Class clazz) throws NoSuchMethodException,
IllegalAccessException, InvocationTargetException {
Method getClassMetadata = sessionFactory.getClass().getMethod(
- "getClassMetadata", new Class[] { Class.class });
+ "getClassMetadata", new Class[] { Class.class }); //$NON-NLS-1$
Object classMetadata = getClassMetadata.invoke(sessionFactory,
new Object[] { clazz });
return classMetadata;
@@ -261,7 +261,7 @@
private String getHibernatePropTypes(String className, String property) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException{
Object classMetadata = getClassMetadata(className);
- Method getPropertyType = classMetadata.getClass().getMethod("getPropertyType", new Class[] {String.class});
+ Method getPropertyType = classMetadata.getClass().getMethod("getPropertyType", new Class[] {String.class}); //$NON-NLS-1$
Object type = getPropertyType.invoke(classMetadata, new Object[] {property});
return getReturnTypeName(type);
}
@@ -275,10 +275,10 @@
try {
session = openSession();
Object q = createQuery(session,queryText);
- Method list = q.getClass().getMethod("list", emptyClassArg);
+ Method list = q.getClass().getMethod("list", emptyClassArg); //$NON-NLS-1$
result = (List) list.invoke(q, emptyObjectArg);
iterator = result.iterator();
- Method getReturnTypes = q.getClass().getMethod("getReturnTypes", emptyClassArg);
+ Method getReturnTypes = q.getClass().getMethod("getReturnTypes", emptyClassArg); //$NON-NLS-1$
this.queryReturnTypes = (Object[]) getReturnTypes.invoke(q, emptyObjectArg);
} catch (Exception e) {
throw new OdaException(e.getLocalizedMessage());
@@ -304,12 +304,12 @@
if (metadata == null) {
metadata = getClassMetadata(obj.getClass());
}
- String className = "org.hibernate.EntityMode";
+ String className = "org.hibernate.EntityMode"; //$NON-NLS-1$
Class pojo = Activator.classForName(className, getClass());
- Field pojoField = pojo.getField("POJO");
+ Field pojoField = pojo.getField("POJO"); //$NON-NLS-1$
Object POJO = pojoField.get(null);
Class[] parameterTypes = new Class[] {Object.class,String.class, POJO.getClass()};
- Method getPropertyValue = metadata.getClass().getMethod("getPropertyValue", parameterTypes);
+ Method getPropertyValue = metadata.getClass().getMethod("getPropertyValue", parameterTypes); //$NON-NLS-1$
Object[] args = new Object[] {obj,getMetaData().getColumnName(rstcol),POJO};
value = getPropertyValue.invoke(metadata, args);
} else {
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ServerOdaFactory.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ServerOdaFactory.java 2008-11-15 18:40:40 UTC (rev 11809)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/ServerOdaFactory.java 2008-11-15 18:41:05 UTC (rev 11810)
@@ -10,6 +10,7 @@
import org.hibernate.SessionFactory;
import org.hibernate.ejb.EntityManagerImpl;
import org.jboss.tools.birt.oda.IOdaFactory;
+import org.jboss.tools.birt.oda.Messages;
public class ServerOdaFactory extends AbstractOdaFactory {
@@ -30,15 +31,15 @@
String jndiName = properties.getProperty(JNDI_NAME);
String configurationName = properties.getProperty(CONFIGURATION);
if (configurationName != null) {
- int index = configurationName.indexOf("-ejb");
+ int index = configurationName.indexOf("-ejb"); //$NON-NLS-1$
if (index > 0) {
configurationName = configurationName.substring(0, index);
}
}
if (jndiName == null || jndiName.length() <= 0) {
- jndiName = "java:/" + configurationName;
+ jndiName = "java:/" + configurationName; //$NON-NLS-1$
}
- String entityFactoryName = "java:/" + configurationName + "EntityManagerFactory";
+ String entityFactoryName = "java:/" + configurationName + "EntityManagerFactory"; //$NON-NLS-1$ //$NON-NLS-2$
if (sessionFactory == null) {
InitialContext ctx = null;
@@ -83,7 +84,7 @@
} catch (Exception e) {
e.printStackTrace();
throw new OdaException(
- "Cannot create Hibernate session factory");
+ Messages.ServerOdaFactory_Cannot_create_Hibernate_session_factory);
}
}
return sessionFactory;
Added: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/messages.properties
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/messages.properties (rev 0)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/messages.properties 2008-11-15 18:41:05 UTC (rev 11810)
@@ -0,0 +1,13 @@
+AbstractOdaFactory_The_type_is_not_valid=''{0}'' is not a valid type.
+ConsoleConfigurationOdaFactory_Invalid_configuration=Invalid configuration ''{0}''.
+DataTypes_Invalid_type_name=Invalid type name \: {0}
+HibernateConnection_Invalid_AppContext=Invalid AppContext
+HibernateDataSetMetaData_Hibernate_Data_Source=Hibernate Data Source
+HibernateDriver_Non_defined=Non-defined
+HibernateResultSet_Cursor_has_not_been_initialized=Cursor has not been initialized.
+HibernateResultSet_The_data_type_is_not_valid=The {0} data type is not valid.
+HibernateResultSetMetaData_Argument_cannot_be_null=Argument cannot be null.
+HibernateResultSetMetaData_Invalid_index=Invalid index {0}.
+ReflectServerOdaFactory_Cannot_create_Hibernate_session_factory=Cannot create Hibernate session factory
+ReflectServerOdaFactory_The_type_is_not_valid=The ''{0}'' is not a valid type.
+ServerOdaFactory_Cannot_create_Hibernate_session_factory=Cannot create Hibernate session factory
17 years, 5 months
JBoss Tools SVN: r11809 - trunk/examples/features/org.jboss.tools.project.examples.feature.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-15 13:40:40 -0500 (Sat, 15 Nov 2008)
New Revision: 11809
Modified:
trunk/examples/features/org.jboss.tools.project.examples.feature/feature.xml
Log:
JBIDE-3000 Internationalize BIRT component
Modified: trunk/examples/features/org.jboss.tools.project.examples.feature/feature.xml
===================================================================
--- trunk/examples/features/org.jboss.tools.project.examples.feature/feature.xml 2008-11-15 18:40:33 UTC (rev 11808)
+++ trunk/examples/features/org.jboss.tools.project.examples.feature/feature.xml 2008-11-15 18:40:40 UTC (rev 11809)
@@ -6,7 +6,7 @@
provider-name="%providerName"
plugin="org.jboss.tools.project.examples">
- <description url="http://www.example.com/description">
+ <description>
%description
</description>
17 years, 5 months
JBoss Tools SVN: r11808 - in trunk/birt/plugins/org.jboss.tools.birt.oda.ui: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-15 13:40:33 -0500 (Sat, 15 Nov 2008)
New Revision: 11808
Added:
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/Messages.java
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/messages.properties
Modified:
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/META-INF/MANIFEST.MF
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/plugin.properties
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/Activator.java
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/HibernateDSDropSource.java
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/HibernateSelectionPageHelper.java
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/TextMenuManager.java
Log:
JBIDE-3000 Internationalize BIRT component
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/META-INF/MANIFEST.MF 2008-11-14 22:10:43 UTC (rev 11807)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/META-INF/MANIFEST.MF 2008-11-15 18:40:33 UTC (rev 11808)
@@ -4,7 +4,7 @@
Bundle-SymbolicName: org.jboss.tools.birt.oda.ui;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.jboss.tools.birt.oda.ui.Activator
-Bundle-Vendor: JBoss, a division of Red Hat
+Bundle-Vendor: %BundleVendor
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/plugin.properties
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/plugin.properties 2008-11-14 22:10:43 UTC (rev 11807)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/plugin.properties 2008-11-15 18:40:33 UTC (rev 11808)
@@ -14,3 +14,5 @@
profile.propertypage.name=Hibernate Data Source Connection Properties
wizard.data.set.window.title=New Hibernate Data Set
wizard.data.set.page.title=Query
+
+BundleVendor = JBoss, a division of Red Hat
\ No newline at end of file
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/Activator.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/Activator.java 2008-11-14 22:10:43 UTC (rev 11807)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/Activator.java 2008-11-15 18:40:33 UTC (rev 11808)
@@ -20,7 +20,7 @@
public class Activator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.birt.oda.ui";
+ public static final String PLUGIN_ID = "org.jboss.tools.birt.oda.ui"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
Added: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/Messages.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/Messages.java (rev 0)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/Messages.java 2008-11-15 18:40:33 UTC (rev 11808)
@@ -0,0 +1,40 @@
+package org.jboss.tools.birt.oda.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.birt.oda.ui.messages"; //$NON-NLS-1$
+ public static String CustomDataSetWizardPage_Avaliable_Items;
+ public static String CustomDataSetWizardPage_Define_the_query_text_for_the_data_set;
+ public static String CustomDataSetWizardPage_Invalid_configuration;
+ public static String CustomDataSetWizardPage_Requires_input_value;
+ public static String CustomDataSetWizardPage_Test_query;
+ public static String CustomDataSetWizardPage_Test_query1;
+ public static String CustomDataSetWizardPage_The_query_is_not_valid;
+ public static String CustomDataSetWizardPage_The_query_is_valid;
+ public static String HibernateSelectionPageHelper_Configuration;
+ public static String HibernateSelectionPageHelper_Configuration_must_not_be_empty;
+ public static String HibernateSelectionPageHelper_Connection_successfull;
+ public static String HibernateSelectionPageHelper_Edit_the_selected_data_source;
+ public static String HibernateSelectionPageHelper_Invalid_configuration;
+ public static String HibernateSelectionPageHelper_JNDI_URL;
+ public static String HibernateSelectionPageHelper_Max_results;
+ public static String HibernateSelectionPageHelper_Test_connection;
+ public static String HibernateSelectionPageHelper_Test_connection1;
+ public static String TextMenuManager_Content_Assist;
+ public static String TextMenuManager_Content_Tip;
+ public static String TextMenuManager_Copy;
+ public static String TextMenuManager_Cut;
+ public static String TextMenuManager_Format_HQL_source;
+ public static String TextMenuManager_Paste;
+ public static String TextMenuManager_Redo;
+ public static String TextMenuManager_Select_all;
+ public static String TextMenuManager_Undo;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java 2008-11-14 22:10:43 UTC (rev 11807)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/CustomDataSetWizardPage.java 2008-11-15 18:40:33 UTC (rev 11808)
@@ -50,6 +50,7 @@
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.KeyEvent;
@@ -94,6 +95,7 @@
import org.jboss.tools.birt.oda.IOdaFactory;
import org.jboss.tools.birt.oda.impl.HibernateDriver;
import org.jboss.tools.birt.oda.ui.Activator;
+import org.jboss.tools.birt.oda.ui.Messages;
/**
* Hibernate data set designer page
@@ -102,7 +104,7 @@
*/
public class CustomDataSetWizardPage extends DataSetWizardPage {
- private static String DEFAULT_MESSAGE = "Define the query text for the data set";
+ private static String DEFAULT_MESSAGE = Messages.CustomDataSetWizardPage_Define_the_query_text_for_the_data_set;
private StyledText styledText;
@@ -323,7 +325,7 @@
SourceViewerConfiguration svc = new HQLSourceViewerConfiguration(editor);
sourceViewer.configure(svc);
testButton = new Button(composite, SWT.NONE);
- testButton.setText("Test query ...");
+ testButton.setText(Messages.CustomDataSetWizardPage_Test_query);
testButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -335,11 +337,11 @@
}
private void testQuery() {
- String title = "Test query";
+ String title = Messages.CustomDataSetWizardPage_Test_query1;
ConsoleConfiguration configuration = getInternalConsoleConfiguration();
if (configuration == null || configuration.getSessionFactory() == null) {
MessageDialog.openConfirm(getShell(), title,
- "Invalid configuration '" + getConfigurationName() + "'.");
+ NLS.bind(Messages.CustomDataSetWizardPage_Invalid_configuration, getConfigurationName()));
}
try {
//session = configuration.getSessionFactory().openSession();
@@ -350,9 +352,9 @@
//q.setMaxResults(1);
//q.list();
MessageDialog.openInformation(getShell(), title,
- "The query is valid.");
+ Messages.CustomDataSetWizardPage_The_query_is_valid);
} catch (Exception e) {
- String message = "The query is not valid.";
+ String message = Messages.CustomDataSetWizardPage_The_query_is_not_valid;
IStatus status = new Status(Status.ERROR, Activator.PLUGIN_ID, e
.getLocalizedMessage(), e);
Activator.getDefault().getLog().log(status);
@@ -372,7 +374,7 @@
for (int i = 0; i < translators.length; i++) {
QueryTranslator translator = translators[i];
if(translator.isManipulationStatement()) {
- str.append(HibernateConsoleMessages.DynamicSQLPreviewView_manipulation_of + i + ":"); //$NON-NLS-1$
+ str.append("Manipulation of" + i + ":"); //$NON-NLS-1$ //$NON-NLS-2$
Iterator iterator = translator.getQuerySpaces().iterator();
while ( iterator.hasNext() ) {
Object qspace = iterator.next();
@@ -438,7 +440,7 @@
composite.setLayoutData(data);
Label dataSourceLabel = new Label(composite, SWT.LEFT);
- dataSourceLabel.setText("Available Items");
+ dataSourceLabel.setText(Messages.CustomDataSetWizardPage_Avaliable_Items);
data = new GridData();
dataSourceLabel.setLayoutData(data);
@@ -506,11 +508,11 @@
private String getInitialQueryString() {
DataSetDesign dataSetDesign = getInitializationDesign();
if (dataSetDesign == null)
- return ""; // nothing to initialize
+ return ""; // nothing to initialize //$NON-NLS-1$
String queryText = dataSetDesign.getQueryText();
if (queryText == null) {
- return "";
+ return ""; //$NON-NLS-1$
}
return queryText;
}
@@ -578,7 +580,7 @@
if (isValid)
setMessage(DEFAULT_MESSAGE);
else
- setMessage("Requires input value.", ERROR);
+ setMessage(Messages.CustomDataSetWizardPage_Requires_input_value, ERROR);
if (testButton != null) {
testButton.setEnabled(isValid);
@@ -731,7 +733,7 @@
ParameterDefinition paramDef = (ParameterDefinition) paramDesign
.getParameterDefinitions().get(0);
if (paramDef != null)
- paramDef.setDefaultScalarValue("dummy default value");
+ paramDef.setDefaultScalarValue("dummy default value"); //$NON-NLS-1$
}
}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/HibernateDSDropSource.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/HibernateDSDropSource.java 2008-11-14 22:10:43 UTC (rev 11807)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/HibernateDSDropSource.java 2008-11-15 18:40:33 UTC (rev 11808)
@@ -78,8 +78,8 @@
}
private String getShortName(String name) {
- while (name.indexOf(".") > -1)
- name = name.substring(name.indexOf(".") + 1);
+ while (name.indexOf(".") > -1) //$NON-NLS-1$
+ name = name.substring(name.indexOf(".") + 1); //$NON-NLS-1$
return name;
}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/HibernateSelectionPageHelper.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/HibernateSelectionPageHelper.java 2008-11-14 22:10:43 UTC (rev 11807)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/HibernateSelectionPageHelper.java 2008-11-15 18:40:33 UTC (rev 11808)
@@ -17,6 +17,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -36,6 +37,7 @@
import org.hibernate.console.KnownConfigurations;
import org.jboss.tools.birt.oda.IOdaFactory;
import org.jboss.tools.birt.oda.ui.Activator;
+import org.jboss.tools.birt.oda.ui.Messages;
/**
* Helper class for Hibernate wizard and property page
@@ -45,7 +47,7 @@
*/
public class HibernateSelectionPageHelper {
- private static final String DEFAULT_MAX_ROWS = "100";
+ private static final String DEFAULT_MAX_ROWS = "100"; //$NON-NLS-1$
private WizardPage wizardPage;
private PreferencePage propertyPage;
private Combo configurationCombo;
@@ -73,7 +75,7 @@
GridData gridData;
Label configurationLabel = new Label(composite, SWT.RIGHT);
- configurationLabel.setText("Configuration:");
+ configurationLabel.setText(Messages.HibernateSelectionPageHelper_Configuration);
configurationCombo = new Combo(composite, SWT.NONE);
gridData = new GridData();
@@ -83,7 +85,7 @@
configurationCombo.setLayoutData(gridData);
Label jndiLabel = new Label(composite, SWT.RIGHT);
- jndiLabel.setText("JNDI URL:");
+ jndiLabel.setText(Messages.HibernateSelectionPageHelper_JNDI_URL);
jndiSessionFactoryName = new Text(composite,SWT.BORDER);
gridData = new GridData();
@@ -101,7 +103,7 @@
configurationCombo.setItems(configurationNames);
Label maxFetchLabel = new Label(composite, SWT.NONE);
- maxFetchLabel.setText("Max results:");
+ maxFetchLabel.setText(Messages.HibernateSelectionPageHelper_Max_results);
maxRows = new Text(composite, SWT.BORDER);
maxRows.setLayoutData(gridData);
@@ -119,7 +121,7 @@
new Label(composite, SWT.NONE);
testButton = new Button(composite, SWT.PUSH);
- testButton.setText("Test Connection...");
+ testButton.setText(Messages.HibernateSelectionPageHelper_Test_connection);
testButton.setLayoutData(new GridData(GridData.CENTER));
testButton.addSelectionListener(new SelectionAdapter() {
@@ -139,11 +141,11 @@
if (jndiName == null || jndiName.length() <= 0) {
String configurationName = configurationCombo.getText();
if (configurationName != null && configurationName.length() > 0) {
- int index = configurationName.indexOf("-ejb");
+ int index = configurationName.indexOf("-ejb"); //$NON-NLS-1$
if (index > 0) {
configurationName = configurationName.substring(0,index);
}
- jndiSessionFactoryName.setText("java:/" + configurationName);
+ jndiSessionFactoryName.setText("java:/" + configurationName); //$NON-NLS-1$
}
}
}
@@ -164,11 +166,11 @@
private void validateData() {
if (configurationCombo.getText().trim().length() > 0) {
- setMessage("Edit the selected data source");
+ setMessage(Messages.HibernateSelectionPageHelper_Edit_the_selected_data_source);
testButton.setEnabled(true);
setPageComplete(true);
} else {
- setMessage("Configuration must not be empty",
+ setMessage(Messages.HibernateSelectionPageHelper_Configuration_must_not_be_empty,
IMessageProvider.ERROR);
testButton.setEnabled(false);
setPageComplete(false);
@@ -198,7 +200,7 @@
ConsoleConfiguration[] configurations = KnownConfigurations
.getInstance().getConfigurations();
ConsoleConfiguration consoleConfiguration = null;
- String title = "Test connection";
+ String title = Messages.HibernateSelectionPageHelper_Test_connection1;
for (int i = 0; i < configurations.length; i++) {
if (configurations[i].getName().equals(configurationName)) {
consoleConfiguration = configurations[i];
@@ -215,7 +217,7 @@
sessionFactory = consoleConfiguration.getSessionFactory();
}
MessageDialog.openInformation(getShell(), title,
- "Connection successfull.");
+ Messages.HibernateSelectionPageHelper_Connection_successfull);
} catch (HibernateException e) {
String message = e.getLocalizedMessage();
IStatus status = new Status(Status.ERROR, Activator.PLUGIN_ID,
@@ -225,7 +227,7 @@
}
} else {
MessageDialog.openConfirm(getShell(), title,
- "Invalid configuration '" + configurationName + "'.");
+ NLS.bind(Messages.HibernateSelectionPageHelper_Invalid_configuration, configurationName));
}
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/TextMenuManager.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/TextMenuManager.java 2008-11-14 22:10:43 UTC (rev 11807)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/impl/TextMenuManager.java 2008-11-15 18:40:33 UTC (rev 11808)
@@ -12,6 +12,7 @@
import org.eclipse.jface.text.TextViewer;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
+import org.jboss.tools.birt.oda.ui.Messages;
/**
@@ -39,17 +40,17 @@
manager.add( separator );
separator = new Separator( "select" );//$NON-NLS-1$
manager.add( separator );
- manager.appendToGroup( "undo", getAction( "undo", viewer, "Undo", ITextOperationTarget.UNDO ) );
- manager.appendToGroup( "undo", getAction( "redo", viewer, "Redo", ITextOperationTarget.REDO ) );
- manager.appendToGroup( "copy", getAction( "cut", viewer, "Cut", ITextOperationTarget.CUT ) );
- manager.appendToGroup( "copy", getAction( "copy", viewer, "Copy", ITextOperationTarget.COPY ) );//$NON-NLS-1$
- manager.appendToGroup( "copy", getAction( "paste", viewer, "Paste", ITextOperationTarget.PASTE ) );//$NON-NLS-1$
- manager.appendToGroup( "select", getAction( "selectall", viewer, "Select all", ITextOperationTarget.SELECT_ALL ) );//$NON-NLS-1$
+ manager.appendToGroup( "undo", getAction( "undo", viewer, Messages.TextMenuManager_Undo, ITextOperationTarget.UNDO ) ); //$NON-NLS-1$ //$NON-NLS-2$
+ manager.appendToGroup( "undo", getAction( "redo", viewer, Messages.TextMenuManager_Redo, ITextOperationTarget.REDO ) ); //$NON-NLS-1$ //$NON-NLS-2$
+ manager.appendToGroup( "copy", getAction( "cut", viewer, Messages.TextMenuManager_Cut, ITextOperationTarget.CUT ) ); //$NON-NLS-1$ //$NON-NLS-2$
+ manager.appendToGroup( "copy", getAction( "copy", viewer, Messages.TextMenuManager_Copy, ITextOperationTarget.COPY ) );//$NON-NLS-1$ //$NON-NLS-2$
+ manager.appendToGroup( "copy", getAction( "paste", viewer, Messages.TextMenuManager_Paste, ITextOperationTarget.PASTE ) );//$NON-NLS-1$ //$NON-NLS-2$
+ manager.appendToGroup( "select", getAction( "selectall", viewer, Messages.TextMenuManager_Select_all, ITextOperationTarget.SELECT_ALL ) );//$NON-NLS-1$ //$NON-NLS-2$
- manager.add( new Separator("hql") );
- manager.appendToGroup( "hql", getAction("contentAssist", viewer, "Content Assist",13));
- manager.appendToGroup( "hql", getAction("contentTip", viewer, "Content Tip",14));
- manager.appendToGroup( "hql", getAction("format", viewer, "Format HQL source",15));
+ manager.add( new Separator("hql") ); //$NON-NLS-1$
+ manager.appendToGroup( "hql", getAction("contentAssist", viewer, Messages.TextMenuManager_Content_Assist,13)); //$NON-NLS-1$ //$NON-NLS-2$
+ manager.appendToGroup( "hql", getAction("contentTip", viewer, Messages.TextMenuManager_Content_Tip,14)); //$NON-NLS-1$ //$NON-NLS-2$
+ manager.appendToGroup( "hql", getAction("format", viewer, Messages.TextMenuManager_Format_HQL_source,15)); //$NON-NLS-1$ //$NON-NLS-2$
manager.addMenuListener( new IMenuListener( ) {
Added: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/messages.properties
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/messages.properties (rev 0)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/src/org/jboss/tools/birt/oda/ui/messages.properties 2008-11-15 18:40:33 UTC (rev 11808)
@@ -0,0 +1,26 @@
+CustomDataSetWizardPage_Avaliable_Items=Available Items
+CustomDataSetWizardPage_Define_the_query_text_for_the_data_set=Define the query text for the data set
+CustomDataSetWizardPage_Invalid_configuration=Invalid configuration ''{0}''.
+CustomDataSetWizardPage_Requires_input_value=Requires input value.
+CustomDataSetWizardPage_Test_query=Test query ...
+CustomDataSetWizardPage_Test_query1=Test query
+CustomDataSetWizardPage_The_query_is_not_valid=The query is not valid.
+CustomDataSetWizardPage_The_query_is_valid=The query is valid.
+HibernateSelectionPageHelper_Configuration=Configuration:
+HibernateSelectionPageHelper_Configuration_must_not_be_empty=Configuration must not be empty
+HibernateSelectionPageHelper_Connection_successfull=Connection successfull.
+HibernateSelectionPageHelper_Edit_the_selected_data_source=Edit the selected data source
+HibernateSelectionPageHelper_Invalid_configuration=Invalid configuration ''{0}''.
+HibernateSelectionPageHelper_JNDI_URL=JNDI URL:
+HibernateSelectionPageHelper_Max_results=Max results:
+HibernateSelectionPageHelper_Test_connection=Test Connection...
+HibernateSelectionPageHelper_Test_connection1=Test connection
+TextMenuManager_Content_Assist=Content Assist
+TextMenuManager_Content_Tip=Content Tip
+TextMenuManager_Copy=Copy
+TextMenuManager_Cut=Cut
+TextMenuManager_Format_HQL_source=Format HQL source
+TextMenuManager_Paste=Paste
+TextMenuManager_Redo=Redo
+TextMenuManager_Select_all=Select all
+TextMenuManager_Undo=Undo
17 years, 5 months
JBoss Tools SVN: r11807 - trunk/examples/features/org.jboss.tools.project.examples.feature.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-14 17:10:43 -0500 (Fri, 14 Nov 2008)
New Revision: 11807
Added:
trunk/examples/features/org.jboss.tools.project.examples.feature/license.html
Modified:
trunk/examples/features/org.jboss.tools.project.examples.feature/build.properties
trunk/examples/features/org.jboss.tools.project.examples.feature/feature.properties
trunk/examples/features/org.jboss.tools.project.examples.feature/feature.xml
Log:
JBIDE-3002 Internationalize project-examples component
Modified: trunk/examples/features/org.jboss.tools.project.examples.feature/build.properties
===================================================================
--- trunk/examples/features/org.jboss.tools.project.examples.feature/build.properties 2008-11-14 22:10:34 UTC (rev 11806)
+++ trunk/examples/features/org.jboss.tools.project.examples.feature/build.properties 2008-11-14 22:10:43 UTC (rev 11807)
@@ -1,2 +1,3 @@
bin.includes = feature.xml,\
- feature.properties
+ feature.properties,\
+ license.html
Modified: trunk/examples/features/org.jboss.tools.project.examples.feature/feature.properties
===================================================================
--- trunk/examples/features/org.jboss.tools.project.examples.feature/feature.properties 2008-11-14 22:10:34 UTC (rev 11806)
+++ trunk/examples/features/org.jboss.tools.project.examples.feature/feature.properties 2008-11-14 22:10:43 UTC (rev 11807)
@@ -0,0 +1,144 @@
+###############################################################################
+# 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=Project Examples
+
+# "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
+
+# "description" property - description of the feature
+description=Project Examples
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2008 JBoss, a division of Red Hat and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors:\n\
+ JBoss, 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
+
+# "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\n\
+March 17, 2005\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public\n\
+License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
+Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse.org CVS\n\
+repository ("Repository") in CVS modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+Features may also include other Features ("Included Features"). Files named\n\
+"feature.xml" may contain a list of the names and version numbers of\n\
+Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, 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 JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Eclipse Update Manager, you must agree to a license ("Feature Update\n\
+License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties". Such Abouts,\n\
+Feature Licenses and Feature Update Licenses contain the terms and\n\
+conditions (or references to such terms and conditions) that govern your\n\
+use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 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\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use,\n\
+and re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+########### end of license property ##########################################
Modified: trunk/examples/features/org.jboss.tools.project.examples.feature/feature.xml
===================================================================
--- trunk/examples/features/org.jboss.tools.project.examples.feature/feature.xml 2008-11-14 22:10:34 UTC (rev 11806)
+++ trunk/examples/features/org.jboss.tools.project.examples.feature/feature.xml 2008-11-14 22:10:43 UTC (rev 11807)
@@ -1,226 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.jboss.tools.project.examples.feature"
- label="Project Examples"
+ label="%featureName"
version="1.0.0"
- provider-name="JBoss, a division of Red Hat"
+ provider-name="%providerName"
plugin="org.jboss.tools.project.examples">
<description url="http://www.example.com/description">
- Project Examples
+ %description
</description>
<copyright>
- Copyright (c) 2008 Red Hat, Inc.
-Distributed under license by Red Hat, Inc. All rights reserved.
-This program is made available under the terms of the
-Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
-Contributors:
-Red Hat, Inc. - initial API and implementation
+ %copyright
</copyright>
- <license url="http://www.eclipse.org/legal/epl-v10.html">
- Eclipse Public License - v 1.0
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
-ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
-DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.
-1. DEFINITIONS
-"Contribution" means:
-a) in the case of the initial Contributor, the initial code and
-documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate
-from and are distributed by that particular Contributor. A Contribution
-'originates' from a Contributor if it was added to the Program
-by such Contributor itself or anyone acting on such Contributor's
-behalf. Contributions do not include additions to the Program
-which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii)
-are not derivative works of the Program.
-"Contributor" means any person or entity that distributes the
-Program.
-"Licensed Patents " mean patent claims licensable by a Contributor
-which are necessarily infringed by the use or sale of its Contribution
-alone or when combined with the Program.
-"Program" means the Contributions distributed in accordance with
-this Agreement.
-"Recipient" means anyone who receives the Program under this
-Agreement, including all Contributors.
-2. GRANT OF RIGHTS
-a) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free copyright
-license to reproduce, prepare derivative works of, publicly display,
-publicly perform, distribute and sublicense the Contribution
-of such Contributor, if any, and such derivative works, in source
-code and object code form.
-b) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free patent
-license under Licensed Patents to make, use, sell, offer to sell,
-import and otherwise transfer the Contribution of such Contributor,
-if any, in source code and object code form. This patent license
-shall apply to the combination of the Contribution and the Program
-if, at the time the Contribution is added by the Contributor,
-such addition of the Contribution causes such combination to
-be covered by the Licensed Patents. The patent license shall
-not apply to any other combinations which include the Contribution.
-No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants
-the licenses to its Contributions set forth herein, no assurances
-are provided by any Contributor that the Program does not infringe
-the patent or other intellectual property rights of any other
-entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement
-of intellectual property rights or otherwise. As a condition
-to exercising the rights and licenses granted hereunder, each
-Recipient hereby assumes sole responsibility to secure any other
-intellectual property rights needed, if any. For example, if
-a third party patent license is required to allow Recipient to
-distribute the Program, it is Recipient's responsibility to acquire
-that license before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient
-copyright rights in its Contribution, if any, to grant the copyright
-license set forth in this Agreement.
-3. REQUIREMENTS
-A Contributor may choose to distribute the Program in object
-code form under its own license agreement, provided that:
-a) it complies with the terms and conditions of this Agreement;
-and
-b) its license agreement:
-i) effectively disclaims on behalf of all Contributors all warranties
-and conditions, express and implied, including warranties or
-conditions of title and non-infringement, and implied warranties
-or conditions of merchantability and fitness for a particular
-purpose;
-ii) effectively excludes on behalf of all Contributors all liability
-for damages, including direct, indirect, special, incidental
-and consequential damages, such as lost profits;
-iii) states that any provisions which differ from this Agreement
-are offered by that Contributor alone and not by any other party;
-and
-iv) states that source code for the Program is available from
-such Contributor, and informs licensees how to obtain it in a
-reasonable manner on or through a medium customarily used for
-software exchange.
-When the Program is made available in source code form:
-a) it must be made available under this Agreement; and
-b) a copy of this Agreement must be included with each copy of
-the Program.
-Contributors may not remove or alter any copyright notices contained
-within the Program.
-Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.
-4. COMMERCIAL DISTRIBUTION
-Commercial distributors of software may accept certain responsibilities
-with respect to end users, business partners and the like. While
-this license is intended to facilitate the commercial use of
-the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create
-potential liability for other Contributors. Therefore, if a Contributor
-includes the Program in a commercial product offering, such Contributor
-("Commercial Contributor") hereby agrees to defend and indemnify
-every other Contributor ("Indemnified Contributor") against any
-losses, damages and costs (collectively "Losses") arising from
-claims, lawsuits and other legal actions brought by a third party
-against the Indemnified Contributor to the extent caused by the
-acts or omissions of such Commercial Contributor in connection
-with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any
-claims or Losses relating to any actual or alleged intellectual
-property infringement. In order to qualify, an Indemnified Contributor
-must: a) promptly notify the Commercial Contributor in writing
-of such claim, and b) allow the Commercial Contributor to control,
-and cooperate with the Commercial Contributor in, the defense
-and any related settlement negotiations. The Indemnified Contributor
-may participate in any such claim at its own expense.
-For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor's responsibility
-alone. Under this section, the Commercial Contributor would have
-to defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any
-other Contributor to pay any damages as a result, the Commercial
-Contributor must pay those damages.
-5. NO WARRANTY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM
-IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
-OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
-ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
-OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and
-distributing the Program and assumes all risks associated with
-its exercise of rights under this Agreement , including but not
-limited to the risks and costs of program errors, compliance
-with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations.
-6. DISCLAIMER OF LIABILITY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
-NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE
-OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGES.
-7. GENERAL
-If any provision of this Agreement is invalid or unenforceable
-under applicable law, it shall not affect the validity or enforceability
-of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be
-reformed to the minimum extent necessary to make such provision
-valid and enforceable.
-If Recipient institutes patent litigation against any entity
-(including a cross-claim or counterclaim in a lawsuit) alleging
-that the Program itself (excluding combinations of the Program
-with other software or hardware) infringes such Recipient's patent(s),
-then such Recipient's rights granted under Section 2(b) shall
-terminate as of the date such litigation is filed.
-All Recipient's rights under this Agreement shall terminate if
-it fails to comply with any of the material terms or conditions
-of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If
-all Recipient's rights under this Agreement terminate, Recipient
-agrees to cease use and distribution of the Program as soon as
-reasonably practicable. However, Recipient's obligations under
-this Agreement and any licenses granted by Recipient relating
-to the Program shall continue and survive.
-Everyone is permitted to copy and distribute copies of this Agreement,
-but in order to avoid inconsistency the Agreement is copyrighted
-and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including
-revisions) of this Agreement from time to time. No one other
-than the Agreement Steward has the right to modify this Agreement.
-The Eclipse Foundation is the initial Agreement Steward. The
-Eclipse Foundation may assign the responsibility to serve as
-the Agreement Steward to a suitable separate entity. Each new
-version of the Agreement will be given a distinguishing version
-number. The Program (including Contributions) may always be distributed
-subject to the version of the Agreement under which it was received.
-In addition, after a new version of the Agreement is published,
-Contributor may elect to distribute the Program (including its
-Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights
-or licenses to the intellectual property of any Contributor under
-this Agreement, whether expressly, by implication, estoppel or
-otherwise. All rights in the Program not expressly granted under
-this Agreement are reserved.
-This Agreement is governed by the laws of the State of New York
-and the intellectual property laws of the United States of America.
-No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose.
-Each party waives its rights to a jury trial in any resulting
-litigation.
+ <license url="%licenseURL">
+ %license
</license>
<url>
- <update label="JBossTools Update Site" url="http://download.jboss.org/jbosstools/updates/stable"/>
+ <update label="%updateSiteName" url="http://download.jboss.org/jbosstools/updates/stable"/>
</url>
<plugin
Added: trunk/examples/features/org.jboss.tools.project.examples.feature/license.html
===================================================================
--- trunk/examples/features/org.jboss.tools.project.examples.feature/license.html (rev 0)
+++ trunk/examples/features/org.jboss.tools.project.examples.feature/license.html 2008-11-14 22:10:43 UTC (rev 11807)
@@ -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>
17 years, 5 months
JBoss Tools SVN: r11806 - in trunk/examples/plugins/org.jboss.tools.project.examples: META-INF and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-14 17:10:34 -0500 (Fri, 14 Nov 2008)
New Revision: 11806
Added:
trunk/examples/plugins/org.jboss.tools.project.examples/plugin.properties
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF
trunk/examples/plugins/org.jboss.tools.project.examples/build.properties
trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/MarkerDialog.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/MarkerLabelProvider.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer/ECFExamplesTransport.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Category.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
Log:
JBIDE-3002 Internationalize project-examples component
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF 2008-11-14 22:10:34 UTC (rev 11806)
@@ -1,10 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Project Examples
+Bundle-Name: %BundleName
Bundle-SymbolicName: org.jboss.tools.project.examples;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.jboss.tools.project.examples.ProjectExamplesActivator
-Bundle-Vendor: JBoss, a division of Red Hat
+Bundle-Vendor: %BunldeVendor
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
@@ -21,3 +21,4 @@
org.eclipse.wst.validation,
org.eclipse.ui.views
Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/build.properties
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/build.properties 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/build.properties 2008-11-14 22:10:34 UTC (rev 11806)
@@ -4,4 +4,10 @@
.,\
plugin.xml,\
icons/,\
- projectExamples.xml
+ projectExamples.xml,\
+ plugin.properties,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ rhds_wiz.png
Added: trunk/examples/plugins/org.jboss.tools.project.examples/plugin.properties
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/plugin.properties (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/plugin.properties 2008-11-14 22:10:34 UTC (rev 11806)
@@ -0,0 +1,6 @@
+#Properties file for org.jboss.tools.project.examples
+BunldeVendor = JBoss, a division of Red Hat
+BundleName = Project Examples
+JBoss_Tools_category = JBoss Tools
+Project_Examples_wizard = Project Examples
+Project_Examples_command = Project Examples
\ No newline at end of file
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2008-11-14 22:10:34 UTC (rev 11806)
@@ -4,12 +4,12 @@
<extension point="org.eclipse.ui.newWizards">
<category
- name="JBoss Tools"
+ name="%JBoss_Tools_category"
id="org.jboss.ide.eclipse.ui.wizards">
</category>
<wizard
id="org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard"
- name="Project Examples"
+ name="%Project_Examples_wizard"
class="org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard"
category="org.jboss.ide.eclipse.ui.wizards"
icon="icons/examples_wiz.gif">
@@ -18,7 +18,7 @@
<extension
point="org.eclipse.ui.commands">
<command
- name="Project Examples"
+ name="%Project_Examples_command"
id="org.jboss.tools.project.examples">
</command>
</extension>
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -0,0 +1,56 @@
+/*************************************************************************************
+ * 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.
+ ************************************************************************************/
+package org.jboss.tools.project.examples;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.project.examples.messages"; //$NON-NLS-1$
+ public static String Category_Other;
+ public static String ECFExamplesTransport_Downloading;
+ public static String ECFExamplesTransport_Internal_error;
+ public static String ECFExamplesTransport_Internal_Error;
+ public static String ECFExamplesTransport_IO_error;
+ public static String ECFExamplesTransport_Loading;
+ public static String ECFExamplesTransport_of;
+ public static String ECFExamplesTransport_Server_redirected_too_many_times;
+ public static String ECFExamplesTransport_Unexpected_interrupt_while_waiting_on_ECF_transfer;
+ public static String MarkerDialog_Description;
+ public static String MarkerDialog_Finish;
+ public static String MarkerDialog_Markers;
+ public static String MarkerDialog_Quick_Fix;
+ public static String MarkerDialog_Resource;
+ public static String MarkerDialog_Select_a_marker_and_click_the_Quick_Fix_button;
+ public static String MarkerDialog_Type;
+ public static String NewProjectExamplesWizard_Detail;
+ public static String NewProjectExamplesWizard_Downloading;
+ public static String NewProjectExamplesWizard_Error;
+ public static String NewProjectExamplesWizard_Importing;
+ public static String NewProjectExamplesWizard_New_Project_Example;
+ public static String NewProjectExamplesWizard_OverwriteProject;
+ public static String NewProjectExamplesWizard_Question;
+ public static String NewProjectExamplesWizardPage_Description;
+ public static String NewProjectExamplesWizardPage_Import_Project_Example;
+ public static String NewProjectExamplesWizardPage_Project_Example;
+ public static String NewProjectExamplesWizardPage_Project_name;
+ public static String NewProjectExamplesWizardPage_Project_size;
+ public static String NewProjectExamplesWizardPage_Projects;
+ public static String NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog;
+ public static String NewProjectExamplesWizardPage_URL;
+ public static String ProjectExamplesActivator_Waiting;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -34,14 +34,14 @@
public class ProjectExamplesActivator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.project.examples";
+ public static final String PLUGIN_ID = "org.jboss.tools.project.examples"; //$NON-NLS-1$
// The shared instance
private static ProjectExamplesActivator plugin;
private static BundleContext context;
- public static Job waitForBuildAndValidation = new Job("Waiting...") {
+ public static Job waitForBuildAndValidation = new Job(Messages.ProjectExamplesActivator_Waiting) {
@Override
protected IStatus run(IProgressMonitor monitor) {
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/MarkerDialog.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/MarkerDialog.java 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/MarkerDialog.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -66,6 +66,7 @@
import org.eclipse.ui.statushandlers.StatusManager;
import org.eclipse.ui.views.markers.WorkbenchMarkerResolution;
import org.eclipse.ui.views.markers.internal.MarkerMessages;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.dialog.xpl.QuickFixWizard;
import org.jboss.tools.project.examples.model.Project;
@@ -76,7 +77,7 @@
*/
public class MarkerDialog extends TitleAreaDialog {
- private static final String QUICK_FIX = "Quick Fix";
+ private static final String QUICK_FIX = Messages.MarkerDialog_Quick_Fix;
private static final IMarkerResolution[] EMPTY_ARRAY = new IMarkerResolution[0];
private List<Project> projects;
private Image _dlgTitleImage;
@@ -119,13 +120,13 @@
contents.setLayoutData(gd);
contents.setLayout(new GridLayout());
setTitle(QUICK_FIX);
- setMessage("Select a marker and click the Quick Fix button.");
+ setMessage(Messages.MarkerDialog_Select_a_marker_and_click_the_Quick_Fix_button);
getShell().setText(QUICK_FIX);
applyDialogFont(contents);
initializeDialogUnits(area);
Label markersLabel = new Label(contents, SWT.NULL);
- markersLabel.setText("Markers:");
+ markersLabel.setText(Messages.MarkerDialog_Markers);
tableViewer = new TableViewer(contents, SWT.H_SCROLL | SWT.V_SCROLL
| SWT.BORDER | SWT.SINGLE);
Table table = tableViewer.getTable();
@@ -134,7 +135,7 @@
table.setHeaderVisible(true);
table.setLinesVisible(true);
- String[] columnNames = new String[] { "Description", "Resource", "Type" };
+ String[] columnNames = new String[] { Messages.MarkerDialog_Description, Messages.MarkerDialog_Resource, Messages.MarkerDialog_Type };
int[] columnWidths = new int[] { 200, 150, 150 };
for (int i = 0; i < columnNames.length; i++) {
@@ -198,9 +199,9 @@
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
quickFixButton = getButton(IDialogConstants.OK_ID);
- quickFixButton.setText("Quick Fix");
+ quickFixButton.setText(Messages.MarkerDialog_Quick_Fix);
finishButton = getButton(IDialogConstants.CANCEL_ID);
- finishButton.setText("Finish");
+ finishButton.setText(Messages.MarkerDialog_Finish);
quickFixButton.setEnabled(false);
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/MarkerLabelProvider.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/MarkerLabelProvider.java 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/MarkerLabelProvider.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -37,14 +37,14 @@
IMarker marker = (IMarker) element;
switch (columnIndex) {
case 0:
- return marker.getAttribute(IMarker.MESSAGE, "");
+ return marker.getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
case 1:
return marker.getResource().getName();
case 2:
try {
IExtensionPoint extensionPoint = Platform
.getExtensionRegistry().getExtensionPoint(
- "org.eclipse.core.resources.markers");
+ "org.eclipse.core.resources.markers"); //$NON-NLS-1$
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; i++) {
IExtension extension = extensions[i];
@@ -58,7 +58,7 @@
}
return marker.getType();
} catch (CoreException e) {
- return "";
+ return ""; //$NON-NLS-1$
}
}
return null;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer/ECFExamplesTransport.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer/ECFExamplesTransport.java 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/filetransfer/ECFExamplesTransport.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -47,6 +47,7 @@
import org.eclipse.equinox.security.storage.ISecurePreferences;
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
import org.eclipse.equinox.security.storage.StorageException;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.osgi.util.tracker.ServiceTracker;
@@ -62,7 +63,7 @@
*/
private static final int LOGIN_RETRIES = 3;
private static final ProtocolException ERROR_401 = new ProtocolException();
- private static final String SERVER_REDIRECT = "Server redirected too many times";
+ private static final String SERVER_REDIRECT = Messages.ECFExamplesTransport_Server_redirected_too_many_times;
private static ECFExamplesTransport INSTANCE;
private ServiceTracker retrievalFactoryTracker;
@@ -79,7 +80,7 @@
* @param barrier The job will wait until the first entry in the barrier is non-null
*/
WaitJob(String location, Object[] barrier) {
- super("Loading");
+ super(Messages.ECFExamplesTransport_Loading);
this.barrier = barrier;
setSystem(true);
}
@@ -143,7 +144,7 @@
throw new OperationCanceledException();
}
//too many retries, so report as failure
- throw new CoreException(new Status(IStatus.ERROR, ProjectExamplesActivator.PLUGIN_ID, "IO error", null));
+ throw new CoreException(new Status(IStatus.ERROR, ProjectExamplesActivator.PLUGIN_ID, Messages.ECFExamplesTransport_IO_error, null));
}
/**
@@ -196,13 +197,13 @@
}
}
//reached maximum number of retries without success
- return new Status(IStatus.ERROR, ProjectExamplesActivator.PLUGIN_ID, "IO error", null);
+ return new Status(IStatus.ERROR, ProjectExamplesActivator.PLUGIN_ID, Messages.ECFExamplesTransport_IO_error, null);
}
public IStatus performDownload(String name,String toDownload, OutputStream target, IConnectContext context, IProgressMonitor monitor) throws ProtocolException {
IRetrieveFileTransferFactory factory = (IRetrieveFileTransferFactory) retrievalFactoryTracker.getService();
if (factory == null)
- return new Status(IStatus.ERROR, ProjectExamplesActivator.PLUGIN_ID, "IO error");
+ return new Status(IStatus.ERROR, ProjectExamplesActivator.PLUGIN_ID, Messages.ECFExamplesTransport_IO_error);
return transfer(name,factory.newInstance(), toDownload, target, context, monitor);
}
@@ -225,7 +226,7 @@
long fileLength = rse.getSource().getFileLength();
final long totalWork = ((fileLength == -1) ? 100 : fileLength);
int work = (totalWork > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int) totalWork;
- monitor.beginTask("Downloading " + name,work);
+ monitor.beginTask(Messages.ECFExamplesTransport_Downloading + name,work);
oldWorked=0;
}
} catch (IOException e) {
@@ -250,10 +251,10 @@
int worked = (int) Math.round(factor * received);
double downloadRateBytesPerSecond = (received / ((System.currentTimeMillis() + 1 - transferStartTime) / 1000.0));
- String rates = String.format(" (at %s/s)", AbstractRetrieveFileTransfer.toHumanReadableBytes(downloadRateBytesPerSecond));
+ String rates = String.format(" (at %s/s)", AbstractRetrieveFileTransfer.toHumanReadableBytes(downloadRateBytesPerSecond)); //$NON-NLS-1$
String receivedString = AbstractRetrieveFileTransfer.toHumanReadableBytes(received);
String fileLengthString = AbstractRetrieveFileTransfer.toHumanReadableBytes(fileLength);
- monitor.subTask(receivedString + " of " + fileLengthString + rates);
+ monitor.subTask(receivedString + Messages.ECFExamplesTransport_of + fileLengthString + rates);
monitor.worked(worked-oldWorked);
oldWorked=worked;
}
@@ -375,7 +376,7 @@
return null;
return ConnectContextFactory.createUsernamePasswordConnectContext(username, password);
} catch (StorageException e) {
- String msg = "Internal Error";
+ String msg = Messages.ECFExamplesTransport_Internal_Error;
throw new CoreException(new Status(IStatus.ERROR, ProjectExamplesActivator.PLUGIN_ID, msg, e));
}
}
@@ -398,10 +399,10 @@
prefNode.put(IRepository.PROP_PASSWORD, loginDetails.getPassword(), true);
prefNode.flush();
} catch (StorageException e1) {
- String msg = "Internal error";
+ String msg = Messages.ECFExamplesTransport_Internal_error;
throw new CoreException(new Status(IStatus.ERROR, ProjectExamplesActivator.PLUGIN_ID, msg, e1));
} catch (IOException e) {
- String msg = "Internal error";
+ String msg = Messages.ECFExamplesTransport_Internal_error;
throw new CoreException(new Status(IStatus.ERROR, ProjectExamplesActivator.PLUGIN_ID, msg, e));
}
}
@@ -428,7 +429,7 @@
wait.join();
} catch (InterruptedException e) {
if (!logged)
- LogHelper.log(new Status(IStatus.WARNING, ProjectExamplesActivator.PLUGIN_ID, "Unexpected interrupt while waiting on ECF transfer", e));
+ LogHelper.log(new Status(IStatus.WARNING, ProjectExamplesActivator.PLUGIN_ID, Messages.ECFExamplesTransport_Unexpected_interrupt_while_waiting_on_ECF_transfer, e));
}
}
}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties 2008-11-14 22:10:34 UTC (rev 11806)
@@ -0,0 +1,32 @@
+Category_Other=Other
+ECFExamplesTransport_Downloading=Downloading
+ECFExamplesTransport_Internal_error=Internal error
+ECFExamplesTransport_Internal_Error=Internal Error
+ECFExamplesTransport_IO_error=IO error
+ECFExamplesTransport_Loading=Loading
+ECFExamplesTransport_of=\ of
+ECFExamplesTransport_Server_redirected_too_many_times=Server redirected too many times
+ECFExamplesTransport_Unexpected_interrupt_while_waiting_on_ECF_transfer=Unexpected interrupt while waiting on ECF transfer
+MarkerDialog_Description=Description
+MarkerDialog_Finish=Finish
+MarkerDialog_Markers=Markers:
+MarkerDialog_Quick_Fix=Quick Fix
+MarkerDialog_Resource=Resource
+MarkerDialog_Select_a_marker_and_click_the_Quick_Fix_button=Select a marker and click the Quick Fix button.
+MarkerDialog_Type=Type
+NewProjectExamplesWizard_Detail=Detail
+NewProjectExamplesWizard_Downloading=Downloading...
+NewProjectExamplesWizard_Error=Error
+NewProjectExamplesWizard_Importing=Importing...
+NewProjectExamplesWizard_New_Project_Example=New Project Example
+NewProjectExamplesWizard_OverwriteProject=Overwrite project ''{0}''
+NewProjectExamplesWizard_Question=Question
+NewProjectExamplesWizardPage_Description=Description:
+NewProjectExamplesWizardPage_Import_Project_Example=Import Project Example
+NewProjectExamplesWizardPage_Project_Example=Project Example
+NewProjectExamplesWizardPage_Project_name=Project name:
+NewProjectExamplesWizardPage_Project_size=Project size:
+NewProjectExamplesWizardPage_Projects=Projects:
+NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog=Show the Quick Fix dialog
+NewProjectExamplesWizardPage_URL=URL:
+ProjectExamplesActivator_Waiting=Waiting...
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Category.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Category.java 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Category.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -13,6 +13,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.jboss.tools.project.examples.Messages;
+
/**
* @author snjeza
*
@@ -21,7 +23,7 @@
private String name;
private List<Project> projects = new ArrayList<Project>();
- public static Category OTHER = new Category("Other");
+ public static Category OTHER = new Category(Messages.Category_Other);
public Category(String name) {
super();
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -13,6 +13,8 @@
import java.math.BigDecimal;
import java.util.List;
+import org.jboss.tools.project.examples.Messages;
+
/**
* @author snjeza
*
@@ -28,10 +30,10 @@
private List<String> includedProjects;
public Project() {
- name="";
- shortDescription="";
- description="";
- url="";
+ name=""; //$NON-NLS-1$
+ shortDescription=""; //$NON-NLS-1$
+ description=""; //$NON-NLS-1$
+ url=""; //$NON-NLS-1$
setCategory(Category.OTHER);
}
@@ -84,16 +86,16 @@
}
public String getSizeAsText() {
- String sizeString = "";
+ String sizeString = ""; //$NON-NLS-1$
BigDecimal sizeDecimal = new BigDecimal(size);
BigDecimal MB = new BigDecimal(1024*1024);
BigDecimal KB = new BigDecimal(1024);
if (sizeDecimal.compareTo(MB) > 0) {
- sizeString = String.format("%5.2fM", sizeDecimal.divide(MB));
+ sizeString = String.format("%5.2fM", sizeDecimal.divide(MB)); //$NON-NLS-1$
} else if (sizeDecimal.compareTo(KB) > 0) {
- sizeString = String.format("%5.2fK", sizeDecimal.divide(KB));
+ sizeString = String.format("%5.2fK", sizeDecimal.divide(KB)); //$NON-NLS-1$
} else {
- sizeString = String.format("%d", size);
+ sizeString = String.format("%d", size); //$NON-NLS-1$
}
return sizeString;
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -29,6 +29,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.filetransfer.ECFExamplesTransport;
import org.osgi.framework.Bundle;
@@ -43,83 +44,25 @@
*/
public class ProjectUtil {
- private final static String PROJECT_EXAMPLES_XML = "http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/projectExamp...";
- private static final String PROTOCOL_FILE = "file";
+ private final static String PROJECT_EXAMPLES_XML = "http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/projectExamp..."; //$NON-NLS-1$
+ private static final String PROTOCOL_FILE = "file"; //$NON-NLS-1$
private ProjectUtil() {
}
- public static List<Category> getTestProjects() {
- Category seamCategory = new Category("Seam");
- Project project = new Project();
- project.setName("dvdstore");
- project.setShortDescription("Seam DVD Store Example");
- project
- .setDescription("This example demonstrates the use of Seam with jBPM pageflow and business process management. It runs on JBoss AS and Tomcat.");
- project.setSize(10000);
- project
- .setUrl("http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...");
- project.setCategory(seamCategory);
- seamCategory.getProjects().add(project);
-
- Category portletCategory = new Category("Portlet");
-
- project = new Project();
- project.setName("TestJavaPortlet");
- project.setShortDescription("JBoss Java Portlet Example");
- project
- .setDescription("This example demonstrates the use of JBoss Java Portlet. It runs on JBoss Portal 2.7.0");
- project.setSize(10000);
- project
- .setUrl("http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...");
- project.setCategory(portletCategory);
- portletCategory.getProjects().add(project);
-
- project = new Project();
- project.setName("TestJSFPortlet");
- project.setShortDescription("JBoss JSF Portlet Example");
- project
- .setDescription("This example demonstrates the use of JBoss JSF Portlet. It runs on JBoss Portal 2.7.0");
- project.setSize(4000000);
- project
- .setUrl("http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...");
- project.setCategory(portletCategory);
- portletCategory.getProjects().add(project);
-
- project = new Project();
- project.setName("TestSeamPortlet");
- project.setShortDescription("JBoss Seam Portlet Example");
- project
- .setDescription("This example demonstrates the use of JBoss Seam Portlet. It runs on JBoss Portal 2.7.0");
- project.setSize(10000000);
- project
- .setUrl("http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...");
- project.setCategory(portletCategory);
- portletCategory.getProjects().add(project);
-
- Category otherCategory = new Category("Other");
-
- List<Category> list = new ArrayList<Category>();
- list.add(seamCategory);
- list.add(portletCategory);
- list.add(otherCategory);
-
- return list;
- }
-
public static List<Category> getProjects() {
List<Category> list = new ArrayList<Category>();
Category other = Category.OTHER;
try {
// TODO add a progress monitor
- File file = getProjectExamplesFile(getProjectExamplesXml(),"projectExamples", ".xml",null);
+ File file = getProjectExamplesFile(getProjectExamplesXml(),"projectExamples", ".xml",null); //$NON-NLS-1$ //$NON-NLS-2$
if (file.exists() && file.isFile()) {
DocumentBuilderFactory dbf = DocumentBuilderFactory
.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(file);
- NodeList projects = doc.getElementsByTagName("project");
+ NodeList projects = doc.getElementsByTagName("project"); //$NON-NLS-1$
int len = projects.getLength();
for (int i = 0; i < len; i++) {
Node node = projects.item(i);
@@ -134,7 +77,7 @@
if (cNode.getNodeType() == Node.ELEMENT_NODE) {
Element child = (Element) cNode;
String nodeName = child.getNodeName();
- if (nodeName.equals("category")) {
+ if (nodeName.equals("category")) { //$NON-NLS-1$
String value = getContent(child);
boolean found = false;
for (Category cat:list) {
@@ -150,19 +93,19 @@
}
project.setCategory(category);
}
- if (nodeName.equals("name")) {
+ if (nodeName.equals("name")) { //$NON-NLS-1$
project.setName(getContent(child));
}
- if (nodeName.equals("shortDescription")) {
+ if (nodeName.equals("shortDescription")) { //$NON-NLS-1$
project.setShortDescription(getContent(child));
}
- if (nodeName.equals("description")) {
+ if (nodeName.equals("description")) { //$NON-NLS-1$
project.setDescription(getContent(child));
}
- if (nodeName.equals("url")) {
+ if (nodeName.equals("url")) { //$NON-NLS-1$
project.setUrl(getContent(child));
}
- if (nodeName.equals("size")) {
+ if (nodeName.equals("size")) { //$NON-NLS-1$
long size = 0;
try {
size = new Long(getContent(child));
@@ -170,11 +113,11 @@
}
project.setSize(size);
}
- if (nodeName.equals("included-projects")) {
+ if (nodeName.equals("included-projects")) { //$NON-NLS-1$
String includedProjects = getContent(child);
if (includedProjects != null) {
includedProjects = includedProjects.trim();
- StringTokenizer tokenizer = new StringTokenizer(includedProjects,",");
+ StringTokenizer tokenizer = new StringTokenizer(includedProjects,","); //$NON-NLS-1$
List<String> projectList = new ArrayList<String>();
while (tokenizer.hasMoreTokens()) {
projectList.add(tokenizer.nextToken());
@@ -196,7 +139,7 @@
}
private static String getProjectExamplesXml() {
- String projectXML = System.getProperty("org.jboss.tools.project.examples.xml");
+ String projectXML = System.getProperty("org.jboss.tools.project.examples.xml"); //$NON-NLS-1$
if (projectXML != null && projectXML.length() > 0) {
return projectXML;
}
@@ -206,18 +149,10 @@
private static String getContent(Element child) {
String value = child.getTextContent();
if (value == null) {
- value="";
+ value=""; //$NON-NLS-1$
}
return value.trim();
}
-
- private static File getProjectExamplesXmlTest() throws Exception {
- Bundle bundle = Platform.getBundle(ProjectExamplesActivator.PLUGIN_ID);
- URL examplesURL = bundle.getEntry("/projectExamples.xml");
- URL url = FileLocator.resolve(examplesURL);
- File file = new File(FileLocator.toFileURL(url).getFile());
- return file;
- }
public static File getProjectExamplesFile(String urlString,String prefix, String suffix, IProgressMonitor monitor) {
URL url;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -42,6 +42,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.INewWizard;
@@ -52,6 +53,7 @@
import org.eclipse.ui.wizards.datatransfer.IImportStructureProvider;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.dialog.MarkerDialog;
import org.jboss.tools.project.examples.model.Project;
@@ -84,7 +86,7 @@
public NewProjectExamplesWizard() {
super();
- setWindowTitle("New Project Example");
+ setWindowTitle(Messages.NewProjectExamplesWizard_New_Project_Example);
}
@@ -98,7 +100,7 @@
if (page.getSelection() == null || page.getSelection().size() <= 0) {
return false;
}
- workspaceJob = new WorkspaceJob("Downloading...") {
+ workspaceJob = new WorkspaceJob(Messages.NewProjectExamplesWizard_Downloading) {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor)
@@ -114,7 +116,7 @@
String url = project.getUrl();
String name = project.getName();
final File file = ProjectUtil.getProjectExamplesFile(
- url, name, ".zip", monitor);
+ url, name, ".zip", monitor); //$NON-NLS-1$
if (file == null) {
return Status.CANCEL_STATUS;
}
@@ -124,7 +126,7 @@
}
try {
int i = 0;
- setName("Importing...");
+ setName(Messages.NewProjectExamplesWizard_Importing);
for (Project project : projects) {
importProject(project, files.get(i++), monitor);
}
@@ -133,10 +135,10 @@
public void run() {
MessageDialogWithToggle.openError(getShell(),
- "Error", e.getMessage(), "Detail", false,
+ Messages.NewProjectExamplesWizard_Error, e.getMessage(), Messages.NewProjectExamplesWizard_Detail, false,
ProjectExamplesActivator.getDefault()
.getPreferenceStore(),
- "errorDialog");
+ "errorDialog"); //$NON-NLS-1$
}
});
@@ -226,8 +228,8 @@
public void run() {
overwrite = MessageDialog.openQuestion(getShell(),
- "Question", "Overwrite project '"
- + projectName + "'");
+ Messages.NewProjectExamplesWizard_Question, NLS.bind(Messages.NewProjectExamplesWizard_OverwriteProject,
+ projectName));
}
});
@@ -245,7 +247,7 @@
Enumeration<? extends ZipEntry> entries = sourceFile.entries();
ZipEntry entry = null;
List<ZipEntry> filesToImport = new ArrayList<ZipEntry>();
- String prefix = projectName + "/";
+ String prefix = projectName + "/"; //$NON-NLS-1$
while (entries.hasMoreElements()) {
entry = entries.nextElement();
if (entry.getName().startsWith(prefix)) {
@@ -276,8 +278,8 @@
public void run() {
overwrite = MessageDialog.openQuestion(getShell(),
- "Question", "Overwrite project '" + projectName
- + "'");
+ Messages.NewProjectExamplesWizard_Question, NLS.bind(Messages.NewProjectExamplesWizard_OverwriteProject,
+ projectName));
}
});
@@ -308,7 +310,7 @@
protected void initializeDefaultPageImageDescriptor() {
ImageDescriptor desc = ProjectExamplesActivator
.imageDescriptorFromPlugin(ProjectExamplesActivator.PLUGIN_ID,
- "icons/new_wiz.gif");
+ "icons/new_wiz.gif"); //$NON-NLS-1$
setDefaultPageImageDescriptor(desc);
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2008-11-14 21:25:10 UTC (rev 11805)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2008-11-14 22:10:34 UTC (rev 11806)
@@ -31,6 +31,7 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
+import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Category;
import org.jboss.tools.project.examples.model.Project;
@@ -46,10 +47,10 @@
private Button showQuickFixButton;
public NewProjectExamplesWizardPage() {
- super("org.jboss.tools.project.examples");
- setTitle( "Project Example" );
- setDescription( "Import Project Example" );
- setImageDescriptor( ProjectExamplesActivator.imageDescriptorFromPlugin(ProjectExamplesActivator.PLUGIN_ID, "icons/new_wiz.gif"));
+ super("org.jboss.tools.project.examples"); //$NON-NLS-1$
+ setTitle( Messages.NewProjectExamplesWizardPage_Project_Example );
+ setDescription( Messages.NewProjectExamplesWizardPage_Import_Project_Example );
+ setImageDescriptor( ProjectExamplesActivator.imageDescriptorFromPlugin(ProjectExamplesActivator.PLUGIN_ID, "icons/new_wiz.gif")); //$NON-NLS-1$
}
@@ -61,7 +62,7 @@
gd.widthHint= 225;
composite.setLayoutData(gd);
- new Label(composite,SWT.NONE).setText("Projects:");
+ new Label(composite,SWT.NONE).setText(Messages.NewProjectExamplesWizardPage_Projects);
TreeViewer viewer = new TreeViewer(composite,SWT.MULTI);
Tree tree = viewer.getTree();
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -72,7 +73,7 @@
viewer.setInput(ProjectUtil.getProjects());
Label descriptionLabel = new Label(composite,SWT.NULL);
- descriptionLabel.setText("Description:");
+ descriptionLabel.setText(Messages.NewProjectExamplesWizardPage_Description);
final Text text = new Text(composite,SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
gd.heightHint=75;
@@ -84,17 +85,17 @@
internal.setLayoutData(gd);
Label projectNameLabel = new Label(internal,SWT.NULL);
- projectNameLabel.setText("Project name:");
+ projectNameLabel.setText(Messages.NewProjectExamplesWizardPage_Project_name);
final Text projectName = new Text(internal,SWT.BORDER | SWT.READ_ONLY);
projectName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label projectSizeLabel = new Label(internal,SWT.NULL);
- projectSizeLabel.setText("Project size:");
+ projectSizeLabel.setText(Messages.NewProjectExamplesWizardPage_Project_size);
final Text projectSize = new Text(internal,SWT.BORDER | SWT.READ_ONLY);
projectSize.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label projectURLLabel = new Label(internal,SWT.NULL);
- projectURLLabel.setText("URL:");
+ projectURLLabel.setText(Messages.NewProjectExamplesWizardPage_URL);
final Text projectURL = new Text(internal,SWT.BORDER | SWT.READ_ONLY);
projectURL.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -111,10 +112,10 @@
projectSize.setText(selectedProject.getSizeAsText());
} else {
//Project selectedProject=null;
- text.setText("");
- projectName.setText("");
- projectURL.setText("");
- projectSize.setText("");
+ text.setText(""); //$NON-NLS-1$
+ projectName.setText(""); //$NON-NLS-1$
+ projectURL.setText(""); //$NON-NLS-1$
+ projectSize.setText(""); //$NON-NLS-1$
}
boolean canFinish = false;
Iterator iterator = selection.iterator();
@@ -133,7 +134,7 @@
});
showQuickFixButton = new Button(internal,SWT.CHECK);
- showQuickFixButton.setText("Show the Quick Fix dialog");
+ showQuickFixButton.setText(Messages.NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog);
showQuickFixButton.setSelection(true);
gd=new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan=2;
17 years, 5 months
JBoss Tools SVN: r11805 - in workspace/jgraham/plugins: trunk and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: john.graham(a)jboss.org
Date: 2008-11-14 16:25:10 -0500 (Fri, 14 Nov 2008)
New Revision: 11805
Added:
workspace/jgraham/plugins/org.jboss.tools.esb.actionview/
Removed:
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/
Log:
Reset position
Copied: workspace/jgraham/plugins/org.jboss.tools.esb.actionview (from rev 11804, workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview)
17 years, 5 months
JBoss Tools SVN: r11804 - in workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview: .settings and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: john.graham(a)jboss.org
Date: 2008-11-14 16:23:08 -0500 (Fri, 14 Nov 2008)
New Revision: 11804
Added:
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.classpath
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.project
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.settings/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.settings/org.eclipse.jdt.core.prefs
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/META-INF/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/META-INF/MANIFEST.MF
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/build.properties
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/icons/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/icons/action.gif
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/plugin.xml
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/Activator.java
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionContentProvider.java
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionLabelProvider.java
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionPage.java
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionTreeObject.java
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/DefaultPage.java
workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ESBActionView.java
Log:
Initial commit
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.classpath
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.classpath (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.classpath 2008-11-14 21:23:08 UTC (rev 11804)
@@ -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>
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.project
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.project (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.project 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.esb.actionview</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>
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.settings/org.eclipse.jdt.core.prefs 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,7 @@
+#Tue Nov 11 15:23:22 GMT-05:00 2008
+eclipse.preferences.version=1
+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
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/META-INF/MANIFEST.MF
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/META-INF/MANIFEST.MF (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/META-INF/MANIFEST.MF 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ESB Action View Plug-in
+Bundle-SymbolicName: org.jboss.tools.esb.actionview; singleton:=true
+Bundle-Version: 0.0.1.200811141617
+Bundle-Activator: org.jboss.tools.esb.actionview.Activator
+Bundle-Vendor: JBoss, a division of Red Hat
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources;bundle-version="3.4.1",
+ org.eclipse.jdt.core;bundle-version="3.4.2",
+ org.eclipse.jdt.ui;bundle-version="3.4.1",
+ org.eclipse.jface.text;bundle-version="3.4.1"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/build.properties
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/build.properties (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/build.properties 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/icons/action.gif
===================================================================
(Binary files differ)
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/icons/action.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/plugin.xml
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/plugin.xml (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/plugin.xml 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ name="ESB"
+ id="org.jboss.tools.esb.actionview">
+ </category>
+ <view
+ name="ESB Action View"
+ icon="icons/action.gif"
+ category="org.jboss.tools.esb.actionview"
+ class="org.jboss.tools.esb.actionview.views.ESBActionView"
+ id="org.jboss.tools.esb.actionview.views.ESBActionView">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.jdt.ui.JavaPerspective">
+ <view
+ ratio="0.5"
+ relative="org.eclipse.ui.views.TaskList"
+ relationship="right"
+ id="org.jboss.tools.esb.actionview.views.ESBActionView">
+ </view>
+ </perspectiveExtension>
+ </extension>
+
+</plugin>
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/Activator.java
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/Activator.java (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/Activator.java 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2008 JBoss, a division of 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:
+ * JBoss, a division of Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.esb.actionview;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+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.tools.esb.actionview";
+
+ // 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;
+ }
+
+ public IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ public void writeLog(int severity, String msg, Throwable t) {
+ IStatus status = new Status(severity, PLUGIN_ID, msg, t);
+ super.getLog().log(status);
+ }
+}
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/Activator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionContentProvider.java
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionContentProvider.java (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionContentProvider.java 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2008 JBoss, a division of 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:
+ * JBoss, a division of Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.esb.actionview.views;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.core.ITypeHierarchyChangedListener;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.progress.IProgressService;
+import org.jboss.tools.esb.actionview.Activator;
+
+public class ActionContentProvider implements IStructuredContentProvider,
+ ITreeContentProvider {
+
+ private static String ESB_ACTION_IFACE = "org.jboss.soa.esb.actions.ActionLifecycle";
+
+ private Viewer theViewer;
+
+ private boolean isActionType(IType type) {
+ return !"java.lang.Object".equals(type.getFullyQualifiedName());
+ }
+
+ private boolean isVisibleMethod(IMethod method) throws JavaModelException {
+ return Flags.isPublic(method.getFlags());
+ }
+
+ private Object[] initialize(IJavaProject project,
+ IProgressMonitor monitor) throws JavaModelException,
+ InterruptedException {
+ Object[] res = null;
+ try {
+ IType esbActionType = project.findType(ESB_ACTION_IFACE);
+ if (esbActionType != null) {
+ ITypeHierarchy typeHierarchy = esbActionType.newTypeHierarchy(project, null);
+ typeHierarchy.addTypeHierarchyChangedListener(new ITypeHierarchyChangedListener() {
+ public void typeHierarchyChanged(ITypeHierarchy typeHierarchy) {
+ if (theViewer != null) {
+ Display display = PlatformUI.getWorkbench().getDisplay();
+ display.asyncExec(new Runnable() {
+ public void run() {
+ theViewer.refresh();
+ }
+ });
+ }
+ }
+ });
+ IType[] allClasses = typeHierarchy.getAllClasses();
+ monitor.beginTask("Loading", allClasses.length);
+ List<ActionTreeObject> esbActions =
+ new ArrayList<ActionTreeObject>(allClasses.length);
+ Map<String, ActionTreeObject> packages = new HashMap<String, ActionTreeObject>();
+ for (int i = 0; i < allClasses.length; i++) {
+ if (!isActionType(allClasses[i])) {
+ monitor.worked(1);
+ continue;
+ }
+ ActionTreeObject hostPackage = null;
+ if (allClasses[i].getPackageFragment() != null) {
+ String packageName = allClasses[i].getPackageFragment().getElementName();
+ hostPackage = packages.get(packageName);
+ if (hostPackage == null) {
+ hostPackage = new ActionTreeObject(packageName, allClasses[i].getPackageFragment());
+ packages.put(packageName, hostPackage);
+ esbActions.add(hostPackage);
+ }
+ }
+ ActionTreeObject clazz = new ActionTreeObject(allClasses[i].getElementName(), allClasses[i]);
+ addMethods(allClasses[i], clazz);
+ if (hostPackage != null) {
+ hostPackage.addChild(clazz);
+ }
+ monitor.worked(1);
+ if (monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+ }
+ res = new Object[esbActions.size()];
+ esbActions.toArray(res);
+ }
+ } finally {
+ monitor.done();
+ }
+ return res == null?new Object[0]:res;
+ }
+
+ private void addMethods(IType type, ActionTreeObject clazz) throws JavaModelException {
+ IMethod[] methods = type.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ if (isVisibleMethod(methods[i])) {
+ ActionTreeObject m =
+ new ActionTreeObject(methods[i].getElementName(), methods[i]);
+ clazz.addChild(m);
+ }
+ }
+ }
+
+ private class InitializationRunnable implements IRunnableWithProgress {
+ private Object[] results;
+ private IJavaProject project;
+
+ public InitializationRunnable(IJavaProject project) {
+ this.project = project;
+ }
+
+ public void run(IProgressMonitor monitor) throws InvocationTargetException,
+ InterruptedException {
+ try {
+ results = initialize(project, monitor);
+ } catch (JavaModelException e) {
+ Activator.getDefault().writeLog(IStatus.ERROR, e.getMessage(), e);
+ }
+ }
+ public Object[] getResults() {
+ return results;
+ }
+ }
+
+ private Object[] getTreeNodes(Object element) {
+ if (element instanceof IJavaProject) {
+ IProgressService pgService = Activator.getDefault().
+ getWorkbench().getProgressService();
+ InitializationRunnable runnable =
+ new InitializationRunnable((IJavaProject)element);
+ try {
+ pgService.run(true, true, runnable);
+ } catch (InvocationTargetException e) {
+ Activator.getDefault().writeLog(IStatus.ERROR, e.getMessage(), e);
+ } catch (InterruptedException e) {
+ // Loading was cancelled; nothing to log here
+ }
+ return runnable.getResults() != null?runnable.getResults():new Object[0];
+ }
+ if (element instanceof ActionTreeObject) {
+ return ((ActionTreeObject)element).getChildren();
+ }
+ return new Object[0];
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getTreeNodes(inputElement);
+ }
+
+
+ public Object[] getChildren(Object parentElement) {
+ return getTreeNodes(parentElement);
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ theViewer = viewer;
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof ActionTreeObject) {
+ return ((ActionTreeObject)element).getParent();
+ } else {
+ return null;
+ }
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof ActionTreeObject) {
+ return ((ActionTreeObject)element).hasChildren();
+ } else {
+ return false;
+ }
+ }
+}
\ No newline at end of file
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionContentProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionLabelProvider.java
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionLabelProvider.java (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionLabelProvider.java 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008 JBoss, a division of 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:
+ * JBoss, a division of Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.esb.actionview.views;
+
+import org.eclipse.jdt.ui.JavaElementLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+public class ActionLabelProvider extends LabelProvider {
+ private JavaElementLabelProvider javaLabels;
+
+ public ActionLabelProvider() {
+ javaLabels = new JavaElementLabelProvider();
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof ActionTreeObject) {
+ return javaLabels.getImage(((ActionTreeObject)element).getJavaElement());
+ }
+ return super.getImage(element);
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof ActionTreeObject) {
+ return javaLabels.getText(((ActionTreeObject)element).getJavaElement());
+ } else {
+ return element.toString();
+ }
+ }
+}
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionLabelProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionPage.java
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionPage.java (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionPage.java 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,181 @@
+/*******************************************************************************
+ * Copyright (c) 2008 JBoss, a division of 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:
+ * JBoss, a division of Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.esb.actionview.views;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.ui.infoviews.JavadocView;
+import org.eclipse.jdt.ui.ISharedImages;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.part.DrillDownAdapter;
+import org.eclipse.ui.part.Page;
+import org.jboss.tools.esb.actionview.Activator;
+
+public class ActionPage extends Page {
+
+ private TreeViewer viewer;
+ private IJavaProject project;
+ private DrillDownAdapter drillDownAdapter;
+
+ private Action openSrcFileAction;
+
+ public ActionPage(IJavaProject project) {
+ this.project = project;
+ }
+
+ public IJavaProject getJavaProject() {
+ return project;
+ }
+
+ public void refresh() {
+ if (viewer != null) {
+ viewer.refresh(true);
+ }
+ handleSelection();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.part.Page#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ try {
+ viewer = new TreeViewer(parent, SWT.NONE);
+ } catch (Throwable t) {
+ // Stupid "widget disposed" errors when view is closed then reopened...
+ // Ignoring this doesn't seem to impact the rest of the functionality
+ }
+ drillDownAdapter = new DrillDownAdapter(viewer);
+
+ viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleSelection();
+ }
+ });
+ viewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ handleOpenSrcFile();
+ }
+ });
+
+ viewer.setSorter(new ViewerSorter());
+ viewer.setContentProvider(new ActionContentProvider());
+ viewer.setLabelProvider(new ActionLabelProvider());
+ viewer.setInput(project);
+
+ openSrcFileAction = new Action() {
+ public void run() {
+ handleOpenSrcFile();
+ }
+ };
+ openSrcFileAction.setText("Open source file");
+ openSrcFileAction.setToolTipText("Opens the source file");
+ openSrcFileAction.setImageDescriptor(JavaUI.getSharedImages().
+ getImageDescriptor(ISharedImages.IMG_OBJS_CFILE));
+ hookContextMenu();
+ }
+
+ private void hookContextMenu() {
+ if (super.getSite() == null) {
+ return;
+ }
+ MenuManager menuMgr = new MenuManager("#PopupMenu");
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ ActionPage.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ super.getSite().registerContextMenu(this.toString(), menuMgr, viewer);
+ }
+
+ private void fillContextMenu(IMenuManager manager) {
+ manager.add(openSrcFileAction);
+ manager.add(new Separator());
+ drillDownAdapter.addNavigationActions(manager);
+ // Other plug-ins can contribute there actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void handleOpenSrcFile() {
+ IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+ if (selection.getFirstElement() instanceof ActionTreeObject) {
+ ActionTreeObject o = (ActionTreeObject)selection.getFirstElement();
+ try {
+ JavaUI.openInEditor(o.getJavaElement());
+ } catch (Exception e) {
+ Activator.getDefault().writeLog(IStatus.ERROR, e.getMessage(), e);
+ }
+ }
+ }
+
+ private void handleSelection() {
+ IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+ if (selection == null) {
+ return;
+ }
+ if (selection.getFirstElement() instanceof ActionTreeObject) {
+ ActionTreeObject o = (ActionTreeObject)selection.getFirstElement();
+ JavadocView jdview = getJavaDocView();
+ if (jdview != null) {
+ jdview.setInput(o.getJavaElement());
+ }
+ boolean canOpen = o.getJavaElement() instanceof IType ||
+ o.getJavaElement() instanceof IMethod;
+ openSrcFileAction.setEnabled(canOpen);
+ }
+ }
+
+ private JavadocView getJavaDocView() {
+ return (JavadocView)Activator.getDefault().
+ getWorkbench().getActiveWorkbenchWindow().
+ getActivePage().findView(JavaUI.ID_JAVADOC_VIEW);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.part.Page#getControl()
+ */
+ public Control getControl() {
+ return viewer != null?viewer.getTree():null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.part.Page#setFocus()
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+}
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionTreeObject.java
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionTreeObject.java (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionTreeObject.java 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008 JBoss, a division of 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:
+ * JBoss, a division of Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.esb.actionview.views;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.IJavaElement;
+
+public class ActionTreeObject {
+ private ActionTreeObject parent;
+ private List<ActionTreeObject> children;
+ private String name;
+ private IJavaElement javaElement;
+
+ public ActionTreeObject(String name, IJavaElement javaElement) {
+ this.name = name;
+ this.javaElement = javaElement;
+ children = new ArrayList<ActionTreeObject>();
+ }
+ public IJavaElement getJavaElement() {
+ return javaElement;
+ }
+ public void setJavaElement(IJavaElement javaElement) {
+ this.javaElement = javaElement;
+ }
+
+ public ActionTreeObject getParent() {
+ return parent;
+ }
+ public void setParent(ActionTreeObject parent) {
+ this.parent = parent;
+ }
+ public ActionTreeObject[] getChildren() {
+ ActionTreeObject[] res = new ActionTreeObject[children.size()];
+ children.toArray(res);
+ return res;
+ }
+ public boolean hasChildren() {
+ return children.size() > 0;
+ }
+ public void addChild(ActionTreeObject child) {
+ children.add(child);
+ child.setParent(this);
+
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ActionTreeObject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/DefaultPage.java
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/DefaultPage.java (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/DefaultPage.java 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008 JBoss, a division of 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:
+ * JBoss, a division of Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.esb.actionview.views;
+
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.part.Page;
+
+public class DefaultPage extends Page {
+
+ private TreeViewer viewer;
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.part.Page#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ viewer = new TreeViewer(parent, SWT.NONE);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.part.Page#getControl()
+ */
+ public Control getControl() {
+ return viewer.getTree();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.part.Page#setFocus()
+ */
+ public void setFocus() {
+ getControl().setFocus();
+ }
+}
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/DefaultPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ESBActionView.java
===================================================================
--- workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ESBActionView.java (rev 0)
+++ workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ESBActionView.java 2008-11-14 21:23:08 UTC (rev 11804)
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2008 JBoss, a division of 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:
+ * JBoss, a division of Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.esb.actionview.views;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.IPageSite;
+import org.eclipse.ui.part.Page;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.PageSite;
+import org.eclipse.ui.part.ViewPart;
+import org.jboss.tools.esb.actionview.Activator;
+
+public class ESBActionView extends ViewPart {
+
+ private PageBook pageBook;
+ private DefaultPage defaultPage;
+ private Map<String, Page> pages;
+ private Page currentPage;
+
+ private Composite parent;
+
+ public ESBActionView() {
+ pages = new HashMap<String, Page>();
+ }
+
+ public void createPartControl(Composite parent) {
+ this.parent = parent;
+ initializeControls();
+ createListeners();
+ }
+
+ private void initializeControls() {
+ try {
+ pages.clear();
+ pageBook = new PageBook(parent, SWT.NONE);
+ defaultPage = new DefaultPage();
+ defaultPage.createControl(pageBook);
+ currentPage = defaultPage;
+ } catch (Throwable t) {
+ // TODO: Figure out what's up with those stupid "widget disposed" errors
+ // when view is closed and then re-opened.
+ }
+ }
+
+ private void createListeners() {
+ SelectionChangeListener selListener = new SelectionChangeListener();
+ super.getSite().getPage().addSelectionListener(selListener);
+ }
+
+ public void setFocus() {
+ currentPage.setFocus();
+ }
+
+ private IJavaProject getJavaProject(Object element) throws CoreException {
+ if (element instanceof IJavaProject) {
+ return (IJavaProject)element;
+ }
+ if (element instanceof IJavaElement) {
+ IJavaProject jproject = ((IJavaElement)element).getJavaProject();
+ if (jproject != null) {
+ return jproject;
+ }
+ }
+ if (element instanceof IResource) {
+ IResource resource = (IResource)element;
+ if (resource.getProject() != null &&
+ resource.getProject().hasNature(JavaCore.NATURE_ID)) {
+ return JavaCore.create(((IResource)element).getProject());
+ }
+ }
+ return null;
+ }
+
+ private boolean isProjectSelection(Object selection) {
+ return selection instanceof IJavaElement || selection instanceof IResource;
+ }
+
+ private void setCurrentPage(Object selection) {
+ if (selection == null || !isProjectSelection(selection)) {
+ return;
+ }
+ IJavaProject project = null;
+ try {
+ project = getJavaProject(selection);
+ } catch (CoreException e) {
+ Activator.getDefault().writeLog(IStatus.ERROR, e.getMessage(), e);
+ }
+ try {
+ if (project != null) {
+ Page selPage = pages.get(project.getProject().getName());
+ if (selPage == null) {
+ selPage = createProjectPage(project);
+ } else {
+ if (selPage.getControl().isDisposed()) {
+ initializeControls();
+ selPage = createProjectPage(project);
+ }
+ }
+ currentPage = selPage;
+ pageBook.showPage(selPage.getControl());
+ } else {
+ if (currentPage != defaultPage) {
+ if (defaultPage.getControl().isDisposed()) {
+ initializeControls();
+ }
+ currentPage = defaultPage;
+ pageBook.showPage(defaultPage.getControl());
+ }
+ }
+ } catch (Exception e) {
+ // TODO: Figure out what's up with those stupid "widget disposed" errors
+ // when view is closed and then re-opened.
+ }
+ }
+
+ private Page createProjectPage(IJavaProject project) {
+ Page selPage;
+ selPage = new ActionPage(project);
+ try {
+ IPageSite pgSite = new PageSite(getViewSite());
+ selPage.init(pgSite);
+ selPage.createControl(pageBook);
+ } catch (Throwable t) {
+ // in some cases IServiceLocatorCreator in PageSite<init> is null,
+ // causing a NPE. Don't know what I'm supposed to do about that...
+ }
+ pages.put(project.getProject().getName(), selPage);
+ return selPage;
+ }
+
+ class SelectionChangeListener implements ISelectionListener {
+
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection)selection;
+ setCurrentPage(ss.getFirstElement());
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: workspace/jgraham/plugins/trunk/org.jboss.tools.esb.actionview/src/org/jboss/tools/esb/actionview/views/ESBActionView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 5 months