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


Java TextArea.addStyleName方法代码示例

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


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

示例1: initAppComments

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
/**
 * Helper method called by constructor to initialize the app's comment area
 */
private void initAppComments() {
  // App details - comments
  appDetails.add(appComments);
  appComments.addStyleName("app-comments-wrapper");
  Label commentsHeader = new Label("Comments and Reviews");
  commentsHeader.addStyleName("app-comments-header");
  appComments.add(commentsHeader);
  final TextArea commentTextArea = new TextArea();
  commentTextArea.addStyleName("app-comments-textarea");
  appComments.add(commentTextArea);
  Button commentSubmit = new Button("Submit my comment");
  commentSubmit.addStyleName("app-comments-submit");
  commentSubmit.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      final OdeAsyncCallback<Long> commentPublishCallback = new OdeAsyncCallback<Long>(
          // failure message
          MESSAGES.galleryError()) {
            @Override
            public void onSuccess(Long date) {
              // get the new comment list so gui updates
              //   note: we might modify the call to publishComment so it returns
              //   the list instead, this would save one server call
              gallery.GetComments(app.getGalleryAppId(), 0, 100);
            }
        };
      Ode.getInstance().getGalleryService().publishComment(app.getGalleryAppId(),
          commentTextArea.getText(), commentPublishCallback);
    }
  });
  appComments.add(commentSubmit);

  // Add list of comments
  gallery.GetComments(app.getGalleryAppId(), 0, 100);
  appComments.add(appCommentsList);
  appCommentsList.addStyleName("app-comments");

}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:42,代码来源:GalleryPage.java

示例2: ConsoleDialog

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
public ConsoleDialog(ConsoleDialogListener listener) {
	super(false, true);
	this.listener = listener;
	
       VerticalPanel dialogContents = new VerticalPanel();
       dialogContents.setSpacing(4);
       setWidget(dialogContents);
       
       console = new TextArea();
       console.setReadOnly(true);
       int width= Window.getClientWidth();
       int height= Window.getClientHeight();
       console.setSize(width*2/3 + "px", height*2/3   + "px");
       console.addStyleName(Utils.sandboxStyle.consoleArea());
       okButton = new Button("Ok");
       addButton(okButton);
       
       dialogContents.add(console);
       
       okButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			hide();
			if (ConsoleDialog.this.listener != null) {
				ConsoleDialog.this.listener.onOk(rpcCallSucceded && consoleSessionSucceded);
			}
		}
       });
       okButton.setEnabled(false);
}
 
开发者ID:kaaproject,项目名称:sandbox-frame,代码行数:31,代码来源:ConsoleDialog.java

示例3: onModuleLoad

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
/**
 * This is the entry point method.
 */
@Override
public void onModuleLoad() {
    final TextArea log = new TextArea();
    RootPanel.get("log-div").add(log);
    log.addStyleName("logBox");
    log.setVisibleLines(10);
    log.setReadOnly(true);
    System.setOut(new TextAreaPrintStream(log));
    System.setErr(System.out);

    final Button runButton = new Button("Run!");
    RootPanel.get("btn-div").add(runButton);
    runButton.addStyleName("runButton");

    runButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            log.setValue("");
            String code = getSourceCode();
            String className = Javac.getClassName(code);

            boolean ok = Javac.compile(className + ".java", code);
            if (ok) {
                System.out.println("Compiled!");
                printMagic(fs.readFile(fs.cwd() + className + ".class"));
                System.out.println("Output:");

                JVM.setClassLoader(new JibClassLoader());
                JVM.run(className);
            }
        }
    });
}
 
开发者ID:ctalau,项目名称:javainthebrowser,代码行数:37,代码来源:Jib.java

示例4: initReportSection

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
/**
 * Helper method called by constructor to initialize the report section
 */
private void initReportSection() {
  final HTML reportPrompt = new HTML();
  reportPrompt.setHTML(MESSAGES.galleryReportPrompt());
  reportPrompt.addStyleName("primary-prompt");
  final TextArea reportText = new TextArea();
  reportText.addStyleName("action-textarea");
  final Button submitReport = new Button(MESSAGES.galleryReportButton());
  submitReport.addStyleName("action-button");
  final Label descriptionError = new Label();
  descriptionError.setText("Description required");
  descriptionError.setStyleName("ode-ErrorMessage");
  descriptionError.setVisible(false);
  appReportPanel.add(reportPrompt);
  appReportPanel.add(descriptionError);
  appReportPanel.add(reportText);
  appReportPanel.add(submitReport);

  final OdeAsyncCallback<Boolean> isReportdByUserCallback = new OdeAsyncCallback<Boolean>(
      // failure message
      MESSAGES.galleryError()) {
        @Override
        public void onSuccess(Boolean isAlreadyReported) {
          if(isAlreadyReported) { //already reported, cannot report again
            reportPrompt.setHTML(MESSAGES.galleryAlreadyReportedPrompt());
            reportText.setVisible(false);
            submitReport.setVisible(false);
            submitReport.setEnabled(false);
          } else {
            submitReport.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
                final OdeAsyncCallback<Long> reportClickCallback = new OdeAsyncCallback<Long>(
                    // failure message
                    MESSAGES.galleryError()) {
                      @Override
                      public void onSuccess(Long id) {
                        reportPrompt.setHTML(MESSAGES.galleryReportCompletionPrompt());
                        reportText.setVisible(false);
                        submitReport.setVisible(false);
                        submitReport.setEnabled(false);
                      }
                  };
                if (!reportText.getText().trim().isEmpty()){
                  Ode.getInstance().getGalleryService().addAppReport(app, reportText.getText(),
                    reportClickCallback);
                  descriptionError.setVisible(false);
                } else {
                  descriptionError.setVisible(true);
                }
              }
            });
          }
        }
    };
  Ode.getInstance().getGalleryService().isReportedByUser(app.getGalleryAppId(),
      isReportdByUserCallback);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:60,代码来源:GalleryPage.java


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