2 * Copyright (C) 2015 Roland Haeder
\r
4 * This program is free software: you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation, either version 3 of the License, or
\r
7 * (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License
\r
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
17 package org.mxchange.addressbook.menu.item.console;
\r
19 import org.mxchange.addressbook.client.Client;
\r
20 import org.mxchange.addressbook.menu.item.BaseMenuItem;
\r
21 import org.mxchange.addressbook.menu.item.SelectableMenuItem;
\r
25 * @author Roland Haeder
\r
27 public class ConsoleMenuItem extends BaseMenuItem implements SelectableMenuItem {
\r
31 private char accessKey;
\r
36 private String text;
\r
39 * Constructor for building a console menu with access key and text
\r
41 * @param accessKey Access key for this menu entry
\r
42 * @param text Text to show to user
\r
44 public ConsoleMenuItem (final char accessKey, final String text) {
\r
45 this.accessKey = accessKey;
\r
51 * @return the accessKey
\r
54 public char getAccessKey () {
\r
55 return this.accessKey;
\r
60 * @param accessKey the accessKey to set
\r
62 private void setAccessKey (char accessKey) {
\r
63 this.accessKey = accessKey;
\r
71 public String getText () {
\r
77 * @param text the text to set
\r
79 private void setText (String text) {
\r
84 public void show (final Client client) {
\r
85 // Call-back client over menu
\r
86 client.showEntry(this);
\r