KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > methodhead > transfer > MockExtension2


1 /*
2  * Copyright (C) 2006 Methodhead Software LLC. All rights reserved.
3  *
4  * This file is part of TransferCM.
5  *
6  * TransferCM is free software; you can redistribute it and/or modify it under the
7  * terms of the GNU General Public License as published by the Free Software
8  * Foundation; either version 2 of the License, or (at your option) any later
9  * version.
10  *
11  * TransferCM is distributed in the hope that it will be useful, but WITHOUT ANY
12  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * TransferCM; if not, write to the Free Software Foundation, Inc., 51 Franklin St,
18  * Fifth Floor, Boston, MA 02110-1301 USA
19  */

20
21 package com.methodhead.transfer;
22
23 import com.methodhead.shim.Module;
24 import com.methodhead.util.OperationContext;
25 import com.methodhead.sitecontext.SiteContext;
26 import com.methodhead.tree.FoldingTreeNode;
27 import org.apache.struts.util.*;
28
29 public class MockExtension2
30 implements
31   Extension {
32
33   // constructors /////////////////////////////////////////////////////////////
34

35   // constants ////////////////////////////////////////////////////////////////
36

37   // classes //////////////////////////////////////////////////////////////////
38

39   // methods //////////////////////////////////////////////////////////////////
40

41   public String JavaDoc getName() {
42     return "MockExtension2";
43   }
44
45   public void init(
46     SiteContext siteContext ) {
47
48     init_ = true;
49   }
50
51   public void destroy(
52     SiteContext siteContext ) {
53
54     destroy_ = siteContext.getInt( "id" );
55   }
56
57   public Module[] getModules() {
58     return null;
59   }
60
61   public void setUpMenu(
62     OperationContext op,
63     FoldingTreeNode menu,
64     MessageResources messages ) {
65   }
66
67   public void setUpEditorMenu(
68     OperationContext op,
69     FoldingTreeNode menu,
70     MessageResources messages ) {
71   }
72
73   // properties ///////////////////////////////////////////////////////////////
74

75   public static boolean getInit() {
76     return init_;
77   }
78
79   public static void setInit(
80     boolean init ) {
81     init_ = init;
82   }
83
84   public static int getDestroy() {
85     return destroy_;
86   }
87
88   public static void setDestroy(
89     int destroy ) {
90     destroy_ = destroy;
91   }
92
93   // attributes ///////////////////////////////////////////////////////////////
94

95   private static boolean init_ = false;
96   private static int destroy_ = 0;
97 }
98
Popular Tags