Buggy code:
public abstract class ScheduleOutputLocationDialog extends PromptDialogBox { private String filePath ; private TextBox scheduleNameTextBox = new TextBox ( ) ; private static TextBox scheduleLocationTextBox = new TextBox ( ) ; private static HandlerRegistration changeHandlerReg = null ; private static HandlerRegistration keyHandlerReg = null ; private static native String getDefaultSaveLocation ( ) { } public ScheduleOutputLocationDialog ( final String filePath ) { } private void createUI ( ) { VerticalPanel content = new VerticalPanel ( ) ; HorizontalPanel scheduleNameLabelPanel = new HorizontalPanel ( ) ; Label scheduleNameLabel = new Label ( Messages . getString ( "scheduleNameColon" ) ) ; scheduleNameLabel . setHorizontalAlignment ( ALIGN_LEFT ) ; Label scheduleNameInfoLabel = new Label ( Messages . getString ( "scheduleNameInfo" ) ) ; scheduleNameInfoLabel . setStyleName ( "msg-Label" ) ; scheduleNameLabelPanel . add ( scheduleNameLabel ) ; scheduleNameLabelPanel . add ( scheduleNameInfoLabel ) ; String defaultName = filePath . substring ( ( ( filePath . lastIndexOf ( "//" ) ) + 1 ) , filePath . lastIndexOf ( "." ) ) ; scheduleNameTextBox . getElement ( ) . setId ( "schedule-name-input" ) ; scheduleNameTextBox . setText ( defaultName ) ; content . add ( scheduleNameLabelPanel ) ; content . add ( scheduleNameTextBox ) ; Label scheduleLocationLabel = new Label ( Messages . getString ( "generatedContentLocation" ) ) ; scheduleLocationLabel . setStyleName ( SCHEDULE_LABEL ) ; content . add ( scheduleLocationLabel ) ; Button browseButton = new Button ( Messages . getString ( "select" ) ) ; browseButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { final SelectFolderDialog selectFolder = new SelectFolderDialog ( ) ; selectFolder . setCallback ( new IDialogCallback ( ) { public void okPressed ( ) { ScheduleOutputLocationDialog . scheduleLocationTextBox . setText ( selectFolder . getSelectedPath ( ) ) ; } public void cancelPressed ( ) { } } ) ; selectFolder . center ( ) ; ScheduleOutputLocationDialog . scheduleLocationTextBox . setText ( "//home//admin" ) ; } } ) ; browseButton . setStyleName ( "pentaho-button" ) ; ChangeHandler ch = new ChangeHandler ( ) { public void onChange ( ChangeEvent event ) { updateButtonState ( ) ; } } ; KeyUpHandler kh = new KeyUpHandler ( ) { public void onKeyUp ( KeyUpEvent event ) { updateButtonState ( ) ; } } ; if ( ( ScheduleOutputLocationDialog . keyHandlerReg ) != null ) { ScheduleOutputLocationDialog . keyHandlerReg . removeHandler ( ) ; } if ( ( ScheduleOutputLocationDialog . changeHandlerReg ) != null ) { ScheduleOutputLocationDialog . changeHandlerReg . removeHandler ( ) ; } ScheduleOutputLocationDialog . keyHandlerReg = scheduleNameTextBox . addKeyUpHandler ( kh ) ; ScheduleOutputLocationDialog . changeHandlerReg = ScheduleOutputLocationDialog . scheduleLocationTextBox . addChangeHandler ( ch ) ; scheduleNameTextBox . addChangeHandler ( ch ) ; ScheduleOutputLocationDialog . scheduleLocationTextBox . getElement ( ) . setId ( "generated-content-location" ) ; HorizontalPanel locationPanel = new HorizontalPanel ( ) ; ScheduleOutputLocationDialog . scheduleLocationTextBox . setEnabled ( false ) ; locationPanel . add ( ScheduleOutputLocationDialog . scheduleLocationTextBox ) ; locationPanel . setCellVerticalAlignment ( ScheduleOutputLocationDialog . scheduleLocationTextBox , ALIGN_MIDDLE ) ; locationPanel . add ( browseButton ) ; content . add ( locationPanel ) ; setContent ( content ) ; content . getElement ( ) . getStyle ( ) . clearHeight ( ) ; content . getElement ( ) . getParentElement ( ) . getStyle ( ) . setVerticalAlign ( TOP ) ; content . getParent ( ) . setHeight ( "100%" ) ; <START_BUG> okButton . getParent ( ) . getParent ( ) . setStyleName ( "schedule-dialog-button-panel" ) ; <END_BUG> updateButtonState ( ) ; setSize ( "650px" , "450px" ) ; validateScheduleLocationTextBox ( ) ; } private void setupCallbacks ( ) { } private void updateButtonState ( ) { } private void validateScheduleLocationTextBox ( ) { } protected abstract void onSelect ( String name , String outputLocationPath ) { } public void setOkButtonText ( String text ) { } }

Fix:
okButton . getParent ( ) . getParent ( ) . setStyleName ( "button-panel" ) ;