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();
}
}
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);
}
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();
}
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");
}
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);
}
}
Aggregations