Package org.eclipse.ui.ide

Examples of org.eclipse.ui.ide.FileStoreEditorInput


      }
    } else {
      IFileStore store = EFS.getLocalFileSystem().getStore(
          new Path(file.getAbsolutePath()));
      try {
        return IDE.openEditor(page, new FileStoreEditorInput(store),
            EditorsUI.DEFAULT_TEXT_EDITOR_ID);
      } catch (PartInitException e) {
        Activator.handleError(UIText.EgitUiEditorUtils_openFailed, e,
            true);
      }
View Full Code Here


        IFileStore store = EFS.getLocalFileSystem().getStore(
            new Path(traceFileLocation.getText()));
        try {
          IDE.openEditor(PlatformUI.getWorkbench()
              .getActiveWorkbenchWindow().getActivePage(),
              new FileStoreEditorInput(store),
              EditorsUI.DEFAULT_TEXT_EDITOR_ID);

        } catch (PartInitException ex) {
          Activator.handleError(ex.getMessage(), ex, true);
        }
View Full Code Here

              new Path(((FileBasedConfig) editableConfig)
                  .getFile().getAbsolutePath()));
          try {
            IDE.openEditor(PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getActivePage(),
                new FileStoreEditorInput(store),
                EditorsUI.DEFAULT_TEXT_EDITOR_ID);
          } catch (PartInitException ex) {
            Activator.handleError(ex.getMessage(), ex, true);
          }
        }
View Full Code Here

        IFile ifile = fileEditorInput.getFile();
        uniquePath = ifile.getLocation().toPortableString();
      }
      else if (editorInput instanceof FileStoreEditorInput)
      {
        FileStoreEditorInput fileStoreInput = (FileStoreEditorInput)editorInput;
          IFileStore store = EFS.getStore(fileStoreInput.getURI());
          File localFile = store.toLocalFile(EFS.NONE, null);
        //if no local file is available, obtain a cached file
        if (localFile == null)
          localFile = store.toLocalFile(EFS.CACHE, null);
        if (localFile == null)
View Full Code Here

          .findEditorInput(new Path(fileStore.toURI().getPath()));
      if (nonExistingEditorInput != null) {
        return nonExistingEditorInput;
      }

      return new FileStoreEditorInput(fileStore);
    }
    Logger.log(Logger.WARNING_DEBUG, "Unknown editor input type: " //$NON-NLS-1$
        + element.getClass().getName());
    return null;
  }
View Full Code Here

      }

      // Support external files opened using File -> Open
      File localFile = new File(location);
      if (localFile.exists()) {
        return new FileStoreEditorInput(new LocalFile(localFile));
      }
    } catch (CoreException e) {
      DLTKUIPlugin.log(e);
    }
    return null;
View Full Code Here

     
     
    }
    if(editorInput instanceof FileStoreEditorInput)
    {
      FileStoreEditorInput input = (FileStoreEditorInput) editorInput;
      FileInputStream contentStream = null;
     
      try
      {
        contentStream = new FileInputStream(input.getURI().getPath());
      }
      catch (FileNotFoundException e)
      {
        e.printStackTrace();
      }
View Full Code Here

 
  public boolean isModifiable(Object element)
  {
      if(element instanceof FileStoreEditorInput)
      {
        FileStoreEditorInput input = (FileStoreEditorInput)element;
        File file = new File(input.getURI().getPath());
          return file.canWrite();
      }

      if(!isStateValidated(element))
    {
      if (element instanceof IFileEditorInput)
      {
        return true;
      }
    }
   
    if(element instanceof CFJavaFileEditorInput)
    {
        CFJavaFileEditorInput input = (CFJavaFileEditorInput)element;
          return input.getPath(input).toFile().canWrite();
    }
   
    if(element instanceof RemoteFileEditorInput)
    {
        RemoteFileEditorInput input = (RemoteFileEditorInput)element;   
        return input.canWrite();
    }
   
    return super.isModifiable(element);
  }
View Full Code Here

          return !input.canWrite();
      }

      if(element instanceof FileStoreEditorInput)
      {
        FileStoreEditorInput input = (FileStoreEditorInput)element;
        File file = new File(input.getURI().getPath());
          return !file.canWrite();
      }
     
      return super.isReadOnly(element);
  }
View Full Code Here

      IFile file = files[0];
      return new FileEditorInput(file);
    } else {
      //file not in workspace
      IFileStore fileOnLocalDisk = EFS.getLocalFileSystem().getStore(uri);
      return new FileStoreEditorInput(fileOnLocalDisk);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.ide.FileStoreEditorInput

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.