Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IEncodedStorage


        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) {
            }
        }
        return ResourcesPlugin.getEncoding();
View Full Code Here


    return input;
  }

  private static String getLocalEncoding(IResource resource) {
    if (resource instanceof IEncodedStorage) {
      IEncodedStorage es = (IEncodedStorage) resource;
      try {
        return es.getCharset();
      } catch (CoreException e) {
        Activator.logError(e.getMessage(), e);
      }
    }
    return null;
View Full Code Here

          return ((IFileState) storage).getModificationTime();
        }
      };
    }

    return new IEncodedStorage() {
      public Object getAdapter(Class adapter) {
        return storage.getAdapter(adapter);
      }

      public boolean isReadOnly() {
View Full Code Here

    // Get the encoding for the current version. As a matter of
    // principle one might want to use the eclipse settings for the
    // version we are retrieving as that may be defined by the
    // project settings, but there is no historic API for this.
    String charset;
    IEncodedStorage encodedStorage = ((IEncodedStorage) resource);
    try {
      charset = encodedStorage.getCharset();
      if (charset == null)
        charset = resource.getParent().getDefaultCharset();
    } catch (CoreException e) {
      charset = Constants.CHARACTER_ENCODING;
    }
View Full Code Here

TOP

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

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.