Package org.eclipse.ui.ide

Examples of org.eclipse.ui.ide.FileStoreEditorInput


            if (!fetchInfo.isDirectory() && fetchInfo.exists()) {
                if (element instanceof IErlModule
                        && element.getParent() instanceof IErlExternal) {
                    return new ErlangExternalEditorInput(fileStore, (IErlModule) element);
                }
                return new FileStoreEditorInput(fileStore);
            }
        }
        return null;
    }
View Full Code Here


class FileStoreDocumentContentsFactory implements DocumentContentsFactory {
  @Inject private ContentReader contentReader;
  @Inject private XtextResourceFactory resourceFactory;

  @Override public void createContents(XtextDocument document, Object element) throws CoreException {
    FileStoreEditorInput input = supportedEditorInputType().cast(element);
    File file = new File(input.getURI());
    try {
      String contents = contentsOf(file);
      document.set(contents);
      XtextResource resource = resourceFactory.createResource(file.toURI().toString(), contents);
      document.setInput(resource);
View Full Code Here

    IWorkbenchPage page = activeWorkbenchPage();
    if (page == null) {
      return null;
    }
    IFileStore fileStore = EFS.getLocalFileSystem().getStore(Path.fromOSString(uri.toFileString()));
    IEditorInput editorInput = new FileStoreEditorInput(fileStore);
    return openFile(editorInput, page);
  }
View Full Code Here

     
      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;
View Full Code Here

    if(part == null)
      return false; // TODO: may be wrong if part not restored See EditorManager.findEditors
    IEditorInput editorInput = part.getEditorInput();
    if(editorInput instanceof FileEditorInput && input instanceof FileStoreEditorInput) {
      FileEditorInput fei = (FileEditorInput) editorInput;
      FileStoreEditorInput fsei = (FileStoreEditorInput) input;
      if(fei.getFile().isLinked() && fei.getURI().equals(fsei.getURI()))
        return true;
    }
    return editorInput.equals(input);
  }
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

    fileDialog.setText("Messages.ImportExportPart_SaveImportSpecAsTitle"); //$NON-NLS-1$
    final String fileName = fileDialog.open();
    if (fileName != null) {
      final URI fileURI = new File(fileName).toURI();
      try {
        final FileStoreEditorInput input = new FileStoreEditorInput(
            EFS.getStore(fileURI));
        setValidPartName(input.getName());
        setInputWithNotify(input);
        doSave(new NullProgressMonitor());
      } catch (final CoreException e) {
        LogService.error(e.getMessage(), e);
      }
View Full Code Here

    final String fileName = fileDialog.open();
    if (fileName != null) {
      final URI fileURI = new File(fileName).toURI();
      try {
        final IFileStore store = EFS.getStore(fileURI);
        final FileStoreEditorInput input = new FileStoreEditorInput(
            store);
        new ProgressMonitorDialog(getSite().getWorkbenchWindow()
            .getShell()).run(false, // don't fork
            false, // not cancelable
            new WorkspaceModifyOperation() { // run this operation
              @Override
              public void execute(final IProgressMonitor monitor) {
                monitor.beginTask(MusicMessages.MeiseEditor_8,
                    2);
                setValidPartName(input.getName());
                setInputWithNotify(input);
                // doSave(monitor);
                final MusicDiagram shutDownDiagram = (MusicDiagram) getMusicDiagram()
                    .clone();
                shutDownDiagram.tearDown();
View Full Code Here

    super.setInput(input);

    if (getEditorInput() != null) {
      if (getEditorInput() instanceof FileStoreEditorInput) {
        FileStoreEditorInput fsei = (FileStoreEditorInput) getEditorInput();
        final URI targetURI = fsei.getURI();
        try {
          final IFileStore store = EFS.getStore(targetURI);
          setValidPartName(store.getName());
        } catch (CoreException e) {
          LogService.warning(e.getMessage(), e);
View Full Code Here

        String editorId = getEditorId(file);
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        IFileStore fileStore;
        try {
            fileStore = EFS.getLocalFileSystem().getStore(new Path(file.getCanonicalPath()));
            IEditorInput input = new FileStoreEditorInput(fileStore);
            return page.openEditor(input, editorId);
        } catch (IOException e) {
            FindbugsPlugin.getDefault().logException(e, "Could not get canonical file path");
        } catch (CoreException e) {
            FindbugsPlugin.getDefault().logException(e, "Could not get canonical file path");
View Full Code Here

TOP

Related Classes of org.eclipse.ui.ide.FileStoreEditorInput

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.