Examples of IFileStore


Examples of org.eclipse.core.filesystem.IFileStore

    String[] filePaths = files.toArray(new String[files.size()]);
    files.clear();
   
    for (String path : filePaths) {
      File fileToOpen = new File(path);
      IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    
        try {
            IDE.openEditorOnFileStore( page, fileStore );
        } catch ( PartInitException e ) {
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

   */
  public static void openExternalFile(String absolute){
    File fileToOpen = new File(absolute);
    
    if (fileToOpen.exists() && fileToOpen.isFile()) {
        IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    
        try {
            IDE.openEditorOnFileStore( page, fileStore );
        } catch ( PartInitException e ) {
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

  public void open() {
    if (fHyperlinkFile != null) {
      try {
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        IFileStore store = EFS.getLocalFileSystem().getStore(fHyperlinkFile.toURI());
        IDE.openEditorOnFileStore(page, store) ;
      }
      catch (PartInitException e) {
        Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
      }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

      return NLS.bind(XMLUIMessages.Open_With, path, editorLabel);
    return NLS.bind(XMLUIMessages.Open, path);
  }

  private String getEditorLabel() {
    final IFileStore store = EFS.getLocalFileSystem().getStore(fHyperlinkFile.toURI());
    final String name = store.fetchInfo().getName();

    if (name == null) {
      return null;
    }

    IContentType contentType= null;
    try {
      InputStream is = null;
      try {
        is = store.openInputStream(EFS.NONE, null);
        contentType= Platform.getContentTypeManager().findContentTypeFor(is, name);
      } finally {
        if (is != null) {
          is.close();
        }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

  public void open() {
    if (fHyperlinkFile != null) {
      try {
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        IFileStore store = EFS.getLocalFileSystem().getStore(fHyperlinkFile.toURI());
        IDE.openEditorOnFileStore(page, store) ;
      }
      catch (PartInitException e) {
        Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
      }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

            int numberOfFilesNotFound = 0;
            StringBuffer notFound = new StringBuffer();
            IWorkbenchPage page = window.getActivePage();
            for ( String name : names )
            {
                IFileStore fileStore = EFS.getLocalFileSystem().getStore( new Path( filterPath ) ).getChild( name );
                IFileInfo fetchInfo = fileStore.fetchInfo();
                if ( !fetchInfo.isDirectory() && fetchInfo.exists() )
                {
                    try
                    {
                        IDE.openEditorOnFileStore( page, fileStore );
                    }
                    catch ( PartInitException e )
                    {
                        MessageDialog.openError( window.getShell(), Messages.getString( "OpenFileAction.Error" ), e
                            .getMessage() );
                    }
                }
                else
                {
                    if ( ++numberOfFilesNotFound > 1 )
                    {
                        notFound.append( '\n' );
                    }
                    notFound.append( fileStore.getName() );
                }
            }

            if ( numberOfFilesNotFound > 0 )
            {
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

            int numberOfFilesNotFound = 0;
            StringBuffer notFound = new StringBuffer();
            IWorkbenchPage page = window.getActivePage();
            for ( String name : names )
            {
                IFileStore fileStore = EFS.getLocalFileSystem().getStore( new Path( filterPath ) ).getChild( name );
                IFileInfo fetchInfo = fileStore.fetchInfo();
                if ( !fetchInfo.isDirectory() && fetchInfo.exists() )
                {
                    try
                    {
                        IDE.openEditorOnFileStore( page, fileStore );
                    }
                    catch ( PartInitException e )
                    {
                        MessageDialog.openError( window.getShell(), Messages.getString( "OpenFileAction.Error" ), e //$NON-NLS-1$
                            .getMessage() );
                    }
                }
                else
                {
                    if ( ++numberOfFilesNotFound > 1 )
                    {
                        notFound.append( '\n' );
                    }
                    notFound.append( fileStore.getName() );
                }
            }

            if ( numberOfFilesNotFound > 0 )
            {
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

            getCommandStack().markSaveLocation();
          }
        } else if (getEditorInput() instanceof FileStoreEditorInput) {
          final URI targetURI = ((FileStoreEditorInput) getEditorInput())
              .getURI();
          final IFileStore store = EFS.getStore(targetURI);
          final OutputStream outputStream = store.openOutputStream(
              EFS.NONE, progressMonitor);
          if (null != currentMeiData) {
            MeiResourceReader.writeMEIInstance(store,
                currentMeiData, progressMonitor);
            outputStream.close();
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

    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 IFileStore store = EFS.getStore(fileURI);
        final FileStoreEditorInput input = new FileStoreEditorInput(
            store);
        new ProgressMonitorDialog(getSite().getWorkbenchWindow()
            .getShell()).run(false, // don't fork
            false, // not cancelable
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileStore

      } catch (CoreException e) {
        LogService.error(e.getMessage(), e);
      }
    } else if (input instanceof FileStoreEditorInput) {
      try {
        IFileStore fileStore = EFS
            .getStore(((FileStoreEditorInput) input).getURI());
        validationResult = MeiResourceReader
            .validateMEIInstance(fileStore.openInputStream(
                EFS.NONE, new NullProgressMonitor()));
        openNewEditorTab(fileStore.getName(), validationResult,
            fileStore.openInputStream(EFS.NONE,
                new NullProgressMonitor()));
      } catch (CoreException e) {
        LogService.error(e.getMessage(), e);
      }
    } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.