use of org.eclipse.core.resources.ISaveContext in project linuxtools by eclipse.
the class LibhoverPlugin method start.
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
ResourcesPlugin.getWorkspace().addSaveParticipant(PLUGIN_ID, new ISaveParticipant() {
@Override
public void saving(ISaveContext saveContext) {
save();
}
@Override
public void rollback(ISaveContext saveContext) {
}
@Override
public void prepareToSave(ISaveContext saveContext) {
}
@Override
public void doneSaving(ISaveContext saveContext) {
}
});
IPreferenceStore ps = getPreferenceStore();
if (ps == null || !ps.getBoolean(PreferenceConstants.LAZY_LOAD)) {
Job k = new LibHoverLoadJob(LibHoverMessages.getString(LOAD_JOB_TXT));
k.schedule();
}
}
use of org.eclipse.core.resources.ISaveContext in project xtext-xtend by eclipse.
the class UIResourceChangeRegistry method init.
@Inject
public void init(final IWorkspace workspace) {
try {
this.workspace = workspace;
this.load();
String _symbolicName = this.uiPlugin.getBundle().getSymbolicName();
workspace.addSaveParticipant(_symbolicName, new ISaveParticipant() {
@Override
public void saving(final ISaveContext context) throws CoreException {
UIResourceChangeRegistry.this.save();
}
@Override
public void doneSaving(final ISaveContext context) {
}
@Override
public void prepareToSave(final ISaveContext context) throws CoreException {
}
@Override
public void rollback(final ISaveContext context) {
}
});
workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations