[jboss-cvs] jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties ...
Max Rydahl Andersen
mandersen at jboss.com
Fri Dec 22 10:36:18 EST 2006
User: mandersen
Date: 06/12/22 10:36:18
Modified: hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties
HibernatePropertyPage.java
Log:
remove useless constant
Revision Changes Path
1.7 +2 -31 jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: HibernatePropertyPage.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- HibernatePropertyPage.java 15 Sep 2006 12:49:18 -0000 1.6
+++ HibernatePropertyPage.java 22 Dec 2006 15:36:18 -0000 1.7
@@ -61,8 +61,6 @@
public class HibernatePropertyPage extends PropertyPage {
- private static final int TEXT_FIELD_WIDTH = 50;
-
Control[] settings;
private Button enableHibernate;
@@ -180,7 +178,7 @@
selectedConfiguration = new Combo(parent, SWT.DROP_DOWN);
GridData gd = new GridData();
- gd.widthHint = convertWidthInCharsToPixels(TEXT_FIELD_WIDTH);
+ gd.widthHint = convertWidthInCharsToPixels(50);
selectedConfiguration.setLayoutData(gd);
// Populate owner text field
@@ -265,34 +263,7 @@
}
public boolean performOk() {
- IProject project = getProject();
- IScopeContext scope = new ProjectScope(project);
-
- Preferences node = scope.getNode("org.hibernate.eclipse.console");
-
- if(node!=null) {
- node.putBoolean("hibernate3.enabled", enableHibernate.getSelection() );
- node.put("default.configuration", selectedConfiguration.getText() );
- try {
- node.flush();
- } catch (BackingStoreException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Could not save changes to preferences", e);
- return false;
- }
- } else {
- return false;
- }
-
- try {
- if(enableHibernate.getSelection() ) {
- ProjectUtils.addProjectNature(project, "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
- } else {
- ProjectUtils.removeProjectNature(project, "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
- }
- } catch(CoreException ce) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Could not activate Hibernate nature on project " + project.getName(), ce);
- HibernateConsolePlugin.getDefault().log(ce.getStatus() );
- }
+ ProjectUtils.toggleHibernateOnProject( getProject(), enableHibernate.getSelection(), selectedConfiguration.getText() );
return true;
}
More information about the jboss-cvs-commits
mailing list