當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。