Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IFile.refreshLocal()


          newPath = newPath.addFileExtension("html");
        }
        final IFile oldFile = ResourcesPlugin.getWorkspace().getRoot().getFile(path.append(sourceType.getTypeQualifiedName() + ".html"));

        if (oldFile.exists() && oldFile.isAccessible()) { // if there's a file in the same folder
          oldFile.refreshLocal(SAVE_IF_DIRTY, paramIProgressMonitor);
          oldFile.move(newPath, true, true, paramIProgressMonitor);
        }

        FileSearcher fs = new FileSearcher(sourceType.getJavaProject().getProject(), sourceType.getTypeQualifiedName() + "*");
        ResourcesPlugin.getWorkspace().getRoot().accept(fs);
 
View Full Code Here


        // path in project that is the same as the external file's path to avoid collision
        // without need to create new names
        linkFile = project.getFile(uri.getPath());
      }
      if(linkFile.exists())
        linkFile.refreshLocal(1, null); // don't know if needed (or should be avoided...)
      else {
        // create the link
        createLink(project, linkFile, uri);
      }
      return linkFile;
View Full Code Here

      refresh();
      Object file = editor.getIFileOrFile(dialog.genFilePath);
      if (file instanceof IFile) {
        try {
          IFile ifile = (IFile) file;
          ifile.refreshLocal(1, null);
          ((IFile) file).setPersistentProperty(
                  new QualifiedName(PLUGIN_ID, IMPORTABLE_PART_CONTEXT), editor.getFile()
                          .getLocation().toString());
        } catch (CoreException e) {
          throw new InternalErrorCDE("unexpected exception", e);
View Full Code Here

      throws IOException, CoreException {
    IFile file = getIFileResource(project, folderName, fileName);
    if (!file.exists()) {
      throw new FileNotFoundException();
    }
    file.refreshLocal(1, new NullProgressMonitor());
    IPath fullPath = file.getFullPath();
    boolean dispose = false;
    ITextFileBuffer fileBuffer = (ITextFileBuffer) FileBuffers
        .getTextFileBufferManager().getTextFileBuffer(fullPath,
            LocationKind.IFILE);
View Full Code Here

    IStructuredModel model = null;
    try {
      // get existing model for read, then get document from it
      IModelManager modelManager = getModelManager();
      if (modelManager != null) {
        jspFile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
        model = modelManager.getModelForRead(jspFile);
      }
      // handle unsupported
      if (model instanceof IDOMModel) {
        IDOMModel xmlModel = (IDOMModel)model;
View Full Code Here

    String requiredString=fullPath + File.separator + exportPage.getFileName();
    try {
      IFile file = exportPage.createNewFile();
      workingUserCatalog.setLocation(requiredString);
      workingUserCatalog.save();
      file.refreshLocal(IResource.DEPTH_ZERO, null);
    } catch (Exception ex) {
      return false;
    }
    return true;
  }
View Full Code Here

        else {
          // put template contents into file
          String templateString = fNewXMLTemplatesWizardPage.getTemplateString();
          generator.createTemplateXMLDocument(newFile, templateString);
        }
        newFile.refreshLocal(IResource.DEPTH_ONE, null);
        IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        BasicNewResourceWizard.selectAndReveal(newFile, workbenchWindow);
        openEditor(newFile);
      }
    }
View Full Code Here

    }
    try
    {
      IDE.openEditor(UIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(), file, true);
      file.touch(null);
      file.refreshLocal(IResource.DEPTH_ONE, null);
    } catch (CoreException e)
    {

    }
    return true;
View Full Code Here

        e.printStackTrace();
      }

      IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
      try {
        file.refreshLocal(1,null);
      } catch (CoreException e) {
        System.err.println("Unable to refresh");
        e.printStackTrace();
      }
    }
View Full Code Here

      refresh();
      Object file = editor.getIFileOrFile(dialog.genFilePath);
      if (file instanceof IFile) {
        try {
          IFile ifile = (IFile) file;
          ifile.refreshLocal(1, null);
          ((IFile) file).setPersistentProperty(
                  new QualifiedName(PLUGIN_ID, IMPORTABLE_PART_CONTEXT), editor.getFile()
                          .getLocation().toString());
        } catch (CoreException e) {
          throw new InternalErrorCDE("unexpected exception", e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.