/** * Creates a new working set broker instance with the given injector and status helper arguments. The injector is * used to inject members into the available contributions. Also restores its most recent state from the preference * store. * * @param injector * the injector for initializing the contributions. * @param statusHelper * convenient way to create {@link IStatus status} instances. * */ @Inject private WorkingSetManagerBrokerImpl(final Injector injector, final StatusHelper statusHelper) { this.injector = injector; this.statusHelper = statusHelper; this.activeWorkingSetManager = new AtomicReference<>(); this.workingSetTopLevel = new AtomicBoolean(false); this.alreadyQueuedNavigatorRefresh = new AtomicBoolean(false); this.contributions = initContributions(); topLevelElementChangeListeners = newHashSet(); workingSetManagerStateChangeListeners = newHashSet(); restoreState(new NullProgressMonitor()); if (EMFPlugin.IS_ECLIPSE_RUNNING) { final String pluginId = N4JSActivator.getInstance().getBundle().getSymbolicName(); final IWorkspace workspace = ResourcesPlugin.getWorkspace(); try { workspace.addSaveParticipant(pluginId, new SaveParticipantAdapter() { @Override public void saving(final ISaveContext context) throws CoreException { saveState(new NullProgressMonitor()); } }); } catch (final CoreException e) { LOGGER.error("Error occurred while attaching save participant to workspace.", e); } } }
public void saving(ISaveContext context) throws CoreException { IPath savePath = new Path(ConnectionPointManager.STATE_FILENAME).addFileExtension(Integer.toString(context .getSaveNumber())); ConnectionPointManager.getInstance().saveState(getStateLocation().append(savePath)); context.map(new Path(ConnectionPointManager.STATE_FILENAME), savePath); context.needSaveNumber(); }
public void saving(ISaveContext context) throws CoreException { IPath savePath = new Path(ServerManager.STATE_FILENAME).addFileExtension(Integer.toString(context .getSaveNumber())); ((ServerManager) getServerManager()).saveState(getStateLocation().append(savePath)); context.map(new Path(ServerManager.STATE_FILENAME), savePath); context.needSaveNumber(); }
public void saving(ISaveContext context) throws CoreException { Map<IProject, IEclipsePreferences> toFlush = new HashMap<>(); synchronized (projectPrefs) { toFlush.putAll(projectPrefs); projectPrefs.clear(); } for (Entry<IProject, IEclipsePreferences> entry : toFlush.entrySet()) { try { entry.getValue().flush(); } catch (BackingStoreException e) { IvyPlugin.logError("Failed to save the state of the Ivy preferences of " + entry.getKey().getName(), e); } } }
public void saving(ISaveContext context) { switch (context.getKind()) { case ISaveContext.FULL_SAVE: fullSave(); break; case ISaveContext.PROJECT_SAVE: saveBugCollection(context.getProject()); break; default: break; } }
@Override public void doneSaving(final ISaveContext context) { // Nothing by default. }
@Override public void prepareToSave(final ISaveContext context) throws CoreException { // Nothing by default. }
@Override public void rollback(final ISaveContext context) { // Nothing by default. }
@Override public void saving(final ISaveContext context) throws CoreException { // Nothing by default. }
@Override public void doneSaving(ISaveContext context) { }
@Override public void prepareToSave(ISaveContext context) throws CoreException { if (context.getKind() == ISaveContext.FULL_SAVE) { GradleBuildSupport.saveModels(); } }
@Override public void rollback(ISaveContext context) { }
@Override public void saving(ISaveContext context) throws CoreException { }
@Override public void doneSaving(ISaveContext context) { // not necessary }
@Override public void prepareToSave(ISaveContext context) throws CoreException { // not necessary }
@Override public void rollback(ISaveContext context) { // not necessary }
@Override public void saving(ISaveContext context) throws CoreException { // not necessary }
public void prepareToSave(ISaveContext context) throws CoreException { }
public void doneSaving(ISaveContext context) { IPath prevSavePath = new Path(ConnectionPointManager.STATE_FILENAME).addFileExtension(Integer .toString(context.getPreviousSaveNumber())); getStateLocation().append(prevSavePath).toFile().delete(); }
public void rollback(ISaveContext context) { IPath savePath = new Path(ConnectionPointManager.STATE_FILENAME).addFileExtension(Integer.toString(context .getSaveNumber())); getStateLocation().append(savePath).toFile().delete(); }
public void doneSaving(ISaveContext context) { IPath prevSavePath = new Path(ServerManager.STATE_FILENAME).addFileExtension(Integer.toString(context .getPreviousSaveNumber())); getStateLocation().append(prevSavePath).toFile().delete(); }
public void rollback(ISaveContext context) { IPath savePath = new Path(ServerManager.STATE_FILENAME).addFileExtension(Integer.toString(context .getSaveNumber())); getStateLocation().append(savePath).toFile().delete(); }
/** * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext) */ public void doneSaving(ISaveContext context) { // ignore }
/** * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext) */ public void prepareToSave(ISaveContext context) throws CoreException { // ignore }
/** * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext) */ public void rollback(ISaveContext context) { // ignore }
/** * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext) */ public void saving(ISaveContext context) throws CoreException { context.needDelta(); }
public void prepareToSave(ISaveContext context) throws CoreException { // nothing to do }
public void rollback(ISaveContext context) { // nothing to do }
public void doneSaving(ISaveContext context) { // nothing to do }
@Override public void prepareToSave(ISaveContext context) throws CoreException { }
@Override public void saving(ISaveContext context) throws CoreException { saveDatabaseJob.setSystem(true); saveDatabaseJob.schedule(); }
public void doneSaving(ISaveContext context) { // noop }
public void prepareToSave(ISaveContext context) { // noop }
public void rollback(ISaveContext context) { // noop }
/** * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext) */ public void doneSaving(ISaveContext context) { }
/** * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext) */ public void prepareToSave(ISaveContext context) { }
/** * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext) */ public void rollback(ISaveContext context) { }