001// Copyright 2007 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007//     http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014
015package org.apache.tapestry5.corelib.data;
016
017import org.apache.tapestry5.corelib.components.Grid;
018
019/**
020 * Used by the {@link Grid} component to control where the pager portion of the Grid should be displayed.
021 */
022public enum GridPagerPosition
023{
024    /**
025     * Position the pager above the Grid's table.
026     */
027    TOP(true, false),
028
029    /**
030     * Position the pager below the Grid's table (this is the default).
031     */
032    BOTTOM(false, true),
033
034    /**
035     * Show the pager above and below the Grid's table.
036     */
037    BOTH(true, true),
038
039    /**
040     * Don't show a pager (the application will need to supply its own navigation mechanism).
041     */
042    NONE(false, false);
043
044    private final boolean matchTop;
045
046    private final boolean matchBottom;
047
048    private GridPagerPosition(boolean matchTop, boolean matchBottom)
049    {
050        this.matchTop = matchTop;
051        this.matchBottom = matchBottom;
052    }
053
054    public boolean isMatchBottom()
055    {
056        return matchBottom;
057    }
058
059    public boolean isMatchTop()
060    {
061        return matchTop;
062    }
063
064}