Package org.eclipse.ui

Examples of org.eclipse.ui.IPathEditorInput


    {
        String className = input.getClass().getName();
        File file = null;
        if ( input instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) input;
            IPath path = pei.getPath();
            file = path.toFile();
        }
        else if ( className.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" ) //$NON-NLS-1$
            || className.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) ) //$NON-NLS-1$
        // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
View Full Code Here


            writeDocumentContent( document, ( ( FileEditorInput ) element ).getFile(), monitor );
            return;
        }
        else if ( element instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) element;
            IPath path = pei.getPath();
            file = path.toFile();
        }
        else if ( elementClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" ) //$NON-NLS-1$
            || elementClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) ) //$NON-NLS-1$
        // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
View Full Code Here

    public boolean isModifiable( Object element )
    {
        String elementClassName = element.getClass().getName();
        if ( element instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) element;
            File file = pei.getPath().toFile();
            return file.canWrite() || !file.exists(); // Allow to edit new files
        }
        else if ( elementClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" ) //$NON-NLS-1$
            || elementClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) ) //$NON-NLS-1$
        // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
View Full Code Here

        IStorageEditorInput sei = (IStorageEditorInput) input;
        try {
          return sei.getStorage().getFullPath().toOSString();
        } catch (Exception e) {
          if (input instanceof IPathEditorInput) {
            IPathEditorInput pin = (IPathEditorInput) input;
            return pin.getPath().toOSString();
          }
        }
      } else if (input instanceof IPathEditorInput) {
        IPathEditorInput pin = (IPathEditorInput) input;
        return pin.getPath().toOSString();
      }
    } catch (Exception e) {
      return null;
    }
View Full Code Here

  protected URL getURLFromEditorInput(IEditorInput editorInput) throws MalformedURLException{
    URL documentURL = null;
    if(editorInput != null) {
      String url = null;
      if(editorInput instanceof IPathEditorInput) {
        IPathEditorInput pathEditorInput = (IPathEditorInput)editorInput;       
        url = pathEditorInput.getPath().toString();     
     
      //TODO replace use of refelction API with this block if eclipse 3.3 is always used
      else {
        try {
          Method getURIMethod = editorInput.getClass().getDeclaredMethod("getURI",new Class[0]);
View Full Code Here

    } else if (element instanceof IPathEditorInput) {

      // Maybe this is not executed on Eclipse 3.3 or later
      // Eclipse 3.2 executed for a file outside of workspace
      IPathEditorInput input = (IPathEditorInput) element;
      document = createHdlDocument(null, null);
      FileInputStream contentStream = null;
      try {
        contentStream = new FileInputStream(input.getPath().toFile());
        setDocumentContent(document, contentStream,
            getEncoding(element));
      } catch (FileNotFoundException e) {
        e.printStackTrace();
        document = null;
View Full Code Here

  protected IFile getFile() {
    IFile wodFile = null;
    IEditorInput input = _editorPart.getEditorInput();
    if (input instanceof IPathEditorInput) {
      IPathEditorInput pathInput = (IPathEditorInput) input;
      IPath path = pathInput.getPath();
      wodFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
    }
    return wodFile;
  }
View Full Code Here

      int offset = _offset;
      TypeCache typeCache = WodParserCache.getTypeCache();
      IDocument document = viewer.getDocument();
      IEditorInput input = _editor.getEditorInput();
      if (input instanceof IPathEditorInput) {
        IPathEditorInput pathInput = (IPathEditorInput) input;
        IPath path = pathInput.getPath();
        IFile wodFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
        IProject project = wodFile.getProject();
        IJavaProject javaProject = JavaCore.create(project);

        // Without an underlying model, we have to rescan the line to
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

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.