Package org.eclipse.ui

Examples of org.eclipse.ui.IPathEditorInput


     * @return This is the Path that the editor is editing.
     */
    private IPath getPathFromInput(IEditorInput otherInput) {
        IPath path = null;
        if (otherInput instanceof IPathEditorInput) {
            IPathEditorInput iPathEditorInput = (IPathEditorInput) otherInput;
            try {
                path = iPathEditorInput.getPath();
            } catch (IllegalArgumentException e) {
                //ignore: we may have the trace below inside the FileEditorInput.
                //java.lang.IllegalArgumentException
                //at org.eclipse.ui.part.FileEditorInput.getPath(FileEditorInput.java:208)
                //at org.python.pydev.editor.PyEditTitle.getPathFromInput(PyEditTitle.java:751)
View Full Code Here


        CFJavaFileEditorInput input= (CFJavaFileEditorInput) o;
        return fFile.equals(input.fFile);
      }

          if (o instanceof IPathEditorInput) {
              IPathEditorInput input= (IPathEditorInput)o;
              return getPath().equals(input.getPath());
          }

      return false;
    }
View Full Code Here

    try {
      IEditorInput input = editor.getEditorInput();

      if (input instanceof IPathEditorInput) {
        IPathEditorInput pathInput = (IPathEditorInput) input;
        path = pathInput.getPath();
      }
    } catch (NullPointerException npe) {

    }
View Full Code Here

        throws CoreException
    {

        if ( element instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) element;
            IPath path = pei.getPath();
            File file = path.toFile();

            try
            {
                file.createNewFile();
View Full Code Here

     */
    public boolean isModifiable( Object element )
    {
        if ( element instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) element;
            File file = pei.getPath().toFile();
            return file.canWrite() || !file.exists(); // Allow to edit new files
        }
        return false;
    }
View Full Code Here

     */
    public void init( IEditorSite site, IEditorInput input ) throws PartInitException
    {
        if ( input instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) input;
            IPath path = pei.getPath();
            File javaIoFile = path.toFile();
            long fileLength = javaIoFile.length();
            if ( fileLength > ( 1 * 1024 * 1024 ) )
            {
                MessageDialog.openError( site.getShell(), "LDIF file is too big",
View Full Code Here

      if (editor != null) {
        ((HudsonBrowser) editor).openUrl(url, name);
      }

      if (editor == null) {
        getSite().getPage().openEditor(new IPathEditorInput() {
          public IPath getPath() {
            return new Path(url);
          }

          public boolean exists() {
View Full Code Here

      if (editor != null) {
        ((HudsonBrowser)editor).openUrl(url, name);
      }
     
      if (editor == null) {
        getSite().getPage().openEditor(new IPathEditorInput() {
          public IPath getPath() {
            return new Path(url);
          }
 
          public boolean exists() {
View Full Code Here

   * @param html
   * @return
   */
  private String addBaseURL(IEditorPart editor, String html) {
  try {
    IPathEditorInput input = (IPathEditorInput) editor.getEditorInput();
    IPath path = input.getPath();
    path = path.removeLastSegments(1);
    File f = path.toFile();
    URI fileURI = f.toURI();
    String html2 = "<html><head><base href='"+fileURI+"' /></head><body>\r\n"+html
    +"\r\n</body></html>";
View Full Code Here

    return null;
  }


  private IFile getResource(MarkdownEditor markdownEditor) {
    IPathEditorInput input = (IPathEditorInput) getEditorInput();
    IPath path = input.getPath();   
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot();
    IFile[] files = root.findFilesForLocation(path);
    if (files.length != 1) return null;
    IFile docFile = files[0];   
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IPathEditorInput

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.