01: /*
02: * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>
03: * @version $Id: PortletTabEventImpl.java 6385 2007-10-25 14:02:26Z wehrens $
04: */
05: package org.gridsphere.layout.event.impl;
06:
07: import org.gridsphere.layout.PortletComponent;
08: import org.gridsphere.layout.PortletTab;
09: import org.gridsphere.layout.event.ComponentAction;
10: import org.gridsphere.layout.event.PortletTabEvent;
11:
12: /**
13: * A <code>PortletTabEventImpl</code> is the concrete implementation of
14: * <code>PortletTabEvent</code>
15: */
16: public class PortletTabEventImpl implements PortletTabEvent {
17:
18: private ComponentAction action;
19: private PortletTab portletTab;
20: private int id;
21:
22: /**
23: * Constructs an instance of PortletTabEventImpl from a portlet tab, a
24: * tab event action and the portlet tab component id
25: *
26: * @param portletTab the portlet tab
27: * @param action the portlet tab event action
28: * @param id the portlet component id
29: * @see PortletTab
30: */
31: public PortletTabEventImpl(PortletTab portletTab,
32: ComponentAction action, int id) {
33: this .action = action;
34: this .portletTab = portletTab;
35: this .id = id;
36: }
37:
38: /**
39: * Returns true if this event actually triggered an action
40: *
41: * @return true if this event actually triggered an action
42: */
43: public boolean hasAction() {
44: return (action != null);
45: }
46:
47: /**
48: * Returns the portlet tab event action
49: *
50: * @return the portlet tab event action
51: */
52: public ComponentAction getAction() {
53: return action;
54: }
55:
56: /**
57: * Returns the PortletTab that was selected
58: *
59: * @return the PortletTab that was selcted
60: */
61: public PortletComponent getPortletComponent() {
62: return portletTab;
63: }
64:
65: /**
66: * Returns the component id of the portlet tab
67: *
68: * @return the component id of the portlet tab
69: */
70: public int getID() {
71: return id;
72: }
73:
74: }
|