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


Java TextArea.setFocus方法代码示例

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


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

示例1: showTextArea

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
private void showTextArea() {
	final TextArea textArea=new TextArea();
	textArea.setStyleName("mf-writeACommentTextArea");
	textArea.setTitle(i18n.hitCtrlEnterToSubmitComment());
	textArea.setFocus(true);
	textArea.addKeyUpHandler(new KeyUpHandler() {
		public void onKeyUp(KeyUpEvent event) {
			if(event.getNativeKeyCode()==KeyCodes.KEY_ENTER && event.isControlKeyDown()) {
				if(!"".equals(textArea.getText())) {
					ctx.getStatusLine().showProgress(i18n.savingYourComment());
					ctx.getService().saveQuestionComment(questionId,textArea.getText(),new AsyncCallback<String>() {
						public void onFailure(Throwable caught) {
							ctx.getRia().handleServiceError(caught);
						}
						public void onSuccess(String result) {
							ctx.getStatusLine().hideStatus();
							textArea.setVisible(false);
							CommentBean commentBean=new CommentBean(
									result,
									ctx.getState().getCurrentUser(),
									questionId,
									textArea.getText(),
									new Date());
							// this is a new comment, therefore it is always added at the end - replacing existing one ;-)
							final int threadRow = questionCommentsPanel.getRowCount()-1;
							questionCommentsPanel.setWidget(threadRow, 0, new ViewCommentPanel(threadRow, questionCommentsPanel, commentBean, ctx));
							questionCommentsPanel.addNewComment();
						}
					});						
				}
			}			
		}
	});
	add(textArea);
}
 
开发者ID:dvorka,项目名称:coaching-notebook,代码行数:36,代码来源:NewCommentPanel.java

示例2: createWordCloud

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
private void createWordCloud()
{
    TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text"));
    String text = textArea.getText().trim();
    if (!text.isEmpty())
    {
        createWordCloud(text);
    }
    else
    {
        textArea.setFocus(true);
    }
}
 
开发者ID:spupyrev,项目名称:swcv,代码行数:14,代码来源:WordCloudApp.java

示例3: onModuleLoad

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
public void onModuleLoad() {
    // create the widgets
    final Button analyseButton = new Button(messages.sendButton());
    final Button configureButton = new Button(messages.configureButton());
    final TextArea mainTextArea = new TextArea();
    mainTextArea.setCharacterWidth(80);
    mainTextArea.setVisibleLines(15);
    final Label errorLabel = new Label();
    final CellTable<SnomedConcept> resultsTable = new CellTable<>();

    // add them to the root panel
    RootPanel.get("mainTextArea").add(mainTextArea);
    RootPanel.get("analyseButton").add(analyseButton);
    RootPanel.get("configureButton").add(configureButton);
    RootPanel.get("status").add(errorLabel);
    RootPanel.get("snomedCodes").add(resultsTable);

    // set the focus to the text area
    mainTextArea.setFocus(true);

    // initialise the SNOMED code results table
    final List<SnomedConcept> conceptList = configSnomedTable(resultsTable);

    // add the handlers
    final List<SemanticType> types = new ArrayList<>();
    final Map<String, String> typeCodeToDescription = new HashMap<>();
    analyseButton.addClickHandler(
            new AnalyseHandler(mainTextArea, errorLabel, conceptList, types, typeCodeToDescription));
    configureButton.addClickHandler(new ConfigureHandler(types, typeCodeToDescription));
}
 
开发者ID:NICTA,项目名称:t3as-snomedct-service,代码行数:31,代码来源:SnomedCoderUi.java

示例4: insertBetweenSelectionText

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
public static void insertBetweenSelectionText(TextSelection selection,String header,String footer){
  	String newText=header+selection.getSelection()+footer;
selection.replace(newText);
  	
TextArea target=selection.getTargetTextArea();
target.setCursorPos(selection.getStart()+(header+selection.getSelection()).length());
target.setFocus(true);
   }
 
开发者ID:akjava,项目名称:GWTMarkdownEditor,代码行数:9,代码来源:MarkdownEditor.java

示例5: createClipboardTextArea

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
private TextArea createClipboardTextArea() {
  final TextArea pasteArea = new TextArea();
  pasteArea.setPixelSize(0, 0);
  Style style = pasteArea.getElement().getStyle();
  style.setPosition(Style.Position.FIXED);
  RootPanel.get().add(pasteArea);
  pasteArea.setFocus(true);
  return pasteArea;
}
 
开发者ID:JetBrains,项目名称:jetpad-projectional-open-source,代码行数:10,代码来源:ClipboardSupport.java


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