Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/webobjects/woextensions/WOAggregateEventRow.java


1   /*
2    * WOAggregateEventRow.java
3    * © Copyright 2001 Apple Computer, Inc. All rights reserved.
4    * This a modified version.
5    * Original license: http://www.opensource.apple.com/apsl/
6    */
7   
8   package com.webobjects.woextensions;
9   
10  import com.webobjects.appserver.*;
11  import com.webobjects.foundation.*;
12  import com.webobjects.eocontrol.*;
13  
14  public class WOAggregateEventRow extends WOEventRow {
15      public WOAggregateEventRow(WOContext aContext)  {
16          super(aContext);
17      }
18  
19      public boolean synchronizesVariablesWithBindings() {
20          // Do not sync with the bindings
21          return false;
22      }
23  
24      public EOAggregateEvent object()
25      {
26          return (EOAggregateEvent)_WOJExtensionsUtil.valueForBindingOrNull("object",this);
27      }
28  
29      public WOEventDisplayPage controller()    {
30          return (WOEventDisplayPage)_WOJExtensionsUtil.valueForBindingOrNull("controller",this);
31      }
32  
33      public int displayMode()
34      {
35          int result = 1;
36          Object resultStr = valueForBinding("displayMode");
37          if (resultStr != null) {
38              try {
39                  result = Integer.parseInt(resultStr.toString());
40              } catch (NumberFormatException e) {
41                  throw new IllegalStateException("WOAggregateEventRow - problem parsing int from displayMode binding "+e);
42              }
43          }
44          return result;
45      }
46      
47      public EOEvent event()
48      {
49          return (EOEvent)object().events().objectAtIndex(0);
50      }
51  
52      public String displayComponentName()
53      {
54          WOEventDisplayPage ctr;
55          int level, group;
56          EOEvent obj;
57  
58          obj = object();
59          ctr = controller();
60          level = ctr.displayLevelForEvent(obj);
61          group = ctr.groupTagForDisplayLevel(level);
62  
63          if (group != -1)
64              return "WOEventRow";
65          else
66              return event().displayComponentName();
67      }
68  }