本文整理汇总了Java中com.google.gwt.user.client.ui.HasHTML类的典型用法代码示例。如果您正苦于以下问题:Java HasHTML类的具体用法?Java HasHTML怎么用?Java HasHTML使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HasHTML类属于com.google.gwt.user.client.ui包,在下文中一共展示了HasHTML类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasValueChanged
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
/**
* Returns if a value has changed into the report.
*
* @return if a value has changed into the report.
*/
public boolean hasValueChanged() {
if (ClientUtils.isEmpty(textAreas)) {
return false;
}
for (final Entry<Integer, String> entry : oldContents.entrySet()) {
final HasHTML textArea = textAreas.get(entry.getKey());
if (!ClientUtils.equals(textArea.getHTML(), entry.getValue())) {
return true;
}
}
return false;
}
示例2: setText
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
public void setText(String html) {
if (iReadOnly == null) {
iReadOnly = new P("label");
iReadOnly.setVisible(!getWidget().isVisible());
if (iPrint != null)
iReadOnly.addStyleName("unitime-NoPrint");
insert(iReadOnly, 1);
}
if (iReadOnly instanceof HasHTML) {
((HasHTML)iReadOnly).setHTML(html);
} else if (iReadOnly instanceof HasText) {
((HasText)iReadOnly).setText(html);
}
}
示例3: getCaptionWidget
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
@Override
public HasHTML getCaptionWidget() {
if (captionWidget instanceof HasHTML) {
return (HasHTML) captionWidget;
} else {
return null;
}
}
示例4: addTextArea
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public HasHTML addTextArea(final RichTextElementDTO richTextElement, final FoldPanel sectionPanel, final boolean draftMode) {
if (draftMode) {
final RichTextArea textArea = new RichTextArea();
textArea.setHTML(richTextElement.getText());
textArea.addFocusHandler(new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
globalFormatterArray[0] = textArea.getFormatter();
}
});
sectionPanel.add(textArea);
return textArea;
} else {
final HTML html = new HTML();
final String value = richTextElement.getText();
if (ClientUtils.isBlank(value)) {
html.setText(I18N.CONSTANTS.reportEmptySection());
html.addStyleName(STYLE_PROJECT_REPORT_FIELD_EMPTY);
} else {
html.setHTML(value);
html.addStyleName(STYLE_PROJECT_REPORT_FIELD);
}
sectionPanel.add(html);
return null;
}
}
示例5: addKeyQuestion
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public HasHTML addKeyQuestion(final KeyQuestionDTO keyQuestion, final FoldPanel sectionPanel, final boolean draftMode) {
keyQuestionState.increaseCount();
keyQuestion.setNumber(keyQuestionState.getCount());
// Rich text field.
final RichTextArea textArea = new RichTextArea();
final RichTextElementDTO richTextElementDTO = keyQuestion.getRichTextElementDTO();
if (richTextElementDTO != null) {
textArea.setHTML(richTextElementDTO.getText());
}
// Compas icon.
final ImageResource icon;
if (ClientUtils.isBlank(textArea.getText())) {
icon = ToolbarImages.IMAGES.compasRed();
} else {
icon = ToolbarImages.IMAGES.compasGreen();
keyQuestionState.increaseValids();
}
sectionPanel.addToolButton(icon, new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
KeyQuestionDialog.getDialog(keyQuestion, textArea, sectionPanel, sectionPanel.getToolButtonCount(), keyQuestionState, draftMode).show();
}
});
return textArea;
}
示例6: getChanges
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
/**
* Returns the report sections corresponding HTML changes map.
*
* @return The report sections corresponding HTML changes map.
*/
private Map<String, Object> getChanges() {
final Map<String, Object> changes = new HashMap<String, Object>();
for (final Map.Entry<Integer, HasHTML> textArea : textAreas.entrySet()) {
changes.put(textArea.getKey().toString(), textArea.getValue().getHTML());
}
return changes;
}
示例7: getDetails
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
@Override
public HasHTML getDetails() {
return projectDetailsPanel;
}
示例8: get
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
/** @return the existing HTML property of a widget. */
public static SafeHtml get(HasHTML t) {
return new SafeHtmlString(t.getHTML());
}
示例9: set
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
/** Set the HTML property of a widget. */
public static <T extends HasHTML> T set(T e, SafeHtml str) {
e.setHTML(str.asString());
return e;
}
示例10: setCaptionWidget
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
@Override
public void setCaptionWidget(HasHTML aCaptionWidget) {
window.setCaptionWidget(aCaptionWidget);
}
示例11: getCaptionWidget
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
@Override
public HasHTML getCaptionWidget() {
return window.getCaptionWidget();
}
示例12: getTextField
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
@Override
public HasHTML getTextField() {
return valueField;
}
示例13: getNameLabel
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public HasHTML getNameLabel() {
return usernameLabel;
}
示例14: getNameLabel
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public HasHTML getNameLabel() {
return nameLabel;
}
示例15: onSaveReport
import com.google.gwt.user.client.ui.HasHTML; //导入依赖的package包/类
/**
* Method executed on report save action.
*
* @param report
* The current report.
* @param changes
* The changes.
* @param loadingMask
* Set to {@code true} to display a loading mask on the entire report during save action. Set to
* {@code false} to ignore loading mask.
*/
private void onSaveReport(final ProjectReportDTO report, final Map<String, Object> changes, final boolean loadingMask) {
changes.put(ProjectReportDTO.CURRENT_PHASE, phaseName);
dispatch.execute(new UpdateEntity(ProjectReportDTO.ENTITY_NAME, report.getVersionId(), changes), new CommandResultHandler<VoidResult>() {
@Override
public void onCommandFailure(final Throwable caught) {
N10N.error(I18N.CONSTANTS.projectTabReports(), I18N.CONSTANTS.reportSaveError());
}
@Override
public void onCommandSuccess(final VoidResult result) {
N10N.infoNotif(I18N.CONSTANTS.projectTabReports(), I18N.CONSTANTS.reportSaveSuccess());
// --
// Updates store.
// --
for (int index = 0; index < view.getReportsStore().getCount(); index++) {
final ReportReference reference = view.getReportsStore().getAt(index);
if (reference.getId().equals(report.getId())) {
view.getReportsStore().remove(reference);
reference.setEditorName(auth().getUserShortName());
reference.setPhaseName(phaseName);
reference.setLastEditDate(new Date());
view.getReportsStore().add(reference);
break;
}
}
// --
// Updates changes.
// --
if (ClientUtils.isEmpty(textAreas)) {
return;
}
for (final Entry<Integer, String> entry : oldContents.entrySet()) {
final HasHTML textArea = textAreas.get(entry.getKey());
oldContents.put(entry.getKey(), textArea.getHTML());
}
// --
// Cancels timer.
// --
autoSaveTimer.cancel();
autoSaveTimer.schedule(AUTO_SAVE_PERIOD);
}
}, loadingMask ? new LoadingMask(view.getMainPanel()) : null);
}