Search in sources :

Example 11 with BindingFactory

use of org.pentaho.ui.xul.binding.BindingFactory in project data-access by pentaho.

the class GwtDatasourceSelectionDialog method xulLoaded.

public void xulLoaded(final GwtXulRunner runner) {
    try {
        GwtXulDomContainer container = (GwtXulDomContainer) runner.getXulDomContainers().get(0);
        BindingFactory bf = new GwtBindingFactory(container.getDocumentRoot());
        // begin DatasourceSelectionDialogController setup
        datasourceSelectionDialogController = new DatasourceSelectionDialogController(context);
        datasourceSelectionDialogController.setBindingFactory(bf);
        datasourceSelectionDialogController.setDatasourceService(datasourceService);
        container.addEventHandler(datasourceSelectionDialogController);
        // end DatasourceSelectionDialogController setup
        datasourceSelectionDialogController.setDatasourceDialogController(gwtDatasourceEditor);
        ResourceBundle resBundle = (ResourceBundle) container.getResourceBundles().get(0);
        GwtDatasourceMessages datasourceMessages = new GwtDatasourceMessages();
        datasourceMessages.setMessageBundle(resBundle);
        datasourceSelectionDialogController.setMessageBundle(datasourceMessages);
        runner.initialize();
        runner.start();
        initialized = true;
        if (constructorListener != null) {
            constructorListener.asyncConstructorDone(this);
        }
        datasourceSelectionDialogController.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 12 with BindingFactory

use of org.pentaho.ui.xul.binding.BindingFactory in project pentaho-kettle by pentaho.

the class AuthProviderControllerTest method setup.

@Before
public void setup() {
    BindingFactory bf = new SwtBindingFactory();
    controller = new AuthProviderController();
    controller.setResourceBundle(resourceBundle);
    providers = AuthHarness.getProviders(bf);
}
Also used : SwtBindingFactory(org.pentaho.ui.xul.swt.SwtBindingFactory) BindingFactory(org.pentaho.ui.xul.binding.BindingFactory) SwtBindingFactory(org.pentaho.ui.xul.swt.SwtBindingFactory) Before(org.junit.Before)

Example 13 with BindingFactory

use of org.pentaho.ui.xul.binding.BindingFactory in project pdi-dataservice-server-plugin by pentaho.

the class DataServiceRemapStepChooserDialogController method init.

public void init() throws InvocationTargetException, XulException {
    model.setServiceStep(stepNames.get(0));
    ((XulLabel) getElementById("label1")).setValue(BaseMessages.getString(PKG, "RemapStepChooserDialog.Label", dataService.getName()));
    SwtListbox steps = getElementById("trans-steps");
    steps.setElements(stepNames);
    BindingFactory bindingFactory = getBindingFactory();
    bindingFactory.setBindingType(Binding.Type.BI_DIRECTIONAL);
    bindingFactory.createBinding(model, "serviceStep", steps, "selectedItem").fireSourceChanged();
}
Also used : SwtListbox(org.pentaho.ui.xul.swt.tags.SwtListbox) XulLabel(org.pentaho.ui.xul.components.XulLabel) BindingFactory(org.pentaho.ui.xul.binding.BindingFactory)

Example 14 with BindingFactory

use of org.pentaho.ui.xul.binding.BindingFactory in project pdi-dataservice-server-plugin by pentaho.

the class StreamingController method initBindings.

/**
 * Inits the controller-ui bindings.
 *
 * @param model - The {@link org.pentaho.di.trans.dataservice.ui.model.DataServiceModel} dataservice model.
 * @throws InvocationTargetException
 * @throws XulException
 */
public void initBindings(DataServiceModel model) throws InvocationTargetException, XulException, KettleException {
    BindingFactory bindingFactory = getBindingFactory();
    XulRadio streamingRadioButton = getElementById("streaming-type-radio");
    XulTab streamingTab = getElementById("streaming-tab");
    XulTextbox streamingMaxRows = getElementById("streaming-max-rows");
    XulTextbox streamingMaxTime = getElementById("streaming-max-time");
    bindingFactory.setBindingType(Binding.Type.BI_DIRECTIONAL);
    // Set streaming max rows and time limit value on the text boxes.
    // Get the values from the model first and fallback to the appropriate Kettle Properties
    // if they don't exist in the mode.
    int modelStreamingMaxRows = model.getServiceMaxRows();
    streamingMaxRows.setValue(modelStreamingMaxRows > 0 ? Integer.toString(modelStreamingMaxRows) : kettleUtils.getKettleProperty("KETTLE_STREAMING_ROW_LIMIT", Integer.toString(DataServiceConstants.KETTLE_STREAMING_ROW_LIMIT)));
    long modelStreamingMaxTime = model.getServiceMaxTime();
    streamingMaxTime.setValue(modelStreamingMaxTime > 0 ? Long.toString(modelStreamingMaxTime) : kettleUtils.getKettleProperty("KETTLE_STREAMING_TIME_LIMIT", Integer.toString(DataServiceConstants.KETTLE_STREAMING_TIME_LIMIT)));
    streamingTab.setVisible(model.isStreaming());
    bindingFactory.createBinding(model, "serviceMaxRows", streamingMaxRows, "value", BindingConvertor.integer2String());
    bindingFactory.createBinding(model, "serviceMaxTime", streamingMaxTime, "value", BindingConvertor.long2String());
    bindingFactory.createBinding(streamingRadioButton, "selected", streamingTab, "visible");
}
Also used : XulRadio(org.pentaho.ui.xul.components.XulRadio) XulTextbox(org.pentaho.ui.xul.components.XulTextbox) XulTab(org.pentaho.ui.xul.components.XulTab) BindingFactory(org.pentaho.ui.xul.binding.BindingFactory)

Example 15 with BindingFactory

use of org.pentaho.ui.xul.binding.BindingFactory in project data-access by pentaho.

the class EmbeddedWizard method xulLoaded.

/*
   * (non-Javadoc)
   * 
   * @see org.pentaho.ui.xul.gwt.util.IXulLoaderCallback#xulLoaded(org.pentaho.ui.xul.gwt.GwtXulRunner)
   */
public void xulLoaded(GwtXulRunner runner) {
    mainWizardContainer = runner.getXulDomContainers().get(0);
    Document rootDocument = mainWizardContainer.getDocumentRoot();
    BindingFactory bf = new GwtBindingFactory(rootDocument);
    ResourceBundle resBundle = (ResourceBundle) mainWizardContainer.getResourceBundles().get(0);
    datasourceMessages = new GwtDatasourceMessages();
    datasourceMessages.setMessageBundle(resBundle);
    MessageHandler.getInstance().setMessages(datasourceMessages);
    connectionController = new ConnectionController(rootDocument);
    connectionController.setDatasourceModel(datasourceModel);
    // connectionController.setService(connectionService);
    mainWizardContainer.addEventHandler(connectionController);
    summaryDialogController.setBindingFactory(bf);
    mainWizardContainer.addEventHandler(summaryDialogController);
    wizardController = new MainWizardController(bf, wizardModel, datasourceService);
    mainWizardContainer.addEventHandler(wizardController);
    dialog = (XulDialog) rootDocument.getElementById(WIZARD_DIALOG_ID);
    MessageHandler.getInstance().setWizardDialog(dialog);
    datasourceController = new WizardDatasourceController();
    datasourceController.setBindingFactory(bf);
    datasourceController.setDatasourceMessages(datasourceMessages);
    mainWizardContainer.addEventHandler(datasourceController);
    mainWizardContainer.addEventHandler(MessageHandler.getInstance());
    // add the steps ..
    // physicalStep = new RelationalPhysicalStep(datasourceService, connectionService, datasourceMessages, this);
    wizardController.addWizardListener(this);
    // Controller for the File Import functionality
    FileImportController fileImportController = new FileImportController(datasourceModel, datasourceMessages);
    mainWizardContainer.addEventHandler(fileImportController);
    // init other controllers
    fileImportController.init();
    MessageHandler.getInstance().init();
    summaryDialogController.init();
    // Create the gui
    try {
        // new WizardContentPanel(wizardController).addContent(mainWizardContainer);
        wizardController.init();
        initialized = true;
    } catch (Exception throwable) {
        throwable.printStackTrace();
    }
    // Remap the upload action in development mode
    if (GWT.isScript() == false) {
        // $NON-NLS-1$
        XulFileUpload upload = (XulFileUpload) rootDocument.getElementById("fileUpload");
        // $NON-NLS-1$
        upload.setAction(GWT.getModuleBaseURL() + "UploadService");
    }
    initialized = true;
    if (asyncConstructorListener != null) {
        asyncConstructorListener.asyncConstructorDone(this);
    }
}
Also used : FileImportController(org.pentaho.platform.dataaccess.datasource.wizard.controllers.FileImportController) XulFileUpload(org.pentaho.ui.xul.components.XulFileUpload) GwtBindingFactory(org.pentaho.ui.xul.gwt.binding.GwtBindingFactory) MainWizardController(org.pentaho.platform.dataaccess.datasource.wizard.controllers.MainWizardController) ResourceBundle(org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle) Document(org.pentaho.ui.xul.dom.Document) ConnectionController(org.pentaho.platform.dataaccess.datasource.wizard.controllers.ConnectionController) WizardDatasourceController(org.pentaho.platform.dataaccess.datasource.wizard.controllers.WizardDatasourceController) DatasourceServiceException(org.pentaho.platform.dataaccess.datasource.wizard.service.DatasourceServiceException) BindingFactory(org.pentaho.ui.xul.binding.BindingFactory) GwtBindingFactory(org.pentaho.ui.xul.gwt.binding.GwtBindingFactory)

Aggregations

BindingFactory (org.pentaho.ui.xul.binding.BindingFactory)17 GwtBindingFactory (org.pentaho.ui.xul.gwt.binding.GwtBindingFactory)7 ResourceBundle (org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle)4 GwtDatasourceMessages (org.pentaho.platform.dataaccess.datasource.wizard.GwtDatasourceMessages)3 XulRadio (org.pentaho.ui.xul.components.XulRadio)3 XulTextbox (org.pentaho.ui.xul.components.XulTextbox)3 Matchers.anyString (org.mockito.Matchers.anyString)2 JoinTableModel (org.pentaho.agilebi.modeler.models.JoinTableModel)2 BaseMessages.getString (org.pentaho.di.i18n.BaseMessages.getString)2 XulComponent (org.pentaho.ui.xul.XulComponent)2 Binding (org.pentaho.ui.xul.binding.Binding)2 GwtXulDomContainer (org.pentaho.ui.xul.gwt.GwtXulDomContainer)2 MalformedURLException (java.net.MalformedURLException)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 List (java.util.List)1 FileObject (org.apache.commons.vfs2.FileObject)1 FileSystemException (org.apache.commons.vfs2.FileSystemException)1 SWTException (org.eclipse.swt.SWTException)1 SashForm (org.eclipse.swt.custom.SashForm)1