public RepoConfigManager() {
PrettyFormLayout form = new PrettyFormLayout();
form.addHeader( GuvnorImages.INSTANCE.Config(),
new HTML( constants.ManageRepositoryConfig() ) );
DockPanel dock = new DockPanel();
dock.setSpacing( 4 );
dock.setHorizontalAlignment( DockPanel.ALIGN_CENTER );
HorizontalPanel hPanel1 = new HorizontalPanel();
hPanel1.add(getDbTypePanel());
VerticalPanel dataInputPanel = new VerticalPanel();
dataInputPanel.add(hPanel1);
SimplePanel divider = new SimplePanel();
divider.setSize( "100px",
"30px" );
vPanel2.add( divider );
vPanel2.add( noJndiInfo );
vPanel2.add( jndiInfo );
vPanel2.setVisible( false );
dataInputPanel.add(vPanel2);
dock.add(dataInputPanel,
DockPanel.WEST );
repoDisplayArea.setSize( "740px",
"470px" );
repoDisplayArea.setTitle( "repository.xml" );
repoDisplayArea.setVisible( false );
DockPanel idock = new DockPanel();
idock.setSpacing( 4 );
idock.setHorizontalAlignment( DockPanel.ALIGN_CENTER );
idock.add( repoDisplayArea,
DockPanel.WEST );
final Button saveButton = new Button( constants.SaveRepo() );
saveButton.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent w) {
String name = rdbmsConf.getDbType() + "-repository";
if ( rdbmsConf.isJndi() ) name += "-jndi";
hiddenRepoConfig.setValue( repoDisplayArea.getText() );
saveRepoConfigForm.submit();
}
} );
saveRepoConfigForm.setEncoding( FormPanel.ENCODING_URLENCODED );
saveRepoConfigForm.setMethod( FormPanel.METHOD_POST );
saveRepoConfigForm.setAction( GWT.getModuleBaseURL() + "backup" );
VerticalPanel formHolder = new VerticalPanel();
HorizontalPanel saveInfoHolder = new HorizontalPanel();
saveInfoHolder.add( saveButton );
saveInfoHolder.add( new InfoPopup( constants.SaveRepo(),
constants.SaveRepoInfo() ) );
formHolder.add( saveInfoHolder );
formHolder.add( hiddenRepoConfig );
saveRepoConfigForm.add( formHolder );
saveRepoConfigForm.setVisible( false );
idock.add( saveRepoConfigForm,
DockPanel.EAST );
dock.add( idock,
DockPanel.EAST );