Author: dgeraskov
Date: 2008-08-27 08:54:44 -0400 (Wed, 27 Aug 2008)
New Revision: 9920
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2658
redundant dependencies removed
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF 2008-08-27
12:54:37 UTC (rev 9919)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF 2008-08-27
12:54:44 UTC (rev 9920)
@@ -4,30 +4,18 @@
Bundle-SymbolicName: org.jboss.tools.hibernate.jpt.ui;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
+Require-Bundle:
org.eclipse.jpt.ui,
org.eclipse.jpt.core;bundle-version="2.0.0",
- org.eclipse.jpt.eclipselink.core;bundle-version="1.0.0",
- org.eclipse.jpt.eclipselink.ui;bundle-version="1.0.0",
- org.eclipse.jpt.gen;bundle-version="1.1.0",
- org.eclipse.jpt.utility;bundle-version="1.2.0",
org.hibernate.eclipse.console;bundle-version="3.2.0",
org.hibernate.eclipse;bundle-version="3.2.0",
- org.eclipse.core.resources;bundle-version="3.4.0",
org.eclipse.debug.core;bundle-version="3.4.0",
org.eclipse.jdt.core;bundle-version="3.4.0",
- org.eclipse.jpt.db;bundle-version="1.1.1",
org.eclipse.jdt.ui;bundle-version="3.4.0",
- org.eclipse.jpt.db.ui;bundle-version="1.0.1",
org.eclipse.datatools.connectivity;bundle-version="1.1.0",
org.eclipse.jdt.launching;bundle-version="3.4.0",
org.eclipse.wst.common.project.facet.ui;bundle-version="1.3.0",
- org.eclipse.wst.web.ui;bundle-version="1.1.200",
- org.eclipse.wst.common.frameworks;bundle-version="1.1.200",
- org.eclipse.wst.common.emf;bundle-version="1.1.200",
- org.eclipse.wst.common.modulecore;bundle-version="1.1.200",
- org.eclipse.wst.common.frameworks.ui;bundle-version="1.1.200"
+ org.eclipse.wst.common.frameworks;bundle-version="1.1.200"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: Hibernate Team
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java 2008-08-27
12:54:37 UTC (rev 9919)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java 2008-08-27
12:54:44 UTC (rev 9920)
@@ -11,28 +11,16 @@
package org.jboss.tools.hibernate.jpt.ui.internal.platform;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
-import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.gen.internal.EntityGenerator;
-import org.eclipse.jpt.gen.internal.PackageGenerator;
import org.eclipse.jpt.ui.internal.platform.generic.GenericPlatformUi;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java 2008-08-27
12:54:37 UTC (rev 9919)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java 2008-08-27
12:54:44 UTC (rev 9920)
@@ -10,26 +10,13 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.ui.wizard;
-import java.util.Collection;
-import java.util.Collections;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.gen.internal.EntityGenerator;
-import org.eclipse.jpt.gen.internal.PackageGenerator;
import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.wizards.DatabaseReconnectWizardPage;
-import org.eclipse.jpt.utility.internal.CollectionTools;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-08-27
12:54:37 UTC (rev 9919)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-08-27
12:54:44 UTC (rev 9920)
@@ -10,11 +10,9 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.ui.wizard;
-import java.io.File;
-import java.net.URL;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -23,7 +21,6 @@
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
@@ -35,10 +32,7 @@
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.db.JptDbPlugin;
import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -52,14 +46,13 @@
import org.hibernate.cfg.Environment;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import
org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
+import org.hibernate.tool.hbm2x.StringUtils;
import org.hibernate.util.StringHelper;
import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
-import org.w3c.dom.Element;
/**
* @author Dmitry Geraskov
@@ -162,11 +155,10 @@
connectionProfileName = new ComboDialogField(SWT.READ_ONLY);
connectionProfileName.setLabelText(JptUiMessages.DatabaseReconnectWizardPage_connection);
- List<String> list = dtpConnectionProfileNames();
- connectionProfileName.setItems((String[]) list.toArray(new String[list.size()]));
+ connectionProfileName.setItems(dtpConnectionProfileNames());
String connectionName = getProjectConnectionProfileName();
- if (!StringTools.stringIsEmpty(connectionName)) {
+ if (!StringUtils.isEmpty(connectionName)) {
connectionProfileName.selectItem(connectionName);
}
connectionProfileName.doFillIntoGrid(dbGroup, numColumns);
@@ -206,21 +198,17 @@
setErrorMessage(null);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.WizardPage#isPageComplete()
- */
- /*@Override
- public boolean isPageComplete() {
- return (selectMethod.getSelection() &&
(StringHelper.isNotEmpty(getConfigurationName())))
- ||(!selectMethod.getSelection() &&
(StringHelper.isNotEmpty(getConnectionProfileName())));
- }*/
-
- private List<String> dtpConnectionProfileNames() {
+ private String[] dtpConnectionProfileNames() {
List<String> list = new ArrayList<String>();
- for (Iterator<String> i =
CollectionTools.sort(JptDbPlugin.instance().getConnectionProfileRepository().connectionProfileNames());
i.hasNext();) {
+ /*for (Iterator<String> i =
CollectionTools.sort(JptDbPlugin.instance().getConnectionProfileRepository().connectionProfileNames());
i.hasNext();) {
list.add(i.next());
+ }*/
+ IConnectionProfile[] cps = ProfileManager.getInstance().getProfiles();
+ for (int i = 0; i < cps.length; i++) {
+ list.add(cps[i].getName());
}
- return list;
+ Collections.sort(list);
+ return (String[]) list.toArray(new String[list.size()]);
}
private String getProjectConnectionProfileName() {