001 package org.apache.myfaces.tobago.event;
002
003 /*
004 * Licensed to the Apache Software Foundation (ASF) under one or more
005 * contributor license agreements. See the NOTICE file distributed with
006 * this work for additional information regarding copyright ownership.
007 * The ASF licenses this file to You under the Apache License, Version 2.0
008 * (the "License"); you may not use this file except in compliance with
009 * the License. You may obtain a copy of the License at
010 *
011 * http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 */
019
020 import org.apache.myfaces.tobago.component.UIData;
021
022 import javax.faces.event.ActionEvent;
023
024
025 public class PageActionEvent extends ActionEvent {
026
027 private static final long serialVersionUID = 3364193750247386220L;
028
029 private PageAction action;
030 private int value;
031
032 public PageActionEvent(UIData component, PageAction action) {
033 super(component);
034 this.action = action;
035 }
036
037 /**
038 * Returns the action type ({@link PageAction}).
039 */
040 public PageAction getAction() {
041 return action;
042 }
043
044 public void setValue(int value) {
045 this.value = value;
046 }
047
048 /**
049 * Returns the value for action types {@link PageAction#TO_ROW}
050 * and {@link PageAction#TO_PAGE}.
051 */
052 public int getValue() {
053 return value;
054 }
055
056 /**
057 * Convenience method to get the UIData Component.
058 */
059 public UIData getSheet() {
060 return (UIData) getComponent();
061 }
062 }