Java Code Examples for org.eclipse.core.resources.ISaveContext

The following are top voted examples for showing how to use org.eclipse.core.resources.ISaveContext. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: n4js   File: WorkingSetManagerBrokerImpl.java   Source Code and License 5 votes vote down vote up
/**
 * 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);
		}
	}
}
 
Example 2
Project: APICloud-Studio   File: CoreIOPlugin.java   Source Code and License 5 votes vote down vote up
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();
}
 
Example 3
Project: APICloud-Studio   File: WebServerCorePlugin.java   Source Code and License 5 votes vote down vote up
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();
}
 
Example 4
Project: ant-ivyde   File: RetrieveSetupManager.java   Source Code and License 5 votes vote down vote up
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);
        }
    }
}
 
Example 5
Project: FindBug-for-Domino-Designer   File: FindbugsSaveParticipant.java   Source Code and License 5 votes vote down vote up
public void saving(ISaveContext context) {
    switch (context.getKind()) {
    case ISaveContext.FULL_SAVE:
        fullSave();
        break;
    case ISaveContext.PROJECT_SAVE:
        saveBugCollection(context.getProject());
        break;
    default:
        break;
    }
}
 
Example 6
Project: n4js   File: SaveParticipantAdapter.java   Source Code and License 4 votes vote down vote up
@Override
public void doneSaving(final ISaveContext context) {
	// Nothing by default.
}
 
Example 7
Project: n4js   File: SaveParticipantAdapter.java   Source Code and License 4 votes vote down vote up
@Override
public void prepareToSave(final ISaveContext context) throws CoreException {
	// Nothing by default.
}
 
Example 8
Project: n4js   File: SaveParticipantAdapter.java   Source Code and License 4 votes vote down vote up
@Override
public void rollback(final ISaveContext context) {
	// Nothing by default.
}
 
Example 9
Project: n4js   File: SaveParticipantAdapter.java   Source Code and License 4 votes vote down vote up
@Override
public void saving(final ISaveContext context) throws CoreException {
	// Nothing by default.
}
 
Example 10
Project: eclipse.jdt.ls   File: ProjectsManager.java   Source Code and License 4 votes vote down vote up
@Override
public void doneSaving(ISaveContext context) {
}
 
Example 11
Project: eclipse.jdt.ls   File: ProjectsManager.java   Source Code and License 4 votes vote down vote up
@Override
public void prepareToSave(ISaveContext context) throws CoreException {
	if (context.getKind() == ISaveContext.FULL_SAVE) {
		GradleBuildSupport.saveModels();
	}
}
 
Example 12
Project: eclipse.jdt.ls   File: ProjectsManager.java   Source Code and License 4 votes vote down vote up
@Override
public void rollback(ISaveContext context) {
}
 
Example 13
Project: eclipse.jdt.ls   File: ProjectsManager.java   Source Code and License 4 votes vote down vote up
@Override
public void saving(ISaveContext context) throws CoreException {
}
 
Example 14
Project: VariantSync   File: ChangeListener.java   Source Code and License 4 votes vote down vote up
@Override
public void doneSaving(ISaveContext context) {
	// not necessary
}
 
Example 15
Project: VariantSync   File: ChangeListener.java   Source Code and License 4 votes vote down vote up
@Override
public void prepareToSave(ISaveContext context) throws CoreException {
	// not necessary
}
 
Example 16
Project: VariantSync   File: ChangeListener.java   Source Code and License 4 votes vote down vote up
@Override
public void rollback(ISaveContext context) {
	// not necessary
}
 
Example 17
Project: VariantSync   File: ChangeListener.java   Source Code and License 4 votes vote down vote up
@Override
public void saving(ISaveContext context) throws CoreException {
	// not necessary
}
 
Example 18
Project: APICloud-Studio   File: CoreIOPlugin.java   Source Code and License 4 votes vote down vote up
public void prepareToSave(ISaveContext context) throws CoreException
{
}
 
Example 19
Project: APICloud-Studio   File: CoreIOPlugin.java   Source Code and License 4 votes vote down vote up
public void doneSaving(ISaveContext context)
{
	IPath prevSavePath = new Path(ConnectionPointManager.STATE_FILENAME).addFileExtension(Integer
			.toString(context.getPreviousSaveNumber()));
	getStateLocation().append(prevSavePath).toFile().delete();
}
 
Example 20
Project: APICloud-Studio   File: CoreIOPlugin.java   Source Code and License 4 votes vote down vote up
public void rollback(ISaveContext context)
{
	IPath savePath = new Path(ConnectionPointManager.STATE_FILENAME).addFileExtension(Integer.toString(context
			.getSaveNumber()));
	getStateLocation().append(savePath).toFile().delete();
}
 
Example 21
Project: APICloud-Studio   File: WebServerCorePlugin.java   Source Code and License 4 votes vote down vote up
public void doneSaving(ISaveContext context)
{
	IPath prevSavePath = new Path(ServerManager.STATE_FILENAME).addFileExtension(Integer.toString(context
			.getPreviousSaveNumber()));
	getStateLocation().append(prevSavePath).toFile().delete();
}
 
Example 22
Project: APICloud-Studio   File: WebServerCorePlugin.java   Source Code and License 4 votes vote down vote up
public void prepareToSave(ISaveContext context) throws CoreException
{
}
 
Example 23
Project: APICloud-Studio   File: WebServerCorePlugin.java   Source Code and License 4 votes vote down vote up
public void rollback(ISaveContext context)
{
	IPath savePath = new Path(ServerManager.STATE_FILENAME).addFileExtension(Integer.toString(context
			.getSaveNumber()));
	getStateLocation().append(savePath).toFile().delete();
}
 
Example 24
Project: eclipse-wtp-webresources   File: WebResourcesCorePlugin.java   Source Code and License 4 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
 */
public void doneSaving(ISaveContext context) {
	// ignore
}
 
Example 25
Project: eclipse-wtp-webresources   File: WebResourcesCorePlugin.java   Source Code and License 4 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
 */
public void prepareToSave(ISaveContext context) throws CoreException {
	// ignore
}
 
Example 26
Project: eclipse-wtp-webresources   File: WebResourcesCorePlugin.java   Source Code and License 4 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
 */
public void rollback(ISaveContext context) {
	// ignore
}
 
Example 27
Project: eclipse-wtp-webresources   File: WebResourcesCorePlugin.java   Source Code and License 4 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
 */
public void saving(ISaveContext context) throws CoreException {
	context.needDelta();
}
 
Example 28
Project: ant-ivyde   File: RetrieveSetupManager.java   Source Code and License 4 votes vote down vote up
public void prepareToSave(ISaveContext context) throws CoreException {
    // nothing to do
}
 
Example 29
Project: ant-ivyde   File: RetrieveSetupManager.java   Source Code and License 4 votes vote down vote up
public void rollback(ISaveContext context) {
    // nothing to do
}
 
Example 30
Project: ant-ivyde   File: RetrieveSetupManager.java   Source Code and License 4 votes vote down vote up
public void doneSaving(ISaveContext context) {
    // nothing to do
}
 
Example 31
Project: eclipse-timekeeper   File: TimekeeperPlugin.java   Source Code and License 4 votes vote down vote up
@Override
public void doneSaving(ISaveContext context) {
}
 
Example 32
Project: eclipse-timekeeper   File: TimekeeperPlugin.java   Source Code and License 4 votes vote down vote up
@Override
public void prepareToSave(ISaveContext context) throws CoreException {
}
 
Example 33
Project: eclipse-timekeeper   File: TimekeeperPlugin.java   Source Code and License 4 votes vote down vote up
@Override
public void rollback(ISaveContext context) {
}
 
Example 34
Project: eclipse-timekeeper   File: TimekeeperPlugin.java   Source Code and License 4 votes vote down vote up
@Override
public void saving(ISaveContext context) throws CoreException {
	saveDatabaseJob.setSystem(true);
	saveDatabaseJob.schedule();
}
 
Example 35
Project: FindBug-for-Domino-Designer   File: FindbugsSaveParticipant.java   Source Code and License 4 votes vote down vote up
public void doneSaving(ISaveContext context) {
    // noop
}
 
Example 36
Project: FindBug-for-Domino-Designer   File: FindbugsSaveParticipant.java   Source Code and License 4 votes vote down vote up
public void prepareToSave(ISaveContext context) {
    // noop
}
 
Example 37
Project: FindBug-for-Domino-Designer   File: FindbugsSaveParticipant.java   Source Code and License 4 votes vote down vote up
public void rollback(ISaveContext context) {
    // noop
}
 
Example 38
Project: subclipse   File: FileModificationManager.java   Source Code and License 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
 */
public void doneSaving(ISaveContext context) {
}
 
Example 39
Project: subclipse   File: FileModificationManager.java   Source Code and License 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
 */
public void prepareToSave(ISaveContext context) {
}
 
Example 40
Project: subclipse   File: FileModificationManager.java   Source Code and License 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
 */
public void rollback(ISaveContext context) {
}