当前位置: 首页>>代码示例>>Java>>正文


Java TextBox.setVisibleLength方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.TextBox.setVisibleLength方法的典型用法代码示例。如果您正苦于以下问题:Java TextBox.setVisibleLength方法的具体用法?Java TextBox.setVisibleLength怎么用?Java TextBox.setVisibleLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.TextBox的用法示例。


在下文中一共展示了TextBox.setVisibleLength方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeTextInput

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
public static Widget makeTextInput(String text,
                                   String tip,
                                   String value,
                                   int length,
                                   TextBox textBox) {
    HorizontalPanel hp = new HorizontalPanel();
    Label label = new Label(text);
    label.setTitle(tip);
    textBox.setText(value);
    textBox.setTitle(tip);
    textBox.setVisibleLength(length);
    hp.add(label);
    hp.add(GwtUtil.getFiller(5, 1));
    hp.add(textBox);
    return hp;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:17,代码来源:GwtUtil.java

示例2: FileTextBox

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
/**
 * File textBox
 */
public FileTextBox() {
	textBox = new TextBox();
	textBox.addKeyUpHandler(new KeyUpHandler() {
		@Override
		public void onKeyUp(KeyUpEvent event) {
			switch (event.getNativeKeyCode()) {
				case (char) KeyCodes.KEY_ENTER:
					switch (action) {
						case ACTION_RENAME:
							if (textBox.getText().length() > 0) {
								Main.get().mainPanel.desktop.browser.fileBrowser.rename(textBox.getText());
							} else {
								Main.get().mainPanel.desktop.browser.fileBrowser.hideRename();
							}
							break;
					}
					Main.get().mainPanel.enableKeyShorcuts(); // Enables general keys applications
					break;

				case (char) KeyCodes.KEY_ESCAPE:
					switch (action) {
						case ACTION_RENAME:
							Main.get().mainPanel.desktop.browser.fileBrowser.hideRename();
							break;
					}
					Main.get().mainPanel.enableKeyShorcuts(); // Enables general keys applications
					break;
			}
		}
	});
	textBox.setVisibleLength(20);
	textBox.setStyleName("okm-FileBrowser-TextBox");
	initWidget(textBox);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:38,代码来源:FileTextBox.java

示例3: render

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
public Widget render(Row row, Column column, Object value) {
  if(value == null || !(value instanceof String)) {
    return null;
  } else {
    TextBox textbox = new TextBox();
    textbox.setText((String)value);
    if(_maxLength > 0) textbox.setMaxLength(_maxLength);
    if(_visibleLength > 0) textbox.setVisibleLength(_visibleLength);
    if(_title != null) textbox.setTitle(_title);
    return textbox;
  }
}
 
开发者ID:sanderberents,项目名称:gwtlib,代码行数:13,代码来源:TextBoxRenderer.java

示例4: updateGotoWidget

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
protected void updateGotoWidget(Widget widget) {
  widget.setVisible(computeNumPages() > 1);
  // Update allowed number of characters in the goto page textbox in case page size has changed (Yuck!)
  if(widget instanceof HorizontalPanel) {
    HorizontalPanel panel = (HorizontalPanel)widget;
    if(panel.getWidgetCount() == 3 && panel.getWidget(1) instanceof TextBox) {
      TextBox gotoPage = (TextBox)panel.getWidget(1);
      int maxlen = String.valueOf(computeNumPages()).length();
      gotoPage.setMaxLength(maxlen);
      gotoPage.setVisibleLength(maxlen);
    }
  }
}
 
开发者ID:sanderberents,项目名称:gwtlib,代码行数:14,代码来源:PagingBar.java

示例5: EditorNumberPropertyWidget

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
public EditorNumberPropertyWidget(String name, int value) {
  propertyName.setText(name);

  propertyValueBox = new TextBox();
  propertyValueBox.setVisibleLength(3);
  propertyValueBox.setValue(String.valueOf(value));
  propertyValueBox.addKeyUpHandler(this);

  valuePanel.add(propertyValueBox);
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:EditorNumberPropertyWidget.java

示例6: EditorStringPropertyWidget

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
public EditorStringPropertyWidget(String name, String value) {
  propertyName.setText(name);

  propertyValueBox = new TextBox();
  propertyValueBox.setVisibleLength(5);
  propertyValueBox.setValue(value);
  propertyValueBox.addKeyUpHandler(this);

  valuePanel.add(propertyValueBox);
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:EditorStringPropertyWidget.java

示例7: showInputDialog

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
public static BaseDialog showInputDialog(Widget parent,
                                  String msg,
                                  String intialValue,
                                  int preferWidth,
                                  final ClickHandler okHandler,
                                  final ClickHandler cancelHandler) {

    final TextBox text = new TextBox();
    text.setVisibleLength(preferWidth);
    if (!StringUtils.isEmpty(intialValue)) {
        text.setText(intialValue);
    }

    final BaseDialog dialog= new BaseDialog(parent, ButtonType.OK_CANCEL,"Input Dialog",true,null) {
        protected void inputComplete() {
            if (okHandler!=null) {
                okHandler.onClick(new ClickEvent() {
                    @Override
                    public Object getSource() {
                        return text.getText();
                    }
                });
            }

        }
        protected void inputCanceled() {
            if (cancelHandler!=null) cancelHandler.onClick(null);
        }
    };

    text.addKeyPressHandler(new KeyPressHandler() {
                public void onKeyPress(KeyPressEvent ev) {
                    final char keyCode= ev.getCharCode();
                    DeferredCommand.addCommand(new Command() {
                        public void execute() {
                            if (keyCode== KeyCodes.KEY_ENTER) {
                                dialog.getButton(BaseDialog.ButtonID.OK).click();
                            }
                        }
                    });
                }
            });

    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(5);
    vp.add(new HTML("<h3>" + msg + "</h3>"));
    vp.add(text);

    dialog.setWidget(vp);
    dialog.setVisible(true);
    text.setFocus(true);
    return dialog;

}
 
开发者ID:lsst,项目名称:firefly,代码行数:55,代码来源:PopupUtil.java


注:本文中的com.google.gwt.user.client.ui.TextBox.setVisibleLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。