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


Java SafeHtmlUtils.fromSafeConstant方法代码示例

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


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

示例1: getHTML

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
public SafeHtml getHTML() {
    SafeHtml result = null;
    if (libraryLoaded && initialized) {
        try {
            String contentHtml = getContentHtml(elementId); // TinyMCE takes care of the sanitization.
            if (contentHtml == null || contentHtml.trim().isEmpty()) {
                return SafeHtmlUtils.fromSafeConstant("");
            }
            // Remove the root block <p></p> that gets added automatically by TinyMCE
            if (contentHtml.startsWith("<p>") && contentHtml.endsWith("</p>")) {
                contentHtml = contentHtml.substring(3, contentHtml.length() - 4);
            }
            result = SafeHtmlUtils.fromTrustedString(contentHtml); 
        } catch (JavaScriptException e) {
            GWT.log("Unable to get the content from the TinyMCE editor.", e);
        }
    } else {
        String text = super.getText();
        if (text == null || text.trim().isEmpty()) {
            return SafeHtmlUtils.fromSafeConstant("");
        } else {
            return SafeHtmlUtils.fromString(text);
        }
    }
    return result;        
}
 
开发者ID:harvardpan,项目名称:hftinymce-gwt,代码行数:27,代码来源:HFRichTextEditor.java

示例2: constructBooleanColumn

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
protected float constructBooleanColumn(DataGrid<T> table, String title,
        final BooleanValueProvider<T> valueProvider, 
        Comparator<T> comparator, Boolean isSortAscending, float prefWidth) {
    Header<SafeHtml> header = new SafeHtmlHeader(
            SafeHtmlUtils.fromSafeConstant(title));
    Column<T, Boolean> column = new Column<T, Boolean>(new UneditableCheckboxCell()) {
        @Override
        public Boolean getValue(T item) {
            return valueProvider.getValue(item);
        }
    };
    column.setFieldUpdater(new FieldUpdater<T,Boolean>() {
        @Override
        public void update(int index, T object, Boolean value) {
            onRowClicked(getObjectId(object));
        }
    });
    table.addColumn(column, header);
    table.setColumnWidth(column, prefWidth, Unit.PX);
    processColumnSort(table, column, comparator, isSortAscending);
    return prefWidth;
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:23,代码来源:AbstractGrid.java

示例3: constructActions

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
protected float constructActions(DataGrid<T> table, float prefWidth) {
    if (enableActions) {
        if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
            Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
                    SafeHtmlUtils.fromSafeConstant(Utils.constants.delete()));

            deleteColumn = constructDeleteColumn("");
            table.addColumn(deleteColumn, deleteHeader);
            table.setColumnWidth(deleteColumn, ACTION_COLUMN_WIDTH, Unit.PX);
            return ACTION_COLUMN_WIDTH;
        }
        else {
            return 0;
        }
    }
    else {
        return 0;
    }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:20,代码来源:AbstractGrid.java

示例4: constructActions

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
@Override
protected float constructActions(DataGrid<FormField> table, float prefWidth) {
    if (enableActions) {
        if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
            Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
                    SafeHtmlUtils.fromSafeConstant(Utils.constants.delete()));

            deleteColumn = constructDeleteColumn("");
            table.addColumn(deleteColumn, deleteHeader);
            table.setColumnWidth(deleteColumn, DELETE_COLUMN_WIDTH, Unit.PX);
            return DELETE_COLUMN_WIDTH;
        }
        else {
            return 0;
        }
    }
    else {
        return 0;
    }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:21,代码来源:ArrayFieldWidget.java

示例5: constructActions

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
@Override
protected float constructActions(DataGrid<T> table, float prefWidth) {

  float result = 0;
  if (!embedded
      && (downloadPropsColumn == null || table.getColumnIndex(downloadPropsColumn) == -1)) {
    Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader(
        SafeHtmlUtils.fromSafeConstant(Utils.constants.configuration()));
    downloadPropsColumn = constructDownloadSchemaColumn("");
    table.addColumn(downloadPropsColumn, downloadRecordSchemaHeader);
    table.setColumnWidth(downloadPropsColumn, ACTION_COLUMN_WIDTH, Unit.PX);
    result += ACTION_COLUMN_WIDTH;
  }
  result += super.constructActions(table, prefWidth);
  return result;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:17,代码来源:BasePluginGrid.java

示例6: constructActions

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
@Override
protected float constructActions(DataGrid<ConfigurationSchemaDto> table, float prefWidth) {
  float result = super.constructActions(table, prefWidth);
  if (!embedded && (downloadBaseSchemaColumn == null
      || table.getColumnIndex(downloadBaseSchemaColumn) == -1)) {
    Header<SafeHtml> downloadBaseSchemaHeader = new SafeHtmlHeader(
        SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadBaseSchema()));

    downloadBaseSchemaColumn = constructDownloadBaseSchemaColumnColumn("");
    table.addColumn(downloadBaseSchemaColumn, downloadBaseSchemaHeader);
    table.setColumnWidth(downloadBaseSchemaColumn, ACTION_COLUMN_WIDTH, Style.Unit.PX);
    result += ACTION_COLUMN_WIDTH;
  }

  if (!embedded && (downloadOverrideSchemaColumn == null
      || table.getColumnIndex(downloadOverrideSchemaColumn) == -1)) {
    Header<SafeHtml> downloadOverrideSchemaHeader = new SafeHtmlHeader(
        SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadOverrideSchema()));

    downloadOverrideSchemaColumn = constructDownloadOverrideSchemaColumnColumn("");
    table.addColumn(downloadOverrideSchemaColumn, downloadOverrideSchemaHeader);
    table.setColumnWidth(downloadOverrideSchemaColumn, ACTION_COLUMN_WIDTH, Style.Unit.PX);
    result += ACTION_COLUMN_WIDTH;
  }
  return result;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:27,代码来源:ConfigSchemaGrid.java

示例7: constructActions

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
@Override
protected float constructActions(DataGrid<EndpointProfileDto> table, float prefWidth) {
  if (enableActions) {
    float result = 0;

    if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
      Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
          SafeHtmlUtils.fromSafeConstant(
              embedded ? Utils.constants.remove() : Utils.constants.delete()));

      deleteColumn = constructDeleteColumn("");
      table.addColumn(deleteColumn, deleteHeader);
      table.setColumnWidth(deleteColumn, 40, Style.Unit.PX);
      result += 40;
    }

    return result;
  } else {
    return 0;
  }
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:22,代码来源:EndpointProfileGrid.java

示例8: constructStringColumn

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
protected float constructStringColumn(DataGrid<T> table, String title,
        final StringValueProvider<T> valueProvider, 
        Comparator<T> comparator, Boolean isSortAscending, boolean filtrable, float prefWidth) {
    Header<SafeHtml> header = new SafeHtmlHeader(
            SafeHtmlUtils.fromSafeConstant(title));
    Column<T, String> column = null;
    if (filtrable) {
        FiltrableStringColumn<T> filtrableColumn = new FiltrableStringColumn<T>(new LinkCell()) {
            @Override
            public String getValue(T item) {
                return valueProvider.getValue(item);
            }
        };
        filtrableColumns.add(filtrableColumn);
        column = filtrableColumn;
    } else {
        column = new Column<T, String>(new LinkCell()) {
            @Override
            public String getValue(T item) {
                return valueProvider.getValue(item);
            }
        };
    }
    column.setFieldUpdater(new FieldUpdater<T,String>() {
        @Override
        public void update(int index, T object, String value) {
            onRowClicked(getObjectId(object));
        }
    });
    table.addColumn(column, header);
    table.setColumnWidth(column, prefWidth, Unit.PX);
    processColumnSort(table, column, comparator, isSortAscending);
    return prefWidth;
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:35,代码来源:AbstractGrid.java

示例9: constructActions

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
@Override
protected float constructActions(DataGrid<LogSchemaDto> table, float prefWidth) {
  float result = super.constructActions(table, prefWidth);
  if (!embedded
      && (downloadLibraryColumn == null || table.getColumnIndex(downloadLibraryColumn) == -1)) {
    Header<SafeHtml> downloadLibraryHeader = new SafeHtmlHeader(
        SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadRecordLibrary()));

    downloadLibraryColumn = constructDownloadLibraryColumn("");
    table.addColumn(downloadLibraryColumn, downloadLibraryHeader);
    table.setColumnWidth(downloadLibraryColumn, ACTION_COLUMN_WIDTH, Unit.PX);
    result += ACTION_COLUMN_WIDTH;
  }
  if (enableActions) {
    if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
      Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
          SafeHtmlUtils.fromSafeConstant(
              embedded ? Utils.constants.remove() : Utils.constants.delete()));

      deleteColumn = constructDeleteColumn("");
      table.addColumn(deleteColumn, deleteHeader);
      table.setColumnWidth(deleteColumn, ACTION_COLUMN_WIDTH, Unit.PX);
      result += ACTION_COLUMN_WIDTH;
    }

  }
  return result;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:29,代码来源:LogSchemaGrid.java

示例10: constructActions

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
@Override
protected float constructActions(DataGrid<T> table, float prefWidth) {
  float result = 0;
  if (downloadSchemaColumn == null || table.getColumnIndex(downloadSchemaColumn) == -1) {
    Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader(
        SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadRecordSchema()));
    downloadSchemaColumn = constructDownloadSchemaColumn();
    table.addColumn(downloadSchemaColumn, downloadRecordSchemaHeader);
    table.setColumnWidth(downloadSchemaColumn, 60, Unit.PX);
    result += 60;
  }
  return result;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:14,代码来源:BaseCtlSchemasGrid.java

示例11: constructActions

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
@Override
protected float constructActions(DataGrid<T> table, float prefWidth) {
  float result = 0;
  if (!embedded
      && (downloadSchemaColumn == null || table.getColumnIndex(downloadSchemaColumn) == -1)) {
    Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader(
        SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadRecordSchema()));
    downloadSchemaColumn = constructDownloadSchemaColumn("");
    table.addColumn(downloadSchemaColumn, downloadRecordSchemaHeader);
    table.setColumnWidth(downloadSchemaColumn, ACTION_COLUMN_WIDTH, Unit.PX);
    result += ACTION_COLUMN_WIDTH;
  }
  return result;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:15,代码来源:BaseSchemasGrid.java

示例12: constructActions

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
@Override
protected float constructActions(DataGrid<TopicDto> table, float prefWidth) {
  if (enableActions) {
    float result = 0;
    if (!embedded
        && (sendNotificationColumn == null
        || table.getColumnIndex(sendNotificationColumn) == -1)) {
      Header<SafeHtml> sendNotificationHeader = new SafeHtmlHeader(
          SafeHtmlUtils.fromSafeConstant(Utils.constants.sendNotification()));

      sendNotificationColumn = constructSendNotificationColumn("");
      table.addColumn(sendNotificationColumn, sendNotificationHeader);
      table.setColumnWidth(sendNotificationColumn, 40, Unit.PX);
      result += 40;
    }
    if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
      Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
          SafeHtmlUtils.fromSafeConstant(embedded
              ? Utils.constants.remove()
              : Utils.constants.delete()));

      deleteColumn = constructDeleteColumn("");
      table.addColumn(deleteColumn, deleteHeader);
      table.setColumnWidth(deleteColumn, 40, Unit.PX);
      result += 40;
    }

    return result;
  } else {
    return 0;
  }
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:33,代码来源:TopicGrid.java

示例13: render

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
@Override
public void render(com.google.gwt.cell.client.Cell.Context context,
                   MenuItem value, SafeHtmlBuilder sb)
{
    SafeHtml html = SafeHtmlUtils
            .fromSafeConstant("<div class='cell'> " + value
                    + "</div>");
    sb.append(html);
}
 
开发者ID:cheminfo,项目名称:openchemlib-js,代码行数:10,代码来源:DrawArea.java

示例14: svgCore

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
public SafeHtml svgCore() { 
	return SafeHtmlUtils.fromSafeConstant(AtomClientBundle.INSTANCE.svgCore().getText()); 
}
 
开发者ID:fhcampuswien,项目名称:atom,代码行数:4,代码来源:AtomClientBundle.java

示例15: PanelStatisticsTop

import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
public PanelStatisticsTop() {
	super(SafeHtmlUtils.fromSafeConstant(DESCRIPTION));
	setWidth("600px");
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:5,代码来源:PanelStatisticsTop.java


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