org.eclipse.core.resources.ISaveContext Java Examples

The following examples show how to use org.eclipse.core.resources.ISaveContext. 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 check out the related API usage on the sidebar.
Example #1
Source File: WebServerCorePlugin.java    From APICloud-Studio with GNU General Public License v3.0 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 #2
Source File: WorkingSetManagerBrokerImpl.java    From n4js with 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 #3
Source File: CoreIOPlugin.java    From APICloud-Studio with 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
Source File: FindbugsSaveParticipant.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
@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 #5
Source File: SaveParticipantAdapter.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void prepareToSave(final ISaveContext context) throws CoreException {
	// Nothing by default.
}
 
Example #6
Source File: WebServerCorePlugin.java    From APICloud-Studio with GNU General Public License v3.0 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 #7
Source File: WebServerCorePlugin.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void prepareToSave(ISaveContext context) throws CoreException
{
}
 
Example #8
Source File: WebServerCorePlugin.java    From APICloud-Studio with GNU General Public License v3.0 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 #9
Source File: CoreIOPlugin.java    From APICloud-Studio with 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 #10
Source File: CoreIOPlugin.java    From APICloud-Studio with 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 #11
Source File: CoreIOPlugin.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void prepareToSave(ISaveContext context) throws CoreException
{
}
 
Example #12
Source File: FindbugsSaveParticipant.java    From spotbugs with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void rollback(ISaveContext context) {
    // noop
}
 
Example #13
Source File: FindbugsSaveParticipant.java    From spotbugs with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void doneSaving(ISaveContext context) {
    // noop
}
 
Example #14
Source File: SaveParticipantAdapter.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void doneSaving(final ISaveContext context) {
	// Nothing by default.
}
 
Example #15
Source File: SaveParticipantAdapter.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void rollback(final ISaveContext context) {
	// Nothing by default.
}
 
Example #16
Source File: SaveParticipantAdapter.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void saving(final ISaveContext context) throws CoreException {
	// Nothing by default.
}
 
Example #17
Source File: ProjectsManager.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void doneSaving(ISaveContext context) {
}
 
Example #18
Source File: ProjectsManager.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void prepareToSave(ISaveContext context) throws CoreException {
}
 
Example #19
Source File: ProjectsManager.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void rollback(ISaveContext context) {
}
 
Example #20
Source File: ProjectsManager.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void saving(ISaveContext context) throws CoreException {
}
 
Example #21
Source File: StandardProjectsManager.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void prepareToSave(ISaveContext context) throws CoreException {
	if (context.getKind() == ISaveContext.FULL_SAVE) {
		GradleBuildSupport.saveModels();
	}
}
 
Example #22
Source File: FindbugsSaveParticipant.java    From spotbugs with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void prepareToSave(ISaveContext context) {
    // noop
}
 
Example #23
Source File: FileModificationManager.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
 */
public void doneSaving(ISaveContext context) {
}
 
Example #24
Source File: FileModificationManager.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
 */
public void prepareToSave(ISaveContext context) {
}
 
Example #25
Source File: FileModificationManager.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
 */
public void rollback(ISaveContext context) {
}
 
Example #26
Source File: FileModificationManager.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
 */
public void saving(ISaveContext context) {
}
 
Example #27
Source File: TeamPrivateListener.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
 */
public void doneSaving(ISaveContext context) {
}
 
Example #28
Source File: TeamPrivateListener.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
 */
public void prepareToSave(ISaveContext context) {
}
 
Example #29
Source File: TeamPrivateListener.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
 */
public void rollback(ISaveContext context) {
}
 
Example #30
Source File: TeamPrivateListener.java    From APICloud-Studio with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
 */
public void saving(ISaveContext context) {
}