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

The following examples show how to use org.eclipse.core.resources.ISaveContext. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: n4js   Source File: WorkingSetManagerBrokerImpl.java    License: Eclipse Public License 1.0 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
@Override
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 3
Source Project: APICloud-Studio   Source File: CoreIOPlugin.java    License: GNU General Public License v3.0 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 4
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 5
Source Project: n4js   Source File: SaveParticipantAdapter.java    License: Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void doneSaving(final ISaveContext context) {
	// Nothing by default.
}
 
Example 6
Source Project: n4js   Source File: SaveParticipantAdapter.java    License: Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void prepareToSave(final ISaveContext context) throws CoreException {
	// Nothing by default.
}
 
Example 7
Source Project: n4js   Source File: SaveParticipantAdapter.java    License: Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void rollback(final ISaveContext context) {
	// Nothing by default.
}
 
Example 8
Source Project: n4js   Source File: SaveParticipantAdapter.java    License: Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void saving(final ISaveContext context) throws CoreException {
	// Nothing by default.
}
 
Example 9
Source Project: eclipse.jdt.ls   Source File: ProjectsManager.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doneSaving(ISaveContext context) {
}
 
Example 10
Source Project: eclipse.jdt.ls   Source File: ProjectsManager.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void prepareToSave(ISaveContext context) throws CoreException {
}
 
Example 11
Source Project: eclipse.jdt.ls   Source File: ProjectsManager.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void rollback(ISaveContext context) {
}
 
Example 12
Source Project: eclipse.jdt.ls   Source File: ProjectsManager.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void saving(ISaveContext context) throws CoreException {
}
 
Example 13
@Override
public void prepareToSave(ISaveContext context) throws CoreException {
	if (context.getKind() == ISaveContext.FULL_SAVE) {
		GradleBuildSupport.saveModels();
	}
}
 
Example 14
@Override
public void doneSaving(ISaveContext context) {
    // noop
}
 
Example 15
@Override
public void prepareToSave(ISaveContext context) {
    // noop
}
 
Example 16
@Override
public void rollback(ISaveContext context) {
    // noop
}
 
Example 17
Source Project: APICloud-Studio   Source File: CoreIOPlugin.java    License: GNU General Public License v3.0 4 votes vote down vote up
public void prepareToSave(ISaveContext context) throws CoreException
{
}
 
Example 18
Source Project: APICloud-Studio   Source File: CoreIOPlugin.java    License: GNU General Public License v3.0 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 19
Source Project: APICloud-Studio   Source File: CoreIOPlugin.java    License: GNU General Public License v3.0 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 20
public void doneSaving(ISaveContext context)
{
	IPath prevSavePath = new Path(ServerManager.STATE_FILENAME).addFileExtension(Integer.toString(context
			.getPreviousSaveNumber()));
	getStateLocation().append(prevSavePath).toFile().delete();
}
 
Example 21
public void prepareToSave(ISaveContext context) throws CoreException
{
}
 
Example 22
public void rollback(ISaveContext context)
{
	IPath savePath = new Path(ServerManager.STATE_FILENAME).addFileExtension(Integer.toString(context
			.getSaveNumber()));
	getStateLocation().append(savePath).toFile().delete();
}
 
Example 23
/**
 * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
 */
public void doneSaving(ISaveContext context) {
}
 
Example 24
/**
 * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
 */
public void prepareToSave(ISaveContext context) {
}
 
Example 25
/**
 * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
 */
public void rollback(ISaveContext context) {
}
 
Example 26
/**
 * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
 */
public void saving(ISaveContext context) {
}
 
Example 27
/**
 * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
 */
public void doneSaving(ISaveContext context) {
}
 
Example 28
/**
 * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
 */
public void prepareToSave(ISaveContext context) {
}
 
Example 29
/**
 * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
 */
public void rollback(ISaveContext context) {
}
 
Example 30
/**
 * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
 */
public void saving(ISaveContext context) {
}