[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/preferences ...

Christian Bauer christian at hibernate.org
Sat Sep 15 13:06:17 EDT 2007


  User: cbauer  
  Date: 07/09/15 13:06:17

  Modified:    examples/wiki/src/main/org/jboss/seam/wiki/preferences 
                        PreferenceSupport.java
  Log:
  Various updates (tests still broken)
  
  Revision  Changes    Path
  1.7       +8 -4      jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/preferences/PreferenceSupport.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PreferenceSupport.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/preferences/PreferenceSupport.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- PreferenceSupport.java	17 Aug 2007 13:00:29 -0000	1.6
  +++ PreferenceSupport.java	15 Sep 2007 17:06:17 -0000	1.7
  @@ -7,11 +7,15 @@
   package org.jboss.seam.wiki.preferences;
   
   import org.jboss.seam.Component;
  +import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.annotations.Create;
   import org.jboss.seam.annotations.Logger;
  +import org.jboss.seam.annotations.AutoCreate;
   import org.jboss.seam.core.Events;
  +import org.jboss.seam.core.Conversation;
   import org.jboss.seam.log.Log;
   import org.jboss.seam.wiki.plugin.lastmodified.LastModifiedDocumentsPreferences;
  +import org.jboss.seam.wiki.core.action.prefs.DocumentEditorPreferences;
   
   import java.util.HashMap;
   import java.util.Map;
  @@ -73,14 +77,14 @@
   
       @Create
       public void materialize() {
  -        this.properties = loadPropertyValues();
  +        this.properties = loadPropertyValues(this);
       }
   
       public Map<String, Object> getProperties() {
           return properties;
       }
   
  -    private Map<String, Object> loadPropertyValues() {
  +    private Map<String, Object> loadPropertyValues(Object componentInstance) {
           PreferenceRegistry registry = (PreferenceRegistry) Component.getInstance("preferenceRegistry");
           PreferenceProvider provider = (PreferenceProvider) Component.getInstance("preferenceProvider");
           Object user = getCurrentUserVariable() != null ? Component.getInstance(getCurrentUserVariable()) : null;
  @@ -98,7 +102,7 @@
                             + "' value is: '" + valueHolder.getValue() + "'");
   
                   // Write onto instance so users can call #{myPrefs.thisPreferenceSetting}
  -                valueHolder.getPreferenceProperty().write(this, valueHolder.getValue());
  +                valueHolder.getPreferenceProperty().write(componentInstance, valueHolder.getValue());
   
                   // Keep a duplicate in this map so users can call #{myPrefs.properties['thisPreferenceSetting']}
                   loadedProperties.put(valueHolder.getPreferenceProperty().getName(), valueHolder.getValue());
  @@ -114,7 +118,7 @@
   
       public void refreshProperties() {
           log.debug("refreshing preference component property values");
  -        this.properties = loadPropertyValues();
  +        this.properties = loadPropertyValues(this);
       }
   
       public String getCurrentUserVariable() { return null; }
  
  
  



More information about the jboss-cvs-commits mailing list