001: //** Copyright Statement ***************************************************
002: //The Salmon Open Framework for Internet Applications (SOFIA)
003: // Copyright (C) 1999 - 2002, Salmon LLC
004: //
005: // This program is free software; you can redistribute it and/or
006: // modify it under the terms of the GNU General Public License version 2
007: // as published by the Free Software Foundation;
008: //
009: // This program is distributed in the hope that it will be useful,
010: // but WITHOUT ANY WARRANTY; without even the implied warranty of
011: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: // GNU General Public License for more details.
013: //
014: // You should have received a copy of the GNU General Public License
015: // along with this program; if not, write to the Free Software
016: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: //
018: // For more information please visit http://www.salmonllc.com
019: //** End Copyright Statement ***************************************************
020: package com.salmonllc.html.events;
021:
022: /////////////////////////
023: //$Archive: /JADE/SourceCode/com/salmonllc/html/events/PageEvent.java $
024: //$Author: Dan $
025: //$Revision: 8 $
026: //$Modtime: 10/30/02 2:58p $
027: /////////////////////////
028:
029: import javax.servlet.http.*;
030: import com.salmonllc.html.*;
031:
032: /**
033: * This object will be created and passed to every page event method.
034: * @see PageListener
035: */
036:
037: public class PageEvent extends java.awt.AWTEvent {
038: HtmlPageBase _page;
039: HtmlComponent _subPage;
040: boolean _continue = true;
041: String _subPageName;
042:
043: /**
044: * Constructs a new PageEvent object.
045: */
046: public PageEvent(HtmlPageBase p) {
047: super (p, 0);
048: _page = p;
049: }
050:
051: /**
052: * Constructs a new PageEvent object.
053: */
054: public PageEvent(HtmlPageBase p, HtmlComponent subPage,
055: String subPageName) {
056: super (p, 0);
057: _page = p;
058: _subPage = subPage;
059: _subPageName = subPageName;
060: }
061:
062: /**
063: * Use this method check whether processing should continue after this event;
064: */
065: public boolean getContinueProcessing() {
066: return _continue;
067: }
068:
069: /**
070: * This method will return the page that the event was fired from.
071: */
072: public HtmlPageBase getPage() {
073: return _page;
074: }
075:
076: /**
077: * This method will return the current HttpServletRequest for the page firing the event.
078: */
079: public HttpServletRequest getRequest() {
080: return _page.getCurrentRequest();
081: }
082:
083: /**
084: * This method will return the current HttpServletResponse for the page firing the event.
085: */
086:
087: public HttpServletResponse getResponse() {
088: return _page.getCurrentResponse();
089: }
090:
091: /**
092: * This method will return the session object for the current user session.
093: */
094: public HttpSession getSession() {
095: return _page.getSession();
096: }
097:
098: /**
099: * This method will return the sub page that the event was fired from.
100: */
101: public HtmlComponent getSubPage() {
102: return _subPage;
103: }
104:
105: /**
106: * This method will return the name the sub page is registered under.
107: */
108: public String getSubPageName() {
109: return _subPageName;
110: }
111:
112: /**
113: * Use this method to stop the processing on a page.
114: */
115: public void setContinueProcessing(boolean continueProcessing) {
116: _continue = continueProcessing;
117: }
118: }
|