本文整理汇总了Java中com.google.gwt.user.client.ui.IntegerBox类的典型用法代码示例。如果您正苦于以下问题:Java IntegerBox类的具体用法?Java IntegerBox怎么用?Java IntegerBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IntegerBox类属于com.google.gwt.user.client.ui包,在下文中一共展示了IntegerBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTrainTrackPiecesNum
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
/**
* Gets the train track pieces num.
*
* @param box
* the box
* @return the train track pieces num
*/
private Integer getTrainTrackPiecesNum(IntegerBox box)
{
Integer toSend = box.getValue();
if (toSend == null)
{
return null;
}
if (toSend < 0)
{
toSend = 0;
}
else if (toSend > PIECE_LIMIT)
{
toSend = PIECE_LIMIT;
}
return toSend;
}
示例2: getValue
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
protected int getValue(IntegerBox box) {
try {
Integer value = box.getValue();
if (value == null) {
box.setValue(0);
value = 0;
}
return value;
} catch (Exception e) {
box.setValue(0);
return 0;
}
}
示例3: makeIntegerBox
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
private IntegerBox makeIntegerBox(Panel parent,String name,int value){
HorizontalPanel h1=new HorizontalPanel();
//h.setWidth("100%");
parent.add(h1);
Label label=new Label(name);
label.setWidth("100px");
h1.add(label);
IntegerBox box=new IntegerBox();
box.setWidth("40px");
box.setValue(value);
h1.add(box);
return box;
}
示例4: createMinLengthField
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
private Widget createMinLengthField()
{
final IntegerBox box = new IntegerBox();
box.setValue(setting.getMinWordLength());
box.setMaxLength(2);
box.setWidth("15px");
box.addChangeHandler(new ChangeHandler()
{
@Override
public void onChange(ChangeEvent event)
{
setting.setMinWordLength(box.getValue());
}
});
box.setTitle("Specify the minimum number of characters in a word");
return box;
}
示例5: getFieldValue
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
protected String getFieldValue(IntegerBox field, String defaultValue) {
try {
return String.valueOf(field.getValue());
} catch (Exception e) {
field.setText(defaultValue);
return defaultValue;
}
}
示例6: setFieldValue
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
protected void setFieldValue(Field f, String value) {
Object field = f.field;
if (value == null)
value = f.defaultValue;
if (field instanceof TextBox)
setFieldValue((TextBox) field, value);
else if (field instanceof IntegerBox)
setFieldValue((IntegerBox) field, value);
else if (field instanceof NumberSpinner)
setFieldValue((NumberSpinner) field, value);
else if (field instanceof LongSpinner)
setFieldValue((LongSpinner) field, value);
else if (field instanceof DoubleSpinner)
setFieldValue((DoubleSpinner) field, value);
else if (field instanceof DoubleBox)
setFieldValue((DoubleBox) field, value);
else if (field instanceof SimpleCheckBox)
setFieldValue((SimpleCheckBox) field, value);
else if (field instanceof ListBox)
setFieldValue((ListBox) field, value);
else if (field instanceof PassivesPanel)
setFieldValue((PassivesPanel) field, value);
else if (field instanceof GemsPanel)
setFieldValue((GemsPanel) field, value);
else if (field instanceof ItemPanel)
setFieldValue((ItemPanel) field, value);
else if (field instanceof SkillsPanel)
setFieldValue((SkillsPanel) field, value);
else if (field instanceof DamageTypePanel)
setFieldValue((DamageTypePanel) field, value);
else if (field instanceof SkillDamagePanel)
setFieldValue((SkillDamagePanel) field, value);
}
示例7: updateValue
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
private int updateValue(IntegerBox aInput, int aVal, int maxVal) {
if (aInput.getValue() != null) {
int val = aInput.getValue();
if (val > maxVal) {
val = maxVal;
aInput.setValue(val);
}
if (val < 0) {
val = 0;
aInput.setValue(val);
}
aVal = val;
}
return aVal;
}
示例8: updateUpValue
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
private int updateUpValue(IntegerBox aInput, int aVal, int maxVal) {
aVal += 1;
if (aVal > maxVal) {
aVal = 0;
}
aInput.setValue(aVal);
return aVal;
}
示例9: updateDownValue
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
private int updateDownValue(IntegerBox aInput, int aVal, int maxVal) {
aVal -= 1;
if (aVal < 0) {
aVal = maxVal;
}
aInput.setValue(aVal);
return aVal;
}
示例10: ResizeDataEditor
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
public ResizeDataEditor(){
super();
HorizontalPanel sizes=new HorizontalPanel();
sizes.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
this.add(sizes);
Label f1Label=new Label(SimpleResize.textConstants.size());
f1Label.setWidth("100px");
sizes.add(f1Label);
sizeEditor=new IntegerBox();
sizeEditor.setWidth("100px");
sizes.add(sizeEditor);
}
示例11: makeIntegerBox
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
private IntegerBox makeIntegerBox(Panel parent,String name,int value){
HorizontalPanel h=new HorizontalPanel();
parent.add(h);
Label label=new Label(name);
label.setWidth("100px");
h.add(label);
IntegerBox box=new IntegerBox();
box.setValue(value);
h.add(box);
return box;
}
示例12: Box
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
Box() {
box = new IntegerBox();
box.setVisibleLength(10);
box.setAlignment(TextAlignment.RIGHT);
initWidget(box);
}
示例13: NumberSpinner
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
public NumberSpinner(String text) {
super(new IntegerBox(), text, 0, Integer.MAX_VALUE, 1);
}
示例14: IntegerEditorCell
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
public IntegerEditorCell() {
super(new IntegerBox());
}
示例15: onKeyPress
import com.google.gwt.user.client.ui.IntegerBox; //导入依赖的package包/类
/**
* @see com.google.gwt.event.dom.client.KeyPressHandler#onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent)
*/
@Override
public void onKeyPress(KeyPressEvent event) {
if (Character.isLetter(event.getCharCode()))
((IntegerBox) event.getSource()).cancelKey();
}