KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > toolbar > ToolBarTag


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.wcf.toolbar;
14
15 import javax.servlet.jsp.JspException JavaDoc;
16
17 import com.tonbeller.tbutils.res.Resources;
18 import com.tonbeller.wcf.component.Component;
19 import com.tonbeller.wcf.component.ComponentTag;
20 import com.tonbeller.wcf.controller.RequestContext;
21
22 /**
23  * @author av
24  */

25 public class ToolBarTag extends ComponentTag {
26   String JavaDoc bundle;
27   boolean globalButtonIds = false;
28
29   public void release() {
30     globalButtonIds = false;
31     bundle = null;
32     super.release();
33   }
34   
35   public ToolBar getToolBar() {
36     return (ToolBar) super.getComponent();
37   }
38
39   public Component createComponent(RequestContext context) throws JspException JavaDoc {
40     ToolBar tb = new ToolBar(getId(), null);
41     tb.setGlobalButtonIds(globalButtonIds);
42     if (bundle != null) {
43       Resources resb = context.getResources(bundle);
44       tb.setBundle(resb);
45     }
46     return tb;
47   }
48   
49
50   /**
51    * @return
52    */

53   public String JavaDoc getBundle() {
54     return bundle;
55   }
56
57   /**
58    * @param string
59    */

60   public void setBundle(String JavaDoc string) {
61     bundle = string;
62   }
63
64   public void setGlobalButtonIds(boolean globalButtonIds) {
65     this.globalButtonIds = globalButtonIds;
66   }
67 }
68
Popular Tags