Search in sources :

Example 1 with DataModelerErrorCallback

use of org.kie.workbench.common.screens.datamodeller.client.DataModelerErrorCallback in project kie-wb-common by kiegroup.

the class DataObjectBrowser method openDataObject.

private void openDataObject(final DataObject dataObject) {
    final Path objectPath = getContext().getDataObjectPath(dataObject.getClassName());
    if (objectPath != null) {
        view.showBusyIndicator(org.kie.workbench.common.widgets.client.resources.i18n.CommonConstants.INSTANCE.Loading());
        modelerService.call(new RemoteCallback<Boolean>() {

            @Override
            public void callback(Boolean exists) {
                view.hideBusyIndicator();
                if (Boolean.TRUE.equals(exists)) {
                    placeManager.goTo(new PathPlaceRequest(objectPath));
                } else {
                    view.showYesNoCancelPopup(CommonConstants.INSTANCE.Warning(), Constants.INSTANCE.objectBrowser_message_file_not_exists_or_renamed(objectPath.toURI()), new Command() {

                        @Override
                        public void execute() {
                        // do nothing.
                        }
                    }, CommonConstants.INSTANCE.Close(), ButtonType.WARNING, null, null, null, null, null, null);
                }
            }
        }, new DataModelerErrorCallback(CommonConstants.INSTANCE.ExceptionNoSuchFile0(objectPath.toURI()))).exists(objectPath);
    }
}
Also used : Path(org.uberfire.backend.vfs.Path) DataModelCommand(org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand) Command(org.uberfire.mvp.Command) AddPropertyCommand(org.kie.workbench.common.screens.datamodeller.client.command.AddPropertyCommand) PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) DataModelerErrorCallback(org.kie.workbench.common.screens.datamodeller.client.DataModelerErrorCallback) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Aggregations

RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)1 DataModelerErrorCallback (org.kie.workbench.common.screens.datamodeller.client.DataModelerErrorCallback)1 AddPropertyCommand (org.kie.workbench.common.screens.datamodeller.client.command.AddPropertyCommand)1 DataModelCommand (org.kie.workbench.common.screens.datamodeller.client.command.DataModelCommand)1 Path (org.uberfire.backend.vfs.Path)1 Command (org.uberfire.mvp.Command)1 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)1