001 /*
002 * Copyright 2012 GWT-Bootstrap
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package com.github.gwtbootstrap.client.ui;
017
018 import com.github.gwtbootstrap.client.ui.base.UnorderedList;
019 import com.github.gwtbootstrap.client.ui.resources.Bootstrap;
020 import com.google.gwt.uibinder.client.UiConstructor;
021
022 //@formatter:off
023 /**
024 * Pager that can be aligned
025 *
026 * @since 2.0.4.0
027 * @author Dominik Mayer
028 */
029 //@formatter:on
030 public class Pager extends UnorderedList {
031
032 private NavLink leftLink = new NavLink();
033
034 private NavLink rightLink = new NavLink();
035
036 // private boolean arrows;
037
038 public @UiConstructor
039 Pager(String left, String right) {
040 setStyleName(Bootstrap.pager);
041 leftLink.setText(left);
042 rightLink.setText(right);
043 add(leftLink);
044 add(rightLink);
045 }
046
047 public void setAligned(boolean aligned) {
048 leftLink.setStyleName(Bootstrap.previous);
049 rightLink.setStyleName(Bootstrap.next);
050 }
051
052 public NavLink getLeft() {
053 return leftLink;
054 }
055
056 public NavLink getRight() {
057 return rightLink;
058 }
059
060 public void setArrows(boolean hasArrows) {
061 // TODO
062 }
063 }