spacer = new VerticalPanel();
spacer.setHeight( "4px" );
rootPanel.add( spacer );
DisclosurePanel disclosurePanel = new DisclosurePanel( Messages.getString( "advancedOptions" ) );
disclosurePanel.getHeader().setStyleName( "gwt-Label" );
HorizontalPanel mainPanel = new HorizontalPanel();
mainPanel.add( new HTML( " " ) );
VerticalPanel disclosureContent = new VerticalPanel();
HTML replaceLabel = new HTML( Messages.getString( "fileExists" ) );
replaceLabel.setStyleName( "gwt-Label" );
disclosureContent.add( replaceLabel );
final CustomListBox overwriteFileDropDown = new CustomListBox();
final CustomListBox filePermissionsDropDown = new CustomListBox();
DefaultListItem replaceListItem = new DefaultListItem( Messages.getString( "replaceFile" ) );
replaceListItem.setValue( "true" );
overwriteFileDropDown.addItem( replaceListItem );
DefaultListItem doNotImportListItem = new DefaultListItem( Messages.getString( "doNotImport" ) );
doNotImportListItem.setValue( "false" );
overwriteFileDropDown.addItem( doNotImportListItem );
overwriteFileDropDown.setVisibleRowCount( 1 );
disclosureContent.add( overwriteFileDropDown );
spacer = new VerticalPanel();
spacer.setHeight( "4px" );
disclosureContent.add( spacer );
HTML filePermissionsLabel = new HTML( Messages.getString( "filePermissions" ) );
filePermissionsLabel.setStyleName( "gwt-Label" );
disclosureContent.add( filePermissionsLabel );
DefaultListItem usePermissionsListItem = new DefaultListItem( Messages.getString( "usePermissions" ) );
usePermissionsListItem.setValue( "false" );
filePermissionsDropDown.addItem( usePermissionsListItem ); // If selected set "overwriteAclPermissions" to
// false.
DefaultListItem retainPermissionsListItem = new DefaultListItem( Messages.getString( "retainPermissions" ) );
retainPermissionsListItem.setValue( "true" );
filePermissionsDropDown.addItem( retainPermissionsListItem ); // If selected set "overwriteAclPermissions" to
// true.
final ChangeListener filePermissionsHandler = new ChangeListener() {
@Override
public void onChange( Widget sender ) {
String value = filePermissionsDropDown.getSelectedItem().getValue().toString();
applyAclPermissions.setValue( Boolean.valueOf( value ) );
applyAclPermissions.setFormValue( value );
overwriteAclPermissions.setFormValue( value );
overwriteAclPermissions.setValue( Boolean.valueOf( value ) );
setRetainOwnershipState();
}
};
filePermissionsDropDown.addChangeListener( filePermissionsHandler );
filePermissionsDropDown.setVisibleRowCount( 1 );
disclosureContent.add( filePermissionsDropDown );
spacer = new VerticalPanel();
spacer.setHeight( "4px" );
disclosureContent.add( spacer );
HTML fileOwnershipLabel = new HTML( Messages.getString( "fileOwnership" ) );
fileOwnershipLabel.setStyleName( "gwt-Label" );
disclosureContent.add( fileOwnershipLabel );
retainOwnershipDropDown.addChangeListener( new ChangeListener() {
@Override
public void onChange( Widget sender ) {
String value = retainOwnershipDropDown.getSelectedItem().getValue().toString();
retainOwnership.setValue( value );
}
} );
DefaultListItem keepOwnershipListItem = new DefaultListItem( Messages.getString( "keepOwnership" ) );
keepOwnershipListItem.setValue( "true" );
retainOwnershipDropDown.addItem( keepOwnershipListItem );
DefaultListItem assignOwnershipListItem = new DefaultListItem( Messages.getString( "assignOwnership" ) );
assignOwnershipListItem.setValue( "false" );
retainOwnershipDropDown.addItem( assignOwnershipListItem );
retainOwnershipDropDown.setVisibleRowCount( 1 );
disclosureContent.add( retainOwnershipDropDown );
spacer = new VerticalPanel();
spacer.setHeight( "4px" );
disclosureContent.add( spacer );
ChangeListener overwriteFileHandler = new ChangeListener() {
@Override
public void onChange( Widget sender ) {
String value = overwriteFileDropDown.getSelectedItem().getValue().toString();
overwriteFile.setValue( value );
}
};
overwriteFileDropDown.addChangeListener( overwriteFileHandler );
HTML loggingLabel = new HTML( Messages.getString( "logging" ) );
loggingLabel.setStyleName( "gwt-Label" );
disclosureContent.add( loggingLabel );
final CustomListBox loggingDropDown = new CustomListBox();
loggingDropDown.addChangeListener( new ChangeListener() {
public void onChange( Widget sender ) {
String value = loggingDropDown.getSelectedItem().getValue().toString();
logLevel.setValue( value );
}
} );
DefaultListItem noneListItem = new DefaultListItem( Messages.getString( "none" ) );
noneListItem.setValue( "ERROR" );
loggingDropDown.addItem( noneListItem );
DefaultListItem shortListItem = new DefaultListItem( Messages.getString( "short" ) );
shortListItem.setValue( "WARN" );
loggingDropDown.addItem( shortListItem );
DefaultListItem debugListItem = new DefaultListItem( Messages.getString( "verbose" ) );
debugListItem.setValue( "TRACE" );
loggingDropDown.addItem( debugListItem );
loggingDropDown.setVisibleRowCount( 1 );
disclosureContent.add( loggingDropDown );
mainPanel.add( disclosureContent );
disclosurePanel.setContent( mainPanel );
rootPanel.add( disclosurePanel );
importDir.setName( "importDir" );
importDir.setText( repositoryFile.getPath() );
importDir.setVisible( false );