Search in sources :

Example 56 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.

the class AuditLogEntryCellHelper method getSafeHtml.

private SafeHtml getSafeHtml(final UpdateColumnAuditLogEntry event) {
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    buildColumnDetailsUpdate(event.getDetails(), event.getOriginalDetails(), event.getDiffs(), sb);
    return sb.toSafeHtml();
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 57 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.

the class AuditLogEntryCellHelper method buildColumnDetailsUpdate.

/**
 * BZ-996932: Added column update details for attribute columns.
 * @param details The new details column.
 * @param originalDetails The origin details column.
 * @param diffs A part from the column details, the column fields update information must be present too.
 * @param sb The html bulder buffer.
 */
private void buildColumnDetailsUpdate(final AttributeColumnDetails details, final AttributeColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
    sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateAttribute(details.getAttribute())));
    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_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);
            } else if (changedFieldName.equals(AttributeCol52.FIELD_REVERSE_ORDER)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ReverseOrder(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(AttributeCol52.FIELD_USE_ROW_NUMBER)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.UseRowNumber(), diff.getOldValue(), diff.getValue(), sbFields);
            }
        }
    }
    if (sbFields != null) {
        sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
    }
}
Also used : BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 58 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.

the class AuditLogEntryCellHelper method buildColumnDetailsUpdate.

private void buildColumnDetailsUpdate(final ActionWorkItemInsertFactColumnDetails details, final ActionWorkItemInsertFactColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
    sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateAction(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(ActionInsertFactCol52.FIELD_BOUND_NAME)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Binding(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ActionInsertFactCol52.FIELD_FACT_TYPE)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.FactType(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ActionInsertFactCol52.FIELD_FACT_FIELD)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Field(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ActionInsertFactCol52.FIELD_IS_INSERT_LOGICAL)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.LogicallyInsert(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ActionWorkItemInsertFactCol52.FIELD_WORK_ITEM_NAME)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemName(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ActionWorkItemInsertFactCol52.FIELD_WORK_ITEM_RESULT_PARAM_NAME)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterName(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ActionWorkItemInsertFactCol52.FIELD_PARAMETER_CLASSNAME)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterClassName(), diff.getOldValue(), diff.getValue(), sbFields);
            }
        }
    }
    if (sbFields != null) {
        sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
    }
}
Also used : BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 59 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.

the class AuditLogEntryCellHelper method buildColumnDetailsUpdate.

private void buildColumnDetailsUpdate(final ActionWorkItemColumnDetails details, final ActionWorkItemColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
    sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateAction(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(ActionWorkItemCol52.FIELD_WORKITEM_DEFINITION_NAME)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemName(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ActionWorkItemCol52.FIELD_WORKITEM_DEFINITION_PARAMETER_NAME)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterName(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ActionWorkItemCol52.FIELD_WORKITEM_DEFINITION_PARAMETER_VALUE)) {
                if (diff instanceof WorkItemColumnParameterValueDiffImpl) {
                    final String parameterName = ((WorkItemColumnParameterValueDiffImpl) diff).getParameterName();
                    buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterValueOnly0(parameterName), diff.getOldValue(), diff.getValue(), sbFields);
                } else {
                    buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterValue(), diff.getOldValue(), diff.getValue(), sbFields);
                }
            }
        }
    }
    if (sbFields != null) {
        sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
    }
}
Also used : BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) WorkItemColumnParameterValueDiffImpl(org.drools.workbench.models.guided.dtable.shared.model.WorkItemColumnParameterValueDiffImpl)

Example 60 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.

the class AuditLogEntryCellHelper method getSafeHtml.

private SafeHtml getSafeHtml(final DeleteColumnAuditLogEntry event) {
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogDeleteColumn0(event.getColumnHeader())));
    return sb.toSafeHtml();
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Aggregations

SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)62 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)12 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)10 Column (com.google.gwt.user.cellview.client.Column)10 MenuItem (com.google.gwt.user.client.ui.MenuItem)7 Cell (com.google.gwt.cell.client.Cell)5 Command (com.google.gwt.user.client.Command)5 ClickableTextCell (com.google.gwt.cell.client.ClickableTextCell)4 TextCell (com.google.gwt.cell.client.TextCell)4 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)4 Test (org.junit.Test)4 JsArrayString (com.google.gwt.core.client.JsArrayString)3 ListHandler (com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler)3 SelectionChangeEvent (com.google.gwt.view.client.SelectionChangeEvent)3 SingleSelectionModel (com.google.gwt.view.client.SingleSelectionModel)3 Application (cz.metacentrum.perun.webgui.model.Application)3 CustomClickableTextCell (cz.metacentrum.perun.webgui.widgets.cells.CustomClickableTextCell)3 PerunAppTypeCell (cz.metacentrum.perun.webgui.widgets.cells.PerunAppTypeCell)3 AppCommand (org.rstudio.core.client.command.AppCommand)3 ButtonCell (com.google.gwt.cell.client.ButtonCell)2