01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.controls.api.bean;
20:
21: import java.beans.beancontext.BeanContext;
22: import java.beans.beancontext.BeanContextProxy;
23:
24: import org.apache.beehive.controls.api.context.ControlBeanContext;
25:
26: /**
27: * The ControlBean interface defines a base set of methods that are implemented by all
28: * <code>JavaBeans</code> that host Java Controls.
29: * <p>
30: * A ControlBean will implement the <code>java.beans.beancontext.BeanContextProxy</code>
31: * interface to provide a way to get the <code>BeanContext</code> directly associated
32: * with the Java Control. The <code>getBeanContext()</code> API on the interface will
33: * return the parent (containing) context.
34: *
35: * @see java.beans.beancontext.BeanContextProxy
36: */
37: public interface ControlBean extends BeanContextProxy,
38: java.io.Serializable {
39: /**
40: * The IDSeparator character is used to separated individual control IDs in nesting
41: * scenarios whether the identifier is actually a composite path that represents
42: * a nesting relationship.
43: */
44: public static final char IDSeparator = '/';
45:
46: /**
47: * Returns the <code>java.beans.beancontext.BeanContext</code> that provides the parent
48: * context for the Java Control.
49: * @return the containing <code>BeanContext</code> for the Java ControlBean.
50: *
51: * @see java.beans.beancontext.BeanContext
52: */
53: BeanContext getBeanContext();
54:
55: /**
56: * Returns the <code>org.apache.beehive.controls.api.context.ControlBeanContext</code> instance
57: * that provides the local context for this control bean. <b>This is not the parent
58: * context for the control.</b> It is the context that would be the parent context for
59: * any nested controls hosted by this control.
60: */
61: ControlBeanContext getControlBeanContext();
62:
63: /**
64: * Returns the unique control ID associated with the Java ControlBean. This control ID
65: * is guaranteed to be unique within the containing <code>BeanContext</code>
66: * @return the control ID
67: */
68: String getControlID();
69:
70: /**
71: * Returns the Java Control public interface for the ControlBean. This interface defines
72: * the operations and events exposed by the Java Control to its clients.
73: * @return the control public interface
74: */
75: Class getControlInterface();
76: }
|