Java 类com.google.gwt.user.client.ui.HasHTML 实例源码

项目:sigmah    文件:ReportsPresenter.java   
/**
 * 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;
}
项目:unitimes    文件:UniTimeWidget.java   
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);
    }
}
项目:unitime    文件:UniTimeWidget.java   
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);
    }
}
项目:platypus-js    文件:WindowPanel.java   
@Override
public HasHTML getCaptionWidget() {
    if (captionWidget instanceof HasHTML) {
        return (HasHTML) captionWidget;
    } else {
        return null;
    }
}
项目:sigmah    文件:ReportsView.java   
/**
 * {@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;
    }
}
项目:sigmah    文件:ReportsView.java   
/**
 * {@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;
}
项目:sigmah    文件:ReportsPresenter.java   
/**
 * 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;
}
项目:sandbox-frame    文件:ProjectViewImpl.java   
@Override
public HasHTML getDetails() {
    return projectDetailsPanel;
}
项目:sandbox-frame    文件:ProjectBundleViewImpl.java   
@Override
public HasHTML getDetails() {
    return projectDetailsPanel;
}
项目:gerrit    文件:SafeHtml.java   
/** @return the existing HTML property of a widget. */
public static SafeHtml get(HasHTML t) {
  return new SafeHtmlString(t.getHTML());
}
项目:gerrit    文件:SafeHtml.java   
/** Set the HTML property of a widget. */
public static <T extends HasHTML> T set(T e, SafeHtml str) {
  e.setHTML(str.asString());
  return e;
}
项目:platypus-js    文件:WindowPopupPanel.java   
@Override
public void setCaptionWidget(HasHTML aCaptionWidget) {
    window.setCaptionWidget(aCaptionWidget);
}
项目:platypus-js    文件:WindowPopupPanel.java   
@Override
public HasHTML getCaptionWidget() {
    return window.getCaptionWidget();
}
项目:qafe-platform    文件:SliderViewGwtImpl.java   
@Override
public HasHTML getTextField() {
    return valueField;
}
项目:sigmah    文件:AuthenticationBannerView.java   
/**
 * {@inheritDoc}
 */
@Override
public HasHTML getNameLabel() {
    return usernameLabel;
}
项目:sigmah    文件:OrganizationBannerView.java   
/**
 * {@inheritDoc}
 */
@Override
public HasHTML getNameLabel() {
    return nameLabel;
}
项目:sigmah    文件:ReportsPresenter.java   
/**
 * 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);
}
项目:sigmah    文件:ReportsPresenter.java   
/**
 * Adds a new rich textarea to the given {@code sectionPanel}.
 * 
 * @param richTextElement
 *          The rich text element data.
 * @param sectionPanel
 *          The parent section panel.
 * @param draftMode
 *          If the section is loaded in draft mode.
 * @return The {@link HasHTML} instance associated to the rich text element (if <em>draft</em> mode), or
 *         {@code null}.
 */
HasHTML addTextArea(RichTextElementDTO richTextElement, FoldPanel sectionPanel, boolean draftMode);
项目:sigmah    文件:ReportsPresenter.java   
/**
 * Adds a new key question to the given {@code sectionPanel}.
 * 
 * @param keyQuestion
 *          The key question element data.
 * @param sectionPanel
 *          The parent section panel.
 * @param draftMode
 *          If the section is loaded in draft mode.
 * @return The {@link HasHTML} instance associated to the key question.
 */
HasHTML addKeyQuestion(final KeyQuestionDTO keyQuestion, final FoldPanel sectionPanel, final boolean draftMode);
项目:sandbox-frame    文件:ProjectBundleView.java   
HasHTML getDetails();
项目:sandbox-frame    文件:ProjectView.java   
HasHTML getDetails();
项目:platypus-js    文件:WindowUI.java   
public void setCaptionWidget(HasHTML aCaptionWidget);
项目:platypus-js    文件:WindowUI.java   
public HasHTML getCaptionWidget();
项目:qafe-platform    文件:SliderView.java   
public HasHTML getTextField();
项目:sigmah    文件:AuthenticationBannerPresenter.java   
HasHTML getNameLabel();
项目:sigmah    文件:OrganizationBannerPresenter.java   
HasHTML getNameLabel();