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: /SOFIA/SourceCode/com/salmonllc/html/events/SubmitEvent.java $
024: //$Author: Dan $
025: //$Revision: 9 $
026: //$Modtime: 6/12/03 1:06p $
027: /////////////////////////
028:
029: import com.salmonllc.html.HtmlComponent;
030: import com.salmonllc.html.HtmlPage;
031:
032: /**
033: * This object will be created and passed to every submit event method.
034: * @see SubmitListener
035: */
036:
037: public class SubmitEvent extends java.awt.AWTEvent {
038: HtmlPage _page;
039: HtmlComponent _comp;
040: String _name;
041: String _fullName;
042: int _rowNo = -1;
043: Object _nextListener;
044: boolean _validationFailed;
045:
046: public SubmitEvent(HtmlPage page, HtmlComponent comp, String name,
047: String fullName) {
048: super (comp, 0);
049: _page = page;
050: _comp = comp;
051: _name = name;
052: _fullName = fullName;
053: }
054:
055: public SubmitEvent(HtmlPage page, HtmlComponent comp, String name,
056: String fullName, int rowNo) {
057: this (page, comp, name, fullName);
058: _rowNo = rowNo;
059: }
060:
061: /**
062: * This method returns the component that sumbitted the page.
063: */
064: public HtmlComponent getComponent() {
065: return _comp;
066: }
067:
068: /**
069: * This method returns the full name (name of component appended to the name of its containers) of the component that submitted the page.
070: */
071: public String getFullName() {
072: return _fullName;
073: }
074:
075: /**
076: * This method returns the name of the component that submitted the page.
077: */
078: public String getName() {
079: return _name;
080: }
081:
082: /**
083: * This method returns the page for which the submit was performed.
084: */
085: public HtmlPage getPage() {
086: return _page;
087: }
088:
089: /**
090: * This method returns the row in the datastore for which the button was clicked.
091: */
092: public int getRow() {
093: return _rowNo;
094: }
095:
096: /**
097: * Returns the next listener that will be notified with this submit event
098: */
099: public Object getNextListener() {
100: return _nextListener;
101: }
102:
103: /**
104: * Sets the next listener that will be notified with this submit event
105: */
106: public void setNextListener(Object nextListener) {
107: _nextListener = nextListener;
108: }
109:
110: /**
111: * This method is used by the framework and should not be called directly
112: */
113: public boolean isValidationFailed() {
114: return _validationFailed;
115: }
116:
117: /**
118: * This method is used by the framework and should not be called directly
119: */
120: public void setValidationFailed(boolean validationFailed) {
121: _validationFailed = validationFailed;
122: }
123: }
|