本文整理汇总了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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
示例14: svgCore
import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
public SafeHtml svgCore() {
return SafeHtmlUtils.fromSafeConstant(AtomClientBundle.INSTANCE.svgCore().getText());
}
示例15: PanelStatisticsTop
import com.google.gwt.safehtml.shared.SafeHtmlUtils; //导入方法依赖的package包/类
public PanelStatisticsTop() {
super(SafeHtmlUtils.fromSafeConstant(DESCRIPTION));
setWidth("600px");
}