disableBtn.addClickHandler(disableHandler);
topLevelTools.addToolButtonRight(disableBtn);
// -----
TabPanel bottomPanel = new TabPanel();
bottomPanel.setStyleName("default-tabpanel");
bottomPanel.add(details.asWidget(), "Attributes");
details.getForm().bind(dataSourceTable);
final FormToolStrip.FormCallback<XADataSource> xaCallback = new FormToolStrip.FormCallback<XADataSource>() {
@Override
public void onSave(Map<String, Object> changeset) {
DataSource ds = getCurrentSelection();
presenter.onSaveXADetails(ds.getName(), changeset);
}
@Override
public void onDelete(XADataSource entity) {
// n/a
}
};
final FormToolStrip.FormCallback<DataSource> dsCallback = new FormToolStrip.FormCallback<DataSource>() {
@Override
public void onSave(Map<String, Object> changeset) {
DataSource ds = getCurrentSelection();
presenter.onSaveXADetails(ds.getName(), changeset);
}
@Override
public void onDelete(DataSource entity) {
// n/a
}
};
connectionEditor = new XADataSourceConnection(presenter, xaCallback);
connectionEditor.getForm().bind(dataSourceTable);
bottomPanel.add(connectionEditor.asWidget(), "Connection");
securityEditor = new DataSourceSecurityEditor(dsCallback);
securityEditor.getForm().bind(dataSourceTable);
bottomPanel.add(securityEditor.asWidget(), "Security");
bottomPanel.add(propertyEditor.asWidget(), "Properties");
poolConfig = new PoolConfigurationView(new PoolManagement() {
@Override
public void onSavePoolConfig(String parentName, Map<String, Object> changeset) {
presenter.onSavePoolConfig(parentName, changeset, true);
}
@Override
public void onResetPoolConfig(String parentName, PoolConfig entity) {
presenter.onDeletePoolConfig(parentName, entity, true);
}
@Override
public void onDoFlush(String editedName) {
presenter.onDoFlush(true, editedName);
}
});
bottomPanel.add(poolConfig.asWidget(), "Pool");
poolConfig.getForm().bind(dataSourceTable);
validationEditor = new DataSourceValidationEditor(dsCallback);
validationEditor.getForm().bind(dataSourceTable);
bottomPanel.add(validationEditor.asWidget(), "Validation");
timeoutEditor = new DataSourceTimeoutEditor<XADataSource>(xaCallback, true);
timeoutEditor.getForm().bind(dataSourceTable);
bottomPanel.add(timeoutEditor.asWidget(), "Timeouts");
bottomPanel.selectTab(0);
vpanel.add(new ContentGroupLabel(Console.CONSTANTS.common_label_selection()));
vpanel.add(bottomPanel);
return layout;
}