Package org.eclipse.ui

Examples of org.eclipse.ui.IURIEditorInput


                return p.toPortableString();
            } catch (final CoreException e) {
            }
        }
        if (editorInput instanceof IURIEditorInput) {
            final IURIEditorInput ue = (IURIEditorInput) editorInput;
            return ue.getURI().getPath();
        }
        return null;
    }
View Full Code Here


    /*
     * @see org.eclipse.ui.editors.text.ILocationProviderExtension#getURI(java.lang.Object)
     */
    public URI getURI(Object element) {
      if (element instanceof IURIEditorInput) {
        IURIEditorInput input= (IURIEditorInput)element;
        return input.getURI();
      }
      return null;
    }
View Full Code Here

      IFile file = getWorkspaceFile(fileStore);
      if(file != null)
        newInput = new FileEditorInput(file);
      else {
        IURIEditorInput uriInput = new FileStoreEditorInput(fileStore);
        java.net.URI uri = uriInput.getURI();
        IFile linkedFile = ExtLinkedFileHelper.obtainLink(uri, false);

        newInput = new FileEditorInput(linkedFile);
      }
View Full Code Here

    mySelectionChangedListeners.remove(_listener);
  }

  public void resourceChanged(final IResourceChangeEvent _event) {
    if (_event.getType() == IResourceChangeEvent.PRE_CLOSE) {
      final IURIEditorInput input = (IURIEditorInput) getEditorInput();
      Display.getDefault().asyncExec(new Runnable() {
        public void run() {
          IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
          for (int pageNum = 0; pageNum < pages.length; pageNum++) {
            IFile eclipseIndexFile = EclipseFileUtils.getEclipseFile(input.getURI());
            if (eclipseIndexFile != null && eclipseIndexFile.getProject().equals(_event.getResource())) {
              IEditorPart editorPart = pages[pageNum].findEditor(input);
              pages[pageNum].closeEditor(editorPart, true);
            }
          }
View Full Code Here

import org.objectstyle.wolips.eomodeler.core.model.EOModel;
import org.objectstyle.wolips.eomodeler.core.model.EOModelException;

public class EclipseFileUtils {
  public static IURIEditorInput getEditorInput(EOModel model) throws MalformedURLException, EOModelException, CoreException, URISyntaxException {
    IURIEditorInput editorInput;
    IFile indexFile = EclipseFileUtils.getEclipseIndexFile(model);
    if (indexFile == null) {
      String externalForm = model.getIndexURL().toExternalForm().replace(' ', '+');
      IFileStore indexFileStore = EFS.getStore(new URI(externalForm));
      editorInput = new FileStoreEditorInput(indexFileStore);
View Full Code Here

    }
    // case 2: a file that is not part of the workspace
    if (file == null
        && IURIEditorInput.class.isAssignableFrom(editorInputObject.getClass()))
    {
      IURIEditorInput uriEditorInput = (IURIEditorInput) editorInputObject;
      URI uri = uriEditorInput.getURI();
      if ("file".equals(uri.getScheme()))
      {
        file = this.pathStringToFile(uri.getPath(), this.getResourceType(),
            event);
      }
View Full Code Here

      IEditorInput fileEditorInput = camelEditorInput.getFileEditorInput();
      if (fileEditorInput instanceof IRemoteCamelEditorInput) {
        return (IRemoteCamelEditorInput) fileEditorInput;
      }
    } else if (input instanceof IURIEditorInput) {
      final IURIEditorInput uriInput = (IURIEditorInput) input;
      return new IRemoteCamelEditorInput() {

        @Override
        public String getUriText() {
          return uriInput.getName();
        }

        @Override
        public String getXml() throws IOException {
          return IOUtils.loadText(uriInput.getURI().toURL().openStream(), "UTF-8");
        }
      };
        } else if (input instanceof DiagramEditorInput) {
            final DiagramEditorInput uriInput = (DiagramEditorInput) input;
            return new IRemoteCamelEditorInput() {

                @Override
                public String getUriText() {
                    return uriInput.getName();
                }

                @Override
                public String getXml() throws IOException {
                    try {
                        return IOUtils.loadText(new URI(uriInput.getUri().toString()).toURL().openStream(), "UTF-8");
                    } catch (URISyntaxException e) {
                        throw new IOException("Unable to resolve resource.", e);
                    }
                }
            };
View Full Code Here

        ICamelEditorInput camelInput = (ICamelEditorInput) editorInput;
        editor.onInputLoading(camelInput);
        this.setModel(camelInput.loadModel());
      } else if (editorInput instanceof IURIEditorInput) {
        editor.onInputLoading(editorInput);
        IURIEditorInput uriInput = (IURIEditorInput) editorInput;
        URI uri = uriInput.getURI();
        URL url = uri.toURL();
        if (url == null) {
          Activator.getLogger().warning("Unsupported URI type " + uri);
        } else {
          String xml = IOUtils.loadText(url.openStream(), "UTF-8");
View Full Code Here

    Object getElementOfInput(IEditorInput input) {
        if (input instanceof IFileEditorInput) {
            return ((IFileEditorInput) input).getFile();
        }
        if (input instanceof IURIEditorInput) {
            IURIEditorInput iuriEditorInput = (IURIEditorInput) input;
            URI uri = iuriEditorInput.getURI();
            return new File(uri);

        }
        if (input instanceof PydevZipFileEditorInput) {
            PydevZipFileEditorInput pydevZipFileEditorInput = (PydevZipFileEditorInput) input;
View Full Code Here

            f = pyEditorInput.getPath().toFile();

        } else {
            try {
                if (editorInput instanceof IURIEditorInput) {
                    IURIEditorInput iuriEditorInput = (IURIEditorInput) editorInput;
                    return new File(iuriEditorInput.getURI());
                }
            } catch (Throwable e) {
                //OK, IURIEditorInput was only added on eclipse 3.3
            }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IURIEditorInput

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.