use of java.util.Observable in project core by jcryptool.
the class IntegratorWizardPage method makeNewKey.
protected void makeNewKey() {
Job[] preJobs = Job.getJobManager().find(KeyStoreHelper.KEYSTOREHELPER_FAMILY);
int preJobCount = preJobs.length;
KeyStoreHelper.makeSymmetricKeyByWizard(showKeyGroup).addObserver(new Observer() {
public void update(Observable o, final Object arg) {
if (arg != null) {
keyFromKeystoreGroup.getDisplay().syncExec(new Runnable() {
public void run() {
KeyStoreAlias ref = (KeyStoreAlias) arg;
setKeyForShowcase(ref);
}
});
}
}
});
Job[] jobs = Job.getJobManager().find(KeyStoreHelper.KEYSTOREHELPER_FAMILY);
if (jobs.length > preJobCount) {
createNewKeyButton.getDisplay().syncExec(new Runnable() {
public void run() {
buttonTextBeforeJobrunningMsg = createNewKeyButton.getText();
// $NON-NLS-1$
createNewKeyButton.setText(Messages.getString("IntegratorWizardPage.generatingButtonHint"));
disableControls();
}
});
Job job = jobs[jobs.length - 1];
IJobChangeListener listener = new IJobChangeListener() {
public void sleeping(IJobChangeEvent event) {
}
public void done(IJobChangeEvent event) {
createNewKeyButton.getDisplay().syncExec(new Runnable() {
public void run() {
createNewKeyButton.setText(buttonTextBeforeJobrunningMsg);
enableControls();
}
});
}
public void awake(IJobChangeEvent event) {
}
public void aboutToRun(IJobChangeEvent event) {
}
public void running(IJobChangeEvent event) {
}
public void scheduled(IJobChangeEvent event) {
}
};
if (job.getState() != Job.NONE)
job.addJobChangeListener(listener);
else {
listener.done(null);
}
}
}
use of java.util.Observable in project core by jcryptool.
the class AbstractAlgorithmHandler method performOpenEditor.
/**
* Tries to open the given IEditorInput in the Editor associated with the given ID. This method must be executed in
* an async way since a Job may be used to execute the cryptographic operation.
*
* @param input The IEditorInput that shall be displayed
* @param editorId The ID of the Editor that is supposed to open
*/
protected void performOpenEditor(final IEditorInput input, final String editorId) {
Observer dummyObserver = new Observer() {
@Override
public void update(Observable o, Object arg) {
}
};
performOpenEditor(input, editorId, dummyObserver);
}
Aggregations