Search in sources :

Example 51 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 ActionInsertFactColumnDetails details, final ActionInsertFactColumnDetails 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(ActionInsertFactCol52.FIELD_TYPE)) buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Binding(), diff.getOldValue(), diff.getValue(), sb);
            if (changedFieldName.equals(DTColumnConfig52.FIELD_HEADER)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ColumnHeader(), 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_FACT_TYPE)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.FactType(), 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(ActionInsertFactCol52.FIELD_VALUE_LIST)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ValueList(), 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(DTColumnConfig52.FIELD_HIDE_COLUMN)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.HideThisColumn(), 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 52 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 LimitedEntryActionInsertFactColumnDetails details, final LimitedEntryActionInsertFactColumnDetails 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(ActionInsertFactCol52.FIELD_TYPE)) buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Binding(), diff.getOldValue(), diff.getValue(), sb);
            if (changedFieldName.equals(DTColumnConfig52.FIELD_HEADER)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ColumnHeader(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(LimitedEntryActionInsertFactCol52.FIELD_VALUE)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Value(), 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_FACT_TYPE)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.FactType(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ActionInsertFactCol52.FIELD_IS_INSERT_LOGICAL)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.LogicallyInsert(), diff.getOldValue(), diff.getValue(), sb);
            } else if (changedFieldName.equals(ActionInsertFactCol52.FIELD_VALUE_LIST)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ValueList(), 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(DTColumnConfig52.FIELD_HIDE_COLUMN)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.HideThisColumn(), 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 53 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 LimitedEntryConditionColumnDetails details, final LimitedEntryConditionColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
    sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateCondition(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(LimitedEntryConditionCol52.FIELD_VALUE)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Value(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ConditionCol52.FIELD_FACT_FIELD)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Field(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ConditionCol52.FIELD_OPERATOR)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Operator(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ConditionCol52.FIELD_VALUE_LIST)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ValueList(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ConditionCol52.FIELD_BINDING)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Binding(), diff.getOldValue(), diff.getValue(), sbFields);
            } else if (changedFieldName.equals(ConditionCol52.FIELD_CONSTRAINT_VALUE_TYPE)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.CalculationType(), getLiteralForCalculationType((Integer) diff.getOldValue()), getLiteralForCalculationType((Integer) diff.getValue()), sbFields);
            } else if (changedFieldName.equals(DTColumnConfig52.FIELD_DEFAULT_VALUE)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DefaultValue(), 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(Pattern52.FIELD_FACT_TYPE)) {
                buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.FactType(), diff.getOldValue(), diff.getValue(), sbFields);
            }
        }
    }
    if (sbFields != null) {
        sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
    }
}
Also used : BigInteger(java.math.BigInteger) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 54 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 InsertRowAuditLogEntry event) {
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogInsertRowAt0(event.getRowIndex() + 1)));
    return sb.toSafeHtml();
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 55 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 DeleteRowAuditLogEntry event) {
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogDeleteRowAt0(event.getRowIndex() + 1)));
    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