Java 类org.eclipse.core.resources.IEncodedStorage 实例源码

项目:subclipse    文件:SVNStatusSyncInfo.java   
private static IResourceVariant createBaseResourceVariant(IResource local, LocalResourceStatus baseStatusInfo) {
    if( baseStatusInfo == null
            || baseStatusInfo.getLastChangedRevision() == null )
      return null;

    if( local.getType() == IResource.FILE ) {
        String charset = null;
        try {
            charset = ((IEncodedStorage)local).getCharset();
        } catch (CoreException e) {
            SVNProviderPlugin.log(IStatus.ERROR, e.getMessage(), e);
        }
        return new BaseFile(local, baseStatusInfo, charset);
    }
    else {
        return new BaseFolder(local, baseStatusInfo);
    }
}
项目:bts    文件:XtextDocumentProvider.java   
@Override
public String getEncoding(Object element) {
    String encoding = super.getEncoding(element);
    if (encoding == null && element instanceof IStorageEditorInput) {
        try {
            IStorage storage = ((IStorageEditorInput) element).getStorage();
            URI uri = storage2UriMapper.getUri(storage);
            if (uri != null) {
                encoding = encodingProvider.getEncoding(uri);
            } else if (storage instanceof IEncodedStorage) {
                encoding = ((IEncodedStorage)storage).getCharset();
            }
        } catch (CoreException e) {
            throw new WrappedException(e);
        }
    }
    return encoding;
}
项目:APICloud-Studio    文件:SVNStatusSyncInfo.java   
private static IResourceVariant createBaseResourceVariant(IResource local, LocalResourceStatus baseStatusInfo) {
    if( baseStatusInfo == null
            || baseStatusInfo.getLastChangedRevision() == null )
      return null;

    if( local.getType() == IResource.FILE ) {
        String charset = null;
        try {
            charset = ((IEncodedStorage)local).getCharset();
        } catch (CoreException e) {
            SVNProviderPlugin.log(IStatus.ERROR, e.getMessage(), e);
        }
        return new BaseFile(local, baseStatusInfo, charset);
    }
    else {
        return new BaseFolder(local, baseStatusInfo);
    }
}
项目:birt    文件:StorageDocumentProvider.java   
/**
 * Returns the persisted encoding for the given element.
 * 
 * @param element
 *            the element for which to get the persisted encoding
 * @return the persisted encoding
 */
protected String getPersistedEncoding( Object element )
{
    if ( element instanceof IStorageEditorInput )
    {
        IStorage storage;
        try
        {
            storage = ( (IStorageEditorInput) element ).getStorage( );
            if ( storage instanceof IEncodedStorage )
                return ( (IEncodedStorage) storage ).getCharset( );
        }
        catch ( CoreException e )
        {
            return null;
        }
    }
    return null;
}
项目:birt    文件:FileReportDocumentProvider.java   
/**
 * Returns the persisted encoding for the given element.
 * 
 * @param element
 *            the element for which to get the persisted encoding
 * @return the persisted encoding
 */
protected String getPersistedEncoding( Object element )
{
    if ( element instanceof IEncodedStorage )
    {
        try
        {
            return ( (IEncodedStorage) element ).getCharset( );
        }
        catch ( CoreException e )
        {
            return null;
        }
    }
    return null;
}
项目:subclipse    文件:Utilities.java   
public static String getCharset(IResource resource) {
    if (resource instanceof IEncodedStorage) {
        try {
            return ((IEncodedStorage)resource).getCharset();
        } catch (CoreException ex) {
            // fall  through
        }
    }
    return ResourcesPlugin.getEncoding();
}
项目:APICloud-Studio    文件:Utilities.java   
public static String getCharset(IResource resource) {
    if (resource instanceof IEncodedStorage) {
        try {
            return ((IEncodedStorage)resource).getCharset();
        } catch (CoreException ex) {
            // fall  through
        }
    }
    return ResourcesPlugin.getEncoding();
}