Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IStorage


        }
        if (input instanceof PydevZipFileEditorInput) {
            PydevZipFileEditorInput pydevZipFileEditorInput = (PydevZipFileEditorInput) input;
            try {
                IStorage storage = pydevZipFileEditorInput.getStorage();
                if (storage instanceof PydevZipFileStorage) {
                    PydevZipFileStorage pydevZipFileStorage = (PydevZipFileStorage) storage;
                    return pydevZipFileStorage;
                }
            } catch (CoreException e) {
View Full Code Here


    int maxMatches = InstaSearchPlugin.getIntPref(PreferenceConstants.P_SHOWN_LINES_COUNT);
    List<MatchLine> matchedLines = new ArrayList<MatchLine>();
    int matchCount = doc.getMatchCount();
    String searchString = currentSearchQuery.getSearchString().toLowerCase(Locale.ENGLISH);
   
    IStorage f = getStorage(doc);
    if( f == null ) {
      // index might be outdated (disabled updating)
      //TODO: remove file from index (update index)
      return null;
    }
   
    InputStream fileInputStream = null;
   
    if( f instanceof IFile ) {
      IFile file = (IFile) f;
      if( !file.exists() )
        return null;
      fileInputStream = file.getContents(true);
    } else {
      fileInputStream = f.getContents();
    }
   
    LineNumberReader lineReader = new LineNumberReader(new InputStreamReader(fileInputStream)); // is a buffered reader
   
    String line;
View Full Code Here

   
    IEditorPart editorPart = IDE.openEditor(workbenchPage, input, editorDesc.getId());
    this.editor = getTextEditor(input, editorPart);
    this.document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
   
    IStorage storage = contentProvider.getStorage(doc);
    this.file = null;
    if( storage instanceof IFile )
      file = (IFile) storage;
  }
View Full Code Here

            null);
      } else {
        // Do it "the hard way" by using the WorkspaceRoot as the host for our breakpoint
        // ... quick analysis seems to indicate it's done this way by the JDT "itself" !
        IStorageEditorInput input = (IStorageEditorInput) editor.getEditorInput();
        IStorage storage = input.getStorage();

        for (int i = 0; i < breakpoints.length; i++) {
          IBreakpoint breakpoint = breakpoints[i];
          if (breakpoint instanceof IJavaStratumLineBreakpoint) {
            IJavaStratumLineBreakpoint stratumBreakpoint = (IJavaStratumLineBreakpoint) breakpoint;
            if (storage.getFullPath().toPortableString().equals(stratumBreakpoint.getSourcePath())) {
              if (((ILineBreakpoint) breakpoint).getLineNumber() == (lineNumber + 1)) {
                breakpoint.delete();
                return;
              }
            }
          }
        }
        Map attributes = new HashMap();
        StorageMarkerAnnotationModel.addAttribute(attributes, storage);
        System.out.println("not editor part resource");
        JDIDebugModel.createStratumBreakpoint(
            ResourcesPlugin.getWorkspace().getRoot(),
            "Clojure",
            storage.getName(),
            storage.getFullPath().toPortableString(),
            null,
            lineNumber + 1,
            -1,
            -1,
            0,
View Full Code Here

   * @throws CoreException
   */
  public static FileRevisionEditorInput createEditorInputFor(
      IFileRevision revision, IProgressMonitor monitor)
      throws CoreException {
    IStorage storage = revision.getStorage(monitor);
    return new FileRevisionEditorInput(revision, storage);
  }
View Full Code Here

    try {
      String path = diff.getOldPath();
      IFileRevision rev = CompareUtils.getFileRevision(path, parent,
          revision.getRepository(), null);
      int line = sourceLine == null ? -1 : sourceLine.intValue();
      IStorage storage = rev.getStorage(new NullProgressMonitor());
      IWorkbenchPage page = PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getActivePage();
      BlameOperation operation = new BlameOperation(
          revision.getRepository(), storage, path, parent,
          getShell(), page, line);
View Full Code Here

    if (element instanceof FileRevisionTypedElement){
      FileRevisionTypedElement fileRevisionElement = (FileRevisionTypedElement) element;
      Object fileObject = fileRevisionElement.getFileRevision();
      if (fileObject instanceof LocalFileRevision){
        try {
          IStorage storage = ((LocalFileRevision) fileObject).getStorage(new NullProgressMonitor());
          if (CompareUtils.getAdapter(storage, IFileState.class) != null){
            //local revision
            return UIText.GitCompareFileRevisionEditorInput_LocalRevision;
          } else if (CompareUtils.getAdapter(storage, IFile.class) != null) {
            //current revision
View Full Code Here

   * @throws CoreException
   */
  public static IEditorPart openEditor(IWorkbenchPage page,
      IFileRevision revision, IProgressMonitor monitor)
      throws CoreException {
    IStorage file = revision.getStorage(monitor);
    if (file instanceof IFile) {
      // if this is the current workspace file, open it
      return IDE.openEditor(page, (IFile) file, OpenStrategy
          .activateOnOpen());
    } else {
View Full Code Here

    if (data == null)
      return null;

    Repository repository = data.repository;
    String path = data.repositoryRelativePath;
    IStorage storage = data.storage;
    RevCommit startCommit = data.startCommit;
    Shell shell = HandlerUtil.getActiveShell(event);
    IWorkbenchPage page = HandlerUtil.getActiveSite(event).getPage();
    JobUtil.scheduleUserJob(new BlameOperation(repository, storage, path,
        startCommit, shell, page), UIText.ShowBlameHandler_JobName,
View Full Code Here

    Object element = selection.getFirstElement();
    if (element instanceof IResource) {
      IResource resource = (IResource) element;

      if (resource instanceof IStorage) {
        IStorage storage = (IStorage) resource;
        RepositoryMapping mapping = RepositoryMapping
            .getMapping(resource);

        if (mapping != null) {
          String repoRelativePath = mapping
              .getRepoRelativePath(resource);
          return new Data(mapping.getRepository(), repoRelativePath,
              storage, null);
        }
      }
    } else if (element instanceof CommitFileRevision) {
      CommitFileRevision revision = (CommitFileRevision) element;
      try {
        IStorage storage = revision.getStorage(new NullProgressMonitor());
        return new Data(revision.getRepository(),
            revision.getGitPath(), storage, revision.getRevCommit());
      } catch (CoreException e) {
        // Don't enable
        return null;
View Full Code Here

TOP

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

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.