KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > table > navi > DrillExpandMemberUI


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.table.navi;
14
15 import com.tonbeller.jpivot.olap.model.Member;
16 import com.tonbeller.jpivot.olap.navi.DrillExpandMember;
17 import com.tonbeller.jpivot.table.span.Span;
18
19 /**
20  * Created on 29.11.2002
21  *
22  * @author av
23  */

24 public class DrillExpandMemberUI extends DrillExpandUI {
25
26   public static final String JavaDoc ID = "drillMember";
27   public String JavaDoc getId() {
28     return ID;
29   }
30
31   DrillExpandMember extension;
32
33   protected boolean initializeExtension() {
34     extension = (DrillExpandMember) table.getOlapModel().getExtension(DrillExpandMember.ID);
35     return extension != null;
36   }
37
38   /**
39    * @see com.tonbeller.jpivot.ui.table.navi.DrillExpandUI#canExpand(Span)
40    */

41   protected boolean canExpand(Span span) {
42     if (positionContainsMember(span))
43       return extension.canExpand((Member) span.getMember().getRootDecoree());
44     return false;
45   }
46
47   /**
48    * @see com.tonbeller.jpivot.ui.table.navi.DrillExpandUI#expand(Span)
49    */

50   protected void expand(Span span) {
51     extension.expand((Member) span.getMember().getRootDecoree());
52   }
53
54   /**
55    * @see com.tonbeller.jpivot.ui.table.navi.DrillExpandUI#canCollapse(Span)
56    */

57   protected boolean canCollapse(Span span) {
58     if (positionContainsMember(span))
59       return extension.canCollapse((Member) span.getMember().getRootDecoree());
60     return false;
61   }
62
63   /**
64    * @see com.tonbeller.jpivot.ui.table.navi.DrillExpandUI#collapse(Span)
65    */

66   protected void collapse(Span span) {
67     extension.collapse((Member) span.getMember().getRootDecoree());
68   }
69
70   protected String JavaDoc getCollapseImage() {
71     return "drill-member-collapse";
72   }
73
74   protected String JavaDoc getExpandImage() {
75     return "drill-member-expand";
76   }
77
78   protected String JavaDoc getOtherImage() {
79     return "drill-member-other";
80   }
81
82 }
83
Popular Tags