Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IStorage


        String resourceName;
        if (resource != null) {
            resource.getWorkspace().addResourceChangeListener(this);
            resourceName = resource.getName();
        } else {
            IStorage storage = (IStorage) input.getAdapter(IStorage.class);
            if (storage != null) {
                resourceName = storage.getName();
            } else {
                resourceName = input.getName();
            }
        }
View Full Code Here


        String resourceName;
        if (resource != null) {
            resource.getWorkspace().addResourceChangeListener(this);
            resourceName = resource.getName();
        } else {
            IStorage storage = (IStorage) input.getAdapter(IStorage.class);
            if (storage != null) {
                resourceName = storage.getName();
            } else {
                resourceName = input.getName();
            }
        }
View Full Code Here

    private static String getPathForInput(final IEditorInput editorInput) {
        if (editorInput instanceof IStorageEditorInput) {
            final IStorageEditorInput sei = (IStorageEditorInput) editorInput;
            try {
                final IStorage storage = sei.getStorage();
                final IPath p = storage.getFullPath();
                return p.toPortableString();
            } catch (final CoreException e) {
            }
        }
        if (editorInput instanceof IURIEditorInput) {
View Full Code Here

    private static String getEncodingForInput(final IEditorInput editorInput) {
        if (editorInput instanceof IStorageEditorInput) {
            final IStorageEditorInput sei = (IStorageEditorInput) editorInput;
            try {
                final IStorage storage = sei.getStorage();
                if (storage instanceof IEncodedStorage) {
                    final IEncodedStorage encodedStorage = (IEncodedStorage) storage;
                    return encodedStorage.getCharset();
                }
            } catch (final CoreException e) {
View Full Code Here

            } catch (Throwable t) {
                DroolsEclipsePlugin.log(t);
            }
        } else if (input instanceof IStorageEditorInput) {
            try {
                IStorage storage = ((IStorageEditorInput) input).getStorage();
                setPartName(storage.getName());
                InputStream is = storage.getContents();
                createModel(is);
            } catch (Throwable t) {
                DroolsEclipsePlugin.log(t);
            }
        }
View Full Code Here

      final InputStream data = path.open();
      if (data == null)
        continue;

      final IStorage storage = new IStorage() {
        public Object getAdapter(Class adapter) {
          return AdapterManager.getDefault().getAdapter(this, adapter);
        }

        public boolean isReadOnly() {
View Full Code Here


  @Override
  public IStorage getStorage() throws CoreException {
    log();
    return new IStorage() {
      public Object getAdapter(Class adapter) {
        return null;
      }
      public boolean isReadOnly() {
        return false;
View Full Code Here

        @Override
        public void run() {
          IWorkbench wb = PlatformUI.getWorkbench();
          if (wb != null) {
            IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            IStorage storage = new StringStorage("NuSMV Results", buf.toString());
            IStorageEditorInput input = new StringInput(storage);
            IWorkbenchPage page = window.getActivePage();
            if (page != null) {
              try {
                page.openEditor(input, "org.eclipse.ui.DefaultTextEditor");
View Full Code Here

          return;

      IJobManager jobMgr= Platform.getJobManager();

      try {
        IStorage storage= input.getStorage();
        // check for null for backward compatibility (we used to check before...)
        if (storage == null)
          return;
        fProgressMonitor= monitor;
        ISchedulingRule rule= getSchedulingRule(storage);
View Full Code Here

   * @throws CoreException if the given editor input cannot be accessed
   * @since 2.0
   */
  protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException {
    if (editorInput instanceof IStorageEditorInput) {
      IStorage storage= ((IStorageEditorInput) editorInput).getStorage();
      InputStream stream= storage.getContents();
      try {
        setDocumentContent(document, stream, encoding);
      } finally {
        try {
          stream.close();
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IStorage

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.