Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.ISavedState


         * accumulated deltas, and if the tree is not already locked it
         * becomes a blocking call.
         */
        workspace.run(new IWorkspaceRunnable() {
          public void run(final IProgressMonitor worspaceMonitor) throws CoreException {
            ISavedState savedState = null;
           
            try {
              //add the save participant for this bundle
              savedState = ResourcesPlugin.getWorkspace().addSaveParticipant(
                  JSPCorePlugin.plugin.getBundle().getSymbolicName(), new SaveParticipant());
            } catch (CoreException e) {
              Logger.logException("JSP Core Plugin failed at loading previously saved state." + //$NON-NLS-1$
                  " All componenets dependent on this state will start as if first workspace load.", e); //$NON-NLS-1$
            }
           
            //if there is a saved state start up using that, else start up cold
            if(savedState != null) {
              try {
                Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
              } finally {
                savedState.processResourceChangeEvents(new IResourceChangeListener() {
                  /**
                   * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
                   */
                  public void resourceChanged(IResourceChangeEvent event) {
                    JSPIndexManager.getDefault().start(event.getDelta(), worspaceMonitor);
View Full Code Here


         * accumulated deltas, and if the tree is not already locked it
         * becomes a blocking call.
         */
        workspace.run(new IWorkspaceRunnable() {
          public void run(final IProgressMonitor worspaceMonitor) throws CoreException {
            ISavedState savedState = null;
           
            try {
              //add the save participant for this bundle
              savedState = ResourcesPlugin.getWorkspace().addSaveParticipant(
                  JSPCorePlugin.plugin.getBundle().getSymbolicName(), new SaveParticipant());
            } catch (CoreException e) {
              Logger.logException("JSP Core Plugin failed at loading previously saved state." + //$NON-NLS-1$
                  " All componenets dependent on this state will start as if first workspace load.", e); //$NON-NLS-1$
            }
           
            //if there is a saved state start up using that, else start up cold
            if(savedState != null) {
              try {
                Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
              } finally {
                savedState.processResourceChangeEvents(new IResourceChangeListener() {
                  /**
                   * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
                   */
                  public void resourceChanged(IResourceChangeEvent event) {
                    JSPIndexManager.getDefault().start(event.getDelta(), worspaceMonitor);
View Full Code Here

    // TODO:
    // From save participant documentation example; note
    // that we should use the alternative to java.io.File in Eclipse 3.2
   
        ISaveParticipant saveParticipant = new BBQSaveParticipant( this);
        ISavedState lastState =
           ResourcesPlugin.getWorkspace().addSaveParticipant(this, saveParticipant);
        if (lastState == null)
           return;
        IPath location = lastState.lookup(new Path(ENVIRONMENT_FILE_KEY));
        if (location == null)
           return;
        // the plugin instance should read any important state from the file.
        File f = getStateLocation().append(location).toFile();
        if ( f.canRead())
View Full Code Here

  }

  public void start(BundleContext context) throws Exception {
    super.start(context);
    persistenceStore = new TargetBuilderPersistenceStore();
    ISavedState lastState = ResourcesPlugin.getWorkspace().addSaveParticipant(this, persistenceStore);
    // remove target buildstates if the project is removed
    ResourcesPlugin.getWorkspace().addResourceChangeListener(persistenceStore, IResourceChangeEvent.PRE_DELETE);

    if (lastState == null)
      return;
    IPath location = lastState.lookup(new Path("save"));
    if (location == null)
      return;
    // the plugin instance should read any important state from the file.
    File f = getStateLocation().append(location).toFile();
    persistenceStore.readStateFrom(f);
View Full Code Here

  @SuppressWarnings("deprecation")
  public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;

    ISavedState savedState = ResourcesPlugin.getWorkspace().addSaveParticipant(this, new RunnerSaveParticipant());
    restoreSavedState(savedState);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.ISavedState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.