Search in sources :

Example 1 with ResourcePlace

use of org.activityinfo.ui.client.page.resource.ResourcePlace in project activityinfo by bedatadriven.

the class DbEditor method onUIAction.

private void onUIAction(String actionId) {
    if (UIActions.SAVE.equals(actionId)) {
        save();
    } else if (UIActions.DELETE.equals(actionId)) {
        promptDeleteSelection();
    } else if (UIActions.IMPORT.equals(actionId)) {
        SchemaImportDialog dialog = new SchemaImportDialog(new SchemaImporterV2(service, db), new SchemaImporterV3(db.getId(), locator));
        dialog.show().then(() -> {
            refresh();
            return null;
        });
    } else if (UIActions.EDIT.equals(actionId)) {
        Optional<ResourceId> selectedFormId = getSelectedFormId();
        if (selectedFormId.isPresent()) {
            eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, new ResourcePlace(selectedFormId.get(), ResourcePage.DESIGN_PAGE_ID)));
        }
    } else if (UIActions.OPEN_TABLE.equals(actionId)) {
        Optional<ResourceId> selectedFormId = getSelectedFormId();
        if (selectedFormId.isPresent()) {
            App3.openNewTable(selectedFormId.get());
        }
    }
}
Also used : SchemaImporterV3(org.activityinfo.ui.client.page.config.design.importer.SchemaImporterV3) ResourcePlace(org.activityinfo.ui.client.page.resource.ResourcePlace) ResourceId(org.activityinfo.model.resource.ResourceId) SchemaImportDialog(org.activityinfo.ui.client.page.config.design.importer.SchemaImportDialog) SchemaImporterV2(org.activityinfo.ui.client.page.config.design.importer.SchemaImporterV2)

Example 2 with ResourcePlace

use of org.activityinfo.ui.client.page.resource.ResourcePlace in project activityinfo by bedatadriven.

the class FormPageLoader method load.

@Override
public void load(final PageId pageId, final PageState pageState, final AsyncCallback<Page> callback) {
    BaseStylesheet.INSTANCE.ensureInjected();
    GWT.runAsync(new RunAsyncCallback() {

        @Override
        public void onSuccess() {
            if (pageState instanceof ResourcePlace) {
                ResourcePlace resourcePlace = (ResourcePlace) pageState;
                ResourcePage page = new ResourcePage(eventBus, resourceLocator, resourcePlace.getPageId(), stateProvider);
                page.navigate(pageState);
                callback.onSuccess(page);
            }
        }

        @Override
        public void onFailure(Throwable throwable) {
            callback.onFailure(throwable);
        }
    });
}
Also used : ResourcePlace(org.activityinfo.ui.client.page.resource.ResourcePlace) RunAsyncCallback(com.google.gwt.core.client.RunAsyncCallback) ResourcePage(org.activityinfo.ui.client.page.resource.ResourcePage)

Example 3 with ResourcePlace

use of org.activityinfo.ui.client.page.resource.ResourcePlace in project activityinfo by bedatadriven.

the class DataEntryPage method navigateToNewInterface.

private void navigateToNewInterface() {
    Optional<Integer> activityId = getCurrentActivityId();
    if (activityId.isPresent()) {
        ResourceId formClassId = CuidAdapter.activityFormClass(activityId.get());
        eventBus.fireEvent(new NavigationEvent(NavigationHandler.NAVIGATION_REQUESTED, new ResourcePlace(formClassId, ResourcePage.TABLE_PAGE_ID)));
    }
}
Also used : ResourcePlace(org.activityinfo.ui.client.page.resource.ResourcePlace) ResourceId(org.activityinfo.model.resource.ResourceId)

Aggregations

ResourcePlace (org.activityinfo.ui.client.page.resource.ResourcePlace)3 ResourceId (org.activityinfo.model.resource.ResourceId)2 RunAsyncCallback (com.google.gwt.core.client.RunAsyncCallback)1 SchemaImportDialog (org.activityinfo.ui.client.page.config.design.importer.SchemaImportDialog)1 SchemaImporterV2 (org.activityinfo.ui.client.page.config.design.importer.SchemaImporterV2)1 SchemaImporterV3 (org.activityinfo.ui.client.page.config.design.importer.SchemaImporterV3)1 ResourcePage (org.activityinfo.ui.client.page.resource.ResourcePage)1