*/
package org.mxchange.addressbook.menu.item.console;
+import java.text.MessageFormat;
import org.mxchange.addressbook.client.Client;
import org.mxchange.addressbook.menu.item.BaseMenuItem;
import org.mxchange.addressbook.menu.item.SelectableMenuItem;
* @param text Text to show to user
*/
public ConsoleMenuItem (final char accessKey, final String text) {
- this.accessKey = accessKey;
- this.text = text;
+ this.setAccessKey(accessKey);
+ this.setText(text);
}
/**
@Override
public void show (final Client client) {
+ // Trace message
+ this.getLogger().trace(MessageFormat.format("client={0} - CALLED!", client)); //NOI18N
+
+ // Client must not be null
+ if (client == null) {
+ // Abort here
+ throw new NullPointerException("client is null");
+ }
+
// Call-back client over menu
client.showEntry(this);
+
+ // Trace message
+ this.getLogger().trace("EXIT!"); //NOI18N
}
/**