use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class QueryPhysicalStep method init.
@Bindable
public void init(IWizardModel wizardModel) throws XulException {
// $NON-NLS-1$
datasourceNameTextBox = (XulTextbox) document.getElementById("datasourceName");
wizardConnectionController = new WizardConnectionController(document);
wizardConnectionController.setDatasourceModel(datasourceModel);
// wizardConnectionController.setConnectionService(connectionService);
getXulDomContainer().addEventHandler(wizardConnectionController);
wizardConnectionController.init();
databaseConnectionController = new ConnectionController(document);
databaseConnectionController.setDatasourceModel(datasourceModel);
// databaseConnectionController.setService(connectionService);
databaseConnectionController.reloadConnections();
WizardRelationalDatasourceController relationalDatasourceController = new WizardRelationalDatasourceController();
relationalDatasourceController.setService(datasourceService);
getXulDomContainer().addEventHandler(relationalDatasourceController);
relationalDatasourceController.init(datasourceModel);
initialize();
datasourceModel.clearModel();
super.init(wizardModel);
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class AnalysisImportDialogModel method setConnection.
@Bindable
public void setConnection(IDatabaseConnection value) {
IDatabaseConnection previousValue = connection;
connection = value;
firePropertyChange("connection", previousValue, value);
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class MetadataImportDialogController method addLocalizedBundle.
@Bindable
public void addLocalizedBundle() {
final FileUpload localizedBundleUpload = new FileUpload();
localizedBundleUpload.setName("localeFiles");
localizedBundleUpload.getElement().setId("propertyFileUpload" + FILE_UPLOAD_SUFFIX++);
localizedBundleUpload.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
String fileName = ((FileUpload) event.getSource()).getFilename();
if (fileName == null || fileName.length() < 1) {
// Trying to detect a cancel
propertiesFileImportPanel.remove(localizedBundleUpload);
} else {
importDialogModel.addLocalizedBundle(fileName, fileName);
}
}
});
propertiesFileImportPanel.add(localizedBundleUpload);
jsClickUpload(localizedBundleUpload.getElement().getId());
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class ConnectionController method addConnection.
@Bindable
public void addConnection() {
RequestBuilder addConnectionBuilder = new RequestBuilder(RequestBuilder.POST, ConnectionController.getServiceURL("add"));
addConnectionBuilder.setHeader("Content-Type", "application/json");
try {
AutoBean<IDatabaseConnection> bean = createIDatabaseConnectionBean(currentConnection);
addConnectionBuilder.sendRequest(AutoBeanCodex.encode(bean).getPayload(), new RequestCallback() {
@Override
public void onError(Request request, Throwable exception) {
displayErrorMessage(exception);
}
@Override
public void onResponseReceived(Request request, Response response) {
try {
if (response.getStatusCode() == Response.SC_OK) {
datasourceModel.getGuiStateModel().addConnection(currentConnection);
datasourceModel.setSelectedRelationalConnection(currentConnection);
DialogListener dialogListener = connectionSetter.getOuterListener();
if (dialogListener != null) {
dialogListener.onDialogAccept(currentConnection);
}
} else {
openErrorDialog(MessageHandler.getString("ERROR"), // $NON-NLS-1$
MessageHandler.getString(// $NON-NLS-1$
"ConnectionController.ERROR_0001_UNABLE_TO_ADD_CONNECTION"));
}
} catch (Exception e) {
displayErrorMessage(e);
}
}
});
} catch (RequestException e) {
displayErrorMessage(e);
}
}
use of org.pentaho.ui.xul.stereotype.Bindable in project data-access by pentaho.
the class ConnectionController method toggleSuccessDetails.
@Bindable
public void toggleSuccessDetails() {
// $NON-NLS-1$
XulHbox details = (XulHbox) document.getElementById("success_details_hider");
details.setVisible(!details.isVisible());
}
Aggregations