}
private void createTableControls( final ClickHandler newBlockoutHandler ) {
tableControls.addSpacer( 10 );
tableControls.add( Toolbar.GLUE );
ToolbarButton addButton = new ToolbarButton( ImageUtil.getThemeableImage( "pentaho-addbutton" ) );
addButton.setCommand( new Command() {
@Override
public void execute() {
newBlockoutHandler.onClick( null );
}
} );
addButton.setToolTip( Messages.getString( "blockoutAdd" ) );
editButton = new ToolbarButton( ImageUtil.getThemeableImage( "pentaho-editbutton" ) );
editButton.setEnabled( false );
editButton.setCommand( new Command() {
@Override
public void execute() {
Set<JsJob> jobs = getSelectedSet();
final JsJob jsJob = jobs.iterator().next();
IDialogCallback callback = new IDialogCallback() {
public void okPressed() {
// delete the old one
removeBlockout( jsJob );
refreshCallBack.okPressed();
}
public void cancelPressed() {
refreshCallBack.cancelPressed();
}
};
NewBlockoutScheduleDialog blockoutDialog = new NewBlockoutScheduleDialog( jsJob, callback, false, true );
table.selectRow( list.indexOf( jsJob ) );
blockoutDialog.setUpdateMode();
blockoutDialog.center();
}
} );
editButton.setToolTip( Messages.getString( "blockoutEdit" ) );
removeButton = new ToolbarButton( ImageUtil.getThemeableImage( "pentaho-deletebutton" ) );
removeButton.setEnabled( false );
removeButton.setCommand( new Command() {
public void execute() {
final Set<JsJob> selectedSet = getSelectedSet();