本文整理汇总了Java中com.codename1.ui.plaf.UIManager.localize方法的典型用法代码示例。如果您正苦于以下问题:Java UIManager.localize方法的具体用法?Java UIManager.localize怎么用?Java UIManager.localize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.codename1.ui.plaf.UIManager
的用法示例。
在下文中一共展示了UIManager.localize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: editString
import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
* @inheritDoc
*/
public void editString(Component cmp, int maxSize, int constraint, String text, int keyCode) {
UIManager m = UIManager.getInstance();
CONFIRM_COMMAND = new Command(m.localize("ok", "OK"), Command.OK, 1);
CANCEL_COMMAND = new Command(m.localize("cancel", "Cancel"), Command.CANCEL, 2);
if(mid.getAppProperty("forceBackCommand") != null) {
canvas.addCommand(MIDP_BACK_COMMAND);
}
currentTextBox = new TextBox("", "", maxSize, TextArea.ANY);
currentTextBox.setCommandListener((CommandListener)canvas);
currentTextBox.addCommand(CONFIRM_COMMAND);
currentTextBox.addCommand(CANCEL_COMMAND);
currentTextComponent = cmp;
currentTextBox.setMaxSize(maxSize);
currentTextBox.setString(text);
currentTextBox.setConstraints(constraint);
display.setCurrent(currentTextBox);
((C)canvas).setDone(false);
Display.getInstance().invokeAndBlock(((C)canvas));
}
示例2: initLaf
import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
* This method initializes the Component defaults constants
*/
protected void initLaf(UIManager uim){
if(uim == getUIManager() && isInitialized()){
return;
}
selectText = uim.localize("select", "Select");
LookAndFeel laf = uim.getLookAndFeel();
animationSpeed = laf.getDefaultSmoothScrollingSpeed();
rtl = laf.isRTL();
tactileTouch = isFocusable();
tensileDragEnabled = laf.isDefaultTensileDrag();
snapToGrid = laf.isDefaultSnapToGrid();
alwaysTensile = laf.isDefaultAlwaysTensile();
tensileHighlightEnabled = laf.isDefaultTensileHighlight();
scrollOpacityChangeSpeed = laf.getFadeScrollBarSpeed();
isScrollVisible = laf.isScrollVisible();
if(tensileHighlightEnabled) {
tensileLength = 3;
} else {
tensileLength = -1;
}
}
示例3: EditPopup
import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
protected EditPopup(TextArea lightweightEdit, int maxSize) {
super(new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL), Field.FOCUSABLE | Field.EDITABLE | Screen.DEFAULT_MENU);
UIManager m = UIManager.getInstance();
okString = m.localize("ok", "OK");
cancelString = m.localize("cancel", "Cancel");
this.lightweightEdit = lightweightEdit;
long type = 0;
int constraint = lightweightEdit.getConstraint();
if ((constraint & TextArea.DECIMAL) == TextArea.DECIMAL) {
type = BasicEditField.FILTER_REAL_NUMERIC;
} else if ((constraint & TextArea.EMAILADDR) == TextArea.EMAILADDR) {
type = BasicEditField.FILTER_EMAIL;
} else if ((constraint & TextArea.NUMERIC) == TextArea.NUMERIC) {
type = BasicEditField.FILTER_NUMERIC;
} else if ((constraint & TextArea.PHONENUMBER) == TextArea.PHONENUMBER) {
type = BasicEditField.FILTER_PHONE;
} else if ((constraint & TextArea.NON_PREDICTIVE) == TextArea.NON_PREDICTIVE) {
type = BasicEditField.NO_COMPLEX_INPUT;
}
if (lightweightEdit.isSingleLineTextArea()) {
type |= BasicEditField.NO_NEWLINE;
}
if ((constraint & TextArea.PASSWORD) == TextArea.PASSWORD) {
nativeEdit = new BBPasswordEditField(lightweightEdit, type, maxSize, 0, 0xffffff);
} else {
nativeEdit = new BBEditField(lightweightEdit, type, maxSize, 0, 0xffffff);
}
// using Field.EDITABLE flag now because of bug with DevTrack ID 354265 at
// https://www.blackberry.com/jira/browse/JAVAAPI-101
//nativeEdit.setEditable(true);
net.rim.device.api.ui.Font f = nativeEdit.getFont();
if (f.getHeight() > lightweightEdit.getStyle().getFont().getHeight()) {
nativeEdit.setFont(f.derive(f.getStyle(),
lightweightEdit.getStyle().getFont().getHeight()));
}
add(nativeEdit);
nativeEdit.setFocus();
nativeEdit.setFocusListener(this);
}
示例4: createMenuSelectCommand
import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
* Factory method that returns the Form Menu select Command.
* This method can be overridden to customize the Command on the Form.
*
* @return Command
*/
protected Command createMenuSelectCommand() {
UIManager manager = parent.getUIManager();
LookAndFeel lf = manager.getLookAndFeel();
return new Command(manager.localize("select", "Select"), lf.getMenuIcons()[0]);
}
示例5: createMenuCancelCommand
import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
* Factory method that returns the Form Menu cancel Command.
* This method can be overridden to customize the Command on the Form.
*
* @return Command
*/
protected Command createMenuCancelCommand() {
UIManager manager = parent.getUIManager();
LookAndFeel lf = manager.getLookAndFeel();
return new Command(manager.localize("cancel", "Cancel"), lf.getMenuIcons()[1]);
}