GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(connectButton);
connectButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Job job = new Job(Messages.CloudFoundryServerStatusSection_JOB_CONN_SERVER) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
cfServer.getBehaviour().connect(monitor);
}
catch (CoreException e) {
StatusManager.getManager().handle(new Status(Status.ERROR, CloudFoundryServerUiPlugin.PLUGIN_ID, "", e), StatusManager.LOG); //$NON-NLS-1$
return Status.CANCEL_STATUS;
}
return Status.OK_STATUS;
}
};
job.schedule();
}
});
disconnectButton = toolkit.createButton(composite, Messages.CloudFoundryServerStatusSection_TEXT_DISCONN_BUTTON, SWT.PUSH);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(disconnectButton);
disconnectButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Job job = new Job(Messages.CloudFoundryServerStatusSection_JOB_CONN_SERVER) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
cfServer.getBehaviour().disconnect(monitor);
}
catch (CoreException e) {
StatusManager.getManager().handle(new Status(Status.ERROR, CloudFoundryServerUiPlugin.PLUGIN_ID, "", e), StatusManager.LOG); //$NON-NLS-1$
return Status.CANCEL_STATUS;
}
return Status.OK_STATUS;
}
};
job.schedule();
}
});
update();