[jboss-cvs] jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views ...

Max Rydahl Andersen mandersen at jboss.com
Tue Feb 20 08:21:49 EST 2007


  User: mandersen
  Date: 07/02/20 08:21:49

  Modified:    hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views 
                        ConsoleConfigurationPropertySource.java
  Log:
  HBX-889  sort console configuration lists in ui
  HBX-637  Provide ability to import/export console configs
  HBX-863 Hibernate Code Generation toolbar group is appearing in all Eclipse perspectives.
  
  Revision  Changes    Path
  1.4       +10 -6     jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ConsoleConfigurationPropertySource.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- ConsoleConfigurationPropertySource.java	7 Jul 2006 13:51:09 -0000	1.3
  +++ ConsoleConfigurationPropertySource.java	20 Feb 2007 13:21:49 -0000	1.4
  @@ -29,7 +29,7 @@
   import org.eclipse.ui.views.properties.PropertyDescriptor;
   import org.eclipse.ui.views.properties.TextPropertyDescriptor;
   import org.hibernate.console.ConsoleConfiguration;
  -import org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences;
  +import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
   
   public class ConsoleConfigurationPropertySource implements IPropertySource {
   
  @@ -61,23 +61,27 @@
   	}
   
   	public Object getPropertyValue(Object id) {
  +		try {
   		if("name".equals(id)) {
   			return cfg.getName();
   		}
  -		// TODO: not nice that we need to downcast to get more friendly file names
  -		EclipseConsoleConfigurationPreferences preferences = (EclipseConsoleConfigurationPreferences) cfg.getPreferences();
  +		// TODO: bring back more eclipse friendly file names
  +		ConsoleConfigurationPreferences preferences = cfg.getPreferences();
   		
   		if("hibernate.cfg.xml".equals(id)) {
  -			return preferences.getCfgFile();
  +			return preferences.getConfigXMLFile();
   		}
   		if("hibernate.properties".equals(id)) {
  -			return preferences.getPropertyFilename();
  +			return preferences.getPropertyFile();
   		}
   		if("mapping.files".equals(id)) {
  -			return new Integer(preferences.getMappings().length);
  +			return new Integer(preferences.getMappingFiles().length);
   		}
   		
   		return null;
  +		} catch(RuntimeException e) {
  +			return "Error: " + e.getMessage();
  +		}
   	}
   
   	public boolean isPropertySet(Object id) {
  
  
  



More information about the jboss-cvs-commits mailing list