Examples of IFileStore


Examples of org.eclipse.core.filesystem.IFileStore

   * @see org.eclipse.ui.texteditor.IDocumentProvider#isDeleted(java.lang.Object)
   */
  public boolean isDeleted(Object element) {
    FileInfo info= (FileInfo) fFileInfoMap.get(element);
    if (info != null)  {
      IFileStore fileStore= getFileStore(info);
      return fileStore == null ? true : !fileStore.fetchInfo().exists();
    }
    return getParentProvider().isDeleted(element);
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    IStatus status= info.fTextFileBuffer.getStatus();

    // Ensure that we don't open an empty document for an non-existent IFile
    if (element instanceof IFileEditorInput || element instanceof IURIEditorInput) {
      IFileStore fileStore= info.fTextFileBuffer.getFileStore();
      if (fileStore != null && !fileStore.fetchInfo().exists()) {
        String message= NLSUtility.format(TextEditorMessages.TextFileDocumentProvider_error_doesNotExist, fileStore.toString());
        return new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IResourceStatus.RESOURCE_NOT_FOUND, message, null);
      }
    }

    return status;
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

   *
   * @param info the element's file info object
   * @return <code>true</code> iff read-only
   */
  protected boolean isSystemFileReadOnly(FileInfo info)  {
    IFileStore fileStore= getFileStore(info);
    if (fileStore == null)
      return false;
    IFileInfo fileInfo= fileStore.fetchInfo();
    return fileInfo.exists() && fileInfo.getAttribute(EFS.ATTRIBUTE_READ_ONLY);
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    String path= dialog.open();

    if (path == null)
      return;
   
    IFileStore fileStore= EFS.getLocalFileSystem().getStore(new Path(path));

    try {
      TemplateReaderWriter reader= new TemplateReaderWriter();
      if (fileStore.fetchInfo().exists()) {
        InputStream input= new BufferedInputStream(fileStore.openInputStream(EFS.NONE, null));
        try {
          TemplatePersistenceData[] datas= reader.read(input, null);
          for (int i= 0; i < datas.length; i++) {
            TemplatePersistenceData data= datas[i];
            fTemplateStore.add(data);
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    String path= dialog.open();

    if (path == null)
      return;

    IFileStore fileStore= EFS.getLocalFileSystem().getStore(new Path(path));
    IFileInfo fileInfo= fileStore.fetchInfo();

    if (fileInfo.getAttribute(EFS.ATTRIBUTE_HIDDEN)) {
      String title= TextEditorTemplateMessages.TemplatePreferencePage_export_error_title;
      String message= NLSUtility.format(TextEditorTemplateMessages.TemplatePreferencePage_export_error_hidden, fileStore.toString());
      MessageDialog.openError(getShell(), title, message);
      return;
    }

    if (fileInfo.exists() && fileInfo.getAttribute(EFS.ATTRIBUTE_READ_ONLY)) {
      String title= TextEditorTemplateMessages.TemplatePreferencePage_export_error_title;
      String message= NLSUtility.format(TextEditorTemplateMessages.TemplatePreferencePage_export_error_canNotWrite, fileStore.toString());
      MessageDialog.openError(getShell(), title, message);
      return;
    }

    if (!fileInfo.exists() || confirmOverwrite(fileStore)) {
      OutputStream output= null;
      try {
        output= new BufferedOutputStream(fileStore.openOutputStream(EFS.NONE, null));
        TemplateReaderWriter writer= new TemplateReaderWriter();
        writer.save(templates, output);
      } catch (CoreException e) {
        openWriteErrorDialog();
      } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

  /*
   * @see org.eclipse.jface.wizard.Wizard#performFinish()
   */
  public boolean performFinish() {
    IFileStore fileStore= queryFileStore();
    IEditorInput input= createEditorInput(fileStore);
    String editorId= getEditorId(fileStore);
    IWorkbenchPage page= fWindow.getActivePage();
    try {
      page.openEditor(input, editorId);
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

            return;
          }
        }
      }

      IFileStore fileStore;
      try {
        fileStore = EFS.getStore(localFile.toURI());
      }
      catch(CoreException ex) {
        EditorsPlugin.log(ex.getStatus());
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window != null) {
      IWorkbenchPage page = window.getActivePage();
      if (page != null) {
        try {
          IFileStore fileStore = EFS.getLocalFileSystem().getStore(this.uri);
          IEditorPart editorPart = IDE.openEditorOnFileStore(page, fileStore);
          if (this.line > 0) {
            ITextEditor textEditor = null;
            if (editorPart instanceof ITextEditor)
              textEditor = (ITextEditor) editorPart;
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

  public boolean performFinish() {
   
    try {

      IProject project = samplePage.getProject();
      IFileStore samplesFolder = samplePage.getSamplesFolder().getChild(samplePage.getSample());
     
      IJavaProject javaProject = JavaCore.create(project);
      ensureSourceFolder(javaProject);
      IFileStore srcFolder = samplesFolder.getChild("src");
     
      copy(srcFolder, project);
     
      IFolder folder = project.getFolder(SAMPLE_SRC);
      folder.refreshLocal(IResource.DEPTH_INFINITE, null);
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    if(!srcFolder.exists())
      srcFolder.create(true, true, null);
//    IFolder comFolder = srcFolder.getFolder("com");
//    if(!comFolder.exists());
//      comFolder.create(true, true, null);
    IFileStore workspaceFolder = EFS.getLocalFileSystem().getStore(srcFolder.getLocation());
    sampleSrcFolder.copy(workspaceFolder, EFS.NONE, null);
  }
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.