use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.
the class AuditLogEntryCellHelper method buildColumnDetailsUpdate.
private void buildColumnDetailsUpdate(final ColumnDetails details, final ColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
if ((details instanceof ConditionColumnDetails) && (originalDetails instanceof ConditionColumnDetails)) {
buildColumnDetailsUpdate((ConditionColumnDetails) details, (ConditionColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof LimitedEntryConditionColumnDetails) && (originalDetails instanceof LimitedEntryConditionColumnDetails)) {
buildColumnDetailsUpdate((LimitedEntryConditionColumnDetails) details, (LimitedEntryConditionColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof ActionInsertFactColumnDetails) && (originalDetails instanceof ActionInsertFactColumnDetails)) {
buildColumnDetailsUpdate((ActionInsertFactColumnDetails) details, (ActionInsertFactColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof LimitedEntryActionInsertFactColumnDetails) && (originalDetails instanceof LimitedEntryActionInsertFactColumnDetails)) {
buildColumnDetailsUpdate((LimitedEntryActionInsertFactColumnDetails) details, (LimitedEntryActionInsertFactColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof ActionSetFieldColumnDetails) && (originalDetails instanceof ActionSetFieldColumnDetails)) {
buildColumnDetailsUpdate((ActionSetFieldColumnDetails) details, (ActionSetFieldColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof LimitedEntryActionSetFieldColumnDetails) && (originalDetails instanceof LimitedEntryActionSetFieldColumnDetails)) {
buildColumnDetailsUpdate((LimitedEntryActionSetFieldColumnDetails) details, (LimitedEntryActionSetFieldColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof AttributeColumnDetails) && (originalDetails instanceof AttributeColumnDetails)) {
buildColumnDetailsUpdate((AttributeColumnDetails) details, (AttributeColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof MetadataColumnDetails) && (originalDetails instanceof MetadataColumnDetails)) {
buildColumnDetailsUpdate((MetadataColumnDetails) details, (MetadataColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof ActionWorkItemColumnDetails) && (originalDetails instanceof ActionWorkItemColumnDetails)) {
buildColumnDetailsUpdate((ActionWorkItemColumnDetails) details, (ActionWorkItemColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof ActionWorkItemInsertFactColumnDetails) && (originalDetails instanceof ActionWorkItemInsertFactColumnDetails)) {
buildColumnDetailsUpdate((ActionWorkItemInsertFactColumnDetails) details, (ActionWorkItemInsertFactColumnDetails) originalDetails, diffs, sb);
} else if ((details instanceof ActionWorkItemSetFieldColumnDetails) && (originalDetails instanceof ActionWorkItemSetFieldColumnDetails)) {
buildColumnDetailsUpdate((ActionWorkItemSetFieldColumnDetails) details, (ActionWorkItemSetFieldColumnDetails) originalDetails, diffs, sb);
} else {
sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateColumn(details.getColumnHeader())));
SafeHtmlBuilder sbFields = null;
// Show changed fields too.
if (diffs != null && !diffs.isEmpty()) {
sbFields = new SafeHtmlBuilder();
for (BaseColumnFieldDiff diff : diffs) {
String changedFieldName = diff.getFieldName();
if (changedFieldName.equals(DTColumnConfig52.FIELD_HEADER)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ColumnHeader(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(DTColumnConfig52.FIELD_HIDE_COLUMN)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.HideThisColumn(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(DTColumnConfig52.FIELD_DEFAULT_VALUE)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DefaultValue(), diff.getOldValue(), diff.getValue(), sbFields);
}
}
}
if (sbFields != null) {
sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
}
}
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.
the class WidthCalculator method getElementWidth.
/**
* Get the width of a single item
* @param value
* @return
*/
public int getElementWidth(final V value) {
SafeHtmlBuilder sb = new SafeHtmlBuilder();
cell.render(null, value, sb);
div.setInnerHTML(sb.toSafeHtml().asString());
int width = div.getClientWidth();
if (minWidth == null) {
return div.getClientWidth();
}
return minWidth > width ? minWidth : width;
}
Aggregations