本文整理汇总了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");
}
示例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);
}
示例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);
}
}
});
}
示例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);
}