Package org.eclipse.ui.part

Examples of org.eclipse.ui.part.FileEditorInput


        IWorkspaceRoot root = PerlEditorPlugin.getWorkspace().getRoot();

        try
        {
            IFile[] files = root.findFilesForLocation(fPath);
        if (files.length > 0) return new FileEditorInput(files[0]); // found

            // not found, let's create a link to its parent folder
            // and search again
            createFolderLink(fPath, getEpicLinksProject(root));
   
        files = root.findFilesForLocation(fPath);   
            if (files.length > 0) return new FileEditorInput(files[0]); // found
           
            // we have the link and the file still can't be found??
            throw new CoreException(new Status(
                IStatus.ERROR,
                PerlEditorPlugin.getPluginId(),
View Full Code Here


    fFileValueMap= new HashMap(5);
    fBufferValueMap= new HashMap(5);
  }

  public TextBuffer acquire(IFile file) throws CoreException {
    FileEditorInput input= new FileEditorInput(file)
   
    Value value= (Value)fFileValueMap.get(input);
    if (value != null) {
      value.references++;
      return value.buffer;
View Full Code Here

      }
    }
  }
 
  public TextBuffer create(IFile file) throws CoreException {
    FileEditorInput input= new FileEditorInput(file)
    IDocument document= fDocumentProvider.getDocument(input);
    if (document != null) {
      return new TextBuffer(new Document(document.get()));
    } else {
      return createFromFile(file);
View Full Code Here

      IFile file = project.getFile(BundlePath.DUB_MANIFEST_FILENAME);
     
      IWorkbenchPage activePage = WorkbenchUtils.getActivePage();
      if(activePage != null) {
        try {
          activePage.openEditor(new FileEditorInput(file), EditorsUI.DEFAULT_TEXT_EDITOR_ID);
        } catch (PartInitException e) {
          DeeCore.logInternalError(e);
        }
      }
      fBuildSettingsPage.performOk();
View Full Code Here

    IWorkbenchPage page = activeWorkbenchPage();
    if (page == null) {
      return null;
    }
    IFile file = uris.referredFile(uri);
    IEditorInput editorInput = new FileEditorInput(file);
    return openFile(editorInput, page);
  }
View Full Code Here

    saveAsDialog.open();
    IPath path = saveAsDialog.getResult();
    if (path != null) {
      IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
      if (file != null) {
        doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
      }
    }
  }
View Full Code Here

   * @param path the path of the new location of the file
   */
  protected void handleElementMoved(IFileEditorInput fileEditorInput, IPath path) {
    IWorkspace workspace= ResourcesPlugin.getWorkspace();
    IFile newFile= workspace.getRoot().getFile(path);
    fireElementMoved(fileEditorInput, newFile == null ? null : new FileEditorInput(newFile));
  }
View Full Code Here

     * @see org.eclipse.core.buffer.text.IBufferedFileListener#underlyingFileMoved(org.eclipse.core.buffer.text.IBufferedFile, org.eclipse.core.runtime.IPath)
     */
    public void underlyingFileMoved(IFileBuffer file, IPath newLocation) {
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      IFile newFile= workspace.getRoot().getFile(newLocation);
      IEditorInput input= newFile == null ? null : new FileEditorInput(newFile);
      List list= new ArrayList(fElementStateListeners);
      Iterator e= list.iterator();
      while (e.hasNext()) {
        IElementStateListener l= (IElementStateListener) e.next();
        Iterator i= getElements(file);
View Full Code Here

        return;
      }
     
      IFile file= getWorkspaceFile(fileStore);
      if (file != null)
        newInput= new FileEditorInput(file);
      else
        newInput= new FileStoreEditorInput(fileStore);
     
    } else {
      SaveAsDialog dialog= new SaveAsDialog(shell);

      IFile original= (input instanceof IFileEditorInput) ? ((IFileEditorInput) input).getFile() : null;
      if (original != null)
        dialog.setOriginalFile(original);

      dialog.create();

      if (provider.isDeleted(input) && original != null) {
        String message= NLSUtility.format(TextEditorMessages.AbstractDecoratedTextEditor_warning_saveAs_deleted, original.getName());
        dialog.setErrorMessage(null);
        dialog.setMessage(message, IMessageProvider.WARNING);
      }

      if (dialog.open() == Window.CANCEL) {
        if (progressMonitor != null)
          progressMonitor.setCanceled(true);
        return;
      }
     
      IPath filePath= dialog.getResult();
      if (filePath == null) {
        if (progressMonitor != null)
          progressMonitor.setCanceled(true);
        return;
      }
     
      IWorkspace workspace= ResourcesPlugin.getWorkspace();
      IFile file= workspace.getRoot().getFile(filePath);
      newInput= new FileEditorInput(file);

    }
   
    if (provider == null) {
      // editor has programmatically been  closed while the dialog was open
View Full Code Here

                    boolean succeeded =
                            performSaveOperation(createSaveOperation(command),
                                    progressMonitor);

                    if (succeeded) {
                        setInput(new FileEditorInput(file));
                        context.setPolicyResource(file);
                        setTitle(file.getName());
                    }

                    if (progressMonitor != null) {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.part.FileEditorInput

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.