JBoss Tools SVN: r8623 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test: src/org/hibernate/eclipse and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-06 21:03:38 -0400 (Fri, 06 Jun 2008)
New Revision: 8623
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
Log:
simple test for HQL editor preference page added
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2008-06-07 00:37:56 UTC (rev 8622)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2008-06-07 01:03:38 UTC (rev 8623)
@@ -11,7 +11,8 @@
Bundle-Localization: plugin
Export-Package: org.hibernate.eclipse.console.test,
org.hibernate.eclipse.console.test.mappingproject,
- org.hibernate.eclipse.console.test.xpl
+ org.hibernate.eclipse.console.test.xpl,
+ org.hibernate.eclipse.hqleditor.preferences
Require-Bundle: org.junit,
org.eclipse.jdt.core,
org.eclipse.core.resources,
@@ -31,7 +32,8 @@
org.eclipse.ui.views,
org.jboss.tools.hibernate.ui.view,
org.eclipse.ui.editors,
- org.eclipse.debug.core
+ org.eclipse.debug.core,
+ org.jboss.tools.tests;bundle-version="2.0.0"
Eclipse-LazyStart: true
Bundle-Activator: org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin
Eclipse-RegisterBuddy: org.hibernate.eclipse
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2008-06-07 00:37:56 UTC (rev 8622)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2008-06-07 01:03:38 UTC (rev 8623)
@@ -3,6 +3,7 @@
import java.io.IOException;
import org.hibernate.eclipse.console.test.mappingproject.HibernateAllMappingTests;
+import org.hibernate.eclipse.hqleditor.preferences.HQLEditorPreferencePageTest;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -19,18 +20,19 @@
suite.addTestSuite( ConsoleConfigurationTest.class );
suite.addTestSuite( JavaFormattingTest.class );
suite.addTestSuite( RefactoringTest.class );
-
+
suite.addTestSuite( HibernateAllMappingTests.class );
+ suite.addTestSuite(HQLEditorPreferencePageTest.class);
// core tests
//Properties properties = new Properties();
//properties.load(ConsolePluginAllTests.class.getResourceAsStream("plugintest-hibernate.properties"));
-
+
//System.getProperties().putAll(properties);
-
+
//suite.addTest(org.hibernate.tool.ToolAllTests.suite() );
+
-
return suite;
}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java 2008-06-07 01:03:38 UTC (rev 8623)
@@ -0,0 +1,47 @@
+package org.hibernate.eclipse.hqleditor.preferences;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+import junit.framework.TestCase;
+/**
+ * TODO Get rid of copy paste code
+ *
+ * @author eskimo
+ *
+ */
+public class HQLEditorPreferencePageTest extends TestCase {
+
+ public void testHQLEditorPreferencePageShow() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ HQLEditorPreferencePage.class.getName());
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of HQLEditorPreferencePage", selectedPage instanceof HQLEditorPreferencePage);
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+ public void testHQLEditorPreferencePagePerformOk() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ HQLEditorPreferencePage.class.getName());
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ HQLEditorPreferencePage selectedPage = (HQLEditorPreferencePage)prefDialog.getSelectedPage();
+ selectedPage.performOk();
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 10 months
JBoss Tools SVN: r8622 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-06 20:37:56 -0400 (Fri, 06 Jun 2008)
New Revision: 8622
Added:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPluginStartup.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java
Log:
Fix exception During tests execution. Code requested for workbench moved to IStartup implementation
java.lang.IllegalStateException: Workbench has not been created yet.
[java] at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
[java] at org.jboss.tools.common.model.plugin.ModelPlugin.start(ModelPlugin.java:76)
[java] at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
[java] at java.security.AccessController.doPrivileged(Native Method)
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java 2008-06-07 00:37:27 UTC (rev 8621)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java 2008-06-07 00:37:56 UTC (rev 8622)
@@ -22,6 +22,7 @@
import org.eclipse.ui.IWindowListener;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.Workbench;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.common.model.XModelConstants;
@@ -72,22 +73,6 @@
public void start(BundleContext context) throws Exception {
System.setProperty(XModelConstants.HOME, EclipseResourceUtil.getInstallPath(context.getBundle()));
super.start(context);
- try {
- /*
- FIXME That's not right solution to obtain workbench because there could be no workbench yet
- If so it leads to the exception below and problem with model plug-in activation
- java.lang.IllegalStateException: Workbench has not been created yet.
- [java] at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
- [java] at org.jboss.tools.common.model.plugin.ModelPlugin.start(ModelPlugin.java:76)
- [java] at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
- [java] at java.security.AccessController.doPrivileged(Native Method)
- */
-
- PlatformUI.getWorkbench().addWindowListener(this);
- } catch (Exception e) {
- getPluginLog().logError(e);
- }
-// ClassLoaderUtil.init();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
ClassLoaderUtil.init();
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPluginStartup.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPluginStartup.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPluginStartup.java 2008-06-07 00:37:56 UTC (rev 8622)
@@ -0,0 +1,12 @@
+package org.jboss.tools.common.model.plugin;
+
+import org.eclipse.ui.IStartup;
+import org.eclipse.ui.PlatformUI;
+
+public class ModelPluginStartup implements IStartup {
+
+ public void earlyStartup() {
+ PlatformUI.getWorkbench().addWindowListener(ModelPlugin.getDefault());
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPluginStartup.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 10 months
JBoss Tools SVN: r8621 - in trunk/common/plugins/org.jboss.tools.common.model: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-06 20:37:27 -0400 (Fri, 06 Jun 2008)
New Revision: 8621
Modified:
trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
Log:
Fix exception During tests execution. Code requested for workbench moved to IStartup implementation
java.lang.IllegalStateException: Workbench has not been created yet.
[java] at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
[java] at org.jboss.tools.common.model.plugin.ModelPlugin.start(ModelPlugin.java:76)
[java] at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
[java] at java.security.AccessController.doPrivileged(Native Method)
Modified: trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF 2008-06-07 00:28:52 UTC (rev 8620)
+++ trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF 2008-06-07 00:37:27 UTC (rev 8621)
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Eclipse-LazyStart: true
-Bundle-Name: Model
+Bundle-Name: JBoss Tools Model
Bundle-ClassPath: model.jar,lib/j2ee.jar,lib/Bundles.jar
Bundle-Activator: org.jboss.tools.common.model.plugin.ModelPlugin
Bundle-Vendor: %providerName
Modified: trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2008-06-07 00:28:52 UTC (rev 8620)
+++ trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2008-06-07 00:37:27 UTC (rev 8621)
@@ -386,4 +386,10 @@
class="org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateSupport"/>
</extension>
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.jboss.tools.common.model.plugin.ModelPluginStartup">
+ </startup>
+ </extension>
</plugin>
17 years, 10 months
JBoss Tools SVN: r8619 - in trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test: classpath and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-06-06 14:31:05 -0400 (Fri, 06 Jun 2008)
New Revision: 8619
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java
Removed:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
Renaming package
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-06-06 18:29:51 UTC (rev 8618)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2008-06-06 18:31:05 UTC (rev 8619)
@@ -24,10 +24,10 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.ide.eclipse.as.test.model.JBIDE1657Test;
-import org.jboss.ide.eclipse.as.test.model.JEEClasspathContainerTest;
-import org.jboss.ide.eclipse.as.test.model.ProjectRuntimeTest;
-import org.jboss.ide.eclipse.as.test.model.RuntimeServerModelTest;
+import org.jboss.ide.eclipse.as.test.classpath.JBIDE1657Test;
+import org.jboss.ide.eclipse.as.test.classpath.JEEClasspathContainerTest;
+import org.jboss.ide.eclipse.as.test.classpath.ProjectRuntimeTest;
+import org.jboss.ide.eclipse.as.test.classpath.RuntimeServerModelTest;
public class ASTestSuite extends TestSuite {
public static Test suite() {
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath (from rev 8584, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model)
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JBIDE1657Test.java 2008-06-05 14:44:36 UTC (rev 8584)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java 2008-06-06 18:31:05 UTC (rev 8619)
@@ -1,91 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.test.model;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.wst.server.core.IRuntime;
-import org.jboss.ide.eclipse.as.test.ASTest;
-import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-
-/**
- * This test will test whether the old classpath container,
- * org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer
- * which used to be automatically assigned to WTP projects, still works
- * and will not fail to resolve.
- *
- * @author rob.stryker <rob.stryker(a)redhat.com>
- */
-public class JBIDE1657Test extends TestCase {
- private TestProjectProvider provider;
- private IProject project;
-
- protected void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
- project = provider.getProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
-
- protected void tearDown() throws Exception {
- provider.dispose();
- }
-
- public void testJBIDE1657() {
- try {
- IJavaProject jp = JavaCore.create(project);
-
- // lets try a runtime
- IRuntime createdRuntime = ProjectRuntimeUtil.createRuntime("runtime1", ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_AS_HOME);
- ProjectRuntimeUtil.setTargetRuntime(createdRuntime, project);
- IClasspathEntry[] raw1 = jp.getRawClasspath();
- IClasspathEntry[] resolved1 = jp.getResolvedClasspath(false);
- IClasspathEntry[] raw2 = new IClasspathEntry[raw1.length];
- for( int i = 0; i < raw1.length; i++ ) {
- if( !raw1[i].getPath().segment(0).equals("org.eclipse.jst.server.core.container")) {
- raw2[i]=raw1[i];
- } else {
- IPath containerPath = new Path("org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer");
- containerPath = containerPath.append("runtime1");
- raw2[i] = JavaCore.newContainerEntry(containerPath);
- }
- }
- jp.setRawClasspath(raw2, new NullProgressMonitor());
- IClasspathEntry[] resolved2 = jp.getResolvedClasspath(false);
- assertEquals("New classpath container path should return the same classpath entries as the old. ",
- resolved1.length , resolved2.length);
- assertTrue("Should be more than one classpath entry", resolved1.length > 0);
- } catch( CoreException ce ) {
- ce.printStackTrace();
- fail(ce.getMessage());
- }
- }
-}
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java (from rev 8618, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JBIDE1657Test.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java 2008-06-06 18:31:05 UTC (rev 8619)
@@ -0,0 +1,91 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.test.classpath;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.wst.server.core.IRuntime;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+/**
+ * This test will test whether the old classpath container,
+ * org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer
+ * which used to be automatically assigned to WTP projects, still works
+ * and will not fail to resolve.
+ *
+ * @author rob.stryker <rob.stryker(a)redhat.com>
+ */
+public class JBIDE1657Test extends TestCase {
+ private TestProjectProvider provider;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ }
+
+ public void testJBIDE1657() {
+ try {
+ IJavaProject jp = JavaCore.create(project);
+
+ // lets try a runtime
+ IRuntime createdRuntime = ProjectRuntimeUtil.createRuntime("runtime1", ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_AS_HOME);
+ ProjectRuntimeUtil.setTargetRuntime(createdRuntime, project);
+ IClasspathEntry[] raw1 = jp.getRawClasspath();
+ IClasspathEntry[] resolved1 = jp.getResolvedClasspath(false);
+ IClasspathEntry[] raw2 = new IClasspathEntry[raw1.length];
+ for( int i = 0; i < raw1.length; i++ ) {
+ if( !raw1[i].getPath().segment(0).equals("org.eclipse.jst.server.core.container")) {
+ raw2[i]=raw1[i];
+ } else {
+ IPath containerPath = new Path("org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer");
+ containerPath = containerPath.append("runtime1");
+ raw2[i] = JavaCore.newContainerEntry(containerPath);
+ }
+ }
+ jp.setRawClasspath(raw2, new NullProgressMonitor());
+ IClasspathEntry[] resolved2 = jp.getResolvedClasspath(false);
+ assertEquals("New classpath container path should return the same classpath entries as the old. ",
+ resolved1.length , resolved2.length);
+ assertTrue("Should be more than one classpath entry", resolved1.length > 0);
+ } catch( CoreException ce ) {
+ ce.printStackTrace();
+ fail(ce.getMessage());
+ }
+ }
+}
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java 2008-06-05 14:44:36 UTC (rev 8584)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java 2008-06-06 18:31:05 UTC (rev 8619)
@@ -1,137 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.test.model;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-
-/**
- * This class tests the jee classpath containers
- * to make sure they're returning live jars that exist.
- *
- * @author rob.stryker <rob.stryker(a)redhat.com>
- */
-public class JEEClasspathContainerTest extends TestCase {
-
- private static final int ORIGINAL_ENTRIES = 2;
-
- private TestProjectProvider provider;
- private IProject project;
-
- protected void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
- project = provider.getProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
-
- protected void tearDown() throws Exception {
- provider.dispose();
- }
-
- public void testJEE13ClasspathContainer() {
- testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.j2ee-1.3", 7);
- }
-
- public void testJEE14ClasspathContainer() {
- testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.j2ee-1.4", 8);
- }
-
- public void testJEE50ClasspathContainer() {
- testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.javaee-5.0", 1);
- }
-
-
- protected void testGenericClasspathContainer(String containerPath, int expectedEntries) {
- try {
- IJavaProject jproject = JavaCore.create(project);
- IPath path = new Path(containerPath);
- verifyContainerEntries(path, jproject, expectedEntries);
- verifyRawClasspathCount(jproject, ORIGINAL_ENTRIES);
- verifyNotIncludedEntry(jproject, path);
- int beforeRawCount = jproject.getRawClasspath().length;
- int beforeResolvedCount = jproject.getResolvedClasspath(true).length;
- addContainer(jproject, path);
- assertEquals(beforeRawCount+1, jproject.getRawClasspath().length);
- assertEquals(beforeResolvedCount+expectedEntries, jproject.getResolvedClasspath(true).length);
- beforeRawCount = jproject.getRawClasspath().length;
- beforeResolvedCount = jproject.getResolvedClasspath(true).length;
- removeContainer(jproject, path);
- assertEquals(beforeRawCount-1, jproject.getRawClasspath().length);
- assertEquals(beforeResolvedCount-expectedEntries, jproject.getResolvedClasspath(true).length);
-
- } catch( JavaModelException jme ) {
- fail("Exception: " + jme.getMessage());
- } catch( CoreException ce ) {
- fail("Exception: " + ce.getMessage());
- }
-
- }
-
- protected void verifyContainerEntries(IPath path, IJavaProject jproject, int expected) throws JavaModelException {
- IClasspathContainer cpc = JavaCore.getClasspathContainer(path, jproject);
- IClasspathEntry[] entries = cpc.getClasspathEntries();
- assertEquals("Received unexpected number of entries", expected, entries.length );
- }
-
- protected void verifyRawClasspathCount(IJavaProject jproject, int count) throws JavaModelException {
- IClasspathEntry[] projectEntry = jproject.getRawClasspath();
- assertEquals("Project should start with only " + count + " classpath entries", count, projectEntry.length);
- }
-
- protected void verifyNotIncludedEntry(IJavaProject jproject, IPath path) throws JavaModelException {
- IClasspathEntry[] projectEntry = jproject.getRawClasspath();
- for( int i = 0; i < projectEntry.length; i++ ) {
- if( projectEntry[i].getPath().toOSString().startsWith(path.toOSString())) {
- assertFalse("Project prematurely includes classpath", true);
- }
- }
- }
-
- protected void addContainer(IJavaProject jproject, IPath path) throws JavaModelException {
- ArrayList tmp = new ArrayList();
- tmp.addAll(Arrays.asList(jproject.getRawClasspath()));
- tmp.add(JavaCore.newContainerEntry(path));
- jproject.setRawClasspath((IClasspathEntry[]) tmp.toArray(new IClasspathEntry[tmp.size()]), null);
- }
-
- protected void removeContainer(IJavaProject jproject, IPath path) throws JavaModelException {
- ArrayList tmp = new ArrayList();
- tmp.addAll(Arrays.asList(jproject.getRawClasspath()));
- tmp.remove(JavaCore.newContainerEntry(path));
- jproject.setRawClasspath((IClasspathEntry[]) tmp.toArray(new IClasspathEntry[tmp.size()]), null);
- }
-}
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java (from rev 8618, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/JEEClasspathContainerTest.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java 2008-06-06 18:31:05 UTC (rev 8619)
@@ -0,0 +1,137 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.test.classpath;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+/**
+ * This class tests the jee classpath containers
+ * to make sure they're returning live jars that exist.
+ *
+ * @author rob.stryker <rob.stryker(a)redhat.com>
+ */
+public class JEEClasspathContainerTest extends TestCase {
+
+ private static final int ORIGINAL_ENTRIES = 2;
+
+ private TestProjectProvider provider;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ }
+
+ public void testJEE13ClasspathContainer() {
+ testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.j2ee-1.3", 7);
+ }
+
+ public void testJEE14ClasspathContainer() {
+ testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.j2ee-1.4", 8);
+ }
+
+ public void testJEE50ClasspathContainer() {
+ testGenericClasspathContainer("org.jboss.ide.eclipse.as.classpath.core.javaee-5.0", 1);
+ }
+
+
+ protected void testGenericClasspathContainer(String containerPath, int expectedEntries) {
+ try {
+ IJavaProject jproject = JavaCore.create(project);
+ IPath path = new Path(containerPath);
+ verifyContainerEntries(path, jproject, expectedEntries);
+ verifyRawClasspathCount(jproject, ORIGINAL_ENTRIES);
+ verifyNotIncludedEntry(jproject, path);
+ int beforeRawCount = jproject.getRawClasspath().length;
+ int beforeResolvedCount = jproject.getResolvedClasspath(true).length;
+ addContainer(jproject, path);
+ assertEquals(beforeRawCount+1, jproject.getRawClasspath().length);
+ assertEquals(beforeResolvedCount+expectedEntries, jproject.getResolvedClasspath(true).length);
+ beforeRawCount = jproject.getRawClasspath().length;
+ beforeResolvedCount = jproject.getResolvedClasspath(true).length;
+ removeContainer(jproject, path);
+ assertEquals(beforeRawCount-1, jproject.getRawClasspath().length);
+ assertEquals(beforeResolvedCount-expectedEntries, jproject.getResolvedClasspath(true).length);
+
+ } catch( JavaModelException jme ) {
+ fail("Exception: " + jme.getMessage());
+ } catch( CoreException ce ) {
+ fail("Exception: " + ce.getMessage());
+ }
+
+ }
+
+ protected void verifyContainerEntries(IPath path, IJavaProject jproject, int expected) throws JavaModelException {
+ IClasspathContainer cpc = JavaCore.getClasspathContainer(path, jproject);
+ IClasspathEntry[] entries = cpc.getClasspathEntries();
+ assertEquals("Received unexpected number of entries", expected, entries.length );
+ }
+
+ protected void verifyRawClasspathCount(IJavaProject jproject, int count) throws JavaModelException {
+ IClasspathEntry[] projectEntry = jproject.getRawClasspath();
+ assertEquals("Project should start with only " + count + " classpath entries", count, projectEntry.length);
+ }
+
+ protected void verifyNotIncludedEntry(IJavaProject jproject, IPath path) throws JavaModelException {
+ IClasspathEntry[] projectEntry = jproject.getRawClasspath();
+ for( int i = 0; i < projectEntry.length; i++ ) {
+ if( projectEntry[i].getPath().toOSString().startsWith(path.toOSString())) {
+ assertFalse("Project prematurely includes classpath", true);
+ }
+ }
+ }
+
+ protected void addContainer(IJavaProject jproject, IPath path) throws JavaModelException {
+ ArrayList tmp = new ArrayList();
+ tmp.addAll(Arrays.asList(jproject.getRawClasspath()));
+ tmp.add(JavaCore.newContainerEntry(path));
+ jproject.setRawClasspath((IClasspathEntry[]) tmp.toArray(new IClasspathEntry[tmp.size()]), null);
+ }
+
+ protected void removeContainer(IJavaProject jproject, IPath path) throws JavaModelException {
+ ArrayList tmp = new ArrayList();
+ tmp.addAll(Arrays.asList(jproject.getRawClasspath()));
+ tmp.remove(JavaCore.newContainerEntry(path));
+ jproject.setRawClasspath((IClasspathEntry[]) tmp.toArray(new IClasspathEntry[tmp.size()]), null);
+ }
+}
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java 2008-06-05 14:44:36 UTC (rev 8584)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java 2008-06-06 18:31:05 UTC (rev 8619)
@@ -1,110 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.test.model;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.wst.server.core.IRuntime;
-import org.jboss.ide.eclipse.as.test.ASTest;
-import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
-import org.jboss.tools.common.test.util.TestProjectProvider;
-
-public class ProjectRuntimeTest extends TestCase {
- private TestProjectProvider provider;
- private IProject project;
-
- protected void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
- project = provider.getProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
-
- protected void tearDown() throws Exception {
- provider.dispose();
- }
-
- public void testProjectRuntime() {
- try {
- IJavaProject jp = JavaCore.create(project);
- verifyInitialClasspathEntries(jp);
-
- // lets try a runtime
- IRuntime createdRuntime = ProjectRuntimeUtil.createRuntime("runtime1", ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_AS_HOME);
- ProjectRuntimeUtil.setTargetRuntime(createdRuntime, project);
- verifyPostRuntimeCPE(jp);
-
- ProjectRuntimeUtil.clearRuntime(project);
- verifyInitialClasspathEntries(jp);
-
- } catch( JavaModelException jme ) {
- jme.printStackTrace();
- fail(jme.getMessage());
- } catch( CoreException ce ) {
- ce.printStackTrace();
- fail(ce.getMessage());
- }
- }
-
- protected void verifyPostRuntimeCPE(IJavaProject jp) throws CoreException {
- IClasspathEntry[] entries = jp.getRawClasspath();
- assertEquals(3, entries.length);
- jp.getResolvedClasspath(false); // make sure it can resolve all
- String[] required = new String[] { "org.eclipse.jst.server.core.container",
- "basicwebproject", "org.eclipse.jst.j2ee.internal.web.container" };
- verifyClasspathEntries(entries, required);
- }
-
- protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
- IClasspathEntry[] entries = jp.getRawClasspath();
- jp.getResolvedClasspath(false); // make sure it can resolve all
- String[] required = new String[] {
- "org.eclipse.jst.j2ee.internal.web.container", "basicwebproject"};
- verifyClasspathEntries(entries, required);
- }
-
- protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] required) {
- ArrayList list = new ArrayList(Arrays.asList(required));
- for( int i = 0; i < entries.length; i++ ) {
- if( list.contains(entries[i].getPath().segment(0)))
- list.remove(entries[i].getPath().segment(0));
- }
-
- if( list.size() > 0 ) {
- String tmp = "Required enties not found: ";
- for( int i = 0; i < list.size(); i++ ) {
- tmp += list.get(i) + ", ";
- }
- fail(tmp.substring(0, tmp.length() - 2));
- }
- }
-}
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java (from rev 8618, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java 2008-06-06 18:31:05 UTC (rev 8619)
@@ -0,0 +1,110 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.test.classpath;
+
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.wst.server.core.IRuntime;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+
+public class ProjectRuntimeTest extends TestCase {
+ private TestProjectProvider provider;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.ide.eclipse.as.test", null, "basicwebproject", true);
+ project = provider.getProject();
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ }
+
+ protected void tearDown() throws Exception {
+ provider.dispose();
+ }
+
+ public void testProjectRuntime() {
+ try {
+ IJavaProject jp = JavaCore.create(project);
+ verifyInitialClasspathEntries(jp);
+
+ // lets try a runtime
+ IRuntime createdRuntime = ProjectRuntimeUtil.createRuntime("runtime1", ASTest.JBOSS_RUNTIME_42, ASTest.JBOSS_AS_HOME);
+ ProjectRuntimeUtil.setTargetRuntime(createdRuntime, project);
+ verifyPostRuntimeCPE(jp);
+
+ ProjectRuntimeUtil.clearRuntime(project);
+ verifyInitialClasspathEntries(jp);
+
+ } catch( JavaModelException jme ) {
+ jme.printStackTrace();
+ fail(jme.getMessage());
+ } catch( CoreException ce ) {
+ ce.printStackTrace();
+ fail(ce.getMessage());
+ }
+ }
+
+ protected void verifyPostRuntimeCPE(IJavaProject jp) throws CoreException {
+ IClasspathEntry[] entries = jp.getRawClasspath();
+ assertEquals(3, entries.length);
+ jp.getResolvedClasspath(false); // make sure it can resolve all
+ String[] required = new String[] { "org.eclipse.jst.server.core.container",
+ "basicwebproject", "org.eclipse.jst.j2ee.internal.web.container" };
+ verifyClasspathEntries(entries, required);
+ }
+
+ protected void verifyInitialClasspathEntries(IJavaProject jp) throws CoreException {
+ IClasspathEntry[] entries = jp.getRawClasspath();
+ jp.getResolvedClasspath(false); // make sure it can resolve all
+ String[] required = new String[] {
+ "org.eclipse.jst.j2ee.internal.web.container", "basicwebproject"};
+ verifyClasspathEntries(entries, required);
+ }
+
+ protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] required) {
+ List<String> list = Arrays.asList(required);
+ for( int i = 0; i < entries.length; i++ ) {
+ if( list.contains(entries[i].getPath().segment(0)))
+ list.remove(entries[i].getPath().segment(0));
+ }
+
+ if( list.size() > 0 ) {
+ String tmp = "Required enties not found: ";
+ for( int i = 0; i < list.size(); i++ ) {
+ tmp += list.get(i) + ", ";
+ }
+ fail(tmp.substring(0, tmp.length() - 2));
+ }
+ }
+}
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java 2008-06-05 14:44:36 UTC (rev 8584)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java 2008-06-06 18:31:05 UTC (rev 8619)
@@ -1,72 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.test.model;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.jboss.ide.eclipse.as.test.ASTest;
-
-public class RuntimeServerModelTest extends TestCase {
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=201340
- // skipped since reported issue and always failing
- public void skip_testDoubleCreateEclipseBug201340() throws CoreException {
- createGenericRuntime(ASTest.TOMCAT_RUNTIME_55);
- createGenericRuntime(ASTest.JBOSS_RUNTIME_42);
- }
-
- private IRuntime[] createGenericRuntime(String runtimeId) throws CoreException {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, runtimeId);
- assertEquals("expects only one runtime type", runtimeTypes.length, 1);
-
- IRuntimeType runtimeType = runtimeTypes[0];
-
- IRuntimeWorkingCopy firstRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
- IRuntime savedRuntime = firstRuntime.save(true, new NullProgressMonitor());
-
- IRuntimeWorkingCopy secondRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
- IRuntime secondSavedRuntime = secondRuntime.save(true, new NullProgressMonitor());
-
- assertEquals(savedRuntime.getName(), secondSavedRuntime.getName());
- assertNotSame(savedRuntime, secondSavedRuntime);
- assertFalse("Why are two different runtimes " + runtimeId + " created with the same ID ?!", savedRuntime.getId().equals(secondSavedRuntime.getId()));
- return new IRuntime[] { savedRuntime, secondSavedRuntime };
- }
-
- public void testCreateBrokenServer() throws CoreException {
- IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ASTest.JBOSS_RUNTIME_42);
- assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
- IRuntimeType runtimeType = runtimeTypes[0];
- IRuntimeWorkingCopy jbossRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
- IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
- assertEquals("Neither vm install nor configuration is set - should not be able to validate",savedRuntime.validate(null).getSeverity(), Status.ERROR);
- }
-
-
-}
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java (from rev 8618, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/RuntimeServerModelTest.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/RuntimeServerModelTest.java 2008-06-06 18:31:05 UTC (rev 8619)
@@ -0,0 +1,72 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.test.classpath;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.jboss.ide.eclipse.as.test.ASTest;
+
+public class RuntimeServerModelTest extends TestCase {
+
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=201340
+ // skipped since reported issue and always failing
+ public void skip_testDoubleCreateEclipseBug201340() throws CoreException {
+ createGenericRuntime(ASTest.TOMCAT_RUNTIME_55);
+ createGenericRuntime(ASTest.JBOSS_RUNTIME_42);
+ }
+
+ private IRuntime[] createGenericRuntime(String runtimeId) throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, runtimeId);
+ assertEquals("expects only one runtime type", runtimeTypes.length, 1);
+
+ IRuntimeType runtimeType = runtimeTypes[0];
+
+ IRuntimeWorkingCopy firstRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
+ IRuntime savedRuntime = firstRuntime.save(true, new NullProgressMonitor());
+
+ IRuntimeWorkingCopy secondRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
+ IRuntime secondSavedRuntime = secondRuntime.save(true, new NullProgressMonitor());
+
+ assertEquals(savedRuntime.getName(), secondSavedRuntime.getName());
+ assertNotSame(savedRuntime, secondSavedRuntime);
+ assertFalse("Why are two different runtimes " + runtimeId + " created with the same ID ?!", savedRuntime.getId().equals(secondSavedRuntime.getId()));
+ return new IRuntime[] { savedRuntime, secondSavedRuntime };
+ }
+
+ public void testCreateBrokenServer() throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null,null, ASTest.JBOSS_RUNTIME_42);
+ assertEquals("expects only one runtime type for jboss 4.2", runtimeTypes.length, 1);
+ IRuntimeType runtimeType = runtimeTypes[0];
+ IRuntimeWorkingCopy jbossRuntime = runtimeType.createRuntime(null, new NullProgressMonitor());
+ IRuntime savedRuntime = jbossRuntime.save(true, new NullProgressMonitor());
+ assertEquals("Neither vm install nor configuration is set - should not be able to validate",savedRuntime.validate(null).getSeverity(), Status.ERROR);
+ }
+
+
+}
17 years, 10 months
JBoss Tools SVN: r8618 - trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-06-06 14:29:51 -0400 (Fri, 06 Jun 2008)
New Revision: 8618
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java
Log:
cosmetic change
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java 2008-06-06 16:52:05 UTC (rev 8617)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/model/ProjectRuntimeTest.java 2008-06-06 18:29:51 UTC (rev 8618)
@@ -21,8 +21,8 @@
*/
package org.jboss.ide.eclipse.as.test.model;
-import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
import junit.framework.TestCase;
@@ -93,7 +93,7 @@
}
protected void verifyClasspathEntries(IClasspathEntry[] entries, String[] required) {
- ArrayList list = new ArrayList(Arrays.asList(required));
+ List<String> list = Arrays.asList(required);
for( int i = 0; i < entries.length; i++ ) {
if( list.contains(entries[i].getPath().segment(0)))
list.remove(entries[i].getPath().segment(0));
17 years, 10 months
JBoss Tools SVN: r8617 - in trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate: console/execution and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-06-06 12:52:05 -0400 (Fri, 06 Jun 2008)
New Revision: 8617
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.properties
Removed:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/messages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/messages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/messages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/messages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/messages.properties
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ClassNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/StandAloneConsoleConfigurationPreferences.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginFileAppender.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java
Log:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-500
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -69,42 +69,42 @@
public class ConsoleConfiguration implements ExecutionContextHolder {
private ExecutionContext executionContext;
-
+
private Map fakeDrivers = new HashMap();
-
- /* TODO: move this out to the actual users of the configuraiton/sf ? */
+
+ /* TODO: move this out to the actual users of the configuraiton/sf ? */
private Configuration configuration;
private SessionFactory sessionFactory;
-
+
/** Unique name for this configuration */
public String getName() {
return prefs.getName();
}
-
+
public ConsoleConfiguration(ConsoleConfigurationPreferences config) {
prefs = config;
}
-
+
public Object execute(Command c) {
return executionContext.execute(c);
}
-
-
+
+
public ConsoleConfigurationPreferences prefs = null;
-
-
+
+
/**
* Reset so a new configuration or sessionfactory is needed.
*
*/
public void reset() {
- // reseting state
+ // reseting state
configuration = null;
closeSessionFactory();
}
-
+
public void build() {
- configuration = buildWith(null, true);
+ configuration = buildWith(null, true);
}
private Configuration buildJPAConfiguration(String persistenceUnit, Properties properties, String entityResolver, boolean includeMappings) {
@@ -123,42 +123,42 @@
if(!includeMappings) {
overrides.put( "hibernate.archive.autodetection", "none" ); //$NON-NLS-1$//$NON-NLS-2$
}
-
+
Class clazz = ReflectHelper.classForName("org.hibernate.ejb.Ejb3Configuration", ConsoleConfiguration.class); //$NON-NLS-1$
Object ejb3cfg = clazz.newInstance();
-
+
if(StringHelper.isNotEmpty(entityResolver)) {
Class resolver = ReflectHelper.classForName(entityResolver, this.getClass());
Object object = resolver.newInstance();
Method method = clazz.getMethod("setEntityResolver", new Class[] { EntityResolver.class });//$NON-NLS-1$
method.invoke(ejb3cfg, new Object[] { object } );
}
-
+
Method method = clazz.getMethod("configure", new Class[] { String.class, Map.class }); //$NON-NLS-1$
if ( method.invoke(ejb3cfg, new Object[] { persistenceUnit, overrides } ) == null ) {
- String out = NLS.bind(Messages.CONSOLECONFIGURATION_PERSISTENCE_UNIT_NOT_FOUND, persistenceUnit);
+ String out = NLS.bind(ConsoleMessages.ConsoleConfiguration_persistence_unit_not_found, persistenceUnit);
throw new HibernateConsoleRuntimeException(out);
}
-
+
method = clazz.getMethod("getHibernateConfiguration", new Class[0]);//$NON-NLS-1$
Configuration invoke = (Configuration) method.invoke(ejb3cfg, (Object[])null);
return invoke;
}
catch (Exception e) {
- throw new HibernateConsoleRuntimeException(Messages.CONSOLECONFIGURATION_COULD_NOT_CREATE_JPA_BASED_CONFIGURATION,e);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.ConsoleConfiguration_could_not_create_jpa_based_configuration,e);
}
}
-
+
private Configuration buildAnnotationConfiguration() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
Class clazz = ReflectHelper
.classForName( "org.hibernate.cfg.AnnotationConfiguration" ); //$NON-NLS-1$
Configuration newInstance = (Configuration) clazz.newInstance();
return newInstance;
}
-
+
/**
* @return
- *
+ *
*/
public Configuration buildWith(final Configuration cfg, final boolean includeMappings) {
URL[] customClassPathURLS = prefs.getCustomClassPathURLS();
@@ -170,7 +170,7 @@
throw cnfe;
}
}
-
+
protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
try {
return super.loadClass( name, resolve );
@@ -178,7 +178,7 @@
throw cnfe;
}
}
-
+
public Class loadClass(String name) throws ClassNotFoundException {
try {
return super.loadClass( name );
@@ -186,15 +186,15 @@
throw cnfe;
}
}
- });
-
+ });
+
Configuration result = (Configuration) executionContext.execute(new ExecutionContext.Command() {
-
+
public Object execute() {
Configuration localCfg = cfg;
Properties properties = prefs.getProperties();
-
+
if(properties!=null) {
// in case the transaction manager is empty then we need to inject a faketm since hibernate will still try and instantiate it.
String str = properties.getProperty( "hibernate.transaction.manager_lookup_class" ); //$NON-NLS-1$
@@ -203,8 +203,8 @@
//properties.setProperty( "hibernate.transaction.factory_class", "");
}
}
-
-
+
+
if(localCfg==null) {
localCfg = buildConfiguration( properties, includeMappings );
} else {
@@ -212,16 +212,16 @@
//origProperties.putAll(properties);
//cfg.setProperties(origProperties);
// TODO: this is actually only for jdbc reveng...
- //localCfg = configureStandardConfiguration( includeMappings, localCfg, properties );
+ //localCfg = configureStandardConfiguration( includeMappings, localCfg, properties );
}
- // here both setProperties and configxml have had their chance to tell which databasedriver is needed.
+ // here both setProperties and configxml have had their chance to tell which databasedriver is needed.
registerFakeDriver(localCfg.getProperty(Environment.DRIVER) );
-
+
// TODO: jpa configuration ?
if(includeMappings) {
File[] mappingFiles = prefs.getMappingFiles();
-
+
for (int i = 0; i < mappingFiles.length; i++) {
File hbm = mappingFiles[i];
localCfg = localCfg.addFile(hbm);
@@ -230,13 +230,13 @@
// TODO: HBX-
localCfg.setProperty( "hibernate.temp.use_jdbc_metadata_defaults", "false" ); //$NON-NLS-1$//$NON-NLS-2$
localCfg.setProperty( Environment.HBM2DDL_AUTO, "false" ); //$NON-NLS-1$
-
+
return localCfg;
}
-
+
});
-
-
+
+
return result;
}
@@ -244,7 +244,7 @@
File configXMLFile = prefs.getConfigXMLFile();
if(!includeMappings) {
org.dom4j.Document doc;
- XMLHelper xmlHelper = new XMLHelper();
+ XMLHelper xmlHelper = new XMLHelper();
InputStream stream;
String resourceName = "<unknown>"; //$NON-NLS-1$
try {
@@ -257,37 +257,37 @@
}
}
catch (FileNotFoundException e1) {
- throw new HibernateConsoleRuntimeException(Messages.CONSOLECONFIGURATION_COULD_NOT_ACCESS + configXMLFile, e1);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.ConsoleConfiguration_could_not_access + configXMLFile, e1);
}
-
+
try {
List errors = new ArrayList();
-
+
doc = xmlHelper.createSAXReader( resourceName, errors, entityResolver )
.read( new InputSource( stream ) );
if ( errors.size() != 0 ) {
throw new MappingException(
- Messages.CONSOLECONFIGURATION_INVALID_CONFIGURATION,
+ ConsoleMessages.ConsoleConfiguration_invalid_configuration,
(Throwable) errors.get( 0 )
);
}
-
-
+
+
List list = doc.getRootElement().element("session-factory").elements("mapping"); //$NON-NLS-1$ //$NON-NLS-2$
Iterator iterator = list.iterator();
while ( iterator.hasNext() ) {
Node element = (Node) iterator.next();
- element.getParent().remove(element);
+ element.getParent().remove(element);
}
-
+
DOMWriter dw = new DOMWriter();
Document document = dw.write(doc);
return localCfg.configure( document );
-
+
}
catch (DocumentException e) {
throw new HibernateException(
- Messages.CONSOLECONFIGURATION_COULD_NOT_PARSE_CONFIGURATION + resourceName, e
+ ConsoleMessages.ConsoleConfiguration_could_not_parse_configuration + resourceName, e
);
}
finally {
@@ -306,14 +306,14 @@
}
}
}
-
+
/**
* DriverManager checks what classloader a class is loaded from thus
- * we register a FakeDriver that we know is loaded "properly" which delegates all it class
+ * we register a FakeDriver that we know is loaded "properly" which delegates all it class
* to the real driver.
- *
+ *
* By doing so we can convince DriverManager that we can use any dynamically loaded driver.
- *
+ *
* @param driverClassName
*/
private void registerFakeDriver(String driverClassName) {
@@ -326,22 +326,22 @@
DriverManager.registerDriver(fakeDelegatingDriver);
fakeDrivers.put(driverClassName,fakeDelegatingDriver);
}
- }
+ }
catch (ClassNotFoundException e) {
- String out = NLS.bind(Messages.CONSOLECONFIGURATION_PROBLEMS_WHILE_LOADING_DATABASE_DRIVERCLASS, driverClassName);
- throw new HibernateConsoleRuntimeException(out, e);
- }
+ String out = NLS.bind(ConsoleMessages.ConsoleConfiguration_problems_while_loading_database_driverclass, driverClassName);
+ throw new HibernateConsoleRuntimeException(out, e);
+ }
catch (InstantiationException e) {
- String out = NLS.bind(Messages.CONSOLECONFIGURATION_PROBLEMS_WHILE_LOADING_DATABASE_DRIVERCLASS, driverClassName);
+ String out = NLS.bind(ConsoleMessages.ConsoleConfiguration_problems_while_loading_database_driverclass, driverClassName);
throw new HibernateConsoleRuntimeException(out, e);
- }
+ }
catch (IllegalAccessException e) {
- String out = NLS.bind(Messages.CONSOLECONFIGURATION_PROBLEMS_WHILE_LOADING_DATABASE_DRIVERCLASS, driverClassName);
+ String out = NLS.bind(ConsoleMessages.ConsoleConfiguration_problems_while_loading_database_driverclass, driverClassName);
throw new HibernateConsoleRuntimeException(out, e);
- }
+ }
catch (SQLException e) {
- String out = NLS.bind(Messages.CONSOLECONFIGURATION_PROBLEMS_WHILE_LOADING_DATABASE_DRIVERCLASS, driverClassName);
- throw new HibernateConsoleRuntimeException(out, e);
+ String out = NLS.bind(ConsoleMessages.ConsoleConfiguration_problems_while_loading_database_driverclass, driverClassName);
+ throw new HibernateConsoleRuntimeException(out, e);
}
}
}
@@ -362,7 +362,7 @@
execute(new ExecutionContext.Command() {
public Object execute() {
if(sessionFactory!=null) {
- throw new HibernateConsoleRuntimeException(Messages.CONSOLECONFIGURATION_FACTORY_NOT_CLOSED_BEFORE_BUILD_NEW_FACTORY);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.ConsoleConfiguration_factory_not_closed_before_build_new_factory);
}
sessionFactory = getConfiguration().buildSessionFactory();
fireFactoryBuilt();
@@ -370,63 +370,63 @@
}
});
}
-
+
public SessionFactory getSessionFactory() {
return sessionFactory;
}
-
-
+
+
int execcount;
List queryListeners = new ArrayList();
List consoleCfgListeners = new ArrayList();
-
+
public QueryPage executeHQLQuery(final String hql) {
return executeHQLQuery(hql, new QueryInputModel());
}
-
+
public QueryPage executeHQLQuery(final String hql, final QueryInputModel queryParameters) {
-
+
return (QueryPage) executionContext.execute(new ExecutionContext.Command() {
-
+
public Object execute() {
Session session = getSessionFactory().openSession();
QueryPage qp = new HQLQueryPage(ConsoleConfiguration.this,hql,queryParameters);
qp.setSession(session);
-
- qp.setId(++execcount);
- fireQueryPageCreated(qp);
+
+ qp.setId(++execcount);
+ fireQueryPageCreated(qp);
return qp;
}
-
- });
+
+ });
}
-
+
public QueryPage executeBSHQuery(final String queryString, final QueryInputModel model) {
return (QueryPage) executionContext.execute(new ExecutionContext.Command() {
-
+
public Object execute() {
Session session = getSessionFactory().openSession();
QueryPage qp = new JavaPage(ConsoleConfiguration.this,queryString,model);
qp.setSession(session);
-
- qp.setId(++execcount);
- fireQueryPageCreated(qp);
+
+ qp.setId(++execcount);
+ fireQueryPageCreated(qp);
return qp;
}
-
- });
+
+ });
}
-
+
private void fireQueryPageCreated(QueryPage qp) {
- Iterator i = consoleCfgListeners.iterator();
+ Iterator i = consoleCfgListeners.iterator();
while (i.hasNext() ) {
ConsoleConfigurationListener view = (ConsoleConfigurationListener) i.next();
view.queryPageCreated(qp);
- }
+ }
}
-
+
private void fireFactoryBuilt() {
Iterator i = consoleCfgListeners.iterator();
while (i.hasNext() ) {
@@ -444,26 +444,26 @@
}
public void addConsoleConfigurationListener(ConsoleConfigurationListener v) {
- consoleCfgListeners.add(v);
+ consoleCfgListeners.add(v);
}
-
+
public void removeConsoleConfigurationListener(ConsoleConfigurationListener sfListener) {
- consoleCfgListeners.remove(sfListener);
+ consoleCfgListeners.remove(sfListener);
}
-
+
public ConsoleConfigurationListener[] getConsoleConfigurationListeners() {
return (ConsoleConfigurationListener[]) consoleCfgListeners.toArray(new ConsoleConfigurationListener[consoleCfgListeners.size()]);
}
-
+
public boolean isSessionFactoryCreated() {
return sessionFactory!=null;
}
public ConsoleConfigurationPreferences getPreferences() {
return prefs;
- }
-
+ }
+
public String toString() {
return getClass().getName() + ":" + getName(); //$NON-NLS-1$
}
@@ -475,43 +475,43 @@
public void closeSessionFactory() {
if(sessionFactory!=null) {
fireFactoryClosing(sessionFactory);
- sessionFactory.close();
+ sessionFactory.close();
sessionFactory = null;
- }
+ }
}
public Settings getSettings(final Configuration cfg) {
return (Settings) execute(new Command() {
-
+
public Object execute() {
return cfg.buildSettings();
}
-
- });
+
+ });
}
// TODO: delegate to some extension point
private Configuration buildConfiguration(Properties properties, boolean includeMappings) {
- Configuration localCfg = null;
+ Configuration localCfg = null;
if(prefs.getConfigurationMode().equals( ConfigurationMode.ANNOTATIONS )) {
try {
localCfg = buildAnnotationConfiguration();
localCfg = configureStandardConfiguration( includeMappings, localCfg, properties );
}
catch (Exception e) {
- throw new HibernateConsoleRuntimeException(Messages.CONSOLECONFIGURATION_COULD_NOT_LOAD_ANNOTATIONCONFIGURATION,e);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.ConsoleConfiguration_could_not_load_annotationconfiguration,e);
}
} else if(prefs.getConfigurationMode().equals( ConfigurationMode.JPA )) {
try {
localCfg = buildJPAConfiguration( getPreferences().getPersistenceUnitName(), properties, prefs.getEntityResolverName(), includeMappings );
}
catch (Exception e) {
- throw new HibernateConsoleRuntimeException(Messages.CONSOLECONFIGURATION_COULD_NOT_LOAD_JPA_CONFIGURATION,e);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.ConsoleConfiguration_could_not_load_jpa_configuration,e);
}
} else {
- localCfg = new Configuration();
+ localCfg = new Configuration();
localCfg = configureStandardConfiguration( includeMappings, localCfg, properties );
- }
+ }
return localCfg;
}
@@ -524,25 +524,25 @@
try {
entityResolver = (EntityResolver) ReflectHelper.classForName(prefs.getEntityResolverName()).newInstance();
} catch (Exception c) {
- throw new HibernateConsoleRuntimeException(Messages.CONSOLECONFIGURATION_COULD_NOT_CONFIGURE_ENTITY_RESOLVER + prefs.getEntityResolverName(), c);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.ConsoleConfiguration_could_not_configure_entity_resolver + prefs.getEntityResolverName(), c);
}
}
localCfg.setEntityResolver(entityResolver);
- if(StringHelper.isNotEmpty( prefs.getNamingStrategy())) {
+ if(StringHelper.isNotEmpty( prefs.getNamingStrategy())) {
try {
NamingStrategy ns = (NamingStrategy) ReflectHelper.classForName(prefs.getNamingStrategy()).newInstance();
localCfg.setNamingStrategy( ns );
} catch (Exception c) {
- throw new HibernateConsoleRuntimeException(Messages.CONSOLECONFIGURATION_COULD_NOT_CONFIGURE_NAMING_STRATEGY + prefs.getNamingStrategy(), c);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.ConsoleConfiguration_could_not_configure_naming_strategy + prefs.getNamingStrategy(), c);
}
}
-
+
localCfg = loadConfigurationXML( localCfg, includeMappings, entityResolver );
-
+
return localCfg;
}
-
+
}
\ No newline at end of file
Copied: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java (from rev 8549, trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/Messages.java)
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -0,0 +1,42 @@
+package org.hibernate.console;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ConsoleMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.hibernate.console.ConsoleMessages"; //$NON-NLS-1$
+ public static String ConsoleConfiguration_could_not_access;
+ public static String ConsoleConfiguration_could_not_configure_entity_resolver;
+ public static String ConsoleConfiguration_could_not_configure_naming_strategy;
+ public static String ConsoleConfiguration_could_not_create_jpa_based_configuration;
+ public static String ConsoleConfiguration_could_not_load_annotationconfiguration;
+ public static String ConsoleConfiguration_could_not_load_jpa_configuration;
+ public static String ConsoleConfiguration_could_not_parse_configuration;
+ public static String ConsoleConfiguration_factory_not_closed_before_build_new_factory;
+ public static String ConsoleConfiguration_invalid_configuration;
+ public static String ConsoleConfiguration_persistence_unit_not_found;
+ public static String ConsoleConfiguration_problems_while_loading_database_driverclass;
+ public static String JavaPage_no_info;
+ public static String JavaPage_not_allowed;
+ public static String KnownConfigurations_could_not_write_state;
+ public static String KnownConfigurations_hibernate_log;
+ public static String KnownConfigurations_unknown;
+ public static String DefaultExecutionContext_existing_classloader;
+ public static String ClassNode_uninitialized_proxy;
+ public static String ConfigurationNode_mapped_entities;
+ public static String NodeFactory_unknown;
+ public static String PersistentCollectionNode_could_not_access_property_value;
+ public static String AbstractConsoleConfigurationPreferences_could_not_load_prop_file;
+ public static String AbstractConsoleConfigurationPreferences_name_not_null_or_empty;
+ public static String AbstractConsoleConfigurationPreferences_unknown;
+ public static String StandAloneConsoleConfigurationPreferences_could_not_resolve_classpaths;
+ public static String StandAloneConsoleConfigurationPreferences_errors_while_parsing;
+ public static String PluginFileAppender_missing_plugin_state_location;
+ public static String PluginLogAppender_missing_layout_for_appender;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, ConsoleMessages.class);
+ }
+
+ private ConsoleMessages() {
+ }
+}
Copied: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.properties (from rev 8549, trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/messages.properties)
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.properties (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.properties 2008-06-06 16:52:05 UTC (rev 8617)
@@ -0,0 +1,28 @@
+ConsoleConfiguration_could_not_access=Could not access
+ConsoleConfiguration_could_not_configure_entity_resolver=Could not configure entity resolver
+ConsoleConfiguration_could_not_configure_naming_strategy=Could not configure naming strategy
+ConsoleConfiguration_could_not_create_jpa_based_configuration=Could not create JPA based Configuration
+ConsoleConfiguration_could_not_load_annotationconfiguration=Could not load AnnotationConfiguration
+ConsoleConfiguration_could_not_load_jpa_configuration=Could not load JPA Configuration
+ConsoleConfiguration_could_not_parse_configuration=Could not parse configuration:
+ConsoleConfiguration_factory_not_closed_before_build_new_factory=Factory were not closed before attempting to built a new factory.
+ConsoleConfiguration_invalid_configuration=invalid configuration
+ConsoleConfiguration_persistence_unit_not_found=Persistence unit not found: '{0}'.
+ConsoleConfiguration_problems_while_loading_database_driverclass=Problems while loading database driverclass ({0})
+JavaPage_no_info=<no info>
+JavaPage_not_allowed=System.exit not allowed\!
+KnownConfigurations_could_not_write_state=Could not write state
+KnownConfigurations_hibernate_log=Hibernate Log -
+KnownConfigurations_unknown=<unknown>
+DefaultExecutionContext_existing_classloader=Existing classloader is not equal to the previously installed classloader\! Existing={0} Previous={1}
+ClassNode_uninitialized_proxy=(uninitialized proxy)
+ConfigurationNode_mapped_entities=Mapped entities
+NodeFactory_unknown=Unknown ->
+PersistentCollectionNode_could_not_access_property_value=Could not access property value
+AbstractConsoleConfigurationPreferences_could_not_load_prop_file=Could not load property file
+AbstractConsoleConfigurationPreferences_name_not_null_or_empty=Name cannot be null or empty
+AbstractConsoleConfigurationPreferences_unknown=<unknown>
+StandAloneConsoleConfigurationPreferences_could_not_resolve_classpaths=Could not resolve classpaths
+StandAloneConsoleConfigurationPreferences_errors_while_parsing=Errors while parsing
+PluginFileAppender_missing_plugin_state_location=Missing Plugin State Location.
+PluginLogAppender_missing_layout_for_appender=Missing layout for appender
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -38,11 +38,11 @@
/**
* @author MAX
*
- *
+ *
*/
public class JavaPage extends AbstractQueryPage {
- private String criteriaCode;
+ private String criteriaCode;
Criteria criteria = null;
@@ -51,7 +51,7 @@
private QueryInputModel model;
/**
- * @param model
+ * @param model
* @param session2
*/
public JavaPage(ConsoleConfiguration cfg, String criteriaCode, QueryInputModel model) {
@@ -65,7 +65,7 @@
try {
if(criteriaCode.indexOf( "System.exit" )>=0) { // TODO: externalize run so we don't need this bogus check! //$NON-NLS-1$
list = Collections.EMPTY_LIST;
- addException( new IllegalArgumentException(Messages.JAVAPAGE_NOT_ALLOWED) );
+ addException( new IllegalArgumentException(ConsoleMessages.JavaPage_not_allowed) );
return;
}
ip = setupInterpreter(getSession() );
@@ -83,26 +83,26 @@
}
} else {
list = new ArrayList();
- list.add(o);
- }
- }
+ list.add(o);
+ }
+ }
catch (EvalError e) {
- addException(e);
- }
+ addException(e);
+ }
catch (HibernateException e) {
- addException(e);
- }
+ addException(e);
+ }
}
-
+
private Interpreter setupInterpreter(Session session) throws EvalError, HibernateException {
Interpreter interpreter = new Interpreter();
-
+
interpreter.set("session", session); //$NON-NLS-1$
interpreter.setClassLoader( Thread.currentThread().getContextClassLoader() );
SessionImplementor si = (SessionImplementor)session;
-
+
Map map = si.getFactory().getAllClassMetadata();
-
+
Iterator iterator = map.keySet().iterator();
//TODO: filter non classes.
String imports = new String();
@@ -110,12 +110,12 @@
String element = (String) iterator.next();
imports += "import " + element + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
imports += "import org.hibernate.criterion.*;\n"; //$NON-NLS-1$
imports += "import org.hibernate.*;\n"; //$NON-NLS-1$
// TODO: expose the parameters as values to be used in the code.
interpreter.eval(imports);
-
+
return interpreter;
}
@@ -123,24 +123,24 @@
if(list!=null) return list;
try {
if(criteria!=null) {
- long startTime = System.currentTimeMillis();
+ long startTime = System.currentTimeMillis();
list = criteria.list();
queryTime = System.currentTimeMillis() - startTime;
- }
+ }
else {
return Collections.EMPTY_LIST;
}
- }
+ }
catch (HibernateException e) {
list = Collections.EMPTY_LIST;
addException(e);
- }
+ }
return list;
}
public List getPathNames() {
List l = new ArrayList();
- l.add(Messages.JAVAPAGE_NO_INFO);
+ l.add(ConsoleMessages.JavaPage_no_info);
return l;
}
@@ -149,7 +149,7 @@
}
public void release() {
-
+
super.release();
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -64,12 +64,12 @@
*/
public class KnownConfigurations {
- // TODO: is the best way for the querypage model ?
- private QueryPageModel queryPages = new QueryPageModel();
+ // TODO: is the best way for the querypage model ?
+ private QueryPageModel queryPages = new QueryPageModel();
private List configurationListeners = new ArrayList();
private Map configurations;
private ConsoleConfigurationListener sfListener = new ConsoleConfigurationListener() {
-
+
public void sessionFactoryClosing(final ConsoleConfiguration configuration, final SessionFactory closingFactory) {
fireNotification(new Notification() {
public void notify(KnownConfigurationsListener listener) {
@@ -77,34 +77,34 @@
}
});
}
-
+
public void sessionFactoryBuilt(final ConsoleConfiguration ccfg, final SessionFactory builtSessionFactory) {
fireNotification(new Notification() {
public void notify(KnownConfigurationsListener listener) {
- listener.sessionFactoryBuilt(ccfg, builtSessionFactory);
+ listener.sessionFactoryBuilt(ccfg, builtSessionFactory);
}
});
}
public void queryPageCreated(QueryPage qp) {
- queryPages.add(qp);
+ queryPages.add(qp);
}
-
+
};
private static KnownConfigurations instance;
-
+
public static synchronized KnownConfigurations getInstance() {
if (instance == null) {
instance = new KnownConfigurations();
}
return instance;
}
-
-
-
+
+
+
private abstract class Notification {
-
+
public void run(KnownConfigurationsListener listener) {
notify(listener);
}
@@ -115,16 +115,16 @@
*/
protected abstract void notify(KnownConfigurationsListener listener);
}
-
+
/**
* Register to receive notification of repository creation and disposal
*/
public void addConsoleConfigurationListener(KnownConfigurationsListener listener) {
synchronized(configurationListeners) {
- configurationListeners.add(listener);
+ configurationListeners.add(listener);
}
}
-
+
/**
* De-register a listener
*/
@@ -136,7 +136,7 @@
/**
* Add the repository to the receiver's list of known configurations. Doing this will enable
- *
+ *
*/
public ConsoleConfiguration addConfiguration(final ConsoleConfiguration configuration, boolean broadcast) {
// Check the cache for an equivalent instance and if there is one, just update the cache
@@ -145,11 +145,11 @@
// Store the location
// Cache the location instance for later retrieval
getRepositoriesMap().put(configuration.getName(), configuration);
- configuration.addConsoleConfigurationListener(sfListener);
+ configuration.addConsoleConfigurationListener(sfListener);
existingConfiguration = configuration;
}
-
+
if (broadcast) {
fireNotification(new Notification() {
public void notify(KnownConfigurationsListener listener) {
@@ -159,19 +159,19 @@
}
return existingConfiguration;
}
-
+
public void removeAllConfigurations() {
ConsoleConfiguration[] cfgs = getConfigurations();
for (int i = 0; i < cfgs.length; i++) {
ConsoleConfiguration configuration = cfgs[i];
removeConfiguration(configuration, false);
}
-
+
}
-
+
// added forUpdate as a workaround for letting listeners know it is done to update the configuration so they don't cause removal issues.
public void removeConfiguration(final ConsoleConfiguration configuration, final boolean forUpdate) {
-
+
ConsoleConfiguration oldConfig = (ConsoleConfiguration) getRepositoriesMap().remove(configuration.getName() );
if (oldConfig != null) {
oldConfig.removeConsoleConfigurationListener(sfListener);
@@ -182,13 +182,13 @@
});
oldConfig.reset();
removeLoggingStream( oldConfig );
-
+
}
-
-
+
+
}
-
+
/**
* Answer whether the provided configuration name is known by the provider or not.
* The name string corresponds to the Strin returned by ConsoleConfiguration#getName()
@@ -197,13 +197,13 @@
return internalGetRepository(name) != null;
}
- /**
+ /**
* Return a list of the know repository locations
*/
public ConsoleConfiguration[] getConfigurations() {
return (ConsoleConfiguration[])getRepositoriesMap().values().toArray(new ConsoleConfiguration[getRepositoriesMap().size()]);
}
-
+
public ConsoleConfiguration[] getConfigurationsSortedByName() {
return getConfigurations(new Comparator() {
public boolean equals(Object obj) {
@@ -217,31 +217,31 @@
}
});
}
-
+
public ConsoleConfiguration[] getConfigurations(Comparator c) {
ConsoleConfiguration[] configurations = getConfigurations();
Arrays.sort(configurations, c);
return configurations;
}
-
+
private ConsoleConfiguration internalGetRepository(String location) {
return (ConsoleConfiguration) getRepositoriesMap().get(location);
}
-
-
+
+
private Map getRepositoriesMap() {
if (configurations == null) {
configurations = new TreeMap();
}
return configurations;
}
-
+
private KnownConfigurationsListener[] getListeners() {
synchronized(configurationListeners) {
return (KnownConfigurationsListener[]) configurationListeners.toArray(new KnownConfigurationsListener[configurationListeners.size()]);
}
}
-
+
private void fireNotification(Notification notification) {
// Get a snapshot of the listeners so the list doesn't change while we're firing
KnownConfigurationsListener[] listeners = getListeners();
@@ -253,27 +253,27 @@
}
BaseNode rootNode = new ConfigurationListNode(this);
-
+
public BaseNode getRootNode() {
- return rootNode;
+ return rootNode;
}
// TODO: decouple this logging from Eclipse platform!
private Map loggingStreams = new HashMap();
public MessageConsoleStream findLoggingStream(String name) {
- Object[] console = (Object[]) loggingStreams.get(name);
+ Object[] console = (Object[]) loggingStreams.get(name);
if(console==null) {
console = new Object[2];
- String secondaryId = Messages.KNOWNCONFIGURATIONS_HIBERNATE_LOG + (name==null?Messages.KNOWNCONFIGURATIONS_UNKNOWN:name);
+ String secondaryId = ConsoleMessages.KnownConfigurations_hibernate_log + (name==null?ConsoleMessages.KnownConfigurations_unknown:name);
console[0] = new MessageConsole(secondaryId, null);
IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
consoleManager.addConsoles(new IConsole[] { (IConsole) console[0] });
console[1] = ((MessageConsole)console[0]).newMessageStream();
loggingStreams.put(name, console);
- }
+ }
return (MessageConsoleStream) console[1];
}
-
+
private void removeLoggingStream(ConsoleConfiguration oldConfig) {
Object[] object = (Object[]) loggingStreams.remove( oldConfig.getName() );
if(object!=null) {
@@ -281,17 +281,17 @@
MessageConsoleStream stream = (MessageConsoleStream)object[1];
try { stream.close(); } catch(IOException ie) { /* ignore */ };
IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
- consoleManager.removeConsoles( new IConsole[] { mc } );
+ consoleManager.removeConsoles( new IConsole[] { mc } );
}
}
-
+
public ConsoleConfiguration find(String lastUsedName) {
if(configurations==null) return null;
if(lastUsedName==null) return null;
return (ConsoleConfiguration) configurations.get(lastUsedName);
}
-
+
public QueryPageModel getQueryPageModel() {
return queryPages;
}
@@ -301,36 +301,36 @@
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.newDocument();
-
+
Element element = document.createElement("hibernate-console"); //$NON-NLS-1$
Node node = document.appendChild(element);
-
+
ConsoleConfiguration[] configs = getConfigurations();
for (int i = 0; i < configs.length; i++) {
ConsoleConfiguration cfg = configs[i];
cfg.getPreferences().writeStateTo(element);
}
-
+
writeXml(document, f);
- }
+ }
catch (TransformerConfigurationException e) {
- throw new HibernateConsoleRuntimeException(Messages.KNOWNCONFIGURATIONS_COULD_NOT_WRITE_STATE,e);
- }
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.KnownConfigurations_could_not_write_state,e);
+ }
catch (TransformerException e) {
- throw new HibernateConsoleRuntimeException(Messages.KNOWNCONFIGURATIONS_COULD_NOT_WRITE_STATE,e);
- }
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.KnownConfigurations_could_not_write_state,e);
+ }
catch (ParserConfigurationException e) {
- throw new HibernateConsoleRuntimeException(Messages.KNOWNCONFIGURATIONS_COULD_NOT_WRITE_STATE,e);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.KnownConfigurations_could_not_write_state,e);
}
}
private void writeXml(Document document, File f) throws TransformerConfigurationException, TransformerFactoryConfigurationError, TransformerException {
// Prepare the DOM document for writing
Source source = new DOMSource(document);
-
+
// Prepare the output file
Result result = new StreamResult(f);
-
+
// Write the DOM document to the file
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.setOutputProperty(OutputKeys.INDENT, "true"); //$NON-NLS-1$
@@ -338,14 +338,14 @@
}
List queryParameters = new ArrayList();
-
+
public ConsoleQueryParameter[] getQueryParameters() {
return (ConsoleQueryParameter[]) queryParameters.toArray(new ConsoleQueryParameter[queryParameters.size()]);
}
-
+
public List getQueryParameterList() {
return queryParameters;
- }
-
-
+ }
+
+
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/Messages.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/Messages.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1,30 +0,0 @@
-package org.hibernate.console;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.console.messages"; //$NON-NLS-1$
- public static String CONSOLECONFIGURATION_COULD_NOT_ACCESS;
- public static String CONSOLECONFIGURATION_COULD_NOT_CONFIGURE_ENTITY_RESOLVER;
- public static String CONSOLECONFIGURATION_COULD_NOT_CONFIGURE_NAMING_STRATEGY;
- public static String CONSOLECONFIGURATION_COULD_NOT_CREATE_JPA_BASED_CONFIGURATION;
- public static String CONSOLECONFIGURATION_COULD_NOT_LOAD_ANNOTATIONCONFIGURATION;
- public static String CONSOLECONFIGURATION_COULD_NOT_LOAD_JPA_CONFIGURATION;
- public static String CONSOLECONFIGURATION_COULD_NOT_PARSE_CONFIGURATION;
- public static String CONSOLECONFIGURATION_FACTORY_NOT_CLOSED_BEFORE_BUILD_NEW_FACTORY;
- public static String CONSOLECONFIGURATION_INVALID_CONFIGURATION;
- public static String CONSOLECONFIGURATION_PERSISTENCE_UNIT_NOT_FOUND;
- public static String CONSOLECONFIGURATION_PROBLEMS_WHILE_LOADING_DATABASE_DRIVERCLASS;
- public static String JAVAPAGE_NO_INFO;
- public static String JAVAPAGE_NOT_ALLOWED;
- public static String KNOWNCONFIGURATIONS_COULD_NOT_WRITE_STATE;
- public static String KNOWNCONFIGURATIONS_HIBERNATE_LOG;
- public static String KNOWNCONFIGURATIONS_UNKNOWN;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -26,16 +26,17 @@
import java.util.WeakHashMap;
import org.eclipse.osgi.util.NLS;
+import org.hibernate.console.ConsoleMessages;
import org.hibernate.eclipse.logging.CurrentContext;
public class DefaultExecutionContext implements ExecutionContext {
- final private URLClassLoader configurationClassLoader;
+ final private URLClassLoader configurationClassLoader;
private volatile int installs;
private Map previousLoaders = new WeakHashMap();
final String key;
-
+
public DefaultExecutionContext(String key, URLClassLoader loader) {
configurationClassLoader = loader;
this.key = key;
@@ -49,10 +50,10 @@
if(configurationClassLoader!=null && Thread.currentThread().getContextClassLoader() != configurationClassLoader) {
previousLoaders.put(Thread.currentThread(), Thread.currentThread().getContextClassLoader() );
Thread.currentThread().setContextClassLoader(configurationClassLoader);
- }
-
+ }
+
}
-
+
/* (non-Javadoc)
* @see org.hibernate.console.IExecutionContext#execute(org.hibernate.console.ExecutionContext.Command)
*/
@@ -61,31 +62,31 @@
CurrentContext.push( key );
installLoader();
return c.execute();
- }
+ }
finally {
uninstallLoader();
CurrentContext.pop();
}
}
-
+
/* (non-Javadoc)
* @see org.hibernate.console.IExecutionContext#uninstallLoader()
*/
public void uninstallLoader() {
installs--; // TODO: make more safe (synchronized) bookkeeping of the classloader installation.
-
+
if(installs==0) {
ClassLoader cl = (ClassLoader) previousLoaders.get(Thread.currentThread() );
if(configurationClassLoader!=null && Thread.currentThread().getContextClassLoader() != configurationClassLoader) {
- String out = NLS.bind(Messages.DEFAULTEXECUTIONCONTEXT_EXISTING_CLASSLOADER, Thread.currentThread().getContextClassLoader(), configurationClassLoader);
+ String out = NLS.bind(ConsoleMessages.DefaultExecutionContext_existing_classloader, Thread.currentThread().getContextClassLoader(), configurationClassLoader);
throw new IllegalStateException(out);
}
-
+
if(cl!=null) {
previousLoaders.remove(Thread.currentThread() );
Thread.currentThread().setContextClassLoader(cl);
- }
- }
+ }
+ }
}
-
+
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/Messages.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/Messages.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1,15 +0,0 @@
-package org.hibernate.console.execution;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.console.execution.messages"; //$NON-NLS-1$
- public static String DEFAULTEXECUTIONCONTEXT_EXISTING_CLASSLOADER;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/messages.properties 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/messages.properties 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1 +0,0 @@
-DEFAULTEXECUTIONCONTEXT_EXISTING_CLASSLOADER=Existing classloader is not equal to the previously installed classloader\! Existing={0} Previous={1}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/messages.properties 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/messages.properties 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1,16 +0,0 @@
-CONSOLECONFIGURATION_COULD_NOT_ACCESS=Could not access
-CONSOLECONFIGURATION_COULD_NOT_CONFIGURE_ENTITY_RESOLVER=Could not configure entity resolver
-CONSOLECONFIGURATION_COULD_NOT_CONFIGURE_NAMING_STRATEGY=Could not configure naming strategy
-CONSOLECONFIGURATION_COULD_NOT_CREATE_JPA_BASED_CONFIGURATION=Could not create JPA based Configuration
-CONSOLECONFIGURATION_COULD_NOT_LOAD_ANNOTATIONCONFIGURATION=Could not load AnnotationConfiguration
-CONSOLECONFIGURATION_COULD_NOT_LOAD_JPA_CONFIGURATION=Could not load JPA Configuration
-CONSOLECONFIGURATION_COULD_NOT_PARSE_CONFIGURATION=Could not parse configuration:
-CONSOLECONFIGURATION_FACTORY_NOT_CLOSED_BEFORE_BUILD_NEW_FACTORY=Factory were not closed before attempting to built a new factory.
-CONSOLECONFIGURATION_INVALID_CONFIGURATION=invalid configuration
-CONSOLECONFIGURATION_PERSISTENCE_UNIT_NOT_FOUND=Persistence unit not found: '{0}'.
-CONSOLECONFIGURATION_PROBLEMS_WHILE_LOADING_DATABASE_DRIVERCLASS=Problems while loading database driverclass ({0})
-JAVAPAGE_NO_INFO=<no info>
-JAVAPAGE_NOT_ALLOWED=System.exit not allowed\!
-KNOWNCONFIGURATIONS_COULD_NOT_WRITE_STATE=Could not write state
-KNOWNCONFIGURATIONS_HIBERNATE_LOG=Hibernate Log -
-KNOWNCONFIGURATIONS_UNKNOWN=<unknown>
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ClassNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ClassNode.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ClassNode.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -26,6 +26,7 @@
import org.hibernate.EntityMode;
import org.hibernate.Hibernate;
+import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.ImageConstants;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.type.CollectionType;
@@ -40,22 +41,22 @@
ClassMetadata md;
boolean objectGraph;
-
+
Object baseObject;
boolean childrenCreated = false;
- public ClassNode(NodeFactory factory, BaseNode parent, String name, ClassMetadata metadata, Object baseObject, boolean objectGraph) {
-
+ public ClassNode(NodeFactory factory, BaseNode parent, String name, ClassMetadata metadata, Object baseObject, boolean objectGraph) {
+
super(factory, parent);
this.name = name;
this.baseObject = baseObject;
this.objectGraph = objectGraph;
-
+
md = metadata;
if (md != null) { // Don't have any hibernate related info about this one...
iconName = ImageConstants.MAPPEDCLASS;
} else {
- iconName = ImageConstants.UNMAPPEDCLASS;
- }
+ iconName = ImageConstants.UNMAPPEDCLASS;
+ }
}
protected void checkChildren() {
@@ -64,51 +65,51 @@
childrenCreated = true;
}
}
-
+
protected void createChildren() {
//System.out.println("Creating children for: " + this);
-
+
if(objectGraph && getValue()==null || md == null) {
return;
- }
-
-
+ }
+
+
// Identifier
if(md.getIdentifierPropertyName()!=null) {
- children.add(0, factory.createIdentifierNode(this, md) );
+ children.add(0, factory.createIdentifierNode(this, md) );
}
-
+
String[] names = md.getPropertyNames();
for (int i = 0; i < names.length; i++) {
Type type = md.getPropertyTypes()[i];
-
+
if(type.isCollectionType() ) {
PersistentCollectionNode tn = factory.createPersistentCollectionNode(this, names[i], md, (CollectionType)type, getValue(), objectGraph);
- children.add(tn);
+ children.add(tn);
} else {
children.add(factory.createPropertyNode(this, i, md, getValue(), objectGraph) );
- }
- }
- }
+ }
+ }
+ }
public String getHQL() {
List parents = new ArrayList();
-
+
BaseNode currentParent;
currentParent = this;
while (currentParent != null && !(currentParent instanceof ConfigurationEntitiesNode) ) {
parents.add(currentParent);
currentParent = currentParent.parent;
}
-
+
if(currentParent instanceof ConfigurationEntitiesNode) {
currentParent = (BaseNode) parents.get(parents.size()-1);
}
-
+
// currentParent is the root
String cname = ( (ClassNode)currentParent).md.getMappedClass(EntityMode.POJO).getName();
-
+
if (cname.lastIndexOf(".") != -1) { //$NON-NLS-1$
cname = cname.substring(cname.lastIndexOf(".") + 1); //$NON-NLS-1$
}
@@ -121,7 +122,7 @@
return "select " + alias + path + " from " + cname + " as " + alias; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
public ClassMetadata getClassMetadata() {
return md;
}
@@ -132,14 +133,14 @@
if(Hibernate.isInitialized(o) ) {
return super.renderLabel(fullyQualifiedNames) + " = " + o; //$NON-NLS-1$
} else {
- return super.renderLabel(fullyQualifiedNames) + " = " + Messages.CLASSNODE_UNINITIALIZED_PROXY; //$NON-NLS-1$
+ return super.renderLabel(fullyQualifiedNames) + " = " + ConsoleMessages.ClassNode_uninitialized_proxy; //$NON-NLS-1$
}
-
+
} else {
return super.renderLabel(fullyQualifiedNames);
}
}
-
+
public Object getValue() {
if(objectGraph) {
return baseObject;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationNode.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationNode.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -24,6 +24,7 @@
import org.hibernate.SessionFactory;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ConsoleConfigurationListener;
+import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.QueryPage;
@@ -31,26 +32,26 @@
* @author max
*
*/
-public class ConfigurationNode extends BaseNode {
-
+public class ConfigurationNode extends BaseNode {
+
private final ConsoleConfiguration configuration;
private boolean childrenCreated;
public ConfigurationNode(BaseNode parent, ConsoleConfiguration configuration) {
super(null,parent);
- this.configuration = configuration;
+ this.configuration = configuration;
configuration.addConsoleConfigurationListener(new ConsoleConfigurationListener() {
public void sessionFactoryBuilt(ConsoleConfiguration ccfg, SessionFactory builtSessionFactory) {
clear();
}
-
+
public void sessionFactoryClosing(ConsoleConfiguration configuration, SessionFactory closedSessionFactory) {
clear();
}
public void queryPageCreated(QueryPage qp) { }
});
-
+
name = configuration.getName();
iconName = ImageConstants.CONFIGURATION;
}
@@ -58,27 +59,27 @@
public ConsoleConfiguration getConsoleConfiguration() {
return configuration;
}
-
+
protected void checkChildren() {
if(!childrenCreated) {
if(configuration.isSessionFactoryCreated() ) {
NodeFactory fac = new NodeFactory(configuration);
- children.add(fac.createConfigurationEntitiesNode(Messages.CONFIGURATIONNODE_MAPPED_ENTITIES) );
+ children.add(fac.createConfigurationEntitiesNode(ConsoleMessages.ConfigurationNode_mapped_entities) );
childrenCreated=true;
-
+
/*Configuration cfg = configuration.getConfiguration();
Iterator iter = cfg.getTableMappings();
while (iter.hasNext() ) {// todo: move to nodefactory.
Table table = (Table) iter.next();
TableNode node = NodeFactory.createTableNode(this,table);
children.add(node);
- } */
+ } */
}else {
children.clear();
}
- }
+ }
}
-
+
public String getHQL() {
// TODO Auto-generated method stub
return null;
@@ -90,5 +91,5 @@
public void clear() {
super.clear();
childrenCreated = false;
- }
+ }
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/Messages.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/Messages.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1,18 +0,0 @@
-package org.hibernate.console.node;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.console.node.messages"; //$NON-NLS-1$
- public static String CLASSNODE_UNINITIALIZED_PROXY;
- public static String CONFIGURATIONNODE_MAPPED_ENTITIES;
- public static String NODEFACTORY_UNKNOWN;
- public static String PERSISTENTCOLLECTIONNODE_COULD_NOT_ACCESS_PROPERTY_VALUE;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -32,6 +32,7 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.ImageConstants;
import org.hibernate.mapping.Table;
import org.hibernate.metadata.ClassMetadata;
@@ -50,15 +51,15 @@
private Map collectionMetaData;
private ConsoleConfiguration consoleConfiguration;
-
-
-
-
+
+
+
+
/**
* @param c
*/
public NodeFactory(ConsoleConfiguration c) throws HibernateException {
- setConsoleConfiguration(c);
+ setConsoleConfiguration(c);
}
private void setConsoleConfiguration(ConsoleConfiguration c) {
@@ -73,11 +74,11 @@
public ConfigurationEntitiesNode createConfigurationEntitiesNode(String name) {
Enhancer e = ProxyFactory.createEnhancer(ConfigurationEntitiesNode.class);
-
- return (ConfigurationEntitiesNode) e.create(new Class[] { String.class, NodeFactory.class, List.class },
+
+ return (ConfigurationEntitiesNode) e.create(new Class[] { String.class, NodeFactory.class, List.class },
new Object[] { name, this, classes });
-
- //return new RootNode(this, classes);
+
+ //return new RootNode(this, classes);
}
public BaseNode createObjectNode(Session session, Object o) throws HibernateException {
@@ -92,10 +93,10 @@
}
private ClassNode internalCreateClassNode(BaseNode node, String clazz,ClassMetadata md, Object o, boolean objectGraph) {
-
+
Enhancer e = ProxyFactory.createEnhancer(ClassNode.class);
-
- return (ClassNode) e.create(new Class[] { NodeFactory.class, BaseNode.class, String.class, ClassMetadata.class, Object.class, boolean.class},
+
+ return (ClassNode) e.create(new Class[] { NodeFactory.class, BaseNode.class, String.class, ClassMetadata.class, Object.class, boolean.class},
new Object[] { this, node, clazz, md,o, Boolean.valueOf(objectGraph) } );
}
@@ -109,17 +110,17 @@
}
public CollectionMetadata getCollectionMetaData(String role) {
- return (CollectionMetadata) collectionMetaData.get(role);
+ return (CollectionMetadata) collectionMetaData.get(role);
}
-
+
public BaseNode createPropertyNode(BaseNode parent, int idx, ClassMetadata metadata) {
return createPropertyNode(parent, idx, metadata, null,false);
}
-
+
public BaseNode createPropertyNode(BaseNode node, int i, ClassMetadata md, Object baseObject, boolean objectGraph) {
Enhancer e = ProxyFactory.createEnhancer(PropertyNode.class);
-
- return (BaseNode) e.create(new Class[] { NodeFactory.class, BaseNode.class, int.class, ClassMetadata.class, Object.class, boolean.class},
+
+ return (BaseNode) e.create(new Class[] { NodeFactory.class, BaseNode.class, int.class, ClassMetadata.class, Object.class, boolean.class},
new Object[] { this, node, new Integer(i),md,baseObject,Boolean.valueOf(objectGraph) } );
}
@@ -131,8 +132,8 @@
*/
public IdentifierNode createIdentifierNode(BaseNode parent, ClassMetadata md) {
Enhancer e = ProxyFactory.createEnhancer(IdentifierNode.class);
-
- return (IdentifierNode) e.create(new Class[] { NodeFactory.class, BaseNode.class, ClassMetadata.class},
+
+ return (IdentifierNode) e.create(new Class[] { NodeFactory.class, BaseNode.class, ClassMetadata.class},
new Object[] { this, parent, md } );
//return new IdentifierNode(this, parent, md);
}
@@ -140,29 +141,29 @@
public BaseNode createNode(BaseNode parent, final Class clazz) {
ClassMetadata metadata = getMetaData(clazz);
if(metadata!=null) {
- return createClassNode(parent, clazz.getName() );
+ return createClassNode(parent, clazz.getName() );
}
-
+
return new BaseNode(this, parent) {
public String getHQL() {
return null;
}
-
+
public String getName() {
- return Messages.NODEFACTORY_UNKNOWN + clazz;
+ return ConsoleMessages.NodeFactory_unknown + clazz;
}
-
+
protected void checkChildren() {
// TODO Auto-generated method stub
}
};
- }
-
+ }
+
public PersistentCollectionNode createPersistentCollectionNode(ClassNode node, String name, ClassMetadata md, CollectionType type, Object baseObject, boolean objectGraph) {
Enhancer e = ProxyFactory.createEnhancer(PersistentCollectionNode.class);
-
+
return (PersistentCollectionNode) e.create(
- new Class[] { NodeFactory.class, BaseNode.class, String.class, CollectionType.class, ClassMetadata.class, CollectionMetadata.class, Object.class, boolean.class},
+ new Class[] { NodeFactory.class, BaseNode.class, String.class, CollectionType.class, ClassMetadata.class, CollectionMetadata.class, Object.class, boolean.class},
new Object[] { this, node, name, type, md, getCollectionMetaData(type.getRole() ), baseObject, Boolean.valueOf(objectGraph) } );
//return new PersistentCollectionNode(this, node, name, type, md, getCollectionMetaData(type.getRole() ), baseObject, objectGraph);
}
@@ -172,7 +173,7 @@
if(type.isEntityType() ) {
EntityType et = (EntityType) type;
if(!et.isOneToOne() ) {
- result = ImageConstants.MANYTOONE;
+ result = ImageConstants.MANYTOONE;
} else {
result = ImageConstants.ONETOONE;
}
@@ -186,11 +187,11 @@
} else {
result = ImageConstants.PROPERTY;
}
-
+
return result;
}
-
-
+
+
public ConsoleConfiguration getConsoleConfiguration() {
return consoleConfiguration;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -28,6 +28,7 @@
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
+import org.hibernate.console.ConsoleMessages;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.metadata.CollectionMetadata;
import org.hibernate.type.CollectionType;
@@ -45,7 +46,7 @@
private boolean objectGraph;
private Object baseObject;
private Object collectionObject;
-
+
boolean childrenCreated = false;
private ClassMetadata md;
public PersistentCollectionNode(NodeFactory factory, BaseNode parent, String name, CollectionType type, ClassMetadata md, CollectionMetadata metadata, Object baseObject, boolean objectGraph) {
@@ -55,9 +56,9 @@
this.name = name;
this.baseObject = baseObject;
this.objectGraph = objectGraph;
-
-
-
+
+
+
iconName = factory.getIconNameForType(type);
this.elementType = metadata.getElementType();
if(objectGraph) {
@@ -66,13 +67,13 @@
virtualNode = factory.createNode(null, elementType.getReturnedClass() );
}
}
-
+
Object initCollectionObject() {
if(collectionObject!=null) return collectionObject;
try {
collectionObject = md.getPropertyValue(baseObject, name, EntityMode.POJO);
} catch (HibernateException e) {
- IllegalArgumentException iae = new IllegalArgumentException(Messages.PERSISTENTCOLLECTIONNODE_COULD_NOT_ACCESS_PROPERTY_VALUE);
+ IllegalArgumentException iae = new IllegalArgumentException(ConsoleMessages.PersistentCollectionNode_could_not_access_property_value);
iae.initCause(e);
throw iae;
}
@@ -82,7 +83,7 @@
public String getHQL() {
return ""; //$NON-NLS-1$
}
-
+
public TreeNode getChildAt(int childIndex) {
checkChildren();
if(objectGraph) {
@@ -125,24 +126,24 @@
int idx = 0;
if(!type.isArrayType() ) {
Iterator i = ( (Collection)collectionObject).iterator();
-
+
while (i.hasNext() ) {
Object element = i.next();
-
+
children.add(createNode(idx++,element, elementType) );
}
} else {
Object[] os = (Object[]) collectionObject;
for (int i = 0; i < os.length; i++) {
Object element = os[i];
- children.add(createNode(idx++, element, elementType) );
+ children.add(createNode(idx++, element, elementType) );
}
-
+
}
-
+
childrenCreated = true;
}
-
+
}
private Object createNode(int idx, Object element, Type type) { // TODO: use a common way to create these darn nodes!
@@ -152,8 +153,8 @@
public String renderLabel(boolean b) {
return getLabel(getName(),b) + " : " + getLabel(type.getReturnedClass().getName(),b) + "<" + getLabel(elementType.getReturnedClass().getName(),b) + ">"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
}
-
- public Type getType() {
+
+ public Type getType() {
return type;
}
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/messages.properties 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/messages.properties 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1,4 +0,0 @@
-CLASSNODE_UNINITIALIZED_PROXY=(uninitialized proxy)
-CONFIGURATIONNODE_MAPPED_ENTITIES=Mapped entities
-NODEFACTORY_UNKNOWN=Unknown ->
-PERSISTENTCOLLECTIONNODE_COULD_NOT_ACCESS_PROPERTY_VALUE=Could not access property value
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -26,6 +26,7 @@
import java.io.IOException;
import java.util.Properties;
+import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.util.StringHelper;
import org.w3c.dom.Document;
@@ -42,17 +43,17 @@
static final String PROJECT_ATTRIB = "project"; //$NON-NLS-1$
static final String USE_PROJECT_CLASSPATH_ATTRIB = "use-project-classpath"; //$NON-NLS-1$
-
-
+
+
private String projectName;
- private String name = Messages.ACCP_UNKNOWN;
+ private String name = ConsoleMessages.AbstractConsoleConfigurationPreferences_unknown;
protected String entityResolverName = null;
private boolean useProjectClasspath;
private ConfigurationMode configurationMode;
private String persistenceUnitName;
private String namingStrategy;
-
+
public AbstractConsoleConfigurationPreferences(String name, ConfigurationMode configurationMode, String projectName, boolean useProjectclassPath, String entityResolver, String persistenceUnitName, String namingStrategy) {
setName(name);
this.persistenceUnitName = persistenceUnitName;
@@ -62,28 +63,28 @@
this.projectName = projectName;
this.useProjectClasspath = useProjectclassPath;
}
-
+
protected AbstractConsoleConfigurationPreferences() {
}
-
+
public ConfigurationMode getConfigurationMode() {
return configurationMode;
}
-
+
public String getPersistenceUnitName() {
return persistenceUnitName;
}
-
+
public String getNamingStrategy() {
return namingStrategy;
}
-
+
public void setName(String name) {
if(name==null || name.trim().length()==0) {
- throw new IllegalArgumentException(Messages.ACCP_NAME_NOT_NULL_OR_EMPTY);
+ throw new IllegalArgumentException(ConsoleMessages.AbstractConsoleConfigurationPreferences_name_not_null_or_empty);
}
-
+
this.name = name;
}
@@ -97,14 +98,14 @@
try {
Properties p = new Properties();
p.load(new FileInputStream(propFile) );
- return p;
- }
+ return p;
+ }
catch(IOException io) {
- throw new HibernateConsoleRuntimeException(Messages.ACCP_COULD_NOT_LOAD_PROP_FILE + propFile, io);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.AbstractConsoleConfigurationPreferences_could_not_load_prop_file + propFile, io);
}
}
- /** generic xml dumper that just dumps the toString representation of the paramters
+ /** generic xml dumper that just dumps the toString representation of the paramters
* @param useAnnotations */
protected static void writeStateTo(Node node, String name, String entityResolver, ConfigurationMode configurationMode, String projectName, boolean useProjectClasspath, Object cfgFile, Object propertyFilename, Object[] mappings, Object[] customClasspath) {
Document doc = node.getOwnerDocument();
@@ -113,80 +114,80 @@
n.setAttribute(ANNOTATIONS_ATTRIB, "true");
}*/
n.setAttribute(CONFIGURATION_MODE_ATTRIB, configurationMode.toString());
-
+
if(StringHelper.isNotEmpty(entityResolver)) {
n.setAttribute(ENTITYRESOLVER_ATTRIB, entityResolver);
}
-
+
if(useProjectClasspath) {
n.setAttribute( USE_PROJECT_CLASSPATH_ATTRIB, "true" ); //$NON-NLS-1$
}
-
+
if(StringHelper.isNotEmpty(projectName)) {
n.setAttribute(PROJECT_ATTRIB, projectName);
}
-
+
node.appendChild(n);
-
+
if(cfgFile!=null) {
n.appendChild(createElementWithAttribute(doc, HIBERNATE_CONFIG_XML_TAG, LOCATION_ATTRIB, cfgFile.toString() ) );
}
-
+
if(propertyFilename!=null) {
n.appendChild(createElementWithAttribute(doc, HIBERNATE_PROPERTIES_TAG, LOCATION_ATTRIB, propertyFilename.toString() ) );
}
-
+
if(mappings.length>0) {
Element cc = createElementWithAttribute(doc, MAPPINGS_TAG, null, null);
n.appendChild(cc);
-
+
for (int i = 0; i < mappings.length; i++) {
Object path = mappings[i];
cc.appendChild(createElementWithAttribute(doc, MAPPING_TAG, LOCATION_ATTRIB, path.toString() ) );
}
}
-
+
if(customClasspath.length>0) {
Element cc = createElementWithAttribute(doc, CLASSPATH_TAG, null, null);
n.appendChild(cc);
-
+
for (int i = 0; i < customClasspath.length; i++) {
Object path = customClasspath[i];
cc.appendChild(createElementWithAttribute(doc, PATH_TAG, LOCATION_ATTRIB, path.toString() ) );
}
}
}
-
+
public boolean useProjectClasspath() {
return useProjectClasspath;
}
-
+
protected void setUseProjectClasspath(boolean useProjectClasspath) {
this.useProjectClasspath = useProjectClasspath;
}
-
-
-
+
+
+
public void setProjectName(String projectName) {
this.projectName = projectName;
}
-
+
public String getProjectName() {
return projectName;
}
-
+
public void readStateFrom(Element node) {
-
+
String entityResolver = null;
String cfgName = null;
String cfgFile = null;
String propFile = null;
String[] mappings = new String[0];
String[] classpath = new String[0];
-
+
cfgName = node.getAttribute(NAME_ATTRIB);
-
-
+
+
String attribute = node.getAttribute(ANNOTATIONS_ATTRIB);
if(StringHelper.isNotEmpty( attribute )) {
boolean oldAnnotationFlag = ((attribute != null) && attribute.equalsIgnoreCase("true")); //$NON-NLS-1$
@@ -199,46 +200,46 @@
attribute = node.getAttribute(CONFIGURATION_MODE_ATTRIB);
configurationMode = ConfigurationMode.parse( attribute );
}
-
-
+
+
attribute = node.getAttribute( PROJECT_ATTRIB );
setProjectName( attribute );
-
+
attribute = node.getAttribute( USE_PROJECT_CLASSPATH_ATTRIB );
setUseProjectClasspath((attribute != null) && attribute.equalsIgnoreCase("true")); //$NON-NLS-1$
-
+
attribute = node.getAttribute(ENTITYRESOLVER_ATTRIB);
if(attribute!=null && attribute.trim().length()>0) {
entityResolver = attribute;
}
-
+
NodeList elements = node.getElementsByTagName(HIBERNATE_CONFIG_XML_TAG);
if(elements.getLength()==1) {
cfgFile = ( (Element)elements.item(0) ).getAttribute(LOCATION_ATTRIB);
}
-
+
elements = node.getElementsByTagName(HIBERNATE_PROPERTIES_TAG);
if(elements.getLength()==1) {
propFile = ( (Element)elements.item(0) ).getAttribute(LOCATION_ATTRIB);
}
-
-
- mappings = parseListOfLocations(node, MAPPINGS_TAG, MAPPING_TAG);
+
+
+ mappings = parseListOfLocations(node, MAPPINGS_TAG, MAPPING_TAG);
classpath = parseListOfLocations(node, CLASSPATH_TAG, PATH_TAG);
-
-
+
+
setName(cfgName);
setEntityResolverName(entityResolver);
setConfigFile(cfgFile);
setPropertyFile(propFile);
setMappings(mappings);
setCustomClassPath(classpath);
-
+
}
private void setEntityResolverName(String entityResolver) {
this.entityResolverName = entityResolver;
-
+
}
private String[] parseListOfLocations(Element node, String parenttag, String elementag) {
@@ -256,19 +257,19 @@
return result;
}
- /**
+ /**
* generic XML handling. Ugly like hell - but done to reduce jar requirements and code duplication.
- * TODO: make better ;)
+ * TODO: make better ;)
**/
-
+
public String getEntityResolverName() { return entityResolverName; };
-
+
protected abstract void setConfigFile(String cfgFile);
protected abstract void setPropertyFile(String cfgFile);
protected abstract void setMappings(String[] mappings);
protected abstract void setCustomClassPath(String[] mappings);
-
-
+
+
protected static Element createElementWithAttribute(Document doc, String tagName, String attribName, String attributValue) {
Element n;
n = doc.createElement(tagName);
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/Messages.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/Messages.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1,19 +0,0 @@
-package org.hibernate.console.preferences;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.console.preferences.messages"; //$NON-NLS-1$
- public static String ACCP_COULD_NOT_LOAD_PROP_FILE;
- public static String ACCP_NAME_NOT_NULL_OR_EMPTY;
- public static String ACCP_UNKNOWN;
- public static String STANDALONECONSOLECONFIGURATIONPREFERENCES_COULD_NOT_RESOLVE_CLASSPATHS;
- public static String STANDALONECONSOLECONFIGURATIONPREFERENCES_ERRORS_WHILE_PARSING;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/StandAloneConsoleConfigurationPreferences.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/StandAloneConsoleConfigurationPreferences.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/StandAloneConsoleConfigurationPreferences.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -30,6 +30,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -42,58 +43,58 @@
private File cfgFile;
private File propertyFilename;
private File[] mappings;
- private File[] customClasspath;
+ private File[] customClasspath;
public StandAloneConsoleConfigurationPreferences(String name, File xmlconfig, File propertiesFile, File[] mappingFiles, File[] customClasspath) {
super(name, ConfigurationMode.CORE, null, false, null, null, null);
this.cfgFile = xmlconfig;
this.propertyFilename = propertiesFile;
this.mappings = mappingFiles;
- this.customClasspath = customClasspath;
+ this.customClasspath = customClasspath;
}
protected StandAloneConsoleConfigurationPreferences() {
// hidden for others
}
-
+
protected StandAloneConsoleConfigurationPreferences(String name) {
this(name,null,null,new File[0],new File[0]);
}
-
+
/**
* @return return non-null array of URLs for a customclasspath
*/
public URL[] getCustomClassPathURLS() {
URL[] result = new URL[customClasspath.length];
-
+
for (int i = 0; i < customClasspath.length; i++) {
File file = customClasspath[i];
try {
result[i] = file.toURL();
- }
+ }
catch (MalformedURLException mue) {
- throw new HibernateConsoleRuntimeException(Messages.STANDALONECONSOLECONFIGURATIONPREFERENCES_COULD_NOT_RESOLVE_CLASSPATHS, mue);
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.StandAloneConsoleConfigurationPreferences_could_not_resolve_classpaths, mue);
}
}
return result;
}
-
+
/**
* @return return non-null array of URLs for mapping files
*/
public File[] getMappingFiles() {
return mappings;
}
-
+
public File getConfigXMLFile() {
return cfgFile;
}
public void writeStateTo(Element node) {
- writeStateTo(node, getName(), getEntityResolverName(), getConfigurationMode(), null, false, cfgFile, propertyFilename, mappings, customClasspath);
+ writeStateTo(node, getName(), getEntityResolverName(), getConfigurationMode(), null, false, cfgFile, propertyFilename, mappings, customClasspath);
}
-
+
public File getPropertyFile() {
return propertyFilename;
}
@@ -111,7 +112,7 @@
this.mappings = new File[mappings.length];
for (int i = 0; i < mappings.length; i++) {
String str = mappings[i];
- this.mappings[i] = new File(str);
+ this.mappings[i] = new File(str);
}
}
@@ -119,37 +120,37 @@
this.customClasspath = new File[mappings.length];
for (int i = 0; i < mappings.length; i++) {
String str = mappings[i];
- this.customClasspath[i] = new File(str);
+ this.customClasspath[i] = new File(str);
}
- }
+ }
public static StandAloneConsoleConfigurationPreferences[] readStateFrom(File f) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser;
try {
parser = factory.newDocumentBuilder();
-
+
Document doc = parser.parse(f);
-
+
Element root = doc.getDocumentElement();
-
+
NodeList elementsByTagName = root.getElementsByTagName(CONFIGURATION_TAG);
StandAloneConsoleConfigurationPreferences[] result = new StandAloneConsoleConfigurationPreferences[elementsByTagName.getLength()];
-
+
for(int i = 0; i < elementsByTagName.getLength(); i++) {
result[i] = new StandAloneConsoleConfigurationPreferences();
result[i].readStateFrom( (Element)elementsByTagName.item(i) );
}
return result;
- }
+ }
catch(SAXException sa) {
- throw new HibernateConsoleRuntimeException(Messages.STANDALONECONSOLECONFIGURATIONPREFERENCES_ERRORS_WHILE_PARSING + f,sa);
- }
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.StandAloneConsoleConfigurationPreferences_errors_while_parsing + f,sa);
+ }
catch (ParserConfigurationException e) {
- throw new HibernateConsoleRuntimeException(Messages.STANDALONECONSOLECONFIGURATIONPREFERENCES_ERRORS_WHILE_PARSING + f,e);
- }
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.StandAloneConsoleConfigurationPreferences_errors_while_parsing + f,e);
+ }
catch (IOException e) {
- throw new HibernateConsoleRuntimeException(Messages.STANDALONECONSOLECONFIGURATIONPREFERENCES_ERRORS_WHILE_PARSING + f,e);
- }
+ throw new HibernateConsoleRuntimeException(ConsoleMessages.StandAloneConsoleConfigurationPreferences_errors_while_parsing + f,e);
+ }
}
}
\ No newline at end of file
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/messages.properties 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/messages.properties 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1,5 +0,0 @@
-ACCP_COULD_NOT_LOAD_PROP_FILE=Could not load property file
-ACCP_NAME_NOT_NULL_OR_EMPTY=Name cannot be null or empty
-ACCP_UNKNOWN=<unknown>
-STANDALONECONSOLECONFIGURATIONPREFERENCES_COULD_NOT_RESOLVE_CLASSPATHS=Could not resolve classpaths
-STANDALONECONSOLECONFIGURATIONPREFERENCES_ERRORS_WHILE_PARSING=Errors while parsing
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/Messages.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/Messages.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1,16 +0,0 @@
-package org.hibernate.eclipse.logging;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.eclipse.logging.messages"; //$NON-NLS-1$
- public static String PLUGINFILEAPPENDER_MISSING_PLUGIN_STATE_LOCATION;
- public static String PLUGINLOGAPPENDER_MISSING_LAYOUT_FOR_APPENDER;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginFileAppender.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginFileAppender.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginFileAppender.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -27,44 +27,45 @@
import org.apache.log4j.RollingFileAppender;
import org.apache.log4j.spi.LoggingEvent;
import org.eclipse.core.runtime.IPath;
+import org.hibernate.console.ConsoleMessages;
/**
* PluginFileAppender
- * This class is a custom Log4J appender that sends Log4J events to
+ * This class is a custom Log4J appender that sends Log4J events to
* the Eclipse plug-in state location. It extends the RollingFileAppender class.
* @author Manoel Marques
*/
public class PluginFileAppender extends RollingFileAppender {
private IPath stateLocation;
- private boolean activateOptionsPending;
+ private boolean activateOptionsPending;
private boolean translatePath = true;
-
+
/**
* Creates a new PluginFileAppender.
*/
public PluginFileAppender() {
super();
}
-
+
/**
* Creates a new PluginFileAppender.
* @param layout layout instance.
- * @param stateLocation IPath containing the plug-in state location
- */
+ * @param stateLocation IPath containing the plug-in state location
+ */
public PluginFileAppender(Layout layout,IPath stateLocation) {
super();
setLayout(layout);
- setStateLocation(stateLocation);
+ setStateLocation(stateLocation);
}
-
+
/**
* Creates a new PluginFileAppender.
* @param layout layout instance.
- * @param stateLocation IPath containing the plug-in state location
+ * @param stateLocation IPath containing the plug-in state location
* @param file file name
* @param append true if file is to be appended
- */
+ */
public PluginFileAppender(Layout layout,IPath stateLocation, String file, boolean append)
throws IOException {
super();
@@ -78,9 +79,9 @@
/**
* Creates a new PluginFileAppender.
* @param layout layout instance.
- * @param stateLocation IPath containing the plug-in state location
+ * @param stateLocation IPath containing the plug-in state location
* @param file file name
- */
+ */
public PluginFileAppender(Layout layout,IPath stateLocation, String file) throws IOException {
super();
setLayout(layout);
@@ -88,88 +89,88 @@
setFile(file);
activateOptions();
}
-
+
/**
* Sets the state location. If activateOptions call is pending, translate the file name
- * and call activateOptions
- * @param stateLocation IPath containing the plug-in state location
- */
+ * and call activateOptions
+ * @param stateLocation IPath containing the plug-in state location
+ */
void setStateLocation(IPath stateLocation) {
- this.stateLocation = stateLocation;
+ this.stateLocation = stateLocation;
if (this.stateLocation != null && this.activateOptionsPending) {
this.activateOptionsPending = false;
setFile(getFile());
activateOptions();
}
}
-
+
/**
- * Sets the file name.Translate it before setting.
+ * Sets the file name.Translate it before setting.
* @param file file name
- */
+ */
public void setFile(String file) {
super.setFile(getTranslatedFileName(file));
}
-
+
/**
* Set file options and opens it, leaving ready to write.
* @param file file name
* @param append true if file is to be appended
* @param bufferedIO true if file is to buffered
* @param bufferSize buffer size
- * @throws IOException - IO Error happend or the state location was not set
- */
+ * @throws IOException - IO Error happend or the state location was not set
+ */
public void setFile(String fileName,boolean append,boolean bufferedIO,int bufferSize) throws IOException {
- if (this.stateLocation == null)
- throw new IOException(Messages.PLUGINFILEAPPENDER_MISSING_PLUGIN_STATE_LOCATION);
-
- fileName = (this.translatePath) ? getTranslatedFileName(fileName) : fileName;
+ if (this.stateLocation == null)
+ throw new IOException(ConsoleMessages.PluginFileAppender_missing_plugin_state_location);
+
+ fileName = (this.translatePath) ? getTranslatedFileName(fileName) : fileName;
super.setFile(fileName,append,bufferedIO,bufferSize);
}
-
+
/**
- * Finishes instance initialization. If state location was not set, set activate as
+ * Finishes instance initialization. If state location was not set, set activate as
* pending and does nothing.
- */
+ */
public void activateOptions() {
- if (this.stateLocation == null) {
+ if (this.stateLocation == null) {
this.activateOptionsPending = true;
return;
- }
-
+ }
+
// base class will call setFile, don't translate the name
// because it was already translated
this.translatePath = false;
- super.activateOptions();
+ super.activateOptions();
this.translatePath = true;
}
-
+
/**
* Any path part of a file is removed and the state location is added to the name
* to form a new path. If there is not state location, returns the name unmodified.
* @param file file name
- * @return translated file name
+ * @return translated file name
*/
private String getTranslatedFileName(String file) {
-
+
if (this.stateLocation == null || file == null)
return file;
-
+
file = file.trim();
if (file.length() == 0)
return file;
-
+
int index = file.lastIndexOf('/');
if (index == -1)
index = file.lastIndexOf('\\');
-
- if (index != -1)
+
+ if (index != -1)
file = file.substring(index + 1);
-
- IPath newPath = this.stateLocation.append(file);
+
+ IPath newPath = this.stateLocation.append(file);
return newPath.toString();
}
-
+
public void append(LoggingEvent event) {
super.append( event );
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java 2008-06-06 16:52:05 UTC (rev 8617)
@@ -32,28 +32,29 @@
import org.apache.log4j.spi.ThrowableInformation;
import org.eclipse.core.runtime.ILog;
import org.eclipse.ui.console.MessageConsoleStream;
+import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.KnownConfigurations;
/**
* PluginLogAppender
- * This class is a custom Log4J appender that sends Log4J events to
+ * This class is a custom Log4J appender that sends Log4J events to
* the Eclipse plug-in log.
* @author Manoel Marques
*/
public class PluginLogAppender extends AppenderSkeleton {
-
+
private ILog pluginLog;
private Map streams = new HashMap();
-
-
+
+
/**
* Sets the Eclipse log instance
* @param log plug-in log
- */
+ */
void setLog(ILog pluginLog) {
this.pluginLog = pluginLog;
}
-
+
/**
* Log event happened.
* Translates level to status instance codes:
@@ -62,37 +63,37 @@
* level > Level.DEBUG - Status.INFO
* default - Status.OK
* @param event LoggingEvent instance
- */
+ */
public void append(LoggingEvent event) {
-
+
if (this.layout == null) {
- this.errorHandler.error(Messages.PLUGINLOGAPPENDER_MISSING_LAYOUT_FOR_APPENDER +
- this.name,null,ErrorCode.MISSING_LAYOUT);
+ this.errorHandler.error(ConsoleMessages.PluginLogAppender_missing_layout_for_appender +
+ this.name,null,ErrorCode.MISSING_LAYOUT);
return;
}
-
+
String text = this.layout.format(event);
-
+
Throwable thrown = null;
if (this.layout.ignoresThrowable()) {
ThrowableInformation info = event.getThrowableInformation();
if (info != null)
- thrown = info.getThrowable();
+ thrown = info.getThrowable();
}
- /*
+ /*
Level level = event.getLevel();
int severity = IStatus.OK;
-
- if (level.toInt() >= Priority.ERROR_INT)
+
+ if (level.toInt() >= Priority.ERROR_INT)
severity = IStatus.ERROR;
else
if (level.toInt() >= Priority.WARN_INT)
severity = IStatus.WARNING;
else
- if (level.toInt() >= Priority.DEBUG_INT)
+ if (level.toInt() >= Priority.DEBUG_INT)
severity = IStatus.INFO;
-
-
+
+
this.pluginLog.log(new Status(severity,
this.pluginLog.getBundle().getSymbolicName(),
level.toInt(),text,thrown));*/
@@ -107,22 +108,22 @@
stream.println(stringWriter.getBuffer().toString());
}
}
-
+
}
-
-
-
+
+
+
/**
* Closes this appender
- */
+ */
public void close() {
- this.closed = true;
+ this.closed = true;
}
-
+
/**
* Checks if this appender requires layout
* @return true if layout is required.
- */
+ */
public boolean requiresLayout() {
return true;
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/messages.properties 2008-06-06 16:51:51 UTC (rev 8616)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/messages.properties 2008-06-06 16:52:05 UTC (rev 8617)
@@ -1,2 +0,0 @@
-PLUGINFILEAPPENDER_MISSING_PLUGIN_STATE_LOCATION=Missing Plugin State Location.
-PLUGINLOGAPPENDER_MISSING_LAYOUT_FOR_APPENDER=Missing layout for appender
17 years, 10 months
JBoss Tools SVN: r8616 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view: views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-06-06 12:51:51 -0400 (Fri, 06 Jun 2008)
New Revision: 8616
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/UIViewMessages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/UIViewMessages.properties
Removed:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/messages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/messages.properties
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/BaseUIPlugin.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ViewPlugin.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
Log:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-500
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/BaseUIPlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/BaseUIPlugin.java 2008-06-06 16:51:42 UTC (rev 8615)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/BaseUIPlugin.java 2008-06-06 16:51:51 UTC (rev 8616)
@@ -7,7 +7,7 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.hibernate.ui.view;
import org.eclipse.core.runtime.IStatus;
@@ -18,11 +18,11 @@
/**
* Provides an easy way to log status of events.
- *
+ *
* NOTE: It is useful to make the static method getPluginLog()
* which provides the interface IPluginLog for using it in your code
* in future
- *
+ *
* @author Sergey Vasilyev
*
*/
@@ -44,7 +44,7 @@
public void logInfo(String message, Throwable t) {
LogHelper.logInfo(this, message, t);
}
-
+
public void logInfo(String message) {
LogHelper.logInfo(this, message);
}
@@ -65,6 +65,6 @@
logError(message, t);
Shell shell = Display.getDefault().getActiveShell();
IStatus s = StatusFactory.getInstance(IStatus.ERROR, this.getBundle().getSymbolicName(), message, t);
- ErrorDialog.openError(shell, Messages.BASEUIPLUGIN_HIBERNATE_CONSOLE, message, s);
+ ErrorDialog.openError(shell, UIViewMessages.BaseUIPlugin_hibernate_console, message, s);
}
}
\ No newline at end of file
Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/Messages.java 2008-06-06 16:51:42 UTC (rev 8615)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/Messages.java 2008-06-06 16:51:51 UTC (rev 8616)
@@ -1,16 +0,0 @@
-package org.jboss.tools.hibernate.ui.view;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.hibernate.ui.view.messages"; //$NON-NLS-1$
- public static String BASEUIPLUGIN_HIBERNATE_CONSOLE;
- public static String VIEWPLUGIN_CANOT_LOAD_PREFERENCE_STORE_PROPERTIES;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Copied: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/UIViewMessages.java (from rev 8544, trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/Messages.java)
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/UIViewMessages.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/UIViewMessages.java 2008-06-06 16:51:51 UTC (rev 8616)
@@ -0,0 +1,19 @@
+package org.jboss.tools.hibernate.ui.view;
+
+import org.eclipse.osgi.util.NLS;
+
+public class UIViewMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.hibernate.ui.view.UIViewMessages"; //$NON-NLS-1$
+ public static String BaseUIPlugin_hibernate_console;
+ public static String ViewPlugin_canot_load_preference_store_properties;
+ public static String OrmLabelProvider_element;
+ public static String OrmLabelProvider_orm_element;
+ public static String OrmLabelProvider_unknown_type_of_element_in_tree_of_type;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, UIViewMessages.class);
+ }
+
+ private UIViewMessages() {
+ }
+}
Copied: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/UIViewMessages.properties (from rev 8544, trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/messages.properties)
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/UIViewMessages.properties (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/UIViewMessages.properties 2008-06-06 16:51:51 UTC (rev 8616)
@@ -0,0 +1,6 @@
+BaseUIPlugin_hibernate_console=Hibernate Console
+ViewPlugin_canot_load_preference_store_properties=Can't load preference store properties
+
+OrmLabelProvider_element=element
+OrmLabelProvider_orm_element=OrmElement
+OrmLabelProvider_unknown_type_of_element_in_tree_of_type=Unknown type of element in tree of type:
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ViewPlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ViewPlugin.java 2008-06-06 16:51:42 UTC (rev 8615)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/ViewPlugin.java 2008-06-06 16:51:51 UTC (rev 8616)
@@ -38,20 +38,20 @@
public class ViewPlugin extends BaseUIPlugin {
private static ViewPlugin plugin;
private ResourceBundle resourceBundle;
-
+
public static final ResourceBundle BUNDLE_IMAGE = ResourceBundle.getBundle(ViewPlugin.class.getPackage().getName() + ".image"); //$NON-NLS-1$
-
+
public static boolean TRACE = false;
- public static boolean TRACE_VIEW = false;
+ public static boolean TRACE_VIEW = false;
public static boolean TRACE_WIZARD = false;
-
+
public static final String PLUGIN_ID = "org.jboss.tools.hibernate.view"; //$NON-NLS-1$
public static final String autoMappingSettingPrefPage = "autoMappingSettingPrefPage"; //$NON-NLS-1$
-
+
public ViewPlugin() {
super();
plugin = this;
-
+
try {
resourceBundle = ResourceBundle.getBundle(PLUGIN_ID + ".EditPluginResources"); //$NON-NLS-1$
} catch (MissingResourceException x) {
@@ -69,7 +69,7 @@
return ImageDescriptor.getMissingImageDescriptor();
}
}
-
+
public void start(BundleContext context) throws Exception {
super.start(context);
}
@@ -94,48 +94,48 @@
public ResourceBundle getResourceBundle() {
return resourceBundle;
}
-
+
public static Shell getActiveWorkbenchShell() {
IWorkbenchWindow window = getActiveWorkbenchWindow();
if (window != null) {
return window.getShell();
}
return null;
- }
+ }
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
}
-
+
public static IWorkbenchPage getPage(){
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
return window.getActivePage();
}
-
+
static {
-
+
String value = Platform.getDebugOption(PLUGIN_ID + "/debug"); //$NON-NLS-1$
if (value != null && value.equalsIgnoreCase("true")) TRACE = true; //$NON-NLS-1$
-
+
value = Platform.getDebugOption(PLUGIN_ID + "/debug/view"); //$NON-NLS-1$
if (value != null && value.equalsIgnoreCase("true")) TRACE_VIEW = true; //$NON-NLS-1$
-
+
value = Platform.getDebugOption(PLUGIN_ID + "/debug/view/wizard"); //$NON-NLS-1$
if (value != null && value.equalsIgnoreCase("true")) TRACE_WIZARD = true; //$NON-NLS-1$
-
+
}
-
+
public static void loadPreferenceStoreProperties(Properties properties, String key){
IPreferenceStore preferenceStore = ViewPlugin.getDefault().getPreferenceStore();
String value = preferenceStore.getString(key);
if (value.length() != 0){
- ByteArrayInputStream bain = new ByteArrayInputStream(value.getBytes());
+ ByteArrayInputStream bain = new ByteArrayInputStream(value.getBytes());
try {
properties.load(bain);
} catch (IOException e) {
- getDefault().logError(Messages.VIEWPLUGIN_CANOT_LOAD_PREFERENCE_STORE_PROPERTIES, e);
+ getDefault().logError(UIViewMessages.ViewPlugin_canot_load_preference_store_properties, e);
}
}
- }
+ }
}
\ No newline at end of file
Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/messages.properties 2008-06-06 16:51:42 UTC (rev 8615)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/messages.properties 2008-06-06 16:51:51 UTC (rev 8616)
@@ -1,2 +0,0 @@
-BASEUIPLUGIN_HIBERNATE_CONSOLE=Hibernate Console
-VIEWPLUGIN_CANOT_LOAD_PREFERENCE_STORE_PROPERTIES=Can't load preference store properties
Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/Messages.java 2008-06-06 16:51:42 UTC (rev 8615)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/Messages.java 2008-06-06 16:51:51 UTC (rev 8616)
@@ -1,17 +0,0 @@
-package org.jboss.tools.hibernate.ui.view.views;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.hibernate.ui.view.views.messages"; //$NON-NLS-1$
- public static String ORMLABELPROVIDER_ELEMENT;
- public static String ORMLABELPROVIDER_ORM_ELEMENT;
- public static String ORMLABELPROVIDER_UNKNOWN_TYPE_OF_ELEMENT_IN_TREE_OF_TYPE;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2008-06-06 16:51:42 UTC (rev 8615)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2008-06-06 16:51:51 UTC (rev 8616)
@@ -38,6 +38,7 @@
import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.hibernate.mapping.UnionSubclass;
+import org.jboss.tools.hibernate.ui.view.UIViewMessages;
public class OrmLabelProvider extends LabelProvider implements IColorProvider, IFontProvider {
@@ -48,12 +49,12 @@
public OrmLabelProvider(OrmModelImageVisitor imageVisitor, OrmModelNameVisitor nameVisitor) {
super();
ormModelImageVisitor = imageVisitor;
- ormModelNameVisitor = nameVisitor;
+ ormModelNameVisitor = nameVisitor;
}
-
+
public Image getImage(Object element) {
ImageDescriptor descriptor = null;
-
+
if (element instanceof RootClass) {
descriptor = (ImageDescriptor) ((RootClass) element).accept(ormModelImageVisitor);
} else if (element instanceof UnionSubclass) {
@@ -83,7 +84,7 @@
} else if (element instanceof SimpleValue) {
descriptor = (ImageDescriptor)ormModelImageVisitor.visitSimpleValueMapping((SimpleValue) element);
} else {
- return null;
+ return null;
}
Image image = (Image) imageCache.get(descriptor);
@@ -98,42 +99,42 @@
if (element instanceof RootClass) {
String name = (String)ormModelNameVisitor.visitPersistentClass((RootClass)element, null);
if (name == null) {
- return Messages.ORMLABELPROVIDER_ORM_ELEMENT;
+ return UIViewMessages.OrmLabelProvider_orm_element;
} else {
return name;
}
} else if (element instanceof Table) {
String name = (String)ormModelNameVisitor.visitTable((Table)element, null);
if (name == null) {
- return Messages.ORMLABELPROVIDER_ORM_ELEMENT;
+ return UIViewMessages.OrmLabelProvider_orm_element;
} else {
return name;
}
} else if (element instanceof Subclass) {
String name = (String)ormModelNameVisitor.visitPersistentClass((Subclass)element, null);
if (name == null) {
- return Messages.ORMLABELPROVIDER_ORM_ELEMENT;
+ return UIViewMessages.OrmLabelProvider_orm_element;
} else {
return name;
}
} else if (element instanceof Property) {
String name = (String)ormModelNameVisitor.visitPersistentField((Property)element, null);
if (name == null) {
- return Messages.ORMLABELPROVIDER_ORM_ELEMENT;
+ return UIViewMessages.OrmLabelProvider_orm_element;
} else {
return name;
}
} else if (element instanceof Column) {
String name = (String)ormModelNameVisitor.visitDatabaseColumn((Column)element, cfg);
if (name == null) {
- return Messages.ORMLABELPROVIDER_ORM_ELEMENT;
+ return UIViewMessages.OrmLabelProvider_orm_element;
} else {
return name;
}
} else if (element instanceof OneToMany || element instanceof ManyToOne) {
- String name = Messages.ORMLABELPROVIDER_ELEMENT;
+ String name = UIViewMessages.OrmLabelProvider_element;
if (name == null) {
- return Messages.ORMLABELPROVIDER_ORM_ELEMENT;
+ return UIViewMessages.OrmLabelProvider_orm_element;
} else {
return name;
}
@@ -141,19 +142,19 @@
if (element instanceof DependantValue) {
String name = (String)ormModelNameVisitor.visitCollectionKeyMapping((DependantValue)element, null);
if (name == null) {
- return Messages.ORMLABELPROVIDER_ORM_ELEMENT;
+ return UIViewMessages.OrmLabelProvider_orm_element;
} else {
return name;
}
} else if (element instanceof Component) {
String name = (String)ormModelNameVisitor.visitComponentMapping((Component)element, null);
if (name == null) {
- return Messages.ORMLABELPROVIDER_ORM_ELEMENT;
+ return UIViewMessages.OrmLabelProvider_orm_element;
} else {
return name;
}
} else {
- return Messages.ORMLABELPROVIDER_ELEMENT;
+ return UIViewMessages.OrmLabelProvider_element;
// throw unknownElement(element);
}
} else if (element instanceof String){
@@ -161,16 +162,16 @@
} else {
throw unknownElement(element);
}
-
+
}
protected RuntimeException unknownElement(Object element) {
if (element != null && element.getClass() != null )
- return new RuntimeException(Messages.ORMLABELPROVIDER_UNKNOWN_TYPE_OF_ELEMENT_IN_TREE_OF_TYPE + element.getClass().getName());
- else return new RuntimeException(Messages.ORMLABELPROVIDER_UNKNOWN_TYPE_OF_ELEMENT_IN_TREE_OF_TYPE + element);
-
+ return new RuntimeException(UIViewMessages.OrmLabelProvider_unknown_type_of_element_in_tree_of_type + element.getClass().getName());
+ else return new RuntimeException(UIViewMessages.OrmLabelProvider_unknown_type_of_element_in_tree_of_type + element);
+
}
-
+
public void dispose() {
for (Iterator i = imageCache.values().iterator(); i.hasNext();) {
((Image) i.next()).dispose();
@@ -184,7 +185,7 @@
} else if (element instanceof Property) {
return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE);
}
-
+
return null;
}
@@ -197,6 +198,6 @@
return JFaceResources.getFontRegistry().getBold(JFaceResources.getTextFont().getFontData()[0].getName());
}*/
return null;
- }
+ }
}
\ No newline at end of file
Deleted: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/messages.properties 2008-06-06 16:51:42 UTC (rev 8615)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/messages.properties 2008-06-06 16:51:51 UTC (rev 8616)
@@ -1,3 +0,0 @@
-ORMLABELPROVIDER_ELEMENT=element
-ORMLABELPROVIDER_ORM_ELEMENT=OrmElement
-ORMLABELPROVIDER_UNKNOWN_TYPE_OF_ELEMENT_IN_TREE_OF_TYPE=Unknown type of element in tree of type:
17 years, 10 months
JBoss Tools SVN: r8615 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper: editors and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-06-06 12:51:42 -0400 (Fri, 06 Jun 2008)
New Revision: 8615
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties
Removed:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/messages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/messages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/messages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/messages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/messages.properties
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ChooseConsoleConfigurationDialog.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/HibernateCfgXmlEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ColumnDetailsPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/CounterFormPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/HibernateConfigurationForm.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ParamDetailsPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/PrimaryKeyDetailsPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngFormEditorPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngOverviewPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTableFilterPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTablesPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTypeMappingPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TableDetailsPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TableFilterFormPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesLabelProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingFormPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/GeneratorTypeHandler.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HibernateTypeHandler.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PropertyAccessHandler.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngPrimaryKeyAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/HibernateXMLContentOutlineConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/JFaceNodeAdapterForXML.java
Log:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-500
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -0,0 +1,109 @@
+package org.hibernate.eclipse.mapper;
+
+import org.eclipse.osgi.util.NLS;
+
+public class MapperMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.hibernate.eclipse.mapper.MapperMessages"; //$NON-NLS-1$
+ public static String ChooseConsoleConfigurationDialog_console_configuration;
+ public static String ChooseConsoleConfigurationDialog_select_console_configuration;
+ public static String HibernateCfgXmlEditor_configuration;
+ public static String HibernateCfgXmlEditor_could_not_create_form_part;
+ public static String ReverseEngineeringEditor_could_not_create_graphical_viewer;
+ public static String ReverseEngineeringEditor_error_while_refreshing_databasetree;
+ public static String ReverseEngineeringEditor_no_filters_defined;
+ public static String ReverseEngineeringEditor_no_filters_has_been_defined;
+ public static String ReverseEngineeringEditor_overview;
+ public static String ReverseEngineeringEditor_table_column;
+ public static String ReverseEngineeringEditor_table_filters;
+ public static String ReverseEngineeringEditor_type_mappings;
+ public static String ColumnDetailsPage_column_details;
+ public static String ColumnDetailsPage_exclude_columns_from_reverse_engineering;
+ public static String ColumnDetailsPage_hibernate_type;
+ public static String ColumnDetailsPage_jdbc_type;
+ public static String ColumnDetailsPage_name;
+ public static String ColumnDetailsPage_property_name;
+ public static String ColumnDetailsPage_set_properties_of_selected_column;
+ public static String ColumnDetailsPage_the_hibernate_type;
+ public static String ColumnDetailsPage_the_name_of_the_column;
+ public static String ColumnDetailsPage_the_property_name_which_must_be_used_for;
+ public static String ColumnDetailsPage_which_jdbc_type_this_column_should_have;
+ public static String ConsoleConfigNamePart_console_configuration;
+ public static String ConsoleConfigNamePart_problem_when_trying_to_hibernate_project_info;
+ public static String ConsoleConfigNamePart_select_console_configuration;
+ public static String CounterFormPart_debug_counter;
+ public static String CounterFormPart_debug_counter_for_property_changes;
+ public static String CounterFormPart_zero;
+ public static String GeneratorDetailsPage_class;
+ public static String GeneratorDetailsPage_id_generator_details;
+ public static String GeneratorDetailsPage_set_the_properties_of_the_selected_generator;
+ public static String HibernateConfigurationForm_hibernate_configuration;
+ public static String ParamDetailsPage_generator_parameter_details;
+ public static String ParamDetailsPage_name;
+ public static String ParamDetailsPage_set_the_properties_of_the_selected_parameter;
+ public static String ParamDetailsPage_value;
+ public static String PrimaryKeyDetailsPage_add_column;
+ public static String PrimaryKeyDetailsPage_add_generator;
+ public static String PrimaryKeyDetailsPage_primary_key_can_define_generator_strategy_and_alternative_columns;
+ public static String PrimaryKeyDetailsPage_primary_key_details;
+ public static String RevEngFormEditorPart_need_to_override_formcontent_in;
+ public static String RevEngOverviewPage_contents;
+ public static String RevEngOverviewPage_overview;
+ public static String RevEngOverviewPage_the_content;
+ public static String RevEngTableFilterPage_table_filters;
+ public static String RevEngTablesPage_tables_and_columns;
+ public static String RevEngTypeMappingPage_type_mappings;
+ public static String TableDetailsPage_add_primary_key;
+ public static String TableDetailsPage_catalog;
+ public static String TableDetailsPage_class_name;
+ public static String TableDetailsPage_name;
+ public static String TableDetailsPage_schema;
+ public static String TableDetailsPage_set_properties_of_selected_table;
+ public static String TableDetailsPage_table_details;
+ public static String TableFilterFormPart_table_filters;
+ public static String TableFilterFormPart_table_filters_defines_which_table_included;
+ public static String TablePropertiesBlock_add;
+ public static String TablePropertiesBlock_add_tables_columns;
+ public static String TablePropertiesBlock_delete;
+ public static String TablePropertiesBlock_deselect_all;
+ public static String TablePropertiesBlock_explicitly_control_settings_for_table_columns;
+ public static String TablePropertiesBlock_horizontal_orientation;
+ public static String TablePropertiesBlock_select_all_children;
+ public static String TablePropertiesBlock_select_tables_columns;
+ public static String TablePropertiesBlock_tables_columns;
+ public static String TablePropertiesBlock_vertical_orientation;
+ public static String TablePropertiesLabelProvider_primary_key;
+ public static String TypeMappingFormPart_type_mappings;
+ public static String TypeMappingFormPart_type_mappings_allows_you_define_which_hibernate_type;
+ public static String TypeMappingView_add;
+ public static String TypeMappingView_database_schema;
+ public static String TypeMappingView_do_you_want_to_remove_all_mappings;
+ public static String TypeMappingView_hibernate_type;
+ public static String TypeMappingView_jdbc_type;
+ public static String TypeMappingView_length;
+ public static String TypeMappingView_not_known_button;
+ public static String TypeMappingView_not_null;
+ public static String TypeMappingView_precision;
+ public static String TypeMappingView_remove_all_mappings;
+ public static String TypeMappingView_scale;
+ public static String TypeMappingView_type_mappings;
+ public static String GeneratorTypeHandler_generator_type;
+ public static String GeneratorTypeHandler_return_class;
+ public static String HBMInfoExtractor_access_fields_directly;
+ public static String HBMInfoExtractor_do_not_perform_any_access;
+ public static String HBMInfoExtractor_use_javabean_accessor_methods;
+ public static String HibernateTypeHandler_hibernate_type;
+ public static String HibernateTypeHandler_return_class;
+ public static String HibernateTypeHandler_return_primitive;
+ public static String PropertyAccessHandler_access_method;
+ public static String PropertyAccessHandler_description;
+ public static String DOMReverseEngineeringDefinition_unknown_change;
+ public static String RevEngPrimaryKeyAdapter_column;
+ public static String xml_hibernate_tools;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, MapperMessages.class);
+ }
+
+ private MapperMessages() {
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/MapperMessages.properties 2008-06-06 16:51:42 UTC (rev 8615)
@@ -0,0 +1,95 @@
+ChooseConsoleConfigurationDialog_console_configuration=Console configuration:
+ChooseConsoleConfigurationDialog_select_console_configuration=Select a console configuration
+HibernateCfgXmlEditor_configuration=Configuration
+HibernateCfgXmlEditor_could_not_create_form_part=Could not create form part for hibernate.cfg.xml editor
+ReverseEngineeringEditor_could_not_create_graphical_viewer=Could not create graphical viewer
+ReverseEngineeringEditor_error_while_refreshing_databasetree=Error while refreshing database tree
+ReverseEngineeringEditor_no_filters_defined=No filters defined
+ReverseEngineeringEditor_no_filters_has_been_defined=No filters has been defined.\n This can make the reading of the database schema very slow.\n Do you wish to continue reading the database schema ?
+ReverseEngineeringEditor_overview=Overview
+ReverseEngineeringEditor_table_column=Table && Columns
+ReverseEngineeringEditor_table_filters=Table Filters
+ReverseEngineeringEditor_type_mappings=Type Mappings
+ColumnDetailsPage_column_details=Column Details
+ColumnDetailsPage_exclude_columns_from_reverse_engineering=Exclude column from reverse engineering
+ColumnDetailsPage_hibernate_type=Hibernate Type:
+ColumnDetailsPage_jdbc_type=JDBC Type:
+ColumnDetailsPage_name=Name:
+ColumnDetailsPage_property_name=Property name:
+ColumnDetailsPage_set_properties_of_selected_column=Set the properties of the selected column.
+ColumnDetailsPage_the_hibernate_type=The hibernate type which should be used for this column when used as a property
+ColumnDetailsPage_the_name_of_the_column=The name of the column
+ColumnDetailsPage_the_property_name_which_must_be_used_for=The property name which must be used for this column when used as a property
+ColumnDetailsPage_which_jdbc_type_this_column_should_have=Which JDBC Type this column should have (overriding the type read from the database)
+ConsoleConfigNamePart_console_configuration=Console Configuration
+ConsoleConfigNamePart_problem_when_trying_to_hibernate_project_info=Problem when trying to Hibernate Project information
+ConsoleConfigNamePart_select_console_configuration=Select Console configuration to be used for editing the reverse engineering settings
+CounterFormPart_debug_counter=Debug counter
+CounterFormPart_debug_counter_for_property_changes=debug counter for property changes
+CounterFormPart_zero=Zero
+GeneratorDetailsPage_class=Class:
+GeneratorDetailsPage_id_generator_details=Id Generator details
+GeneratorDetailsPage_set_the_properties_of_the_selected_generator=Set the properties of the selected generator.
+HibernateConfigurationForm_hibernate_configuration=Hibernate Configuration
+ParamDetailsPage_generator_parameter_details=Generator parameter details
+ParamDetailsPage_name=Name:
+ParamDetailsPage_set_the_properties_of_the_selected_parameter=Set the properties of the selected parameter.
+ParamDetailsPage_value=Value:
+PrimaryKeyDetailsPage_add_column=Add column
+PrimaryKeyDetailsPage_add_generator=Add generator
+PrimaryKeyDetailsPage_primary_key_can_define_generator_strategy_and_alternative_columns=A primary key can define a generator strategy and alternative columns
+PrimaryKeyDetailsPage_primary_key_details=Primary key details
+RevEngFormEditorPart_need_to_override_formcontent_in=Need to override formcontent in
+RevEngOverviewPage_contents=Contents
+RevEngOverviewPage_overview=Overview
+RevEngOverviewPage_the_content=<form><p>The content of the reveng.xml is made up of three sections:</p><li style="image" value="page" bindent="5"><a href="typemappings">Type Mappings</a>: lists the mappings from a JDBC/SQL type to Hibernate type.</li><li style="image" value="page" bindent="5"><a href="tablefilter">Table filters</a>: lists which tables that should be included or excluded during reverse engineering.</li><li style="image" value="page" bindent="5"><a href="tables">Tables & Columns</a>: explicitly set properties for tables and columns.</li></form>
+RevEngTableFilterPage_table_filters=Table filters
+RevEngTablesPage_tables_and_columns=Tables & Columns
+RevEngTypeMappingPage_type_mappings=Type Mappings
+TableDetailsPage_add_primary_key=Add primary key
+TableDetailsPage_catalog=Catalog:
+TableDetailsPage_class_name=Class name:
+TableDetailsPage_name=Name:
+TableDetailsPage_schema=Schema:
+TableDetailsPage_set_properties_of_selected_table=Set the properties of the selected table.
+TableDetailsPage_table_details=Table details
+TableFilterFormPart_table_filters=Table filters
+TableFilterFormPart_table_filters_defines_which_table_included=Table filters defines which tables/views are included when performing reverse engineering.
+TablePropertiesBlock_add=Add...
+TablePropertiesBlock_add_tables_columns=Add Tables & Columns
+TablePropertiesBlock_delete=Delete
+TablePropertiesBlock_deselect_all=Deselect all
+TablePropertiesBlock_explicitly_control_settings_for_table_columns=Explicitly control settings for table & columns for which the defaults is not applicable. Click Add, select the relevant tables & columns and adjust their settings here.
+TablePropertiesBlock_horizontal_orientation=Horizontal orientation
+TablePropertiesBlock_select_all_children=Select all children
+TablePropertiesBlock_select_tables_columns=Select tables and columns
+TablePropertiesBlock_tables_columns=Tables & Columns
+TablePropertiesBlock_vertical_orientation=Vertical orientation
+TablePropertiesLabelProvider_primary_key=Primary key
+TypeMappingFormPart_type_mappings=Type mappings
+TypeMappingFormPart_type_mappings_allows_you_define_which_hibernate_type=Type mappings allows you to define which Hibernate type to use for specific JDBC types.
+TypeMappingView_add=Add...
+TypeMappingView_database_schema=Database schema:
+TypeMappingView_do_you_want_to_remove_all_mappings=Do you want to remove all mappings?
+TypeMappingView_hibernate_type=Hibernate Type
+TypeMappingView_jdbc_type=JDBC Type
+TypeMappingView_length=Length
+TypeMappingView_not_known_button=\ not a known button
+TypeMappingView_not_null=Not-Null
+TypeMappingView_precision=Precision
+TypeMappingView_remove_all_mappings=Remove all mappings
+TypeMappingView_scale=Scale
+TypeMappingView_type_mappings=Type mappings:
+GeneratorTypeHandler_generator_type=<b>Generator type</b>:
+GeneratorTypeHandler_return_class=<br><b>Return class</b>:
+HBMInfoExtractor_access_fields_directly=Access fields directly
+HBMInfoExtractor_do_not_perform_any_access=Do not perform any access. Use with HQL-only properties
+HBMInfoExtractor_use_javabean_accessor_methods=Use JavaBean accessor methods
+HibernateTypeHandler_hibernate_type=<b>Hibernate type</b>:
+HibernateTypeHandler_return_class=<br><b>Return class</b>:
+HibernateTypeHandler_return_primitive=<br><b>Return primitive</b>:
+PropertyAccessHandler_access_method=<b>Access method</b>:
+PropertyAccessHandler_description=<br><b>Description</b>:
+DOMReverseEngineeringDefinition_unknown_change=Unknown change: {0} {1}
+RevEngPrimaryKeyAdapter_column=column_
+xml_hibernate_tools=xml (Hibernate Tools)
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ChooseConsoleConfigurationDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ChooseConsoleConfigurationDialog.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ChooseConsoleConfigurationDialog.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -17,19 +17,20 @@
import org.eclipse.swt.widgets.Shell;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.mapper.MapperMessages;
public class ChooseConsoleConfigurationDialog extends TitleAreaDialog {
-
+
private Combo text;
String initialDefault;
String selectedConfigurationName;
-
+
public ChooseConsoleConfigurationDialog(Shell shell, String initialDefault) {
super(shell);
this.initialDefault = initialDefault;
}
-
+
public void prompt() {
open();
@@ -42,7 +43,7 @@
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
- setTitle(Messages.CHOOSCONSOLECONFIGURATIONDIALOG_SELECT_CONSOLE_CONFIGURATION);
+ setTitle(MapperMessages.ChooseConsoleConfigurationDialog_select_console_configuration);
//setMessage("");
if (getTitleImageLabel() != null) {
@@ -56,7 +57,7 @@
protected void configureShell(Shell shell) {
super.configureShell(shell);
- shell.setText(Messages.CHOOSCONSOLECONFIGURATIONDIALOG_SELECT_CONSOLE_CONFIGURATION);
+ shell.setText(MapperMessages.ChooseConsoleConfigurationDialog_select_console_configuration);
}
protected void okPressed() {
@@ -82,10 +83,10 @@
panel.setFont(parent.getFont());
Label label = new Label(panel, SWT.NONE);
- label.setText(Messages.CHOOSCONSOLECONFIGURATIONDIALOG_CONSOLE_CONFIGURATION);
+ label.setText(MapperMessages.ChooseConsoleConfigurationDialog_console_configuration);
text = new Combo(panel, SWT.BORDER | SWT.LEAD | SWT.DROP_DOWN | SWT.READ_ONLY);
-
+
text.setFocus();
text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
| GridData.FILL_HORIZONTAL));
@@ -98,13 +99,13 @@
}
});
setInitialTextValues(text);
-
+
}
private void setInitialTextValues(Combo text) {
ConsoleConfiguration[] recentWorkspaces = KnownConfigurations.getInstance().getConfigurationsSortedByName();
for (int i = 0; i < recentWorkspaces.length; ++i) {
- text.add(recentWorkspaces[i].getName());
+ text.add(recentWorkspaces[i].getName());
}
text.setText(text.getItemCount() > 0 ? text.getItem(0) : initialDefault);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/HibernateCfgXmlEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/HibernateCfgXmlEditor.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/HibernateCfgXmlEditor.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -25,6 +25,7 @@
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.MapperPlugin;
import org.hibernate.eclipse.mapper.editors.reveng.HibernateConfigurationForm;
@@ -33,7 +34,7 @@
private HibernateConfigurationForm configurationForm;
private int configurationPageNo;
private StructuredTextEditor sourcePage;
-
+
public HibernateCfgXmlEditor() {
super();
}
@@ -45,7 +46,7 @@
initSourcePage();
} catch (PartInitException pe) {
MapperPlugin.getDefault().getLogger().logException(
- Messages.HIBERNATECFGXMLEDITOR_COULD_NOT_CREATE_FORM_PART, pe );
+ MapperMessages.HibernateCfgXmlEditor_could_not_create_form_part, pe );
}
}
@@ -53,10 +54,10 @@
int pageCount = getPageCount();
for (int i = 0; i < pageCount; i++) {
if ( getEditor( i ) instanceof StructuredTextEditor ) {
- sourcePage = (StructuredTextEditor) getEditor( i );
+ sourcePage = (StructuredTextEditor) getEditor( i );
}
}
-
+
configurationForm.setModel(getStructuredModel());
}
@@ -64,13 +65,13 @@
configurationForm = new HibernateConfigurationForm();
configurationForm.createPartControl(getContainer());
configurationPageNo = addPage(configurationForm.getControl());
- setPageText(configurationPageNo, Messages.HIBERNATECFGXMLEDITOR_CONFIGURATION);
+ setPageText(configurationPageNo, MapperMessages.HibernateCfgXmlEditor_configuration);
setActivePage( 0 );
}
-
+
IStructuredModel getStructuredModel() {
//TODO:how to get it without usage of deprecated methods ?
return sourcePage.getModel();
}
-
+
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/Messages.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/Messages.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1,26 +0,0 @@
-package org.hibernate.eclipse.mapper.editors;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.eclipse.mapper.editors.messages"; //$NON-NLS-1$
- public static String CHOOSCONSOLECONFIGURATIONDIALOG_CONSOLE_CONFIGURATION;
- public static String CHOOSCONSOLECONFIGURATIONDIALOG_SELECT_CONSOLE_CONFIGURATION;
- public static String HIBERNATECFGXMLEDITOR_CONFIGURATION;
- public static String HIBERNATECFGXMLEDITOR_COULD_NOT_CREATE_FORM_PART;
- public static String REVERSEENGINEERINGEDITOR_COULD_NOT_CREATE_GRAPHICAL_VIEWER;
- public static String REVERSEENGINEERINGEDITOR_ERROR_WHILE_REFRESHING_DATABASETREE;
- public static String REVERSEENGINEERINGEDITOR_NO_FILTERS_DEFINED;
- public static String REVERSEENGINEERINGEDITOR_NO_FILTERS_HAS_BEEN_DEFINED;
- public static String REVERSEENGINEERINGEDITOR_OVERVIEW;
- public static String REVERSEENGINEERINGEDITOR_TABLE_COLUMN;
- public static String REVERSEENGINEERINGEDITOR_TABLE_FILTERS;
- public static String REVERSEENGINEERINGEDITOR_TYPE_MAPPINGS;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -49,6 +49,7 @@
import org.hibernate.eclipse.console.model.ITableFilter;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.console.workbench.LazyDatabaseSchema;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.MapperPlugin;
import org.hibernate.eclipse.mapper.editors.reveng.RevEngOverviewPage;
import org.hibernate.eclipse.mapper.editors.reveng.RevEngTableFilterPage;
@@ -64,17 +65,17 @@
private StructuredTextEditor sourcePage;
private DOMReverseEngineeringDefinition definition;
-
+
private RevEngTableFilterPage tableFilterPage;
private RevEngTypeMappingPage typeMappingsPage;
- private RevEngOverviewPage overviewsPage;
+ private RevEngOverviewPage overviewsPage;
private Map pageNameToIndex = new HashMap();
private RevEngTablesPage tableProperties;
-
+
public ReverseEngineeringEditor() {
-
+
}
-
+
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
super.init( site, input );
@@ -89,7 +90,7 @@
}
catch (PartInitException e) {
MapperPlugin.getDefault().getLogger().logException(
- Messages.REVERSEENGINEERINGEDITOR_COULD_NOT_CREATE_GRAPHICAL_VIEWER, e );
+ MapperMessages.ReverseEngineeringEditor_could_not_create_graphical_viewer, e );
}
}
@@ -97,29 +98,29 @@
int i = 0;
overviewsPage = new RevEngOverviewPage(this);
addPage( i, overviewsPage);
- setPageText(i, Messages.REVERSEENGINEERINGEDITOR_OVERVIEW);
+ setPageText(i, MapperMessages.ReverseEngineeringEditor_overview);
pageNameToIndex.put(RevEngOverviewPage.PART_ID, new Integer(i));
i++;
-
+
typeMappingsPage = new RevEngTypeMappingPage( this );
addPage( i, typeMappingsPage);
- setPageText( i, Messages.REVERSEENGINEERINGEDITOR_TYPE_MAPPINGS );
+ setPageText( i, MapperMessages.ReverseEngineeringEditor_type_mappings );
pageNameToIndex.put(RevEngTypeMappingPage.PART_ID, new Integer(i));
i++;
-
+
tableFilterPage = new RevEngTableFilterPage( this );
addPage( i, tableFilterPage);
- setPageText( i, Messages.REVERSEENGINEERINGEDITOR_TABLE_FILTERS );
- pageNameToIndex.put(RevEngTableFilterPage.PART_ID, new Integer(i));
+ setPageText( i, MapperMessages.ReverseEngineeringEditor_table_filters );
+ pageNameToIndex.put(RevEngTableFilterPage.PART_ID, new Integer(i));
i++;
-
+
tableProperties = new RevEngTablesPage(this );
addPage( i, tableProperties);
- setPageText(i, Messages.REVERSEENGINEERINGEDITOR_TABLE_COLUMN);
+ setPageText(i, MapperMessages.ReverseEngineeringEditor_table_column);
pageNameToIndex.put(RevEngTablesPage.PART_ID, new Integer(i));
i++;
-
+
int activePageIndex = getPreferenceStore().getInt(IXMLPreferenceNames.LAST_ACTIVE_PAGE);
// firstly init overview page with configuration
setActivePage(0);
@@ -132,16 +133,16 @@
Integer number = (Integer) pageNameToIndex.get(string);
if(number!=null) {
setActivePage(number.intValue());
- }
+ }
}*/
-
+
private void initSourcePage() {
int pageCount = getPageCount();
for (int i = 0; i < pageCount; i++) {
if ( getEditor( i ) instanceof StructuredTextEditor ) {
sourcePage = (StructuredTextEditor) getEditor( i );
IDOMDocument document = getDocument(sourcePage);
- definition = new DOMReverseEngineeringDefinition(document);
+ definition = new DOMReverseEngineeringDefinition(document);
}
}
}
@@ -158,24 +159,24 @@
if (service instanceof INestableKeyBindingService) {
INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
nestableService.activateKeyBindingService(null);
- }
+ }
}
saveLastActivePageIndex(newPageIndex);
super.pageChange(newPageIndex);
}
-
+
public IReverseEngineeringDefinition getReverseEngineeringDefinition() {
return definition;
}
-
+
public String getConsoleConfigurationName() {
return overviewsPage.getConsoleConfigName();
}
-
+
protected void setConsoleConfigurationName(String name) {
overviewsPage.setConsoleConfigName(name);
}
-
+
public HibernateNature getHibernateNature() throws CoreException {
if(getEditorInput()!=null) {
IJavaProject project = ProjectUtils.findJavaProject(getEditorInput());
@@ -196,11 +197,11 @@
setConsoleConfigurationName(configuration.getName());
}
}
-
+
ITableFilter[] tableFilters = getReverseEngineeringDefinition().getTableFilters();
Configuration cfg = configuration.buildWith(null, false);
Settings settings = configuration.getSettings(cfg);
-
+
OverrideRepository repository = new OverrideRepository();///*settings.getDefaultCatalogName(),settings.getDefaultSchemaName()*/);
boolean hasIncludes = false;
for (int i = 0; i < tableFilters.length; i++) {
@@ -222,7 +223,7 @@
tf.setMatchName(".*"); //$NON-NLS-1$
repository.addTableFilter(tf);
if(tableFilters.length==0) {
- boolean b = MessageDialog.openQuestion(getContainer().getShell(), Messages.REVERSEENGINEERINGEDITOR_NO_FILTERS_DEFINED, Messages.REVERSEENGINEERINGEDITOR_NO_FILTERS_HAS_BEEN_DEFINED);
+ boolean b = MessageDialog.openQuestion(getContainer().getShell(), MapperMessages.ReverseEngineeringEditor_no_filters_defined, MapperMessages.ReverseEngineeringEditor_no_filters_has_been_defined);
if(!b) {
return null;
}
@@ -233,12 +234,12 @@
// return null;
//}
//}
-
+
LazyDatabaseSchema lazyDatabaseSchema = new LazyDatabaseSchema(configuration, repository.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()));
-
+
return lazyDatabaseSchema;
} catch(HibernateException he) {
- HibernateConsolePlugin.getDefault().showError(getContainer().getShell(), Messages.REVERSEENGINEERINGEDITOR_ERROR_WHILE_REFRESHING_DATABASETREE, he);
+ HibernateConsolePlugin.getDefault().showError(getContainer().getShell(), MapperMessages.ReverseEngineeringEditor_error_while_refreshing_databasetree, he);
return null;
}
}
@@ -250,16 +251,16 @@
return null;
} else {
return KnownConfigurations.getInstance().find( dialog.getSelectedConfigurationName() ); // TODO: double check to see if an result is actually returned ?
- }
+ }
}
-
+
private void saveLastActivePageIndex(int newPageIndex) {
// save the last active page index to preference store
getPreferenceStore().setValue(IXMLPreferenceNames.LAST_ACTIVE_PAGE, newPageIndex);
}
-
+
private IPreferenceStore getPreferenceStore() {
return MapperPlugin.getDefault().getPreferenceStore();
}
-
+
}
\ No newline at end of file
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/messages.properties 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/messages.properties 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1,12 +0,0 @@
-CHOOSCONSOLECONFIGURATIONDIALOG_CONSOLE_CONFIGURATION=Console configuration:
-CHOOSCONSOLECONFIGURATIONDIALOG_SELECT_CONSOLE_CONFIGURATION=Select a console configuration
-HIBERNATECFGXMLEDITOR_CONFIGURATION=Configuration
-HIBERNATECFGXMLEDITOR_COULD_NOT_CREATE_FORM_PART=Could not create form part for hibernate.cfg.xml editor
-REVERSEENGINEERINGEDITOR_COULD_NOT_CREATE_GRAPHICAL_VIEWER=Could not create graphical viewer
-REVERSEENGINEERINGEDITOR_ERROR_WHILE_REFRESHING_DATABASETREE=Error while refreshing database tree
-REVERSEENGINEERINGEDITOR_NO_FILTERS_DEFINED=No filters defined
-REVERSEENGINEERINGEDITOR_NO_FILTERS_HAS_BEEN_DEFINED=No filters has been defined.\n This can make the reading of the database schema very slow.\n Do you wish to continue reading the database schema ?
-REVERSEENGINEERINGEDITOR_OVERVIEW=Overview
-REVERSEENGINEERINGEDITOR_TABLE_COLUMN=Table && Columns
-REVERSEENGINEERINGEDITOR_TABLE_FILTERS=Table Filters
-REVERSEENGINEERINGEDITOR_TYPE_MAPPINGS=Type Mappings
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ColumnDetailsPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ColumnDetailsPage.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ColumnDetailsPage.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -37,6 +37,7 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.hibernate.eclipse.console.model.IRevEngColumn;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.reveng.xpl.FormTextEntry;
public class ColumnDetailsPage extends RevEngDetailsPage implements IDetailsPage, PropertyChangeListener {
@@ -49,63 +50,63 @@
private IRevEngColumn column;
public void buildContents(FormToolkit toolkit, Section section, Composite client) {
- section.setText(Messages.COLUMNDETAILSPAGE_COLUMN_DETAILS);
- section.setDescription(Messages.COLUMNDETAILSPAGE_SET_PROPERTIES_OF_SELECTED_COLUMN);
-
- nameEntry = new FormTextEntry(client, toolkit, Messages.COLUMNDETAILSPAGE_NAME, SWT.NULL);
- nameEntry.setDescription(Messages.COLUMNDETAILSPAGE_THE_NAME_OF_THE_COLUMN);
+ section.setText(MapperMessages.ColumnDetailsPage_column_details);
+ section.setDescription(MapperMessages.ColumnDetailsPage_set_properties_of_selected_column);
+
+ nameEntry = new FormTextEntry(client, toolkit, MapperMessages.ColumnDetailsPage_name, SWT.NULL);
+ nameEntry.setDescription(MapperMessages.ColumnDetailsPage_the_name_of_the_column);
nameEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
column.setName(entry.getValue());
}
});
-
- excluded = toolkit.createButton(client, Messages.COLUMNDETAILSPAGE_EXCLUDE_COLUMNS_FROM_REVERSE_ENGINEERING, SWT.CHECK);
+
+ excluded = toolkit.createButton(client, MapperMessages.ColumnDetailsPage_exclude_columns_from_reverse_engineering, SWT.CHECK);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true,false);
gridData.horizontalSpan = 3;
excluded.setLayoutData(gridData);
excluded.addSelectionListener(new SelectionAdapter() {
-
+
public void widgetSelected(SelectionEvent e) {
column.setExcluded(excluded.getSelection());
}
-
+
});
-
- jdbcTypeEntry = new FormTextEntry(client, toolkit, Messages.COLUMNDETAILSPAGE_JDBC_TYPE, SWT.NULL);
- jdbcTypeEntry.setDescription(Messages.COLUMNDETAILSPAGE_WHICH_JDBC_TYPE_THIS_COLUMN_SHOULD_HAVE);
+
+ jdbcTypeEntry = new FormTextEntry(client, toolkit, MapperMessages.ColumnDetailsPage_jdbc_type, SWT.NULL);
+ jdbcTypeEntry.setDescription(MapperMessages.ColumnDetailsPage_which_jdbc_type_this_column_should_have);
jdbcTypeEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
column.setJDBCType(entry.getValue());
}
});
- propertyEntry = new FormTextEntry(client, toolkit, Messages.COLUMNDETAILSPAGE_PROPERTY_NAME, SWT.NULL);
- propertyEntry.setDescription(Messages.COLUMNDETAILSPAGE_THE_PROPERTY_NAME_WHICH_MUST_BE_USED_FOR);
+ propertyEntry = new FormTextEntry(client, toolkit, MapperMessages.ColumnDetailsPage_property_name, SWT.NULL);
+ propertyEntry.setDescription(MapperMessages.ColumnDetailsPage_the_property_name_which_must_be_used_for);
propertyEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
column.setPropertyName(entry.getValue());
}
});
-
- typeEntry = new FormTextEntry(client, toolkit, Messages.COLUMNDETAILSPAGE_HIBERNATE_TYPE, SWT.NULL);
- typeEntry.setDescription(Messages.COLUMNDETAILSPAGE_THE_HIBERNATE_TYPE);
+
+ typeEntry = new FormTextEntry(client, toolkit, MapperMessages.ColumnDetailsPage_hibernate_type, SWT.NULL);
+ typeEntry.setDescription(MapperMessages.ColumnDetailsPage_the_hibernate_type);
typeEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
column.setType(entry.getValue());
}
- });
+ });
}
public void selectionChanged(IFormPart part, ISelection selection) {
IRevEngColumn newColumn = (IRevEngColumn) ((IStructuredSelection)selection).getFirstElement();
if(column!=null) {
- column.removePropertyChangeListener(this);
+ column.removePropertyChangeListener(this);
}
if(newColumn!=null) {
newColumn.addPropertyChangeListener(this);
}
column = newColumn;
-
+
update();
}
@@ -115,12 +116,12 @@
propertyEntry.setValue(column.getPropertyName());
typeEntry.setValue(column.getType());
excluded.setSelection(column.getExclude());
-
+
nameEntry.setEditable(!column.getExclude());
}
public void propertyChange(PropertyChangeEvent evt) {
- update();
+ update();
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -32,6 +32,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.MapperPlugin;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
import org.hibernate.util.StringHelper;
@@ -40,8 +41,8 @@
private CCombo text;
private ReverseEngineeringEditor re;
-
-
+
+
public ConsoleConfigNamePart(Composite parent, IManagedForm form, ReverseEngineeringEditor re) {
super(parent,form);
this.re = re;
@@ -55,18 +56,18 @@
initialConfg = re.getHibernateNature().getDefaultConsoleConfigurationName();
}
} catch (CoreException e) {
- MapperPlugin.getDefault().getLogger().logException(Messages.CONSOLECONFIGNAMEPART_PROBLEM_WHEN_TRYING_TO_HIBERNATE_PROJECT_INFO,e);
+ MapperPlugin.getDefault().getLogger().logException(MapperMessages.ConsoleConfigNamePart_problem_when_trying_to_hibernate_project_info,e);
}
-
+
text.setText(initialConfg);
}
return false;
}
-
+
public void dispose() {
-
+
}
-
+
Control createClient(IManagedForm form) {
FormToolkit toolkit = form.getToolkit();
Composite composite = toolkit.createComposite(getSection());
@@ -74,31 +75,31 @@
text = new CCombo(composite, SWT.FLAT);
text.setEditable(false);
adaptRecursively(toolkit, text);
-
+
ConsoleConfiguration[] cfg = KnownConfigurations.getInstance().getConfigurationsSortedByName();
String[] names = new String[cfg.length];
for (int i = 0; i < cfg.length; i++) {
ConsoleConfiguration configuration = cfg[i];
names[i] = configuration.getName();
}
- text.setItems(names);
-
+ text.setItems(names);
+
return composite;
}
-
+
protected String getSectionDescription() {
- return Messages.CONSOLECONFIGNAMEPART_SELECT_CONSOLE_CONFIGURATION;
+ return MapperMessages.ConsoleConfigNamePart_select_console_configuration;
}
-
+
protected String getSectionTitle() {
- return Messages.CONSOLECONFIGNAMEPART_CONSOLE_CONFIGURATION;
+ return MapperMessages.ConsoleConfigNamePart_console_configuration;
}
-
+
String getConsoleConfigName() {
return text.getText();
}
public void setConsoleConfigName(String name) {
- text.setText( name );
+ text.setText( name );
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/CounterFormPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/CounterFormPart.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/CounterFormPart.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -31,6 +31,7 @@
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
+import org.hibernate.eclipse.mapper.MapperMessages;
public class CounterFormPart extends RevEngSectionPart {
@@ -49,29 +50,29 @@
public void propertyChange(PropertyChangeEvent evt) {
text.setText("" + cnt++); //$NON-NLS-1$
}
-
+
};
def.addPropertyChangeListener(listener);
return true;
}
-
+
public void dispose() {
def.removePropertyChangeListener(listener);
}
-
+
Control createClient(IManagedForm form) {
FormToolkit toolkit = form.getToolkit();
Composite composite = toolkit.createComposite(getSection());
composite.setLayout(new FillLayout());
- text = toolkit.createText(composite, Messages.COUNTERFORMPART_ZERO);
+ text = toolkit.createText(composite, MapperMessages.CounterFormPart_zero);
return composite;
}
-
+
protected String getSectionDescription() {
- return Messages.COUNTERFORMPART_DEBUG_COUNTER_FOR_PROPERTY_CHANGES;
+ return MapperMessages.CounterFormPart_debug_counter_for_property_changes;
}
-
+
protected String getSectionTitle() {
- return Messages.COUNTERFORMPART_DEBUG_COUNTER;
+ return MapperMessages.CounterFormPart_debug_counter;
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/GeneratorDetailsPage.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -33,38 +33,39 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.hibernate.eclipse.console.model.IRevEngGenerator;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.reveng.xpl.FormTextEntry;
public class GeneratorDetailsPage extends RevEngDetailsPage implements IDetailsPage, PropertyChangeListener {
//private Label label;
private FormTextEntry nameEntry;
-
+
private IRevEngGenerator generator;
-
+
protected void buildContents(FormToolkit toolkit, Section section, Composite client) {
- section.setText(Messages.GENERATORDETAILSPAGE_ID_GENERATOR_DETAILS);
- section.setDescription(Messages.GENERATORDETAILSPAGE_SET_THE_PROPERTIES_OF_THE_SELECTED_GENERATOR);
-
- nameEntry = new FormTextEntry(client, toolkit, Messages.GENERATORDETAILSPAGE_CLASS, SWT.NULL);
+ section.setText(MapperMessages.GeneratorDetailsPage_id_generator_details);
+ section.setDescription(MapperMessages.GeneratorDetailsPage_set_the_properties_of_the_selected_generator);
+
+ nameEntry = new FormTextEntry(client, toolkit, MapperMessages.GeneratorDetailsPage_class, SWT.NULL);
nameEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
generator.setGeneratorClassName(entry.getValue());
}
});
-
+
}
public void selectionChanged(IFormPart part, ISelection selection) {
IRevEngGenerator newTable = (IRevEngGenerator) ((IStructuredSelection)selection).getFirstElement();
if(generator!=null) {
- generator.removePropertyChangeListener(this);
+ generator.removePropertyChangeListener(this);
}
if(newTable!=null) {
newTable.addPropertyChangeListener(this);
}
generator = newTable;
-
+
update();
}
@@ -73,7 +74,7 @@
}
public void propertyChange(PropertyChangeEvent evt) {
- update();
+ update();
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/HibernateConfigurationForm.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/HibernateConfigurationForm.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/HibernateConfigurationForm.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -31,6 +31,7 @@
import org.eclipse.wst.sse.core.internal.provisional.model.IModelStateListenerProposed;
import org.eclipse.wst.sse.core.internal.provisional.model.IStructuredModelEvent;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.w3c.dom.Document;
public class HibernateConfigurationForm {
@@ -71,7 +72,7 @@
public void createPartControl(Composite cotainer) {
this.container = cotainer;
managedForm = new ManagedForm( container );
- getForm().setText( Messages.HIBERNATECONFIGURATIONFORM_HIBERNATE_CONFIGURATION );
+ getForm().setText( MapperMessages.HibernateConfigurationForm_hibernate_configuration );
GridLayout layout = new GridLayout();
layout.numColumns = 2;
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/Messages.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/Messages.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1,84 +0,0 @@
-package org.hibernate.eclipse.mapper.editors.reveng;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.eclipse.mapper.editors.reveng.messages"; //$NON-NLS-1$
- public static String COLUMNDETAILSPAGE_COLUMN_DETAILS;
- public static String COLUMNDETAILSPAGE_EXCLUDE_COLUMNS_FROM_REVERSE_ENGINEERING;
- public static String COLUMNDETAILSPAGE_HIBERNATE_TYPE;
- public static String COLUMNDETAILSPAGE_JDBC_TYPE;
- public static String COLUMNDETAILSPAGE_NAME;
- public static String COLUMNDETAILSPAGE_PROPERTY_NAME;
- public static String COLUMNDETAILSPAGE_SET_PROPERTIES_OF_SELECTED_COLUMN;
- public static String COLUMNDETAILSPAGE_THE_HIBERNATE_TYPE;
- public static String COLUMNDETAILSPAGE_THE_NAME_OF_THE_COLUMN;
- public static String COLUMNDETAILSPAGE_THE_PROPERTY_NAME_WHICH_MUST_BE_USED_FOR;
- public static String COLUMNDETAILSPAGE_WHICH_JDBC_TYPE_THIS_COLUMN_SHOULD_HAVE;
- public static String CONSOLECONFIGNAMEPART_CONSOLE_CONFIGURATION;
- public static String CONSOLECONFIGNAMEPART_PROBLEM_WHEN_TRYING_TO_HIBERNATE_PROJECT_INFO;
- public static String CONSOLECONFIGNAMEPART_SELECT_CONSOLE_CONFIGURATION;
- public static String COUNTERFORMPART_DEBUG_COUNTER;
- public static String COUNTERFORMPART_DEBUG_COUNTER_FOR_PROPERTY_CHANGES;
- public static String COUNTERFORMPART_ZERO;
- public static String GENERATORDETAILSPAGE_CLASS;
- public static String GENERATORDETAILSPAGE_ID_GENERATOR_DETAILS;
- public static String GENERATORDETAILSPAGE_SET_THE_PROPERTIES_OF_THE_SELECTED_GENERATOR;
- public static String HIBERNATECONFIGURATIONFORM_HIBERNATE_CONFIGURATION;
- public static String PARAMDETAILSPAGE_GENERATOR_PARAMETER_DETAILS;
- public static String PARAMDETAILSPAGE_NAME;
- public static String PARAMDETAILSPAGE_SET_THE_PROPERTIES_OF_THE_SELECTED_PARAMETER;
- public static String PARAMDETAILSPAGE_VALUE;
- public static String PRIMARYKEYDETAILSPAGE_ADD_COLUMN;
- public static String PRIMARYKEYDETAILSPAGE_ADD_GENERATOR;
- public static String PRIMARYKEYDETAILSPAGE_PRIMARY_KEY_CAN_DEFINE_GENERATOR_STRATEGY_AND_ALTERNATIVE_COLUMNS;
- public static String PRIMARYKEYDETAILSPAGE_PRIMARY_KEY_DETAILS;
- public static String REVENGFORMEDITORPART_NEED_TO_OVERRIDE_FORMCONTENT_IN;
- public static String REVENGOVERVIEWPAGE_CONTENTS;
- public static String REVENGOVERVIEWPAGE_OVERVIEW;
- public static String REVENGOVERVIEWPAGE_THE_CONTENT;
- public static String REVENGTABLEFILTERPAGE_TABLE_FILTERS;
- public static String REVENGTABLESPAGE_TABLES_AND_COLUMNS;
- public static String REVENGTYPEMAPPINGPAGE_TYPE_MAPPINGS;
- public static String TABLEDETAILSPAGE_ADD_PRIMARY_KEY;
- public static String TABLEDETAILSPAGE_CATALOG;
- public static String TABLEDETAILSPAGE_CLASS_NAME;
- public static String TABLEDETAILSPAGE_NAME;
- public static String TABLEDETAILSPAGE_SCHEMA;
- public static String TABLEDETAILSPAGE_SET_PROPERTIES_OF_SELECTED_TABLE;
- public static String TABLEDETAILSPAGE_TABLE_DETAILS;
- public static String TABLEFILTERFORMPART_TABLE_FILTERS;
- public static String TABLEFILTERFORMPART_TABLE_FILTERS_DEFINES_WHICH_TABLE_INCLUDED;
- public static String TABLEPROPERTIESBLOCK_ADD;
- public static String TABLEPROPERTIESBLOCK_ADD_TABLES_COLUMNS;
- public static String TABLEPROPERTIESBLOCK_DELETE;
- public static String TABLEPROPERTIESBLOCK_DESELECT_ALL;
- public static String TABLEPROPERTIESBLOCK_EXPLICITLY_CONTROL_SETTINGS_FOR_TABLE_COLUMNS;
- public static String TABLEPROPERTIESBLOCK_HORIZONTAL_ORIENTATION;
- public static String TABLEPROPERTIESBLOCK_SELECT_ALL_CHILDREN;
- public static String TABLEPROPERTIESBLOCK_SELECT_TABLES_COLUMNS;
- public static String TABLEPROPERTIESBLOCK_TABLES_COLUMNS;
- public static String TABLEPROPERTIESBLOCK_VERTICAL_ORIENTATION;
- public static String TABLEPROPERTIESLABELPROVIDER_PRIMARY_KEY;
- public static String TYPEMAPPINGFORMPART_TYPE_MAPPINGS;
- public static String TYPEMAPPINGFORMPART_TYPE_MAPPINGS_ALLOWS_YOU_DEFINE_WHICH_HIBERNATE_TYPE;
- public static String TYPEMAPPINGVIEW_ADD;
- public static String TYPEMAPPINGVIEW_DATABASE_SCHEMA;
- public static String TYPEMAPPINGVIEW_DO_YOU_WANT_TO_REMOVE_ALL_MAPPINGS;
- public static String TYPEMAPPINGVIEW_HIBERNATE_TYPE;
- public static String TYPEMAPPINGVIEW_JDBC_TYPE;
- public static String TYPEMAPPINGVIEW_LENGTH;
- public static String TYPEMAPPINGVIEW_NOT_KNOWN_BUTTON;
- public static String TYPEMAPPINGVIEW_NOT_NULL;
- public static String TYPEMAPPINGVIEW_PRECISION;
- public static String TYPEMAPPINGVIEW_REMOVE_ALL_MAPPINGS;
- public static String TYPEMAPPINGVIEW_SCALE;
- public static String TYPEMAPPINGVIEW_TYPE_MAPPINGS;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ParamDetailsPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ParamDetailsPage.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ParamDetailsPage.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -33,6 +33,7 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.hibernate.eclipse.console.model.IRevEngParameter;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.reveng.xpl.FormTextEntry;
public class ParamDetailsPage extends RevEngDetailsPage implements IDetailsPage, PropertyChangeListener {
@@ -40,40 +41,40 @@
// private Label label;
private FormTextEntry nameEntry;
private FormTextEntry valueEntry;
-
+
private IRevEngParameter param;
-
+
protected void buildContents(FormToolkit toolkit, Section section, Composite client) {
- section.setText(Messages.PARAMDETAILSPAGE_GENERATOR_PARAMETER_DETAILS);
- section.setDescription(Messages.PARAMDETAILSPAGE_SET_THE_PROPERTIES_OF_THE_SELECTED_PARAMETER);
-
- nameEntry = new FormTextEntry(client, toolkit, Messages.PARAMDETAILSPAGE_NAME, SWT.NULL);
+ section.setText(MapperMessages.ParamDetailsPage_generator_parameter_details);
+ section.setDescription(MapperMessages.ParamDetailsPage_set_the_properties_of_the_selected_parameter);
+
+ nameEntry = new FormTextEntry(client, toolkit, MapperMessages.ParamDetailsPage_name, SWT.NULL);
nameEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
param.setName(entry.getValue());
}
});
-
- valueEntry = new FormTextEntry(client, toolkit, Messages.PARAMDETAILSPAGE_VALUE, SWT.NULL);
+
+ valueEntry = new FormTextEntry(client, toolkit, MapperMessages.ParamDetailsPage_value, SWT.NULL);
valueEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
param.setValue(entry.getValue());
}
});
-
+
}
public void selectionChanged(IFormPart part, ISelection selection) {
IRevEngParameter newParam = (IRevEngParameter) ((IStructuredSelection)selection).getFirstElement();
if(param!=null) {
- param.removePropertyChangeListener(this);
+ param.removePropertyChangeListener(this);
}
if(newParam!=null) {
newParam.addPropertyChangeListener(this);
}
-
+
param = newParam;
-
+
update();
}
@@ -83,7 +84,7 @@
}
public void propertyChange(PropertyChangeEvent evt) {
- update();
+ update();
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/PrimaryKeyDetailsPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/PrimaryKeyDetailsPage.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/PrimaryKeyDetailsPage.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -36,38 +36,39 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.hibernate.eclipse.console.model.IRevEngPrimaryKey;
+import org.hibernate.eclipse.mapper.MapperMessages;
public class PrimaryKeyDetailsPage extends RevEngDetailsPage implements
IDetailsPage, PropertyChangeListener {
// private Label label;
-
+
private IRevEngPrimaryKey primaryKey;
-
+
protected void buildContents(FormToolkit toolkit, Section section, Composite client) {
- section.setText(Messages.PRIMARYKEYDETAILSPAGE_PRIMARY_KEY_DETAILS);
- section.setDescription(Messages.PRIMARYKEYDETAILSPAGE_PRIMARY_KEY_CAN_DEFINE_GENERATOR_STRATEGY_AND_ALTERNATIVE_COLUMNS);
-
- Button createGenerator = toolkit.createButton(client, Messages.PRIMARYKEYDETAILSPAGE_ADD_GENERATOR, SWT.NONE);
+ section.setText(MapperMessages.PrimaryKeyDetailsPage_primary_key_details);
+ section.setDescription(MapperMessages.PrimaryKeyDetailsPage_primary_key_can_define_generator_strategy_and_alternative_columns);
+
+ Button createGenerator = toolkit.createButton(client, MapperMessages.PrimaryKeyDetailsPage_add_generator, SWT.NONE);
createGenerator.addSelectionListener(new SelectionAdapter() {
-
+
public void widgetSelected(SelectionEvent e) {
handleAddGenerator();
- }
+ }
});
-
- Button createColumn = toolkit.createButton(client, Messages.PRIMARYKEYDETAILSPAGE_ADD_COLUMN, SWT.NONE);
+
+ Button createColumn = toolkit.createButton(client, MapperMessages.PrimaryKeyDetailsPage_add_column, SWT.NONE);
createColumn.addSelectionListener(new SelectionAdapter() {
-
+
public void widgetSelected(SelectionEvent e) {
handleAddColumn();
- }
+ }
});
}
protected void handleAddColumn() {
- primaryKey.addColumn();
+ primaryKey.addColumn();
}
protected void handleAddGenerator() {
@@ -79,23 +80,23 @@
public void selectionChanged(IFormPart part, ISelection selection) {
IRevEngPrimaryKey newParam = (IRevEngPrimaryKey) ((IStructuredSelection)selection).getFirstElement();
if(primaryKey!=null) {
- primaryKey.removePropertyChangeListener(this);
+ primaryKey.removePropertyChangeListener(this);
}
if(newParam!=null) {
newParam.addPropertyChangeListener(this);
}
-
+
primaryKey = newParam;
-
+
update();
}
private void update() {
-
+
}
public void propertyChange(PropertyChangeEvent evt) {
- update();
+ update();
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngFormEditorPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngFormEditorPart.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngFormEditorPart.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -25,6 +25,7 @@
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
public class RevEngFormEditorPart extends FormPage {
@@ -35,15 +36,15 @@
public RevEngFormEditorPart(FormEditor editor, String id, String title) {
super( editor, id, title );
-
+
}
public void createPartControl(Composite parent) {
super.createPartControl( parent );
}
protected void createFormContent(IManagedForm managedForm) {
- throw new IllegalStateException(Messages.REVENGFORMEDITORPART_NEED_TO_OVERRIDE_FORMCONTENT_IN + this.getClass().getName());
+ throw new IllegalStateException(MapperMessages.RevEngFormEditorPart_need_to_override_formcontent_in + this.getClass().getName());
}
-
+
ReverseEngineeringEditor getReverseEngineeringEditor() {
return (ReverseEngineeringEditor) getEditor();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngOverviewPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngOverviewPage.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngOverviewPage.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -35,78 +35,79 @@
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
public class RevEngOverviewPage extends RevEngFormEditorPart {
public static final String PART_ID = "overview"; //$NON-NLS-1$
-
+
public RevEngOverviewPage(ReverseEngineeringEditor reditor) {
- super(reditor, PART_ID, Messages.REVENGOVERVIEWPAGE_OVERVIEW);
+ super(reditor, PART_ID, MapperMessages.RevEngOverviewPage_overview);
this.reditor = reditor;
}
-
+
private final ReverseEngineeringEditor reditor;
private ConsoleConfigNamePart configNamePart;
-
+
public void createFormContent(IManagedForm parent) {
ScrolledForm form = parent.getForm();
-
+
ColumnLayout layout = new ColumnLayout();
layout.maxNumColumns = 2;
-
+
form.getBody().setLayout(layout);
-
+
createConsoleConfigName();
createContentsSection();
-
+
getManagedForm().setInput(reditor.getReverseEngineeringDefinition());
-
+
}
private void createConsoleConfigName() {
Composite parent = getManagedForm().getForm().getBody();
-
+
configNamePart = new ConsoleConfigNamePart(parent, getManagedForm(), reditor);
-
+
//GridData gd = new GridData(GridData.FILL_HORIZONTAL|GridData.VERTICAL_ALIGN_BEGINNING);
//configNamePart.getSection().setLayoutData(gd);
-
+
getManagedForm().addPart(configNamePart);
-
+
}
-
+
private Section createStaticSection(FormToolkit toolkit, Composite parent, String text) {
Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
section.clientVerticalSpacing = 4;
section.setText(text);
return section;
}
-
+
private void createContentsSection() {
String sectionTitle;
- sectionTitle = Messages.REVENGOVERVIEWPAGE_CONTENTS;
+ sectionTitle = MapperMessages.RevEngOverviewPage_contents;
Section section = createStaticSection(
- getManagedForm().getToolkit(),
- getManagedForm().getForm().getBody(),
+ getManagedForm().getToolkit(),
+ getManagedForm().getForm().getBody(),
sectionTitle);
-
+
Composite container = getManagedForm().getToolkit().createComposite(section, SWT.NONE);
TableWrapLayout layout = new TableWrapLayout();
layout.leftMargin = layout.rightMargin = layout.topMargin = layout.bottomMargin = 0;
container.setLayout(layout);
container.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
-
- FormText text = createClient(container, Messages.REVENGOVERVIEWPAGE_THE_CONTENT, getManagedForm().getToolkit());
+
+ FormText text = createClient(container, MapperMessages.RevEngOverviewPage_the_content, getManagedForm().getToolkit());
//text.setImage("page", EclipseImages.getImage(ImageConstants.)); //$NON-NLS-1$
-
+
section.setClient(container);
//section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
//section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL,GridData.FILL_VERTICAL));
-
- //getManagedForm().addPart(s);
+
+ //getManagedForm().addPart(s);
}
-
+
private FormText createClient(Composite section, String content, FormToolkit toolkit) {
FormText text = toolkit.createFormText(section, true);
try {
@@ -116,14 +117,14 @@
}
section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
text.addHyperlinkListener(new IHyperlinkListener() {
-
+
public void linkEntered(HyperlinkEvent e) {}
public void linkExited(HyperlinkEvent e) {}
public void linkActivated(HyperlinkEvent e) {
String href = (String) e.getHref();
- getEditor().setActivePage(href);
+ getEditor().setActivePage(href);
}
});
return text;
@@ -138,7 +139,7 @@
}
public void setConsoleConfigName(String name) {
- configNamePart.setConsoleConfigName(name);
+ configNamePart.setConsoleConfigName(name);
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTableFilterPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTableFilterPage.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTableFilterPage.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -25,37 +25,38 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
public class RevEngTableFilterPage extends RevEngFormEditorPart {
-
+
public final static String PART_ID = "tablefilter"; //$NON-NLS-1$
-
+
public RevEngTableFilterPage(ReverseEngineeringEditor reditor) {
- super(reditor, PART_ID, Messages.REVENGTABLEFILTERPAGE_TABLE_FILTERS);
- }
+ super(reditor, PART_ID, MapperMessages.RevEngTableFilterPage_table_filters);
+ }
protected void createFormContent(IManagedForm managedForm) {
ScrolledForm form = managedForm.getForm();
-
+
GridLayout layout = new GridLayout();
-
+
form.getBody().setLayout(layout);
-
+
createTableFilterSection();
-
+
getManagedForm().setInput(getReverseEngineeringEditor().getReverseEngineeringDefinition());
-
+
}
-
+
private void createTableFilterSection() {
TableFilterFormPart part = new TableFilterFormPart(getManagedForm().getForm().getBody(), getManagedForm(), getReverseEngineeringEditor());
GridData gd = new GridData(GridData.FILL_HORIZONTAL|GridData.FILL_VERTICAL);
//gd.heightHint = 500; // makes the table stay reasonable small when large list available TODO: make it relative
part.getSection().setLayoutData(gd);
-
- getManagedForm().addPart(part);
+
+ getManagedForm().addPart(part);
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTablesPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTablesPage.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTablesPage.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -24,35 +24,36 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
public class RevEngTablesPage extends RevEngFormEditorPart {
public final static String PART_ID = "tables"; //$NON-NLS-1$
-
+
public RevEngTablesPage(ReverseEngineeringEditor reditor) {
- super(reditor, PART_ID, Messages.REVENGTABLESPAGE_TABLES_AND_COLUMNS);
- }
+ super(reditor, PART_ID, MapperMessages.RevEngTablesPage_tables_and_columns);
+ }
protected void createFormContent(IManagedForm managedForm) {
-
+
ScrolledForm form = managedForm.getForm();
-
+
GridLayout layout = new GridLayout();
-
+
form.getBody().setLayout(layout);
-
+
createTablesSection();
-
+
getManagedForm().setInput(getReverseEngineeringEditor().getReverseEngineeringDefinition());
-
+
}
-
+
private void createTablesSection() {
TablePropertiesBlock block = new TablePropertiesBlock(getReverseEngineeringEditor());
//getManagedForm().getForm().setText("Tables & Columns");
block.createContent(getManagedForm());
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTypeMappingPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTypeMappingPage.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/RevEngTypeMappingPage.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -26,38 +26,39 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
public class RevEngTypeMappingPage extends RevEngFormEditorPart {
-
+
public final static String PART_ID = "typemappings"; //$NON-NLS-1$
-
+
public RevEngTypeMappingPage(ReverseEngineeringEditor reditor) {
- super(reditor, PART_ID, Messages.REVENGTYPEMAPPINGPAGE_TYPE_MAPPINGS);
- }
+ super(reditor, PART_ID, MapperMessages.RevEngTypeMappingPage_type_mappings);
+ }
public void createFormContent(IManagedForm mform) {
ScrolledForm form = mform.getForm();
-
+
GridLayout layout = new GridLayout();
-
-
+
+
form.getBody().setLayout(layout);
-
+
createTypeMappingSection();
-
+
getManagedForm().setInput(getReverseEngineeringEditor().getReverseEngineeringDefinition());
-
+
}
private void createTypeMappingSection() {
Composite parent = getManagedForm().getForm().getBody();
-
+
TypeMappingFormPart part = new TypeMappingFormPart(parent, getManagedForm(),getReverseEngineeringEditor());
GridData gd = new GridData(GridData.FILL_HORIZONTAL|GridData.FILL_VERTICAL);
part.getSection().setLayoutData(gd);
-
+
getManagedForm().addPart(part);
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TableDetailsPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TableDetailsPage.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TableDetailsPage.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -36,11 +36,12 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.hibernate.eclipse.console.model.IRevEngTable;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.reveng.xpl.FormTextEntry;
public class TableDetailsPage extends RevEngDetailsPage implements IDetailsPage, PropertyChangeListener {
-
+
//private Label label;
private FormTextEntry nameEntry;
private FormTextEntry schemaEntry;
@@ -48,45 +49,45 @@
private FormTextEntry classEntry;
private IRevEngTable table;
-
+
protected void buildContents(FormToolkit toolkit, Section section, Composite client) {
- section.setText(Messages.TABLEDETAILSPAGE_TABLE_DETAILS);
- section.setDescription(Messages.TABLEDETAILSPAGE_SET_PROPERTIES_OF_SELECTED_TABLE);
-
- catalogEntry = new FormTextEntry(client, toolkit, Messages.TABLEDETAILSPAGE_CATALOG, SWT.NULL);
+ section.setText(MapperMessages.TableDetailsPage_table_details);
+ section.setDescription(MapperMessages.TableDetailsPage_set_properties_of_selected_table);
+
+ catalogEntry = new FormTextEntry(client, toolkit, MapperMessages.TableDetailsPage_catalog, SWT.NULL);
catalogEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
table.setCatalog(entry.getValue());
}
});
- schemaEntry = new FormTextEntry(client, toolkit, Messages.TABLEDETAILSPAGE_SCHEMA, SWT.NULL);
+ schemaEntry = new FormTextEntry(client, toolkit, MapperMessages.TableDetailsPage_schema, SWT.NULL);
schemaEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
table.setSchema(entry.getValue());
}
});
- nameEntry = new FormTextEntry(client, toolkit, Messages.TABLEDETAILSPAGE_NAME, SWT.NULL);
+ nameEntry = new FormTextEntry(client, toolkit, MapperMessages.TableDetailsPage_name, SWT.NULL);
nameEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
table.setName(entry.getValue());
}
});
-
- classEntry = new FormTextEntry(client, toolkit, Messages.TABLEDETAILSPAGE_CLASS_NAME, SWT.NULL);
+
+ classEntry = new FormTextEntry(client, toolkit, MapperMessages.TableDetailsPage_class_name, SWT.NULL);
classEntry.setFormEntryListener(new FormTextEntryListenerAdapter() {
public void textValueChanged(FormTextEntry entry) {
table.setClassname(entry.getValue());
}
});
-
- Button button = toolkit.createButton(client, Messages.TABLEDETAILSPAGE_ADD_PRIMARY_KEY, SWT.NULL);
+
+ Button button = toolkit.createButton(client, MapperMessages.TableDetailsPage_add_primary_key, SWT.NULL);
button.addSelectionListener(new SelectionAdapter() {
-
+
public void widgetSelected(SelectionEvent e) {
- handleAddPrimaryKey();
+ handleAddPrimaryKey();
}
-
+
});
}
@@ -101,13 +102,13 @@
public void selectionChanged(IFormPart part, ISelection selection) {
IRevEngTable newTable = (IRevEngTable) ((IStructuredSelection)selection).getFirstElement();
if(table!=null) {
- table.removePropertyChangeListener(this);
+ table.removePropertyChangeListener(this);
}
if(newTable!=null) {
newTable.addPropertyChangeListener(this);
}
table = newTable;
-
+
update();
}
@@ -120,7 +121,7 @@
}
public void propertyChange(PropertyChangeEvent evt) {
- update();
+ update();
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TableFilterFormPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TableFilterFormPart.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TableFilterFormPart.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -29,6 +29,7 @@
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.wizards.TableFilterView;
import org.hibernate.eclipse.console.workbench.LazyDatabaseSchema;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
public class TableFilterFormPart extends RevEngSectionPart {
@@ -43,14 +44,14 @@
}
protected String getSectionTitle() {
- return Messages.TABLEFILTERFORMPART_TABLE_FILTERS;
+ return MapperMessages.TableFilterFormPart_table_filters;
}
-
+
protected String getSectionDescription() {
- return Messages.TABLEFILTERFORMPART_TABLE_FILTERS_DEFINES_WHICH_TABLE_INCLUDED;
+ return MapperMessages.TableFilterFormPart_table_filters_defines_which_table_included;
}
-
- public Control createClient(IManagedForm form) {
+
+ public Control createClient(IManagedForm form) {
FormToolkit toolkit = form.getToolkit();
composite = new TableFilterView(getSection(), SWT.NULL) {
@@ -62,10 +63,10 @@
}
protected String getConsoleConfigurationName() {
return configNamePart.getConsoleConfigurationName();
- }
+ }
};
-
+
adaptRecursively( toolkit, composite );
return composite;
@@ -75,7 +76,7 @@
composite.setModel(reveng);
return true;
}
-
+
public void dispose() {
composite.dispose();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -62,6 +62,7 @@
import org.hibernate.eclipse.console.workbench.DeferredContentProvider;
import org.hibernate.eclipse.console.workbench.LazyDatabaseSchema;
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
import org.hibernate.eclipse.mapper.model.RevEngColumnAdapter;
import org.hibernate.eclipse.mapper.model.RevEngGeneratorAdapter;
@@ -72,26 +73,26 @@
import org.hibernate.mapping.Table;
public class TablePropertiesBlock extends MasterDetailsBlock {
-
+
private TreeViewer viewer;
private final ReverseEngineeringEditor editor;
public TablePropertiesBlock(ReverseEngineeringEditor editor) {
- this.editor = editor;
+ this.editor = editor;
}
public SashForm getComposite() {
return sashForm;
}
-
+
protected void createMasterPart(final IManagedForm managedForm, Composite parent) {
sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,true));
final ScrolledForm form = managedForm.getForm();
FormToolkit toolkit = managedForm.getToolkit();
- Section section = toolkit.createSection( parent, Section.DESCRIPTION |
+ Section section = toolkit.createSection( parent, Section.DESCRIPTION |
Section.FOCUS_TITLE | Section.TWISTIE | Section.EXPANDED);
- section.setText( Messages.TABLEPROPERTIESBLOCK_TABLES_COLUMNS );
- section.setDescription( Messages.TABLEPROPERTIESBLOCK_EXPLICITLY_CONTROL_SETTINGS_FOR_TABLE_COLUMNS );
+ section.setText( MapperMessages.TablePropertiesBlock_tables_columns );
+ section.setDescription( MapperMessages.TablePropertiesBlock_explicitly_control_settings_for_table_columns );
section.marginWidth = 10;
section.marginHeight = 5;
toolkit.createCompositeSeparator( section );
@@ -108,36 +109,36 @@
gd.verticalSpan = 2;
t.setLayoutData( gd );
toolkit.paintBordersFor( client );
-
- Button btnAdd = toolkit.createButton( client, Messages.TABLEPROPERTIESBLOCK_ADD, SWT.PUSH );
+
+ Button btnAdd = toolkit.createButton( client, MapperMessages.TablePropertiesBlock_add, SWT.PUSH );
btnAdd.addSelectionListener(new SelectionAdapter() {
-
+
public void widgetSelected(SelectionEvent e) {
doAdd();
}
-
+
});
gd = new GridData( GridData.VERTICAL_ALIGN_BEGINNING );
btnAdd.setLayoutData( gd );
-
- Button btnDel = toolkit.createButton( client, Messages.TABLEPROPERTIESBLOCK_DELETE, SWT.PUSH );
+
+ Button btnDel = toolkit.createButton( client, MapperMessages.TablePropertiesBlock_delete, SWT.PUSH );
btnDel.addSelectionListener(new SelectionAdapter() {
-
+
public void widgetSelected(SelectionEvent e) {
doDelete();
}
-
+
});
gd = new GridData( GridData.VERTICAL_ALIGN_BEGINNING );
btnDel.setLayoutData( gd );
-
+
section.setClient( client );
final SectionPart spart = new SectionPart( section ) {
public boolean setFormInput(Object input) {
if(input instanceof IReverseEngineeringDefinition) {
viewer.setInput(input);
return true;
- }
+ }
return false;
}
};
@@ -150,27 +151,27 @@
} );
viewer.setLabelProvider( new TablePropertiesLabelProvider() );
TablePropertiesContentProvider tablePropertiesContentProvider = new TablePropertiesContentProvider();
- viewer.setContentProvider( tablePropertiesContentProvider );
+ viewer.setContentProvider( tablePropertiesContentProvider );
}
protected void doAdd() {
CheckedTreeSelectionDialog dialog = createTreeSelectionDialog();
-
-
+
+
LazyDatabaseSchema lds = editor.getLazyDatabaseSchema();
-
+
Map tables = new HashMap();
Map columns = new HashMap();
-
+
if(lds!=null) {
- dialog.setTitle(Messages.TABLEPROPERTIESBLOCK_ADD_TABLES_COLUMNS);
- dialog.setMessage(Messages.TABLEPROPERTIESBLOCK_SELECT_TABLES_COLUMNS);
+ dialog.setTitle(MapperMessages.TablePropertiesBlock_add_tables_columns);
+ dialog.setMessage(MapperMessages.TablePropertiesBlock_select_tables_columns);
dialog.setInput(lds);
dialog.setContainerMode(true);
dialog.open();
Object[] result = dialog.getResult();
TableIdentifier lastTable = null;
- if(result!=null) {
+ if(result!=null) {
for (int i = 0; i < result.length; i++) {
Object object = result[i];
if(object instanceof Table) {
@@ -181,17 +182,17 @@
List existing = (List) columns.get(lastTable);
if(existing==null) {
existing = new ArrayList();
- columns.put(lastTable,existing);
+ columns.put(lastTable,existing);
}
- existing.add(object);
+ existing.add(object);
}
}
}
-
+
Iterator iterator = tables.entrySet().iterator();
while ( iterator.hasNext() ) {
Map.Entry element = (Map.Entry) iterator.next();
- Table table = (Table) element.getValue();
+ Table table = (Table) element.getValue();
IRevEngTable retable = null;
// editor.getReverseEngineeringDefinition().findTable(TableIdentifier.create(table));
if(retable==null) {
@@ -201,7 +202,7 @@
retable.setName(table.getName());
editor.getReverseEngineeringDefinition().addTable(retable);
}
-
+
List columnList = (List) columns.get(element.getKey());
if(columnList!=null) {
Iterator colIterator = columnList.iterator();
@@ -216,8 +217,8 @@
}
//editor.getReverseEngineeringDefinition();
}
-
-
+
+
}
protected void doDelete() {
@@ -250,7 +251,7 @@
private CheckedTreeSelectionDialog createTreeSelectionDialog() {
return new CheckedTreeSelectionDialog(getComposite().getShell(), new AnyAdaptableLabelProvider(), new DeferredContentProvider()) {
-
+
protected Composite createSelectionButtons(Composite composite) {
Composite buttonComposite = new Composite(composite, SWT.RIGHT);
GridLayout layout = new GridLayout();
@@ -262,7 +263,7 @@
data.grabExcessHorizontalSpace = true;
composite.setData(data);
Button selectButton = createButton(buttonComposite,
- IDialogConstants.SELECT_ALL_ID, Messages.TABLEPROPERTIESBLOCK_SELECT_ALL_CHILDREN,
+ IDialogConstants.SELECT_ALL_ID, MapperMessages.TablePropertiesBlock_select_all_children,
false);
SelectionListener listener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -270,13 +271,13 @@
Iterator iterator = viewerElements.iterator();
while(iterator.hasNext()) {
getTreeViewer().setSubtreeChecked(iterator.next(), true);
- }
+ }
updateOKStatus();
}
};
selectButton.addSelectionListener(listener);
Button deselectButton = createButton(buttonComposite,
- IDialogConstants.DESELECT_ALL_ID, Messages.TABLEPROPERTIESBLOCK_DESELECT_ALL,
+ IDialogConstants.DESELECT_ALL_ID, MapperMessages.TablePropertiesBlock_deselect_all,
false);
listener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -288,7 +289,7 @@
return buttonComposite;
}
-
+
};
}
@@ -302,7 +303,7 @@
}
};
haction.setChecked( true );
- haction.setToolTipText( Messages.TABLEPROPERTIESBLOCK_HORIZONTAL_ORIENTATION );
+ haction.setToolTipText( MapperMessages.TablePropertiesBlock_horizontal_orientation );
Action vaction = new Action( "ver", IAction.AS_RADIO_BUTTON ) { //$NON-NLS-1$
public void run() {
sashForm.setOrientation( SWT.VERTICAL );
@@ -310,7 +311,7 @@
}
};
vaction.setChecked( false );
- vaction.setToolTipText( Messages.TABLEPROPERTIESBLOCK_VERTICAL_ORIENTATION );
+ vaction.setToolTipText( MapperMessages.TablePropertiesBlock_vertical_orientation );
form.getToolBarManager().add( haction );
form.getToolBarManager().add( vaction );
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesLabelProvider.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesLabelProvider.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -30,6 +30,7 @@
import org.hibernate.eclipse.console.model.IRevEngPrimaryKey;
import org.hibernate.eclipse.console.model.IRevEngTable;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.eclipse.mapper.MapperMessages;
public class TablePropertiesLabelProvider extends LabelProvider {
@@ -45,11 +46,11 @@
private String getInternalText(Object element) {
if(element instanceof IRevEngTable) {
IRevEngTable table = (IRevEngTable)element;
- return getLabel( table );
+ return getLabel( table );
} else if(element instanceof IRevEngColumn) {
return ((IRevEngColumn)element).getName();
} else if(element instanceof IRevEngPrimaryKey) {
- return Messages.TABLEPROPERTIESLABELPROVIDER_PRIMARY_KEY;
+ return MapperMessages.TablePropertiesLabelProvider_primary_key;
} else if(element instanceof IRevEngGenerator) {
return ((IRevEngGenerator)element).getGeneratorClassName();
} else if ( element instanceof IRevEngParameter ) {
@@ -69,17 +70,17 @@
if(res.length()!=0) res.append("."); //$NON-NLS-1$
res.append(table.getSchema());
}
-
+
if(table.getName()!=null) {
if(res.length()!=0) res.append("."); //$NON-NLS-1$
res.append(table.getName());
}
return res.toString();
}
-
+
public Image getImage(Object element) {
if(element instanceof IRevEngTable) {
- return EclipseImages.getImage(ImageConstants.TABLE);
+ return EclipseImages.getImage(ImageConstants.TABLE);
} else if(element instanceof IRevEngColumn) {
return EclipseImages.getImage(ImageConstants.COLUMN);
} else if(element instanceof IRevEngParameter) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingFormPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingFormPart.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingFormPart.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -29,6 +29,7 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.workbench.LazyDatabaseSchema;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
public class TypeMappingFormPart extends RevEngSectionPart {
@@ -42,11 +43,11 @@
}
protected String getSectionDescription() {
- return Messages.TYPEMAPPINGFORMPART_TYPE_MAPPINGS_ALLOWS_YOU_DEFINE_WHICH_HIBERNATE_TYPE;
+ return MapperMessages.TypeMappingFormPart_type_mappings_allows_you_define_which_hibernate_type;
}
protected String getSectionTitle() {
- return Messages.TYPEMAPPINGFORMPART_TYPE_MAPPINGS;
+ return MapperMessages.TypeMappingFormPart_type_mappings;
}
public Control createClient(IManagedForm form) {
@@ -61,13 +62,13 @@
protected String getConsoleConfigurationName() {
return configNamePart.getConsoleConfigurationName();
- }
+ }
};
-
+
GridData gd = new GridData(SWT.FILL,SWT.FILL);
gd.heightHint = 400;
composite.setLayoutData(gd);
-
+
adaptRecursively( toolkit, composite);
return composite;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -45,6 +45,7 @@
import org.hibernate.eclipse.console.workbench.DeferredContentProvider;
import org.hibernate.eclipse.console.workbench.LazyDatabaseSchema;
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.PrimaryKey;
@@ -59,7 +60,7 @@
private TableViewer tableViewer;
private IReverseEngineeringDefinition revEngDef;
-
+
public void setModel(IReverseEngineeringDefinition revEngDef) {
this.revEngDef = revEngDef;
tableViewer.setInput( revEngDef );
@@ -94,8 +95,8 @@
result.setCellModifier( new TypeMappingCellModifier( result ) );
result.setLabelProvider( new TypeMappingLabelProvider() );
result.setContentProvider( new TypeMappingContentProvider( result ) );
-
-
+
+
return result;
}
@@ -132,7 +133,7 @@
while ( iter.hasNext() ) {
Column column = (Column) iter.next();
createTypeMapping(column, column.getSqlTypeCode());
- }
+ }
} else {
createDefaultSqlTypeMapping();
}
@@ -145,7 +146,7 @@
private void createTypeMapping(Column col, Integer sqlTypeCode) {
if(sqlTypeCode!=null) {
ITypeMapping typeMapping = revEngDef.createTypeMapping();
-
+
typeMapping.setJDBCType(JDBCToHibernateTypeHelper.getJDBCTypeName(sqlTypeCode.intValue()));
int length = col.getLength();
int precision = col.getPrecision();
@@ -154,9 +155,9 @@
typeMapping.setHibernateType(JDBCToHibernateTypeHelper.getPreferredHibernateType(sqlTypeCode.intValue(), length, precision, scale, nullability, false));
if(JDBCToHibernateTypeHelper.typeHasLength(sqlTypeCode.intValue())) {
if(length!=0 && Column.DEFAULT_LENGTH!=length) {
- typeMapping.setLength(new Integer(length));
+ typeMapping.setLength(new Integer(length));
}
- }
+ }
if(JDBCToHibernateTypeHelper.typeHasScaleAndPrecision(sqlTypeCode.intValue())) {
if(precision!=0 && Column.DEFAULT_PRECISION!=precision) {
typeMapping.setPrecision(new Integer(precision));
@@ -177,10 +178,10 @@
revEngDef.addTypeMapping(createTypeMapping);
}
-
+
protected String[] getAddButtonLabels() {
- return new String[] { Messages.TYPEMAPPINGVIEW_ADD };
+ return new String[] { MapperMessages.TypeMappingView_add };
}
protected void handleAddButtonPressed(int i) {
@@ -189,7 +190,7 @@
doAdd();
break;
default:
- throw new IllegalArgumentException( i + Messages.TYPEMAPPINGVIEW_NOT_KNOWN_BUTTON );
+ throw new IllegalArgumentException( i + MapperMessages.TypeMappingView_not_known_button );
}
}
@@ -203,9 +204,9 @@
rightTable
.setSelection( Math.min( sel, rightTable.getItemCount() - 1 ) );
}
-
+
protected void doRemoveAll() {
- if(MessageDialog.openQuestion( getShell(), Messages.TYPEMAPPINGVIEW_REMOVE_ALL_MAPPINGS , Messages.TYPEMAPPINGVIEW_DO_YOU_WANT_TO_REMOVE_ALL_MAPPINGS)) {
+ if(MessageDialog.openQuestion( getShell(), MapperMessages.TypeMappingView_remove_all_mappings, MapperMessages.TypeMappingView_do_you_want_to_remove_all_mappings)) {
revEngDef.removeAllTypeMappings();
}
}
@@ -225,39 +226,39 @@
revEngDef.moveTypeMappingUp( item );
}
}
-
+
protected void createTableColumns(org.eclipse.swt.widgets.Table table) {
- TableColumn column = new TableColumn(table, SWT.CENTER, 0);
- column.setText(Messages.TYPEMAPPINGVIEW_JDBC_TYPE);
+ TableColumn column = new TableColumn(table, SWT.CENTER, 0);
+ column.setText(MapperMessages.TypeMappingView_jdbc_type);
column.setWidth(100);
-
+
column = new TableColumn(table, SWT.LEFT, 1);
- column.setText(Messages.TYPEMAPPINGVIEW_HIBERNATE_TYPE);
+ column.setText(MapperMessages.TypeMappingView_hibernate_type);
column.setWidth(150);
-
+
column = new TableColumn(table, SWT.LEFT, 2);
- column.setText(Messages.TYPEMAPPINGVIEW_LENGTH);
+ column.setText(MapperMessages.TypeMappingView_length);
column.setWidth(100);
column = new TableColumn(table, SWT.LEFT, 3);
- column.setText(Messages.TYPEMAPPINGVIEW_SCALE);
+ column.setText(MapperMessages.TypeMappingView_scale);
column.setWidth(100);
-
+
column = new TableColumn(table, SWT.LEFT, 4);
- column.setText(Messages.TYPEMAPPINGVIEW_PRECISION);
+ column.setText(MapperMessages.TypeMappingView_precision);
column.setWidth(100);
-
+
column = new TableColumn(table, SWT.LEFT, 5);
- column.setText(Messages.TYPEMAPPINGVIEW_NOT_NULL);
+ column.setText(MapperMessages.TypeMappingView_not_null);
column.setWidth(75);
}
protected String getTableTitle() {
- return Messages.TYPEMAPPINGVIEW_TYPE_MAPPINGS;
+ return MapperMessages.TypeMappingView_type_mappings;
}
-
+
protected String getTreeTitle() {
- return Messages.TYPEMAPPINGVIEW_DATABASE_SCHEMA;
+ return MapperMessages.TypeMappingView_database_schema;
}
-
+
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/messages.properties 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/messages.properties 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1,70 +0,0 @@
-COLUMNDETAILSPAGE_COLUMN_DETAILS=Column Details
-COLUMNDETAILSPAGE_EXCLUDE_COLUMNS_FROM_REVERSE_ENGINEERING=Exclude column from reverse engineering
-COLUMNDETAILSPAGE_HIBERNATE_TYPE=Hibernate Type:
-COLUMNDETAILSPAGE_JDBC_TYPE=JDBC Type:
-COLUMNDETAILSPAGE_NAME=Name:
-COLUMNDETAILSPAGE_PROPERTY_NAME=Property name:
-COLUMNDETAILSPAGE_SET_PROPERTIES_OF_SELECTED_COLUMN=Set the properties of the selected column.
-COLUMNDETAILSPAGE_THE_HIBERNATE_TYPE=The hibernate type which should be used for this column when used as a property
-COLUMNDETAILSPAGE_THE_NAME_OF_THE_COLUMN=The name of the column
-COLUMNDETAILSPAGE_THE_PROPERTY_NAME_WHICH_MUST_BE_USED_FOR=The property name which must be used for this column when used as a property
-COLUMNDETAILSPAGE_WHICH_JDBC_TYPE_THIS_COLUMN_SHOULD_HAVE=Which JDBC Type this column should have (overriding the type read from the database)
-CONSOLECONFIGNAMEPART_CONSOLE_CONFIGURATION=Console Configuration
-CONSOLECONFIGNAMEPART_PROBLEM_WHEN_TRYING_TO_HIBERNATE_PROJECT_INFO=Problem when trying to Hibernate Project information
-CONSOLECONFIGNAMEPART_SELECT_CONSOLE_CONFIGURATION=Select Console configuration to be used for editing the reverse engineering settings
-COUNTERFORMPART_DEBUG_COUNTER=Debug counter
-COUNTERFORMPART_DEBUG_COUNTER_FOR_PROPERTY_CHANGES=debug counter for property changes
-COUNTERFORMPART_ZERO=Zero
-GENERATORDETAILSPAGE_CLASS=Class:
-GENERATORDETAILSPAGE_ID_GENERATOR_DETAILS=Id Generator details
-GENERATORDETAILSPAGE_SET_THE_PROPERTIES_OF_THE_SELECTED_GENERATOR=Set the properties of the selected generator.
-HIBERNATECONFIGURATIONFORM_HIBERNATE_CONFIGURATION=Hibernate Configuration
-PARAMDETAILSPAGE_GENERATOR_PARAMETER_DETAILS=Generator parameter details
-PARAMDETAILSPAGE_NAME=Name:
-PARAMDETAILSPAGE_SET_THE_PROPERTIES_OF_THE_SELECTED_PARAMETER=Set the properties of the selected parameter.
-PARAMDETAILSPAGE_VALUE=Value:
-PRIMARYKEYDETAILSPAGE_ADD_COLUMN=Add column
-PRIMARYKEYDETAILSPAGE_ADD_GENERATOR=Add generator
-PRIMARYKEYDETAILSPAGE_PRIMARY_KEY_CAN_DEFINE_GENERATOR_STRATEGY_AND_ALTERNATIVE_COLUMNS=A primary key can define a generator strategy and alternative columns
-PRIMARYKEYDETAILSPAGE_PRIMARY_KEY_DETAILS=Primary key details
-REVENGFORMEDITORPART_NEED_TO_OVERRIDE_FORMCONTENT_IN=Need to override formcontent in
-REVENGOVERVIEWPAGE_CONTENTS=Contents
-REVENGOVERVIEWPAGE_OVERVIEW=Overview
-REVENGOVERVIEWPAGE_THE_CONTENT=<form><p>The content of the reveng.xml is made up of three sections:</p><li style="image" value="page" bindent="5"><a href="typemappings">Type Mappings</a>: lists the mappings from a JDBC/SQL type to Hibernate type.</li><li style="image" value="page" bindent="5"><a href="tablefilter">Table filters</a>: lists which tables that should be included or excluded during reverse engineering.</li><li style="image" value="page" bindent="5"><a href="tables">Tables & Columns</a>: explicitly set properties for tables and columns.</li></form>
-REVENGTABLEFILTERPAGE_TABLE_FILTERS=Table filters
-REVENGTABLESPAGE_TABLES_AND_COLUMNS=Tables & Columns
-REVENGTYPEMAPPINGPAGE_TYPE_MAPPINGS=Type Mappings
-TABLEDETAILSPAGE_ADD_PRIMARY_KEY=Add primary key
-TABLEDETAILSPAGE_CATALOG=Catalog:
-TABLEDETAILSPAGE_CLASS_NAME=Class name:
-TABLEDETAILSPAGE_NAME=Name:
-TABLEDETAILSPAGE_SCHEMA=Schema:
-TABLEDETAILSPAGE_SET_PROPERTIES_OF_SELECTED_TABLE=Set the properties of the selected table.
-TABLEDETAILSPAGE_TABLE_DETAILS=Table details
-TABLEFILTERFORMPART_TABLE_FILTERS=Table filters
-TABLEFILTERFORMPART_TABLE_FILTERS_DEFINES_WHICH_TABLE_INCLUDED=Table filters defines which tables/views are included when performing reverse engineering.
-TABLEPROPERTIESBLOCK_ADD=Add...
-TABLEPROPERTIESBLOCK_ADD_TABLES_COLUMNS=Add Tables & Columns
-TABLEPROPERTIESBLOCK_DELETE=Delete
-TABLEPROPERTIESBLOCK_DESELECT_ALL=Deselect all
-TABLEPROPERTIESBLOCK_EXPLICITLY_CONTROL_SETTINGS_FOR_TABLE_COLUMNS=Explicitly control settings for table & columns for which the defaults is not applicable. Click Add, select the relevant tables & columns and adjust their settings here.
-TABLEPROPERTIESBLOCK_HORIZONTAL_ORIENTATION=Horizontal orientation
-TABLEPROPERTIESBLOCK_SELECT_ALL_CHILDREN=Select all children
-TABLEPROPERTIESBLOCK_SELECT_TABLES_COLUMNS=Select tables and columns
-TABLEPROPERTIESBLOCK_TABLES_COLUMNS=Tables & Columns
-TABLEPROPERTIESBLOCK_VERTICAL_ORIENTATION=Vertical orientation
-TABLEPROPERTIESLABELPROVIDER_PRIMARY_KEY=Primary key
-TYPEMAPPINGFORMPART_TYPE_MAPPINGS=Type mappings
-TYPEMAPPINGFORMPART_TYPE_MAPPINGS_ALLOWS_YOU_DEFINE_WHICH_HIBERNATE_TYPE=Type mappings allows you to define which Hibernate type to use for specific JDBC types.
-TYPEMAPPINGVIEW_ADD=Add...
-TYPEMAPPINGVIEW_DATABASE_SCHEMA=Database schema:
-TYPEMAPPINGVIEW_DO_YOU_WANT_TO_REMOVE_ALL_MAPPINGS=Do you want to remove all mappings?
-TYPEMAPPINGVIEW_HIBERNATE_TYPE=Hibernate Type
-TYPEMAPPINGVIEW_JDBC_TYPE=JDBC Type
-TYPEMAPPINGVIEW_LENGTH=Length
-TYPEMAPPINGVIEW_NOT_KNOWN_BUTTON=\ not a known button
-TYPEMAPPINGVIEW_NOT_NULL=Not-Null
-TYPEMAPPINGVIEW_PRECISION=Precision
-TYPEMAPPINGVIEW_REMOVE_ALL_MAPPINGS=Remove all mappings
-TYPEMAPPINGVIEW_SCALE=Scale
-TYPEMAPPINGVIEW_TYPE_MAPPINGS=Type mappings:
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/GeneratorTypeHandler.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/GeneratorTypeHandler.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/GeneratorTypeHandler.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -35,11 +35,12 @@
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
public class GeneratorTypeHandler implements HBMInfoHandler {
-
+
private final HBMInfoExtractor extractor;
/**
@@ -51,20 +52,20 @@
public ICompletionProposal[] attributeCompletionProposals(IJavaProject project, Node node, String attributeName, String start, int offset) {
List types = this.extractor.findMatchingGenerators(start);
-
- List proposals = new ArrayList(types.size() );
+
+ List proposals = new ArrayList(types.size() );
for (Iterator iter = types.iterator(); iter.hasNext();) {
HibernateTypeDescriptor element = (HibernateTypeDescriptor) iter.next();
- String extendedinfo = Messages.GENERATORTYPEHANDLER_GENERATOR_TYPE + element.getName();
+ String extendedinfo = MapperMessages.GeneratorTypeHandler_generator_type + element.getName();
if(element.getReturnClass()!=null) {
- extendedinfo += Messages.GENERATORTYPEHANDLER_RETURN_CLASS + element.getReturnClass();
+ extendedinfo += MapperMessages.GeneratorTypeHandler_return_class + element.getReturnClass();
}
proposals.add(new CompletionProposal(element.getName(), offset, start.length(), element.getName().length(), null, null, null, extendedinfo) );
}
-
+
try {
IType typeInterface = project.findType("org.hibernate.id.IdentifierGenerator"); //$NON-NLS-1$
- Set alreadyFound = new HashSet();
+ Set alreadyFound = new HashSet();
if (typeInterface != null) {
ITypeHierarchy hier = typeInterface.newTypeHierarchy(project, new NullProgressMonitor() );
IType[] classes = hier.getAllSubtypes(typeInterface); // TODO: cache these results ?
@@ -73,9 +74,9 @@
} catch (CoreException e) {
throw new RuntimeException(e); // TODO: log as error!
}
-
+
ICompletionProposal[] result = (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
- return result;
+ return result;
}
public IJavaElement getJavaElement(IJavaProject project, Node currentNode, Attr currentAttrNode) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -44,65 +44,66 @@
import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
import org.hibernate.cfg.Environment;
import org.hibernate.cfg.reveng.TableIdentifier;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.util.StringHelper;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
* Helper class that can extract information about a hbm.xml document based on e.g. DOM Nodes.
- *
+ *
* @author max
*
*/
public class HBMInfoExtractor {
HibernateTypeDescriptor[] hibernateTypes;
-
+
final Map javaTypeProvider = new HashMap(); // key: element name, value: attribute which contains javaType
final Map tableProvider = new HashMap(); // key: element name, value: attribute which contains table
-
- /** set of "tagname>attribname", used to decide which attributes we should react to */
+
+ /** set of "tagname>attribname", used to decide which attributes we should react to */
final Map attributeHandlers = new HashMap(); // completes a possible package or classname
private String[] hibernatePropertyNames;
private Map hibernatePropertyValues;
-
+
private HibernateTypeDescriptor[] generatorTypes;
private HibernateTypeDescriptor[] propertyAccessors;
-
-
+
+
public HBMInfoExtractor() {
setupTypeFinder();
setupTableFinder();
-
+
setupJavaTypeHandlers();
-
+
setupPackageHandlers();
-
+
setupFieldsPropertyHandlers();
-
+
setupHibernateTypeHandlers();
-
+
setupHibernateTypeDescriptors();
-
+
setupTableNameHandlers();
setupColumnNameHandlers();
setupHibernateProperties();
-
+
setupGeneratorClassHandlers();
-
+
setupAccessHandlers();
}
-
+
String[] TRUE_FALSE = new String[] { "true", "false" }; //$NON-NLS-1$ //$NON-NLS-2$
-
+
private void setupHibernateProperties() {
hibernatePropertyNames = extractHibernateProperties();
hibernatePropertyValues = new HashMap();
-
+
hibernatePropertyValues.put("bytecode.provider", new String[] { "cglib", "javassist"} ); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
hibernatePropertyValues.put("bytecode.use_reflection_optimizer", TRUE_FALSE ); //$NON-NLS-1$
//hibernatePropertyValues.put("c3p0.acquire_increment", new String[] { } ); //$NON-NLS-1$
@@ -175,7 +176,7 @@
hibernatePropertyValues.put("use_identifier_rollback", TRUE_FALSE ); //$NON-NLS-1$
hibernatePropertyValues.put("use_sql_comments", TRUE_FALSE ); //$NON-NLS-1$
//hibernatePropertyValues.put("xml.output_stylesheet]", new String[] { } ); //$NON-NLS-1$
-
+
}
private String[] extractHibernateProperties() {
@@ -186,7 +187,7 @@
Field[] fields = cl.getFields();
for (int i = 0; i < fields.length; i++) {
Field field = fields[i];
- if(Modifier.isStatic(field.getModifiers() ) &&
+ if(Modifier.isStatic(field.getModifiers() ) &&
field.getType().equals(String.class) ) {
String str = (String) field.get(cl);
if(str.startsWith("hibernate.") ) { //$NON-NLS-1$
@@ -199,7 +200,7 @@
return propertyNames;
} catch (IllegalAccessException iae) {
// ignore
- return new String[0];
+ return new String[0];
}
}
@@ -213,7 +214,7 @@
javaTypeProvider.put("composite-id", "class"); //$NON-NLS-1$ //$NON-NLS-2$
javaTypeProvider.put("component", "class"); //$NON-NLS-1$ //$NON-NLS-2$
javaTypeProvider.put("composite-element", "class"); //$NON-NLS-1$ //$NON-NLS-2$
-
+
javaTypeProvider.put("many-to-one", "class"); //$NON-NLS-1$ //$NON-NLS-2$
javaTypeProvider.put("one-to-many", "class"); //$NON-NLS-1$ //$NON-NLS-2$
javaTypeProvider.put("many-to-many", "class"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -222,7 +223,7 @@
javaTypeProvider.put("key-many-to-one", "class"); //$NON-NLS-1$ //$NON-NLS-2$
javaTypeProvider.put("one-to-many", "class"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
private void setupTableFinder() {
tableProvider.put("class", "table"); //$NON-NLS-1$ //$NON-NLS-2$
tableProvider.put("join", "table"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -287,7 +288,7 @@
Collections.sort(types);
generatorTypes = (HibernateTypeDescriptor[]) types.toArray(new HibernateTypeDescriptor[types.size()]);
}
-
+
private void setupHibernateTypeHandlers() {
HBMInfoHandler hibernateTypeFinder = new HibernateTypeHandler(this);
attributeHandlers.put("filter-param>type", hibernateTypeFinder); //$NON-NLS-1$
@@ -320,7 +321,7 @@
attributeHandlers.put("primitive-array>table", hih); //$NON-NLS-1$
attributeHandlers.put("synchronize>table", hih); //$NON-NLS-1$
}
-
+
private void setupColumnNameHandlers() {
HBMInfoHandler hih = new ColumnNameHandler(this);
attributeHandlers.put("id>column", hih); //$NON-NLS-1$
@@ -347,15 +348,15 @@
attributeHandlers.put("return-scalar>column", hih); //$NON-NLS-1$
}
-
+
private void setupAccessHandlers() {
List types = new ArrayList();
- addType("property", Messages.HBMINFOEXTRACTOR_USE_JAVABEAN_ACCESSOR_METHODS, null, types); //$NON-NLS-1$
- addType("field", Messages.HBMINFOEXTRACTOR_ACCESS_FIELDS_DIRECTLY, null, types); //$NON-NLS-1$
- addType("noop", Messages.HBMINFOEXTRACTOR_DO_NOT_PERFORM_ANY_ACCESS, null, types); //$NON-NLS-1$
+ addType("property", MapperMessages.HBMInfoExtractor_use_javabean_accessor_methods, null, types); //$NON-NLS-1$
+ addType("field", MapperMessages.HBMInfoExtractor_access_fields_directly, null, types); //$NON-NLS-1$
+ addType("noop", MapperMessages.HBMInfoExtractor_do_not_perform_any_access, null, types); //$NON-NLS-1$
Collections.sort(types);
propertyAccessors = (HibernateTypeDescriptor[]) types.toArray(new HibernateTypeDescriptor[types.size()]);
-
+
HBMInfoHandler hih = new PropertyAccessHandler(this);
attributeHandlers.put("hibernate-mapping>default-access", hih); //$NON-NLS-1$
attributeHandlers.put("id>access", hih); //$NON-NLS-1$
@@ -380,9 +381,9 @@
attributeHandlers.put("nested-composite-element>access", hih); //$NON-NLS-1$
}
-
+
private void setupFieldsPropertyHandlers() {
-
+
HBMInfoHandler fieldsFinder = new FieldPropertyHandler(this);
attributeHandlers.put("version>name", fieldsFinder); //$NON-NLS-1$
attributeHandlers.put("timestamp>name", fieldsFinder); //$NON-NLS-1$
@@ -429,7 +430,7 @@
attributeHandlers.put("composite-id>class", classFinder); //$NON-NLS-1$
attributeHandlers.put("key-many-to-one>class", classFinder); //$NON-NLS-1$
}
-
+
List findMatchingHibernateTypes(String item) {
return findInTypes( item, hibernateTypes );
}
@@ -448,7 +449,7 @@
}
return l;
}
-
+
public List findMatchingGenerators(String start) {
return findInTypes(start, generatorTypes);
}
@@ -475,7 +476,7 @@
/**
* @param holder
* @param root TODO
- * @return nearest package attribute, null if none found.
+ * @return nearest package attribute, null if none found.
*/
protected String getPackageName(Node root) {
if(root!=null) {
@@ -488,10 +489,10 @@
Node att = attributes.item(count);
if("package".equals(att.getNodeName() ) ) { //$NON-NLS-1$
return att.getNodeValue();
- }
- }
+ }
+ }
}
- return null;
+ return null;
}
protected boolean beginsWith(String aString, String prefix) {
@@ -505,11 +506,11 @@
void generateTypeProposals(String matchString, int offset, List proposals, Set alreadyFound, IType[] classes, String filterPackage) throws JavaModelException {
for (int j = 0; j < classes.length; j++) {
IType type = classes[j];
- if (!Flags.isAbstract(type.getFlags() ) && (filterPackage==null || !type.getFullyQualifiedName().startsWith(filterPackage)) ) {
+ if (!Flags.isAbstract(type.getFlags() ) && (filterPackage==null || !type.getFullyQualifiedName().startsWith(filterPackage)) ) {
String fullName = type.getFullyQualifiedName();
String shortName = type.getElementName();
if(alreadyFound.contains(fullName) ) {
- continue;
+ continue;
} else {
alreadyFound.add(fullName);
}
@@ -524,7 +525,7 @@
}
-
+
private void addType(String name, String returnClass, String primitiveClass, Collection hibernateTypes) {
hibernateTypes.add(new HibernateTypeDescriptor(name, returnClass, primitiveClass) );
}
@@ -541,40 +542,40 @@
/**
* @param node
- * @return the name of the nearest type from the node or null if none found.
+ * @return the name of the nearest type from the node or null if none found.
*/
private String getNearestType(Node node) {
Map map = javaTypeProvider;
-
+
if(node==null) return null;
-
+
while(!map.containsKey(node.getNodeName() ) ) {
- node = node.getParentNode();
+ node = node.getParentNode();
if(node==null) return null;
}
-
+
String attributeName = (String) map.get(node.getNodeName() );
NamedNodeMap attributes = node.getAttributes();
-
+
Node att = attributes.getNamedItem(attributeName);
if(att!=null && attributeName.equals(att.getNodeName() ) ) {
String typename = att.getNodeValue();
if(typename!=null && typename.indexOf('.')<0) {
String packageName = getPackageName(node);
if(packageName!=null) {
- typename = packageName + "." + typename; //$NON-NLS-1$
+ typename = packageName + "." + typename; //$NON-NLS-1$
}
}
return typename;
}
-
+
return null;
}
public String getNearestType(IJavaProject project, Node parentNode) {
String typename = getNearestType(parentNode);
if(typename!=null) return typename;
-
+
try {
if("component".equals(parentNode.getNodeName())) { // probably need to integrate this into extractor? //$NON-NLS-1$
Node componentPropertyNodeName = parentNode.getAttributes().getNamedItem("name"); //$NON-NLS-1$
@@ -591,13 +592,13 @@
if(!StringHelper.isEmpty(qualifier)) {
simpleName = Signature.toQualifiedName(new String[] { qualifier, simpleName });
}
-
+
String[][] possibleTypes = null;
- possibleTypes = parentType.resolveType(simpleName);
+ possibleTypes = parentType.resolveType(simpleName);
if(possibleTypes != null && possibleTypes.length>0) {
typename = Signature.toQualifiedName(possibleTypes[0]);
}
-
+
}
}
}
@@ -611,39 +612,39 @@
public TableIdentifier getNearestTableName(Node node) {
Map map = tableProvider;
-
+
if(node==null) return null;
-
+
while(!map.containsKey(node.getNodeName() ) ) {
- node = node.getParentNode();
+ node = node.getParentNode();
if(node==null) return null;
}
-
+
String attributeName = (String) map.get(node.getNodeName() );
NamedNodeMap attributes = node.getAttributes();
-
+
Node att = attributes.getNamedItem(attributeName);
if(att!=null && attributeName.equals(att.getNodeName() ) ) {
String typename = att.getNodeValue();
String catalog = null;
String schema = null;
-
+
Node namedItem = attributes.getNamedItem("catalog"); //$NON-NLS-1$
if(namedItem!=null) {
catalog = namedItem.getNodeValue();
}
-
+
namedItem = attributes.getNamedItem("schema"); //$NON-NLS-1$
if(namedItem!=null) {
schema = namedItem.getNodeValue();
}
-
+
return new TableIdentifier(catalog,schema,typename);
}
-
+
return null;
}
-
+
public IType getNearestTypeJavaElement(IJavaProject project, Node currentNode) {
String nearestType = getNearestType(project, currentNode);
if(nearestType!=null) {
@@ -665,15 +666,15 @@
public List findMatchingPropertyValues(String matchString, Node node) {
if(node==null) return Collections.EMPTY_LIST;
-
+
NamedNodeMap attributes = node.getAttributes();
Node namedItem = attributes.getNamedItem("name"); //$NON-NLS-1$
String propName = namedItem.getNodeValue();
if(propName.startsWith("hibernate.")) { //$NON-NLS-1$
propName = propName.substring("hibernate.".length()); //$NON-NLS-1$
- }
+ }
String[] strings = (String[]) hibernatePropertyValues.get(propName);
- if(strings==null) {
+ if(strings==null) {
return Collections.EMPTY_LIST;
} else {
List matches = new ArrayList(strings.length);
@@ -681,7 +682,7 @@
String string = strings[i];
if(string.startsWith(matchString)) {
matches.add(string);
- }
+ }
}
return matches;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HibernateTypeHandler.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HibernateTypeHandler.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HibernateTypeHandler.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -35,6 +35,7 @@
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
@@ -51,41 +52,41 @@
public ICompletionProposal[] attributeCompletionProposals(IJavaProject project, Node node, String attributeName, String start, int offset) {
List types = this.extractor.findMatchingHibernateTypes(start);
-
- List proposals = new ArrayList(types.size() );
+
+ List proposals = new ArrayList(types.size() );
for (Iterator iter = types.iterator(); iter.hasNext();) {
HibernateTypeDescriptor element = (HibernateTypeDescriptor) iter.next();
- String extendedinfo = Messages.HIBERANTETYPEHANDLER_HIBERNATE_TYPE + element.getName();
+ String extendedinfo = MapperMessages.HibernateTypeHandler_hibernate_type + element.getName();
if(element.getReturnClass()!=null) {
- extendedinfo += Messages.HIBERANTETYPEHANDLER_RETURN_CLASS + element.getReturnClass();
+ extendedinfo += MapperMessages.HibernateTypeHandler_return_class + element.getReturnClass();
}
if(element.getPrimitiveClass()!=null) {
- extendedinfo += Messages.HIBERANTETYPEHANDLER_RETURN_PRIMITIVE + element.getPrimitiveClass();
+ extendedinfo += MapperMessages.HibernateTypeHandler_return_primitive + element.getPrimitiveClass();
}
proposals.add(new CompletionProposal(element.getName(), offset, start.length(), element.getName().length(), null, null, null, extendedinfo) );
}
-
+
try {
IType typeInterface = project.findType("org.hibernate.usertype.CompositeUserType"); //$NON-NLS-1$
- Set alreadyFound = new HashSet();
+ Set alreadyFound = new HashSet();
if (typeInterface != null) {
ITypeHierarchy hier = typeInterface.newTypeHierarchy(project, new NullProgressMonitor() );
IType[] classes = hier.getAllSubtypes(typeInterface); // TODO: cache these results ?
- this.extractor.generateTypeProposals(start, offset, proposals, alreadyFound, classes,null);
+ this.extractor.generateTypeProposals(start, offset, proposals, alreadyFound, classes,null);
}
-
+
typeInterface = project.findType("org.hibernate.usertype.UserType"); //$NON-NLS-1$
if (typeInterface != null) {
ITypeHierarchy hier = typeInterface.newTypeHierarchy(project, new NullProgressMonitor() );
IType[] classes = hier.getAllSubtypes(typeInterface); // TODO: cache these results ?
- this.extractor.generateTypeProposals(start, offset, proposals, alreadyFound, classes,null);
+ this.extractor.generateTypeProposals(start, offset, proposals, alreadyFound, classes,null);
}
} catch (CoreException e) {
throw new RuntimeException(e); // TODO: log as error!
}
-
+
ICompletionProposal[] result = (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
- return result;
+ return result;
}
public IJavaElement getJavaElement(IJavaProject project, Node currentNode, Attr currentAttrNode) {
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/Messages.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/Messages.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1,24 +0,0 @@
-package org.hibernate.eclipse.mapper.extractor;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.eclipse.mapper.extractor.messages"; //$NON-NLS-1$
- public static String GENERATORTYPEHANDLER_GENERATOR_TYPE;
- public static String GENERATORTYPEHANDLER_RETURN_CLASS;
- public static String HBMINFOEXTRACTOR_ACCESS_FIELDS_DIRECTLY;
- public static String HBMINFOEXTRACTOR_DO_NOT_PERFORM_ANY_ACCESS;
- public static String HBMINFOEXTRACTOR_USE_JAVABEAN_ACCESSOR_METHODS;
- public static String HIBERANTETYPEHANDLER_HIBERNATE_TYPE;
- public static String HIBERANTETYPEHANDLER_RETURN_CLASS;
- public static String HIBERANTETYPEHANDLER_RETURN_PRIMITIVE;
- public static String PROPERTYACCESSHANDLER_ACCESS_METHOD;
- public static String PROPERTYACCESSHANDLER_DESCRIPTION;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PropertyAccessHandler.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PropertyAccessHandler.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PropertyAccessHandler.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -35,6 +35,7 @@
import org.eclipse.jdt.core.ITypeHierarchy;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
@@ -48,20 +49,20 @@
public ICompletionProposal[] attributeCompletionProposals(IJavaProject project, Node node, String attributeName, String start, int offset) {
List types = this.extractor.findMatchingAccessMethods(start);
-
- List proposals = new ArrayList(types.size() );
+
+ List proposals = new ArrayList(types.size() );
for (Iterator iter = types.iterator(); iter.hasNext();) {
HibernateTypeDescriptor element = (HibernateTypeDescriptor) iter.next();
- String extendedinfo = Messages.PROPERTYACCESSHANDLER_ACCESS_METHOD + element.getName();
+ String extendedinfo = MapperMessages.PropertyAccessHandler_access_method + element.getName();
if(element.getReturnClass()!=null) {
- extendedinfo += Messages.PROPERTYACCESSHANDLER_DESCRIPTION + element.getReturnClass();
+ extendedinfo += MapperMessages.PropertyAccessHandler_description + element.getReturnClass();
}
proposals.add(new CompletionProposal(element.getName(), offset, start.length(), element.getName().length(), null, null, null, extendedinfo) );
}
-
+
try {
IType typeInterface = project.findType("org.hibernate.property.PropertyAccessor"); //$NON-NLS-1$
- Set alreadyFound = new HashSet();
+ Set alreadyFound = new HashSet();
if (typeInterface != null) {
ITypeHierarchy hier = typeInterface.newTypeHierarchy(project, new NullProgressMonitor() );
IType[] classes = hier.getAllSubtypes(typeInterface); // TODO: cache these results ?
@@ -70,9 +71,9 @@
} catch (CoreException e) {
throw new RuntimeException(e); // TODO: log as error!
}
-
+
ICompletionProposal[] result = (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
- return result;
+ return result;
}
public IJavaElement getJavaElement(IJavaProject project, Node currentNode, Attr currentAttrNode) {
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/messages.properties 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/messages.properties 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1,10 +0,0 @@
-GENERATORTYPEHANDLER_GENERATOR_TYPE=<b>Generator type</b>:
-GENERATORTYPEHANDLER_RETURN_CLASS=<br><b>Return class</b>:
-HBMINFOEXTRACTOR_ACCESS_FIELDS_DIRECTLY=Access fields directly
-HBMINFOEXTRACTOR_DO_NOT_PERFORM_ANY_ACCESS=Do not perform any access. Use with HQL-only properties
-HBMINFOEXTRACTOR_USE_JAVABEAN_ACCESSOR_METHODS=Use JavaBean accessor methods
-HIBERANTETYPEHANDLER_HIBERNATE_TYPE=<b>Hibernate type</b>:
-HIBERANTETYPEHANDLER_RETURN_CLASS=<br><b>Return class</b>:
-HIBERANTETYPEHANDLER_RETURN_PRIMITIVE=<br><b>Return primitive</b>:
-PROPERTYACCESSHANDLER_ACCESS_METHOD=<b>Access method</b>:
-PROPERTYACCESSHANDLER_DESCRIPTION=<br><b>Description</b>:
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMReverseEngineeringDefinition.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -40,6 +40,7 @@
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.model.ITableFilter;
import org.hibernate.eclipse.console.model.ITypeMapping;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.factory.ObserverAdapterFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -48,63 +49,63 @@
public class DOMReverseEngineeringDefinition implements IReverseEngineeringDefinition {
private IModelStateListener listener = new IModelStateListener() {
-
+
public void modelReinitialized(IStructuredModel structuredModel) {
- //System.out.println("reinit" + structuredModel);
+ //System.out.println("reinit" + structuredModel);
}
-
+
public void modelAboutToBeReinitialized(IStructuredModel structuredModel) {
- //System.out.println("about to be reinit" + structuredModel);
+ //System.out.println("about to be reinit" + structuredModel);
}
-
+
public void modelResourceMoved(IStructuredModel oldModel,
IStructuredModel newModel) {
- //System.out.println("res moved" + oldModel);
+ //System.out.println("res moved" + oldModel);
}
-
+
public void modelResourceDeleted(IStructuredModel model) {
- //System.out.println("deleted" + model);
+ //System.out.println("deleted" + model);
}
-
+
public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
//System.out.println("dirty changed " + model + " to " + isDirty);
-
+
}
-
+
int cnt = 0;
public void modelChanged(IStructuredModel model) {
//System.out.println("model changed" + cnt++);
//pcs.firePropertyChange(null, null, null);
}
-
+
public void modelAboutToBeChanged(IStructuredModel model) {
//System.out.println("about to be changed" + cnt++);
-
+
}
-
+
};
-
+
private ObserverAdapterFactory factory;
private IDOMDocument document;
public DOMReverseEngineeringDefinition(IDOMDocument document) {
this.document = document;
- factory = new ObserverAdapterFactory(this);
-
+ factory = new ObserverAdapterFactory(this);
+
document.getModel().addModelStateListener(listener);
factory.adapt(document);
}
- public ITableFilter createTableFilter() {
+ public ITableFilter createTableFilter() {
return (ITableFilter) factory.adapt((INodeNotifier) getDocument().createElement("table-filter")); //$NON-NLS-1$
}
-
+
public void addTableFilter(ITableFilter filter) {
if ( filter instanceof TableFilterAdapter ) {
TableFilterAdapter tf = (TableFilterAdapter) filter;
factory.adapt((INodeNotifier) tf.getNode());
-
+
List lastChild = DOMModelUtil.getChildrenByTagName(getDocument().getDocumentElement(),"table-filter"); //$NON-NLS-1$
if(lastChild==null || lastChild.isEmpty()) {
List typeMapping = DOMModelUtil.getChildrenByTagName(getDocument().getDocumentElement(),"type-mapping"); //$NON-NLS-1$
@@ -114,7 +115,7 @@
getDocument().getDocumentElement().appendChild(tf.getNode());
} else {
Element e = (Element) tableMapping.get(tableMapping.size()-1);
- getDocument().getDocumentElement().insertBefore(tf.getNode(),e);
+ getDocument().getDocumentElement().insertBefore(tf.getNode(),e);
}
} else {
Element e = (Element) typeMapping.get(typeMapping.size()-1);
@@ -122,16 +123,16 @@
}
} else {
Element e = (Element) lastChild.get(lastChild.size()-1);
- getDocument().getDocumentElement().insertBefore(tf.getNode(), e.getNextSibling());
+ getDocument().getDocumentElement().insertBefore(tf.getNode(), e.getNextSibling());
}
-
+
DOMModelUtil.formatNode(tf.getNode().getParentNode());
}
-
+
}
PropertyChangeSupport pcs = new PropertyChangeSupport(this);
-
+
public void addPropertyChangeListener(PropertyChangeListener pcl) {
pcs.addPropertyChangeListener(pcl);
}
@@ -139,9 +140,9 @@
public void removePropertyChangeListener(PropertyChangeListener pcl) {
pcs.removePropertyChangeListener(pcl);
}
-
+
public void addPropertyChangeListener(String property, PropertyChangeListener pcl) {
- pcs.addPropertyChangeListener(property, pcl);
+ pcs.addPropertyChangeListener(property, pcl);
}
public void removePropertyChangeListener(String property, PropertyChangeListener pcl) {
@@ -179,7 +180,7 @@
TableFilterAdapter tfe = (TableFilterAdapter) item;
Node nextSibling = DOMModelUtil.getNextNamedSibling( tfe.getNode(), "table-filter" ); //$NON-NLS-1$
if(nextSibling!=null) {
- DOMModelUtil.addElementBefore(tfe.getNode().getParentNode(), nextSibling, tfe.getNode());
+ DOMModelUtil.addElementBefore(tfe.getNode().getParentNode(), nextSibling, tfe.getNode());
}
pcs.firePropertyChange(TABLEFILTER_STRUCTURE,null, null);
}
@@ -188,26 +189,26 @@
public void moveTableFilterUp(ITableFilter item) {
if ( item instanceof TableFilterAdapter ) {
TableFilterAdapter tfe = (TableFilterAdapter) item;
-
+
Node sibling = DOMModelUtil.getPreviousNamedSibling( tfe.getNode(), "table-filter"); //$NON-NLS-1$
if(sibling!=null) {
- DOMModelUtil.addElementBefore(tfe.getNode().getParentNode(), tfe.getNode(), sibling);
+ DOMModelUtil.addElementBefore(tfe.getNode().getParentNode(), tfe.getNode(), sibling);
}
pcs.firePropertyChange(TABLEFILTER_STRUCTURE,null, null);
}
}
-
+
private List getTableFiltersList() {
return DOMModelUtil.getAdaptedElements(getDocument().getDocumentElement(), "table-filter", factory); //$NON-NLS-1$
}
public void unknownNotifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- String out = NLS.bind(Messages.DOMREVERSEENGINEERINGDEFINITION_UNKNOWN_CHANGE, notifier, INodeNotifier.EVENT_TYPE_STRINGS[eventType]);
+ String out = NLS.bind(MapperMessages.DOMReverseEngineeringDefinition_unknown_change, notifier, INodeNotifier.EVENT_TYPE_STRINGS[eventType]);
System.out.println(out);
}
public void hibernateMappingChanged() {
- pcs.firePropertyChange(TABLEFILTER_STRUCTURE,null,null);
+ pcs.firePropertyChange(TABLEFILTER_STRUCTURE,null,null);
pcs.firePropertyChange(TYPEMAPPING_STRUCTURE,null,null);
pcs.firePropertyChange(TABLES_STRUCTURE,null,null);
}
@@ -241,7 +242,7 @@
public void addTypeMapping(ITypeMapping typeMapping) {
if ( typeMapping instanceof TypeMappingAdapter ) {
TypeMappingAdapter tf = (TypeMappingAdapter) typeMapping;
-
+
List parentList = DOMModelUtil.getChildrenByTagName(getDocument().getDocumentElement(),"type-mapping"); //$NON-NLS-1$
Element parent;
if(parentList.isEmpty()) {
@@ -258,15 +259,15 @@
}
parent.appendChild(tf.getNode());
DOMModelUtil.formatNode(tf.getNode().getParentNode());
- }
+ }
}
public void typeMappingChanged(INodeNotifier notifier) {
- pcs.firePropertyChange(TYPEMAPPING_STRUCTURE, null,null);
+ pcs.firePropertyChange(TYPEMAPPING_STRUCTURE, null,null);
}
public void sqlTypeChanged(INodeNotifier notifier) {
- pcs.firePropertyChange(TYPEMAPPING_STRUCTURE, null,null);
+ pcs.firePropertyChange(TYPEMAPPING_STRUCTURE, null,null);
}
public void moveTypeMappingDown(ITypeMapping item) {
@@ -274,22 +275,22 @@
TypeMappingAdapter tfe = (TypeMappingAdapter) item;
Node nextSibling = DOMModelUtil.getNextNamedSibling( tfe.getNode(), "sql-type" ); //$NON-NLS-1$
if(nextSibling!=null) {
- DOMModelUtil.addElementBefore(tfe.getNode().getParentNode(), nextSibling, tfe.getNode());
- }
- }
+ DOMModelUtil.addElementBefore(tfe.getNode().getParentNode(), nextSibling, tfe.getNode());
+ }
+ }
}
public void moveTypeMappingUp(ITypeMapping item) {
if ( item instanceof TypeMappingAdapter ) {
TypeMappingAdapter tfe = (TypeMappingAdapter) item;
-
+
Node sibling = DOMModelUtil.getPreviousNamedSibling( tfe.getNode(), "sql-type"); //$NON-NLS-1$
if(sibling!=null) {
- DOMModelUtil.addElementBefore(tfe.getNode().getParentNode(), tfe.getNode(), sibling);
+ DOMModelUtil.addElementBefore(tfe.getNode().getParentNode(), tfe.getNode(), sibling);
}
}
}
-
+
public void removeAllTypeMappings() {
List list = getTypeMappingsList();
for (java.util.Iterator it = list.iterator(); it.hasNext(); ) {
@@ -324,7 +325,7 @@
}
public void tablesChanged(INodeNotifier notifier) {
- pcs.firePropertyChange(TABLES_STRUCTURE, null,null);
+ pcs.firePropertyChange(TABLES_STRUCTURE, null,null);
}
public INodeAdapterFactory getNodeFactory() {
@@ -342,11 +343,11 @@
public void addTable(IRevEngTable retable) {
if ( retable instanceof RevEngTableAdapter ) {
RevEngTableAdapter tf = (RevEngTableAdapter) retable;
-
+
getDocument().getDocumentElement().appendChild(tf.getNode());
-
+
DOMModelUtil.formatNode(tf.getNode().getParentNode());
- }
+ }
}
public void removeTable(IRevEngTable retable) {
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/Messages.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/Messages.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1,16 +0,0 @@
-package org.hibernate.eclipse.mapper.model;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.eclipse.mapper.model.messages"; //$NON-NLS-1$
- public static String DOMREVERSEENGINEERINGDEFINITION_UNKNOWN_CHANGE;
- public static String REVENGPRIMARYKEYADAPTER_COLUMN;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngPrimaryKeyAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngPrimaryKeyAdapter.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/RevEngPrimaryKeyAdapter.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -27,6 +27,7 @@
import org.hibernate.eclipse.console.model.IRevEngColumn;
import org.hibernate.eclipse.console.model.IRevEngGenerator;
import org.hibernate.eclipse.console.model.IRevEngPrimaryKey;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -64,7 +65,7 @@
public void addColumn() {
RevEngColumnAdapter key = (RevEngColumnAdapter) getModel().createKeyColumn();
- key.setName(Messages.REVENGPRIMARYKEYADAPTER_COLUMN + (getColumns().length+1));
+ key.setName(MapperMessages.RevEngPrimaryKeyAdapter_column + (getColumns().length+1));
getNode().appendChild(key.getNode());
DOMModelUtil.formatNode(getNode().getParentNode());
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/messages.properties 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/messages.properties 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1,2 +0,0 @@
-DOMREVERSEENGINEERINGDEFINITION_UNKNOWN_CHANGE=Unknown change: {0} {1}
-REVENGPRIMARYKEYADAPTER_COLUMN=column_
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/HibernateXMLContentOutlineConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/HibernateXMLContentOutlineConfiguration.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/HibernateXMLContentOutlineConfiguration.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -31,6 +31,7 @@
import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.w3c.dom.Node;
public class HibernateXMLContentOutlineConfiguration extends
@@ -40,25 +41,25 @@
private JFaceNodeAdapterFactoryForXML myFactory;
protected IJFaceNodeAdapterFactory getFactory() {
-
+
if(myFactory==null) {
IJFaceNodeAdapterFactory realFactory = super.getFactory();
-
+
myFactory = new JFaceNodeAdapterFactoryForXML(realFactory);
}
return myFactory;
}*/
-
-
+
+
private HibernateToolsLabelProvider labelProvider;
public ILabelProvider getLabelProvider(TreeViewer viewer) {
if(labelProvider==null) {
labelProvider = new HibernateToolsLabelProvider(super.getLabelProvider(viewer));
- }
+ }
return labelProvider;
}
-
+
static class HibernateToolsLabelProvider implements ILabelProvider {
ILabelProvider delegate;
@@ -88,7 +89,7 @@
nameToMap.put("one-to-one", ImageConstants.ONETOONE); //$NON-NLS-1$
nameToMap.put("component", ImageConstants.ONETOONE); //$NON-NLS-1$
}
-
+
public Image getImage(Object element) {
Node node = (Node) element;
if(node.getNodeType()==Node.ELEMENT_NODE) {
@@ -105,7 +106,7 @@
Node node = (Node) element;
String nodeName = node.getNodeName();
if(node.getNodeType()==Node.PROCESSING_INSTRUCTION_NODE && "xml".equals(nodeName)) { //$NON-NLS-1$
- return Messages.XML_HIBERNATE_TOOLS;
+ return MapperMessages.xml_hibernate_tools;
}
}
return delegate.getText( element );
@@ -119,5 +120,5 @@
delegate.removeListener( listener );
}
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/JFaceNodeAdapterForXML.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/JFaceNodeAdapterForXML.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/JFaceNodeAdapterForXML.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -31,13 +31,14 @@
import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeAdapterFactory;
import org.hibernate.console.ImageConstants;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.eclipse.mapper.MapperMessages;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
* For xml files in general.
- *
+ *
* Adapts a DOM node to a JFace viewer.
*/
public class JFaceNodeAdapterForXML extends JFaceNodeAdapter {
@@ -54,15 +55,15 @@
*/
public String getLabelText(Object object) {
String result = getNodeName(object);
- Node node = (Node) object;
+ Node node = (Node) object;
NamedNodeMap attributes = node.getAttributes();
if(attributes!=null) {
Node firstAttribute = attributes.item(0);
if(firstAttribute!=null) {
return result + " " + firstAttribute.getNodeName() + "=\"" + firstAttribute.getNodeValue() + "\""; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
+ }
+ }
+
return result;
}
@@ -70,7 +71,7 @@
Node node = (Node) object;
String nodeName = node.getNodeName();
if(node.getNodeType()==Node.PROCESSING_INSTRUCTION_NODE && "xml".equals(nodeName)) { //$NON-NLS-1$
- return Messages.XML_HIBERNATE_TOOLS;
+ return MapperMessages.xml_hibernate_tools;
}
return nodeName;
}
@@ -92,8 +93,8 @@
public boolean isAdapterForType(Object type) {
return type.equals(ADAPTER_KEY);
}
-
-
+
+
static Map nameToMap = new HashMap();
static {
nameToMap.put("many-to-one", ImageConstants.MANYTOONE); //$NON-NLS-1$
@@ -107,7 +108,7 @@
nameToMap.put("one-to-one", ImageConstants.ONETOONE); //$NON-NLS-1$
nameToMap.put("component", ImageConstants.ONETOONE); //$NON-NLS-1$
}
-
+
protected Image createImage(Object object) {
Node node = (Node) object;
if(node.getNodeType()==Node.ELEMENT_NODE) {
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/Messages.java 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/Messages.java 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1,15 +0,0 @@
-package org.hibernate.eclipse.mapper.views.contentoutline;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.eclipse.mapper.views.contentoutline.messages"; //$NON-NLS-1$
- public static String XML_HIBERNATE_TOOLS;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/messages.properties 2008-06-06 16:51:19 UTC (rev 8614)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/views/contentoutline/messages.properties 2008-06-06 16:51:42 UTC (rev 8615)
@@ -1 +0,0 @@
-XML_HIBERNATE_TOOLS=xml (Hibernate Tools)
17 years, 10 months
JBoss Tools SVN: r8614 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-06-06 12:51:19 -0400 (Fri, 06 Jun 2008)
New Revision: 8614
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties
Removed:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/messages.properties
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/CriteriaQuickAssistProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/DebugJavaCompletionProposalComputer.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLQuickAssistProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java
Log:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-500
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/CriteriaQuickAssistProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/CriteriaQuickAssistProcessor.java 2008-06-06 16:51:10 UTC (rev 8613)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/CriteriaQuickAssistProcessor.java 2008-06-06 16:51:19 UTC (rev 8614)
@@ -48,17 +48,17 @@
public IJavaCompletionProposal[] getAssists(IInvocationContext context,
IProblemLocation[] locations) throws CoreException {
-
+
IJavaCompletionProposal[] result = new IJavaCompletionProposal[0];
if(!hasAssists( context )) return result;
-
+
IDocument document = getDocument( context.getCompilationUnit() );
try {
String contents = document.get( context.getSelectionOffset(), context.getSelectionLength() );
// position of selection
final Point position = new Point( context.getSelectionOffset(), context.getSelectionLength() );
- result = new IJavaCompletionProposal[1];
- result[0] = new ExternalActionQuickAssistProposal(contents, EclipseImages.getImage(ImageConstants.CRITERIA_EDITOR), Messages.CRITERIAQUICKASSISTPROCESSOR_COPY_TO_CRITERIA_EDITOR, context) {
+ result = new IJavaCompletionProposal[1];
+ result[0] = new ExternalActionQuickAssistProposal(contents, EclipseImages.getImage(ImageConstants.CRITERIA_EDITOR), JdtUiMessages.CriteriaQuickAssistProcessor_copy_to_criteria_editor, context) {
public void apply(IDocument target) {
//IEditorPart editorPart = HibernateConsolePlugin.getDefault().openCriteriaEditor(getName(), getContents());
IEditorPart editorPart = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
@@ -69,11 +69,11 @@
};
}
catch (BadLocationException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage( Messages.CRITERIAQUICKASSISTPROCESSOR_ERRORMESSAGE, e );
+ HibernateConsolePlugin.getDefault().logErrorMessage( JdtUiMessages.CriteriaQuickAssistProcessor_errormessage, e );
}
return result;
}
-
+
private IDocument getDocument(ICompilationUnit cu) throws JavaModelException {
IFile file= (IFile) cu.getResource();
IDocument document= JavaUI.getDocumentProvider().getDocument(new FileEditorInput(file));
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/DebugJavaCompletionProposalComputer.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/DebugJavaCompletionProposalComputer.java 2008-06-06 16:51:10 UTC (rev 8613)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/DebugJavaCompletionProposalComputer.java 2008-06-06 16:51:19 UTC (rev 8614)
@@ -47,7 +47,7 @@
public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
List proposals = new ArrayList();
-
+
proposals.add( new CompletionProposal( "hibernate tools", context.getInvocationOffset(), 7, context.getInvocationOffset()) ); //$NON-NLS-1$
CharSequence computeIdentifierPrefix = null;
try {
@@ -65,7 +65,7 @@
proposals.add( new CompletionProposal("Corectx: " + jcaic.getCoreContext(), context.getInvocationOffset() ,7, context.getInvocationOffset()) ); //$NON-NLS-1$
proposals.add( new CompletionProposal("type: " + jcaic.getExpectedType(), context.getInvocationOffset() ,7, context.getInvocationOffset()) ); //$NON-NLS-1$
}
-
+
proposals.add( new MyCompletionProposal() );
return proposals;
}
@@ -86,7 +86,7 @@
}
public String getDisplayString() {
- return Messages.DEBUGJAVACOMPLETIONPROPOSALCOMPUTER_DISPLAYSTRING;
+ return JdtUiMessages.DebugJavaCompletionProposalComputer_displaystring;
}
public Image getImage() {
@@ -98,7 +98,7 @@
}
}
-
+
public List computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
// TODO Auto-generated method stub
return Collections.EMPTY_LIST;
@@ -111,12 +111,12 @@
public void sessionEnded() {
// TODO Auto-generated method stub
-
+
}
public void sessionStarted() {
// TODO Auto-generated method stub
-
+
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java 2008-06-06 16:51:10 UTC (rev 8613)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java 2008-06-06 16:51:19 UTC (rev 8614)
@@ -45,7 +45,7 @@
HQLCompletionProcessor hqlProcessor;
private String errorMessage;
-
+
public HQLJavaCompletionProposalComputer() {
super();
hqlProcessor = new HQLCompletionProcessor(null);
@@ -66,16 +66,16 @@
public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
List proposals = new ArrayList();
errorMessage = null;
-
+
JavaContentAssistInvocationContext ctx = (JavaContentAssistInvocationContext)context;
-
+
try {
ConsoleConfiguration consoleConfiguration = getConfiguration( ctx.getProject() );
- if(consoleConfiguration!=null) {
+ if(consoleConfiguration!=null) {
Configuration configuration = consoleConfiguration!=null?consoleConfiguration.getConfiguration():null;
IHQLCodeAssist hqlEval = new HQLCodeAssist(configuration);
-
+
String query = ""; //$NON-NLS-1$
int stringStart = getStringStart( ctx.getDocument(), ctx.getInvocationOffset() );
int stringEnd = getStringEnd( ctx.getDocument(), ctx.getInvocationOffset() );
@@ -87,12 +87,12 @@
proposals = eclipseHQLCompletionCollector.getCompletionProposals();
}
} catch(RuntimeException re) {
- HibernateConsolePlugin.getDefault().logErrorMessage( Messages.HQLJAVACOMPLETIONPROPOSALCOMPUTER_ERRORMESSAGE, re );
+ HibernateConsolePlugin.getDefault().logErrorMessage( JdtUiMessages.HQLJavaCompletionProposalComputer_errormessage, re );
}
catch (BadLocationException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage( Messages.HQLJAVACOMPLETIONPROPOSALCOMPUTER_ERRORMESSAGE, e );
+ HibernateConsolePlugin.getDefault().logErrorMessage( JdtUiMessages.HQLJavaCompletionProposalComputer_errormessage, e );
}
-
+
return proposals;
}
@@ -110,7 +110,7 @@
}
}
start++;
-
+
return start;
}
@@ -136,16 +136,16 @@
return Collections.EMPTY_LIST;
}
- public String getErrorMessage() {
+ public String getErrorMessage() {
return errorMessage;
}
public void sessionEnded() {
-
+
}
public void sessionStarted() {
-
+
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLQuickAssistProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLQuickAssistProcessor.java 2008-06-06 16:51:10 UTC (rev 8613)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLQuickAssistProcessor.java 2008-06-06 16:51:19 UTC (rev 8614)
@@ -40,19 +40,19 @@
public IJavaCompletionProposal[] getAssists(final IInvocationContext context,
IProblemLocation[] locations) throws CoreException {
-
+
IJavaCompletionProposal[] result = new IJavaCompletionProposal[0];
if(!hasAssists( context )) return result;
-
+
ASTNode coveringNode = context.getCoveringNode();
if(!(coveringNode instanceof StringLiteral)) {
return result;
}
-
+
final StringLiteral stringLiteral= (StringLiteral) coveringNode;
String contents= stringLiteral.getLiteralValue();
- result = new IJavaCompletionProposal[1];
- result[0] = new ExternalActionQuickAssistProposal(contents, EclipseImages.getImage(ImageConstants.HQL_EDITOR), Messages.HQLQUICKASSISTPROCESSOR_COPY_TO_HQL_EDITOR, context) {
+ result = new IJavaCompletionProposal[1];
+ result[0] = new ExternalActionQuickAssistProposal(contents, EclipseImages.getImage(ImageConstants.HQL_EDITOR), JdtUiMessages.HQLQuickAssistProcessor_copy_to_hql_editor, context) {
public void apply(IDocument document) {
IEditorPart editorPart = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
ITextEditor[] textEditors = OpenMappingAction.getTextEditors(editorPart);
@@ -61,7 +61,7 @@
new SaveQueryEditorListener(textEditors[0], getName(), getContents(), position, SaveQueryEditorListener.HQLEditor);
}
};
-
+
return result;
}
}
Copied: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java (from rev 8546, trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/Messages.java)
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java 2008-06-06 16:51:19 UTC (rev 8614)
@@ -0,0 +1,29 @@
+package org.hibernate.eclipse.jdt.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class JdtUiMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages"; //$NON-NLS-1$
+ public static String CriteriaQuickAssistProcessor_copy_to_criteria_editor;
+ public static String CriteriaQuickAssistProcessor_errormessage;
+ public static String DebugJavaCompletionProposalComputer_displaystring;
+ public static String HQLJavaCompletionProposalComputer_errormessage;
+ public static String HQLQuickAssistProcessor_copy_to_hql_editor;
+ public static String SaveQueryEditorListener_replacequestion;
+ public static String SaveQueryEditorListener_replacetitle;
+ public static String SaveQueryEditorListener_hql_editor;
+ public static String SaveQueryEditorListener_cri_editor;
+ public static String SaveQueryEditorListener_change_name;
+ public static String SaveQueryEditorListener_composite_change_name;
+ public static String SaveQueryEditorListener_refactoringtitle;
+ public static String SaveQueryEditorListener_replacetitle_info;
+ public static String SaveQueryEditorListener_replacequestion_confirm;
+ public static String SaveQueryEditorListener_errormessage;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, JdtUiMessages.class);
+ }
+
+ private JdtUiMessages() {
+ }
+}
Copied: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties (from rev 8546, trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/messages.properties)
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties 2008-06-06 16:51:19 UTC (rev 8614)
@@ -0,0 +1,26 @@
+###############################################################################
+# Copyright (c) 2007-2008 Red Hat, Inc.
+# Distributed under license by Red Hat, Inc. All rights reserved.
+# This program is made available under the terms of the
+# Eclipse Public License v1.0 which accompanies this distribution,
+# and is available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributor:
+# Red Hat, Inc. - initial API and implementation
+##############################################################################/
+
+CriteriaQuickAssistProcessor_copy_to_criteria_editor=Copy to Criteria Editor
+CriteriaQuickAssistProcessor_errormessage= Could not get document contents for CriteriaQuickAssist
+DebugJavaCompletionProposalComputer_displaystring= I wanna show a dialog!
+HQLJavaCompletionProposalComputer_errormessage= Error while performing HQL completion in java
+HQLQuickAssistProcessor_copy_to_hql_editor=Copy to HQL Editor
+SaveQueryEditorListener_replacequestion= Do you want to save this {0} query into ''{1}''?
+SaveQueryEditorListener_replacetitle= Query replace
+SaveQueryEditorListener_hql_editor=HQL
+SaveQueryEditorListener_cri_editor=Criteria
+SaveQueryEditorListener_change_name=Update {0} query in ''{1}''
+SaveQueryEditorListener_composite_change_name=Update {0} query
+SaveQueryEditorListener_refactoringtitle= Update {0} query in file
+SaveQueryEditorListener_replacetitle_info= Query replace
+SaveQueryEditorListener_replacequestion_confirm= ''{0}'' was changed. It is not possible to update the query.
+SaveQueryEditorListener_errormessage=Error while query refactoring
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/Messages.java 2008-06-06 16:51:10 UTC (rev 8613)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/Messages.java 2008-06-06 16:51:19 UTC (rev 8614)
@@ -1,29 +0,0 @@
-package org.hibernate.eclipse.jdt.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.hibernate.eclipse.jdt.ui.internal.messages"; //$NON-NLS-1$
- public static String SAVEQUERYEDITORLISTENER_REPLACEQUESTION;
- public static String SAVEQUERYEDITORLISTENER_REPLACETITLE;
- public static String SAVEQUERYEDITORLISTENER_HQL_EDITOR;
- public static String SAVEQUERYEDITORLISTENER_CRI_EDITOR;
- public static String SAVEQUERYEDITORLISTENER_CHANGE_NAME;
- public static String SAVEQUERYEDITORLISTENER_COMPOSITE_CHANGE_NAME;
- public static String SAVEQUERYEDITORLISTENER_REFACTORINGTITLE;
- public static String SAVEQUERYEDITORLISTENER_REPLACETITLE_INFO;
- public static String SAVEQUERYEDITORLISTENER_REPLACEQUESTION_CONFIRM;
- public static String SAVEQUERYEDITORLISTENER_ERRORMESSAGE;
- public static String CRITERIAQUICKASSISTPROCESSOR_COPY_TO_CRITERIA_EDITOR;
- public static String CRITERIAQUICKASSISTPROCESSOR_ERRORMESSAGE;
- public static String DEBUGJAVACOMPLETIONPROPOSALCOMPUTER_DISPLAYSTRING;
- public static String HQLJAVACOMPLETIONPROPOSALCOMPUTER_ERRORMESSAGE;
- public static String HQLQUICKASSISTPROCESSOR_COPY_TO_HQL_EDITOR;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java 2008-06-06 16:51:10 UTC (rev 8613)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/SaveQueryEditorListener.java 2008-06-06 16:51:19 UTC (rev 8614)
@@ -51,19 +51,19 @@
*
*/
public class SaveQueryEditorListener implements IPropertyListener {
-
+
public static final String id = "AbstractQueryEditor.ReplaceString"; //$NON-NLS-1$
-
+
public static final int HQLEditor = 0;
-
+
public static final int CriteriaEditor = 1;
-
+
private ITextEditor fromEditorPart;
- private AbstractQueryEditor editor;
+ private AbstractQueryEditor editor;
private String query;
private Point position;
-
- public SaveQueryEditorListener(final ITextEditor fromEditorPart, String consoleName,
+
+ public SaveQueryEditorListener(final ITextEditor fromEditorPart, String consoleName,
String query, Point position, int editorNum){
this.fromEditorPart = fromEditorPart;
this.query = query;
@@ -98,17 +98,17 @@
public void partDeactivated(IWorkbenchPart part) {}
public void partOpened(IWorkbenchPart part) {}
-
+
};
fromEditorPart.getEditorSite().getPage().addPartListener(pl);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.IPropertyListener#propertyChanged(java.lang.Object, int)
*/
public void propertyChanged(Object source, int propId) {
-
+
if (IEditorPart.PROP_DIRTY == propId && !editor.isDirty()){
IDocumentProvider docProvider = fromEditorPart.getDocumentProvider();
@@ -121,23 +121,23 @@
} catch (BadLocationException e1) {
//document changed and we can get the exception
}
-
+
final String editorTitle = fromEditorPart.getTitle();
-
- final String editor_name = editor instanceof HQLEditor
- ? Messages.SAVEQUERYEDITORLISTENER_HQL_EDITOR
- : Messages.SAVEQUERYEDITORLISTENER_CRI_EDITOR;
-
+
+ final String editor_name = editor instanceof HQLEditor
+ ? JdtUiMessages.SaveQueryEditorListener_hql_editor
+ : JdtUiMessages.SaveQueryEditorListener_cri_editor;
+
if (isDocChanged){
- String information_message = NLS.bind(Messages.SAVEQUERYEDITORLISTENER_REPLACEQUESTION_CONFIRM, editorTitle);
- MessageDialog.openInformation(null, Messages.SAVEQUERYEDITORLISTENER_REPLACETITLE_INFO, information_message);
+ String information_message = NLS.bind(JdtUiMessages.SaveQueryEditorListener_replacequestion_confirm, editorTitle);
+ MessageDialog.openInformation(null, JdtUiMessages.SaveQueryEditorListener_replacetitle_info, information_message);
return;
}
-
- final String newQuery = editor.getQueryString();
-
- final String wizard_title = NLS.bind(Messages.SAVEQUERYEDITORLISTENER_REFACTORINGTITLE, editor_name);
-
+
+ final String newQuery = editor.getQueryString();
+
+ final String wizard_title = NLS.bind(JdtUiMessages.SaveQueryEditorListener_refactoringtitle, editor_name);
+
Refactoring ref = new Refactoring(){
@Override
@@ -152,12 +152,12 @@
@Override
public Change createChange(IProgressMonitor pm){
- String change_name = NLS.bind(Messages.SAVEQUERYEDITORLISTENER_CHANGE_NAME, editor_name, editorTitle);
+ String change_name = NLS.bind(JdtUiMessages.SaveQueryEditorListener_change_name, editor_name, editorTitle);
DocumentChange change = new DocumentChange(change_name, doc);
TextEdit replaceEdit = new ReplaceEdit(position.x, position.y, newQuery);
change.setEdit(replaceEdit);
-
- String cc_name = NLS.bind(Messages.SAVEQUERYEDITORLISTENER_COMPOSITE_CHANGE_NAME, editor_name);
+
+ String cc_name = NLS.bind(JdtUiMessages.SaveQueryEditorListener_composite_change_name, editor_name);
final CompositeChange cc = new CompositeChange(cc_name);
cc.add(change);
return cc;
@@ -165,10 +165,10 @@
@Override
public String getName() {
- return Messages.SAVEQUERYEDITORLISTENER_COMPOSITE_CHANGE_NAME;
- }
+ return JdtUiMessages.SaveQueryEditorListener_composite_change_name;
+ }
};
-
+
RefactoringWizard wizard = new RefactoringWizard(ref, RefactoringWizard.DIALOG_BASED_USER_INTERFACE){
@Override
protected void addUserInputPages() {
@@ -181,17 +181,17 @@
layout.numColumns = 1;
layout.verticalSpacing = 9;
Label label = new Label(container, SWT.NULL);
- label.setText(NLS.bind(Messages.SAVEQUERYEDITORLISTENER_REPLACEQUESTION, editor_name, editorTitle ));
+ label.setText(NLS.bind(JdtUiMessages.SaveQueryEditorListener_replacequestion, editor_name, editorTitle ));
setControl(container);
- }
+ }
};
addPage(page);
}
};
-
+
wizard.setWindowTitle(wizard_title);
wizard.setDefaultPageTitle(wizard_title);
-
+
IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if ( new RefactoringStarter().activate(wizard, win.getShell(), wizard_title, RefactoringSaveHelper.SAVE_ALL)){ //$NON-NLS-1$
query = newQuery;
@@ -200,9 +200,9 @@
} else {
if (editor.getDocumentProvider() instanceof TextFileDocumentProvider){
((TextFileDocumentProvider)editor.getDocumentProvider()).setCanSaveDocument(editor.getEditorInput());
- }
- }
- }
+ }
+ }
+ }
}
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/messages.properties 2008-06-06 16:51:10 UTC (rev 8613)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/messages.properties 2008-06-06 16:51:19 UTC (rev 8614)
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2007-2008 Red Hat, Inc.
-# Distributed under license by Red Hat, Inc. All rights reserved.
-# This program is made available under the terms of the
-# Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributor:
-# Red Hat, Inc. - initial API and implementation
-##############################################################################/
-
-SAVEQUERYEDITORLISTENER_REPLACEQUESTION= Do you want to save this {0} query into ''{1}''?
-SAVEQUERYEDITORLISTENER_REPLACETITLE= Query replace
-SAVEQUERYEDITORLISTENER_HQL_EDITOR=HQL
-SAVEQUERYEDITORLISTENER_CRI_EDITOR=Criteria
-SAVEQUERYEDITORLISTENER_CHANGE_NAME=Update {0} query in ''{1}''
-SAVEQUERYEDITORLISTENER_COMPOSITE_CHANGE_NAME=Update {0} query
-SAVEQUERYEDITORLISTENER_REFACTORINGTITLE= Update {0} query in file
-SAVEQUERYEDITORLISTENER_REPLACETITLE_INFO= Query replace
-SAVEQUERYEDITORLISTENER_REPLACEQUESTION_CONFIRM= ''{0}'' was changed. It is not possible to update the query.
-SAVEQUERYEDITORLISTENER_ERRORMESSAGE=Error while query refactoring
-CRITERIAQUICKASSISTPROCESSOR_COPY_TO_CRITERIA_EDITOR=Copy to Criteria Editor
-CRITERIAQUICKASSISTPROCESSOR_ERRORMESSAGE= Could not get document contents for CriteriaQuickAssist
-DEBUGJAVACOMPLETIONPROPOSALCOMPUTER_DISPLAYSTRING= I wanna show a dialog!
-HQLJAVACOMPLETIONPROPOSALCOMPUTER_ERRORMESSAGE= Error while performing HQL completion in java
-HQLQUICKASSISTPROCESSOR_COPY_TO_HQL_EDITOR=Copy to HQL Editor
17 years, 10 months