Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortle2009-12-17 04:51:18 +0000
committertle2009-12-17 04:51:18 +0000
commit2607b7033ab13bcf881b95316150c9e20f7772c7 (patch)
treeca5d5436c948c0c2d18d8aae2144635fccb390e0 /jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui
parent234d18e8cf3fd5f3d6839bb1c3f0050dc434b3ac (diff)
downloadwebtools.dali-2607b7033ab13bcf881b95316150c9e20f7772c7.tar.gz
webtools.dali-2607b7033ab13bcf881b95316150c9e20f7772c7.tar.xz
webtools.dali-2607b7033ab13bcf881b95316150c9e20f7772c7.zip
Fix for: 296059, 296525, 294132
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui')
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUi.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiFactory.java3
4 files changed, 106 insertions, 8 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
index 1a23b0742a..3e9859d810 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2007, 2008 Oracle. All rights reserved.
+* Copyright (c) 2007, 2009 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -46,7 +46,7 @@ public class EclipseLinkDDLGeneratorUi
new EclipseLinkDDLGeneratorUi(project).generate();
}
- private EclipseLinkDDLGeneratorUi(JpaProject project) {
+ protected EclipseLinkDDLGeneratorUi(JpaProject project) {
super();
if (project == null) {
throw new NullPointerException();
@@ -73,7 +73,7 @@ public class EclipseLinkDDLGeneratorUi
return;
}
}
- IWorkspaceRunnable runnable = new GenerateDDLRunnable(puName, this.project);
+ IWorkspaceRunnable runnable = this.buildGenerateDDLRunnable(puName, this.project);
try {
ResourcesPlugin.getWorkspace().run(runnable, new NullProgressMonitor());
}
@@ -82,6 +82,10 @@ public class EclipseLinkDDLGeneratorUi
}
}
+ protected IWorkspaceRunnable buildGenerateDDLRunnable(String puName, JpaProject project) {
+ return new GenerateDDLRunnable(puName, project);
+ }
+
private Shell getCurrentShell() {
return Display.getCurrent().getActiveShell();
}
@@ -113,11 +117,11 @@ public class EclipseLinkDDLGeneratorUi
// ********** runnable **********
- static class GenerateDDLRunnable implements IWorkspaceRunnable {
+ protected static class GenerateDDLRunnable implements IWorkspaceRunnable {
private final String puName;
private final JpaProject project;
- GenerateDDLRunnable(String puName, JpaProject project) {
+ public GenerateDDLRunnable(String puName, JpaProject project) {
super();
this.puName = puName;
this.project = project;
@@ -126,7 +130,7 @@ public class EclipseLinkDDLGeneratorUi
public void run(IProgressMonitor monitor) {
String projectLocation = this.project.getProject().getLocation().toString();
try {
- EclipseLinkDDLGenerator.generate(this.puName, this.project, projectLocation, monitor);
+ this.ddlGeneratorGenerate(this.puName, this.project, projectLocation, monitor);
}
catch (OperationCanceledException e) {
return;
@@ -141,6 +145,10 @@ public class EclipseLinkDDLGeneratorUi
}
}
+ protected void ddlGeneratorGenerate(String puName, JpaProject project, String projectLocation, IProgressMonitor monitor) {
+ EclipseLinkDDLGenerator.generate(puName, project, projectLocation, monitor);
+ }
+
protected void logError(String message) {
this.displayError(message);
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java
new file mode 100644
index 0000000000..e433b0003a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+* Copyright (c) 2009 Oracle. All rights reserved.
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License v1.0, which accompanies this distribution
+* and is available at http://www.eclipse.org/legal/epl-v10.html.
+*
+* Contributors:
+* Oracle - initial API and implementation
+*******************************************************************************/
+package org.eclipse.jpt.eclipselink.ui.internal.v2_0.ddlgen.wizards;
+
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.eclipselink.core.internal.v2_0.ddlgen.EclipseLink2_0DDLGenerator;
+import org.eclipse.jpt.eclipselink.ui.internal.ddlgen.EclipseLinkDDLGeneratorUi;
+
+/**
+ * EclipseLink2_0DDLGeneratorUi
+ */
+public class EclipseLink2_0DDLGeneratorUi extends EclipseLinkDDLGeneratorUi
+{
+
+ // ********** static method **********
+
+ public static void generate(JpaProject project) {
+ new EclipseLink2_0DDLGeneratorUi(project).generate();
+ }
+
+ // ********** constructors **********
+
+ private EclipseLink2_0DDLGeneratorUi(JpaProject project) {
+ super(project);
+ }
+
+ // ********** behavior **********
+
+ @Override
+ protected IWorkspaceRunnable buildGenerateDDLRunnable(String puName, JpaProject project) {
+ return new Generate2_0DDLRunnable(puName, project);
+ }
+
+ // ********** runnable **********
+
+ protected static class Generate2_0DDLRunnable extends EclipseLinkDDLGeneratorUi.GenerateDDLRunnable {
+
+ public Generate2_0DDLRunnable(String puName, JpaProject project) {
+ super(puName, project);
+ }
+
+ @Override
+ protected void ddlGeneratorGenerate(String puName, JpaProject project, String projectLocation, IProgressMonitor monitor) {
+ EclipseLink2_0DDLGenerator.generate(puName, project, projectLocation, monitor);
+ }
+ }
+}
+
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUi.java
new file mode 100644
index 0000000000..3a5a50dd74
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUi.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2009 Oracle. All rights reserved.
+* This program and the accompanying materials are made available under the
+* terms of the Eclipse Public License v1.0, which accompanies this distribution
+* and is available at http://www.eclipse.org/legal/epl-v10.html.
+*
+* Contributors:
+* Oracle - initial API and implementation
+*******************************************************************************/
+package org.eclipse.jpt.eclipselink.ui.internal.v2_0.platform;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.eclipselink.ui.internal.v2_0.ddlgen.wizards.EclipseLink2_0DDLGeneratorUi;
+import org.eclipse.jpt.ui.JpaPlatformUiProvider;
+import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
+import org.eclipse.jpt.ui.navigator.JpaNavigatorProvider;
+
+public class EclipseLink2_0JpaPlatformUi extends BaseJpaPlatformUi
+{
+ public EclipseLink2_0JpaPlatformUi(
+ JpaNavigatorProvider navigatorProvider,
+ JpaPlatformUiProvider platformUiProvider) {
+
+ super(navigatorProvider, platformUiProvider);
+ }
+
+ // ********** DDL generation **********
+
+ public void generateDDL(JpaProject project, IStructuredSelection selection) {
+ EclipseLink2_0DDLGeneratorUi.generate(project);
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiFactory.java
index 4d70c2c8b5..e6563fa352 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiFactory.java
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.eclipselink.ui.internal.v2_0.platform;
-import org.eclipse.jpt.eclipselink.ui.internal.platform.EclipseLinkJpaPlatformUi;
import org.eclipse.jpt.eclipselink.ui.internal.platform.EclipseLinkNavigatorProvider;
import org.eclipse.jpt.ui.JpaPlatformUi;
import org.eclipse.jpt.ui.JpaPlatformUiFactory;
@@ -28,7 +27,7 @@ public class EclipseLink2_0JpaPlatformUiFactory implements JpaPlatformUiFactory
}
public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLinkJpaPlatformUi(
+ return new EclipseLink2_0JpaPlatformUi(
new EclipseLinkNavigatorProvider(),
EclipseLink2_0JpaPlatformUiProvider.instance()
);

Back to the top