Author: dgeraskov
Date: 2009-06-02 04:43:06 -0400 (Tue, 02 Jun 2009)
New Revision: 15637
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaUiFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.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/GenerateEntitiesWizardPage.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-4404
Removed xpl package as we don't want to support dali 2.0 any more.
Core refactored.
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java 2009-06-02
08:19:13 UTC (rev 15636)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java 2009-06-02
08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -15,10 +15,11 @@
import java.util.List;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.details.JpaPageComposite;
import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
+import org.eclipse.jpt.ui.internal.widgets.FormPane;
+import org.eclipse.jpt.utility.internal.StringConverter;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
@@ -35,13 +36,12 @@
import org.hibernate.eclipse.launch.PathHelper;
import
org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
import org.jboss.tools.hibernate.jpt.ui.wizard.Messages;
-import org.jboss.tools.hibernate.jpt.ui.xpl.AbstractPane;
/**
* @author Dmitry Geraskov
*
*/
-public class HibernatePropertiesComposite extends
AbstractPane<BasicHibernateProperties> implements
+public class HibernatePropertiesComposite extends
FormPane<BasicHibernateProperties> implements
JpaPageComposite {
private Text cfgFile;
@@ -60,7 +60,7 @@
protected void initializeLayout(Composite container) {
- Composite section = buildSection(container,
Messages.HibernatePropertiesComposite_basic_properties);
+ Composite section = addSection(container,
Messages.HibernatePropertiesComposite_basic_properties);
helper = new DriverClassHelpers();
@@ -89,30 +89,33 @@
final WritablePropertyValueModel<String> driverHolder = buildDriverHolder();
final WritablePropertyValueModel<String> urlHolder = buildUrlHolder();
- Button b = buildButton(section,
HibernateConsoleMessages.CodeGenerationSettingsTab_browse, createSetupAction());
- cfgFile = buildLabeledText(section,
+ Button b = addButton(section,
HibernateConsoleMessages.CodeGenerationSettingsTab_browse, createSetupAction());
+ cfgFile = addLabeledText(section,
HibernateConsoleMessages.ConsoleConfigurationPropertySource_config_file +
':', buildConfigFileHolder(),
b, null);
- buildLabeledEditableCombo(
+ addLabeledEditableCombo(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_database_dialect,
lvmDialect,
dialectHolder,
+ StringConverter.Default.<String>instance(),
null);
- buildLabeledEditableCombo(
+ addLabeledEditableCombo(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_driver_class,
lvmDriver,
- driverHolder,
+ driverHolder,
+ StringConverter.Default.<String>instance(),
null);
- buildLabeledEditableCombo(
- section,
- HibernateConsoleMessages.NewConfigurationWizardPage_connection_url,
+ addLabeledEditableCombo(
+ section,
+ HibernateConsoleMessages.NewConfigurationWizardPage_connection_url,
lvmUrl,
- urlHolder,
+ urlHolder,
+ StringConverter.Default.<String>instance(),
null);
dialectHolder.addPropertyChangeListener(new SWTPropertyChangeListenerWrapper(
@@ -142,22 +145,22 @@
}
) );
- buildLabeledText(
+ addLabeledText(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_default_schema,
buildSchemaDefaultHolder());
- buildLabeledText(
+ addLabeledText(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_default_catalog,
buildCatalogDefaultHolder());
- buildLabeledText(
+ addLabeledText(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_user_name,
buildUsernameHolder());
- buildLabeledText(
+ addLabeledText(
section,
HibernateConsoleMessages.NewConfigurationWizardPage_password,
buildPasswordHolder());
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java 2009-06-02
08:19:13 UTC (rev 15636)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUi.java 2009-06-02
08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -35,7 +35,6 @@
* @author Dmitry Geraskov
*
*/
-@SuppressWarnings("restriction")
public class HibernateJpaPlatformUi extends GenericJpaPlatformUi {
public static final String LaunchConfigurationType_ID =
"org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType";
//$NON-NLS-1$
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java 2009-06-02
08:19:13 UTC (rev 15636)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaPlatformUiFactory.java 2009-06-02
08:43:06 UTC (rev 15637)
@@ -21,7 +21,6 @@
* @author Dmitry Geraskov
*
*/
-@SuppressWarnings("restriction")
public class HibernateJpaPlatformUiFactory implements JpaPlatformUiFactory {
public HibernateJpaPlatformUiFactory() {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaUiFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaUiFactory.java 2009-06-02
08:19:13 UTC (rev 15636)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateJpaUiFactory.java 2009-06-02
08:43:06 UTC (rev 15637)
@@ -18,6 +18,7 @@
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.details.JpaPageComposite;
import org.eclipse.jpt.ui.internal.GenericJpaUiFactory;
+import
org.eclipse.jpt.ui.internal.persistence.details.GenericPersistenceUnitGeneralComposite;
import
org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitConnectionComposite;
import
org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitPropertiesComposite;
import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
@@ -26,13 +27,11 @@
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
import
org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
import
org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.HibernatePropertiesComposite;
-import org.jboss.tools.hibernate.jpt.ui.xpl.PersistenceUnitGeneralComposite;
/**
* @author Dmitry Geraskov
*
*/
-@SuppressWarnings("restriction")
public class HibernateJpaUiFactory extends GenericJpaUiFactory {
@SuppressWarnings("unchecked")
@@ -41,9 +40,8 @@
List<JpaPageComposite> pages = new ArrayList<JpaPageComposite>(1);
- //replaced from Dali 2.0
- pages.add(new PersistenceUnitGeneralComposite(subjectHolder, parent, widgetFactory));
- pages.add(new PersistenceUnitConnectionComposite(subjectHolder, parent,
widgetFactory));
+ pages.add(new GenericPersistenceUnitGeneralComposite(subjectHolder, parent,
widgetFactory));
+ pages.add(new PersistenceUnitConnectionComposite(subjectHolder, parent,
widgetFactory));
pages.add(new PersistenceUnitPropertiesComposite(subjectHolder, parent,
widgetFactory));
// ************Hibernate pages***************
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2009-06-02
08:19:13 UTC (rev 15636)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2009-06-02
08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.ui.wizard;
-import org.eclipse.core.internal.resources.LocationValidator;
-import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
@@ -40,8 +38,6 @@
private StringDialogField filename;
- private LocationValidator validator = new LocationValidator((Workspace)
ResourcesPlugin.getWorkspace());
-
protected GenerateDdlWizardPage(JpaProject jpaProject) {
super(jpaProject);
}
@@ -103,7 +99,7 @@
}
IStatus status = ResourcesPlugin.getWorkspace().validateName(getFilename(),
IResource.FILE);
- if (status.getSeverity() != status.OK){
+ if (status.getSeverity() != IStatus.OK){
setErrorMessage( status.getMessage() );
return;
}
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 2009-06-02
08:19:13 UTC (rev 15636)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizard.java 2009-06-02
08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -30,8 +30,6 @@
private JpaProject jpaProject;
-
- private IStructuredSelection selection;
private GenerateEntitiesWizardPage initPage;
@@ -39,7 +37,6 @@
public GenerateEntitiesWizard( JpaProject jpaProject, IStructuredSelection selection) {
super();
this.jpaProject = jpaProject;
- this.selection = selection;
this.setWindowTitle( JptUiMessages.GenerateEntitiesWizard_generateEntities);
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java 2009-06-02
08:19:13 UTC (rev 15636)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java 2009-06-02
08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -12,11 +12,8 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.PackageFragmentRoot;
import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil;
import org.eclipse.jdt.internal.corext.util.Messages;
import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
@@ -32,8 +29,6 @@
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.launch.PathHelper;
-import org.hibernate.util.StringHelper;
-import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
/**
* @author Dmitry Geraskov
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 2009-06-02
08:19:13 UTC (rev 15636)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2009-06-02
08:43:06 UTC (rev 15637)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2007-2009 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,
@@ -54,7 +54,6 @@
* @author Dmitry Geraskov
*
*/
-@SuppressWarnings("restriction")
public abstract class GenerateInitWizardPage extends WizardPage {
private static final String AUTODETECT = Messages.GenerateInitWizardPage_autodetect;