📄 confirmform.java
字号:
package com.jmobilecore.ui;
import com.jmobilecore.ui.core.*;
/**
* A <code>ConfirmForm</code> is object inherited from <code>ScreenCanvas</code>.
* This form displays messages which require user confirmation.
*
* @author Greg Gridin
*/
public class ConfirmForm extends ScreenCanvas {
/**
* Message for the <code>ConfirmForm</code>.
*/
protected TextPane textLabel;
/**
* Creates a new <code>ConfirmForm</code> instance.
*
* @param title the title for current screen
* @param text the confirmation text to display
* @param leftKey the left soft button for current screen
* @param rightKey the right soft button for current screen
* @see Label
* @see SoftKey
*/
public ConfirmForm(Label title, String text, SoftKey leftKey, SoftKey rightKey) {
super(title);
softKeyBar.setSoftKey(leftKey, SoftKey.LEFT);
softKeyBar.setSoftKey(rightKey, SoftKey.RIGHT);
textLabel = new TextPane(text);
add(textLabel);
}
/**
* Creates a new <code>ConfirmForm</code> instance.
*
* @param parent the parent <code>EventListener</code> for the confirmation screen
* @param titleText the title for current screen
* @param text the confirmation text to display
* @param leftKeyText the left soft button for current screen
* @param rightKeyText the right soft button for current screen
* @see EventListener
* @see SoftKeyImpl
*/
public ConfirmForm
(EventListener parent, String titleText, String text,
String leftKeyText, String rightKeyText) {
this(Label.createTitleLabel(titleText),
text,
new SoftKeyImpl(leftKeyText, parent, EventListener.EVENT_ESCAPE),
new SoftKeyImpl(rightKeyText, parent, EventListener.EVENT_OK));
}
/**
* Default destructor. Helps VM to perform garbage collection
*/
public void destructor() {
textLabel.destructor();
textLabel = null;
super.destructor();
}
/**
* Shows the confirmation form on the screen
*
* @param parent the parent <code>EventListener</code> for the confirmation screen
* @param titleText the title for current screen
* @param text the confirmation text to display
* @param leftKeyText the left soft button for current screen
* @param rightKeyText the right soft button for current screen
* @see EventListener
* @see SoftKeyImpl
*/
static public void showMessage(EventListener parent, String titleText, String text, String leftKeyText, String rightKeyText) {
ScreenManager.goForward(new ConfirmForm(parent, titleText, text, leftKeyText, rightKeyText));
}
/**
* Shows the confirmation form on the screen
*
* @param title the title for current screen
* @param text the confirmation text to display
* @param leftButton the left soft button for current screen
* @param rightButton the right soft button for current screen
* @see Label
* @see SoftKey
*/
static public void showMessage(Label title, String text, SoftKey leftButton, SoftKey rightButton) {
ScreenManager.goForward(new ConfirmForm(title, text, leftButton, rightButton));
}
} // class ConfirmForm
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -