Search in sources :

Example 1 with FormEditorSyncPaletteEvent

use of org.kie.workbench.common.forms.editor.client.editor.events.FormEditorSyncPaletteEvent in project kie-wb-common by kiegroup.

the class FormEditorPresenterTest method testOnSyncPaletteEventHandler.

@Test
public void testOnSyncPaletteEventHandler() {
    loadContent();
    FormEditorPresenter presenterSpy = spy(presenter);
    String formId = presenterSpy.getFormDefinition().getId();
    FormEditorSyncPaletteEvent event = new FormEditorSyncPaletteEvent(formId);
    presenterSpy.onSyncPalette(event);
    verify(presenterSpy).onSyncPalette(formId);
}
Also used : FormEditorSyncPaletteEvent(org.kie.workbench.common.forms.editor.client.editor.events.FormEditorSyncPaletteEvent) Mockito.anyString(org.mockito.Mockito.anyString) Test(org.junit.Test)

Example 2 with FormEditorSyncPaletteEvent

use of org.kie.workbench.common.forms.editor.client.editor.events.FormEditorSyncPaletteEvent in project kie-wb-common by kiegroup.

the class EditorFieldLayoutComponent method onPressOk.

protected void onPressOk(FieldDefinition fieldCopy) {
    editorHelper.saveFormField(field, fieldCopy);
    this.field = fieldCopy;
    this.fieldId = Optional.of(fieldCopy.getId());
    initComponent();
    renderContent();
    showProperties = false;
    if (configContext != null) {
        configContext.getComponentProperties().put(FORM_ID, getFormId());
        configContext.getComponentProperties().put(FIELD_ID, field.getId());
        configContext.configurationFinished();
        configContext = null;
    }
    syncPaletteEvent.fire(new FormEditorSyncPaletteEvent(getFormId()));
}
Also used : FormEditorSyncPaletteEvent(org.kie.workbench.common.forms.editor.client.editor.events.FormEditorSyncPaletteEvent)

Aggregations

FormEditorSyncPaletteEvent (org.kie.workbench.common.forms.editor.client.editor.events.FormEditorSyncPaletteEvent)2 Test (org.junit.Test)1 Mockito.anyString (org.mockito.Mockito.anyString)1