Search in sources :

Example 1 with ResourceBundle

use of org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle in project pentaho-platform by pentaho.

the class MantleEntryPoint method onModuleLoad.

/**
 * This is the entry point method.
 */
public void onModuleLoad() {
    // which comes from the url parameter
    if (!StringUtils.isEmpty(Window.Location.getParameter("locale"))) {
        String locale = Window.Location.getParameter("locale");
        // $NON-NLS-1$
        final String url = GWT.getHostPageBaseURL() + "api/mantle/locale";
        RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url);
        builder.setHeader("If-Modified-Since", "01 Jan 1970 00:00:00 GMT");
        try {
            builder.sendRequest(locale, new RequestCallback() {

                public void onError(Request request, Throwable exception) {
                // showError(exception);
                }

                public void onResponseReceived(Request request, Response response) {
                }
            });
        } catch (RequestException e) {
        // showError(e);
        }
    }
    ResourceBundle messages = new ResourceBundle();
    Messages.setResourceBundle(messages);
    // $NON-NLS-1$ //$NON-NLS-2$
    messages.loadBundle(GWT.getModuleBaseURL() + "messages/", "mantleMessages", true, MantleEntryPoint.this);
}
Also used : Response(com.google.gwt.http.client.Response) RequestBuilder(com.google.gwt.http.client.RequestBuilder) RequestCallback(com.google.gwt.http.client.RequestCallback) Request(com.google.gwt.http.client.Request) ResourceBundle(org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle) RequestException(com.google.gwt.http.client.RequestException)

Example 2 with ResourceBundle

use of org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle in project data-access by pentaho.

the class EmbeddedWizard method loadXul.

private void loadXul() {
    String url = GWT.getModuleBaseURL();
    bundle = new ResourceBundle(url, "modeler", true, this);
    AsyncXulLoader.loadXulFromUrl(url + MAIN_WIZARD_PANEL, GWT.getModuleBaseURL() + MAIN_WIZARD_PANEL_PACKAGE, EmbeddedWizard.this);
}
Also used : ResourceBundle(org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle)

Example 3 with ResourceBundle

use of org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle in project data-access by pentaho.

the class GwtDatasourceAdminDialog method xulLoaded.

public void xulLoaded(final GwtXulRunner runner) {
    try {
        GwtXulDomContainer container = (GwtXulDomContainer) runner.getXulDomContainers().get(0);
        BindingFactory bf = new GwtBindingFactory(container.getDocumentRoot());
        ResourceBundle resBundle = (ResourceBundle) container.getResourceBundles().get(0);
        datasourceMessages = new GwtDatasourceMessages();
        datasourceMessages.setMessageBundle(resBundle);
        datasourceAdminDialogController = new DatasourceAdminDialogController();
        datasourceAdminDialogController.setBindingFactory(bf);
        datasourceAdminDialogController.setDatasourceServiceManager(genericDatasourceServiceManager);
        datasourceAdminDialogController.setModelerService(modelerService);
        datasourceAdminDialogController.setDSWService(dswService);
        datasourceAdminDialogController.setEntryPoint(entryPoint);
        datasourceAdminDialogController.setMessageBundle(datasourceMessages);
        container.addEventHandler(datasourceAdminDialogController);
        runner.initialize();
        runner.start();
        initialized = true;
        if (constructorListener != null) {
            constructorListener.asyncConstructorDone(this);
        }
        datasourceAdminDialogController.onDialogReady();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : GwtDatasourceMessages(org.pentaho.platform.dataaccess.datasource.wizard.GwtDatasourceMessages) GwtBindingFactory(org.pentaho.ui.xul.gwt.binding.GwtBindingFactory) ResourceBundle(org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle) GwtXulDomContainer(org.pentaho.ui.xul.gwt.GwtXulDomContainer) BindingFactory(org.pentaho.ui.xul.binding.BindingFactory) GwtBindingFactory(org.pentaho.ui.xul.gwt.binding.GwtBindingFactory)

Example 4 with ResourceBundle

use of org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle in project data-access by pentaho.

the class GwtImportDialog method xulLoaded.

public void xulLoaded(GwtXulRunner runner) {
    try {
        XulDomContainer container = runner.getXulDomContainers().get(0);
        BindingFactory bf = new GwtBindingFactory(container.getDocumentRoot());
        ResourceBundle resBundle = (ResourceBundle) container.getResourceBundles().get(0);
        datasourceMessages = new GwtDatasourceMessages();
        datasourceMessages.setMessageBundle(resBundle);
        metadataImportDialogController = new MetadataImportDialogController();
        metadataImportDialogController.setBindingFactory(bf);
        container.addEventHandler(metadataImportDialogController);
        metadataImportDialogController.setDatasourceMessages(datasourceMessages);
        analysisImportDialogController = new AnalysisImportDialogController();
        analysisImportDialogController.setBindingFactory(bf);
        container.addEventHandler(analysisImportDialogController);
        analysisImportDialogController.setDatasourceMessages(datasourceMessages);
        importDialogController = new ImportDialogController();
        importDialogController.addImportPerspective(0, metadataImportDialogController);
        importDialogController.addImportPerspective(1, analysisImportDialogController);
        container.addEventHandler(importDialogController);
        runner.initialize();
        runner.start();
        importDialogController.init();
        metadataImportDialogController.init();
        analysisImportDialogController.init();
        if (constructorListener != null) {
            constructorListener.asyncConstructorDone(this);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : GwtDatasourceMessages(org.pentaho.platform.dataaccess.datasource.wizard.GwtDatasourceMessages) GwtBindingFactory(org.pentaho.ui.xul.gwt.binding.GwtBindingFactory) ResourceBundle(org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle) XulDomContainer(org.pentaho.ui.xul.XulDomContainer) BindingFactory(org.pentaho.ui.xul.binding.BindingFactory) GwtBindingFactory(org.pentaho.ui.xul.gwt.binding.GwtBindingFactory)

Example 5 with ResourceBundle

use of org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle in project data-access by pentaho.

the class ModelerDialog method xulLoaded.

public void xulLoaded(GwtXulRunner gwtXulRunner) {
    container = gwtXulRunner.getXulDomContainers().get(0);
    container.addEventHandler(this);
    BogoPojo bogo = new BogoPojo();
    service.gwtWorkaround(bogo, new XulServiceCallback<BogoPojo>() {

        public void success(BogoPojo retVal) {
        }

        public void error(String message, Throwable error) {
        }
    });
    datasourceService = new DSWDatasourceServiceGwtImpl();
    // connectionService = new ConnectionServiceGwtImpl();
    csvService = (ICsvDatasourceServiceAsync) GWT.create(ICsvDatasourceService.class);
    if (wizard == null) {
        wizard = new EmbeddedWizard(false);
        wizard.setDatasourceService(datasourceService);
        // wizard.setConnectionService(connectionService);
        wizard.setCsvDatasourceService(csvService);
        wizard.init(null);
    }
    messages = new GwtModelerMessages((ResourceBundle) container.getResourceBundles().get(0));
    try {
        ModelerMessagesHolder.setMessages(messages);
    } catch (Exception ignored) {
    // Messages may have been set earlier, ignore.
    }
    IModelerWorkspaceHelper workspacehelper = model.getWorkspaceHelper();
    controller = new ModelerController(model);
    controller.setWorkspaceHelper(workspacehelper);
    // controller.setMessages(messages);
    final BindingFactory bf = new GwtBindingFactory(container.getDocumentRoot());
    controller.setBindingFactory(bf);
    container.addEventHandler(controller);
    try {
        controller.init();
    } catch (ModelerException e) {
        e.printStackTrace();
    }
    bf.setBindingType(Binding.Type.ONE_WAY);
    bf.createBinding(model, "valid", "modeler_dialog_accept", "disabled", new BindingConvertor<Boolean, Boolean>() {

        @Override
        public Boolean sourceToTarget(Boolean value) {
            return !value;
        }

        @Override
        public Boolean targetToSource(Boolean value) {
            return !value;
        }
    });
    bf.setBindingType(Binding.Type.BI_DIRECTIONAL);
    // go get the geocontext from the server. Prop forms are initialized after this call returns as they
    // may need them to create the UI
    datasourceService.getGeoContext(new XulServiceCallback<GeoContext>() {

        public void success(GeoContext geoContext) {
            model.setGeoContext(geoContext);
            ModelerUiHelper.configureControllers(container, model, bf, controller, new ColResolverController());
            ModelerDialog.this.constructorListener.asyncConstructorDone(ModelerDialog.this);
        }

        public void error(String s, Throwable throwable) {
            throwable.printStackTrace();
            // put in a stub to ensure the rest of the dialog works
            model.setGeoContext(new GeoContext());
            ModelerUiHelper.configureControllers(container, model, bf, controller, new ColResolverController());
            ModelerDialog.this.constructorListener.asyncConstructorDone(ModelerDialog.this);
        }
    });
}
Also used : ModelerException(org.pentaho.agilebi.modeler.ModelerException) EmbeddedWizard(org.pentaho.platform.dataaccess.datasource.wizard.EmbeddedWizard) ModelerController(org.pentaho.agilebi.modeler.ModelerController) GwtModelerMessages(org.pentaho.agilebi.modeler.gwt.GwtModelerMessages) ModelerException(org.pentaho.agilebi.modeler.ModelerException) GeoContext(org.pentaho.agilebi.modeler.geo.GeoContext) ColResolverController(org.pentaho.agilebi.modeler.ColResolverController) IModelerWorkspaceHelper(org.pentaho.agilebi.modeler.IModelerWorkspaceHelper) GwtBindingFactory(org.pentaho.ui.xul.gwt.binding.GwtBindingFactory) ResourceBundle(org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle) DSWDatasourceServiceGwtImpl(org.pentaho.platform.dataaccess.datasource.wizard.service.impl.DSWDatasourceServiceGwtImpl) BogoPojo(org.pentaho.agilebi.modeler.gwt.BogoPojo) BindingFactory(org.pentaho.ui.xul.binding.BindingFactory) GwtBindingFactory(org.pentaho.ui.xul.gwt.binding.GwtBindingFactory)

Aggregations

ResourceBundle (org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle)8 BindingFactory (org.pentaho.ui.xul.binding.BindingFactory)5 GwtBindingFactory (org.pentaho.ui.xul.gwt.binding.GwtBindingFactory)5 GwtDatasourceMessages (org.pentaho.platform.dataaccess.datasource.wizard.GwtDatasourceMessages)3 GwtXulDomContainer (org.pentaho.ui.xul.gwt.GwtXulDomContainer)2 JsArrayString (com.google.gwt.core.client.JsArrayString)1 Request (com.google.gwt.http.client.Request)1 RequestBuilder (com.google.gwt.http.client.RequestBuilder)1 RequestCallback (com.google.gwt.http.client.RequestCallback)1 RequestException (com.google.gwt.http.client.RequestException)1 Response (com.google.gwt.http.client.Response)1 ColResolverController (org.pentaho.agilebi.modeler.ColResolverController)1 IModelerWorkspaceHelper (org.pentaho.agilebi.modeler.IModelerWorkspaceHelper)1 ModelerController (org.pentaho.agilebi.modeler.ModelerController)1 ModelerException (org.pentaho.agilebi.modeler.ModelerException)1 GeoContext (org.pentaho.agilebi.modeler.geo.GeoContext)1 BogoPojo (org.pentaho.agilebi.modeler.gwt.BogoPojo)1 GwtModelerMessages (org.pentaho.agilebi.modeler.gwt.GwtModelerMessages)1 IResourceBundleLoadCallback (org.pentaho.gwt.widgets.client.utils.i18n.IResourceBundleLoadCallback)1 EmbeddedWizard (org.pentaho.platform.dataaccess.datasource.wizard.EmbeddedWizard)1