本文整理汇总了Java中org.eclipse.core.resources.IEncodedStorage类的典型用法代码示例。如果您正苦于以下问题:Java IEncodedStorage类的具体用法?Java IEncodedStorage怎么用?Java IEncodedStorage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IEncodedStorage类属于org.eclipse.core.resources包,在下文中一共展示了IEncodedStorage类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBaseResourceVariant
import org.eclipse.core.resources.IEncodedStorage; //导入依赖的package包/类
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);
}
}
示例2: getEncoding
import org.eclipse.core.resources.IEncodedStorage; //导入依赖的package包/类
@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;
}
示例3: getPersistedEncoding
import org.eclipse.core.resources.IEncodedStorage; //导入依赖的package包/类
/**
* 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;
}
示例4: getPersistedEncoding
import org.eclipse.core.resources.IEncodedStorage; //导入依赖的package包/类
/**
* 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;
}
示例5: getCharset
import org.eclipse.core.resources.IEncodedStorage; //导入依赖的package包/类
public static String getCharset(IResource resource) {
if (resource instanceof IEncodedStorage) {
try {
return ((IEncodedStorage)resource).getCharset();
} catch (CoreException ex) {
// fall through
}
}
return ResourcesPlugin.getEncoding();
}