本文整理了Java中org.eclipse.core.runtime.Platform.getStateStamp()
方法的一些代码示例,展示了Platform.getStateStamp()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Platform.getStateStamp()
方法的具体详情如下:
包路径:org.eclipse.core.runtime.Platform
类名称:Platform
方法名:getStateStamp
[英]Returns a number that changes whenever the set of installed plug-ins changes. This can be used for invalidating caches that are based on the set of currently installed plug-ins. (e.g. extensions)
Clients are also able to acquire the PlatformAdmin service and get the timestamp from its state object.
[中]返回一个数字,该数字在安装的插件集发生更改时更改。这可用于使基于当前安装的插件集的缓存失效。(例如扩展)
客户端还可以获取PlatformAdmin服务,并从其状态对象获取时间戳。
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources
@Override
public void shutdown(IProgressMonitor monitor) throws CoreException {
if (getCacheState() != INVALID_CACHE)
// remember the platform timestamp for which we have a valid cache
setCacheTimeStamp(Platform.getStateStamp());
IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
//tolerate missing services during shutdown because they might be already gone
if (contentTypeManager != null)
contentTypeManager.removeContentTypeChangeListener(this);
IExtensionRegistry registry = Platform.getExtensionRegistry();
if (registry != null)
registry.removeRegistryChangeListener(this);
cache.dispose();
cache = null;
flushJob.cancel();
flushJob = null;
projectContentTypes = null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.core.resources
@Override
public void shutdown(IProgressMonitor monitor) throws CoreException {
if (getCacheState() != INVALID_CACHE)
// remember the platform timestamp for which we have a valid cache
setCacheTimeStamp(Platform.getStateStamp());
IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
//tolerate missing services during shutdown because they might be already gone
if (contentTypeManager != null)
contentTypeManager.removeContentTypeChangeListener(this);
IExtensionRegistry registry = Platform.getExtensionRegistry();
if (registry != null)
registry.removeRegistryChangeListener(this);
cache.dispose();
cache = null;
flushJob.cancel();
flushJob = null;
projectContentTypes = null;
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources
@Override
public void shutdown(IProgressMonitor monitor) throws CoreException {
if (getCacheState() != INVALID_CACHE)
// remember the platform timestamp for which we have a valid cache
setCacheTimeStamp(Platform.getStateStamp());
IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
//tolerate missing services during shutdown because they might be already gone
if (contentTypeManager != null)
contentTypeManager.removeContentTypeChangeListener(this);
IExtensionRegistry registry = Platform.getExtensionRegistry();
if (registry != null)
registry.removeRegistryChangeListener(this);
cache.dispose();
cache = null;
flushJob.cancel();
flushJob = null;
projectContentTypes = null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.core.resources
@Override
public void startup(IProgressMonitor monitor) throws CoreException {
workspace = (Workspace) ResourcesPlugin.getWorkspace();
cache = new Cache(100, 1000, 0.1);
projectContentTypes = new ProjectContentTypes(workspace);
getCacheState();
if (cacheState == FLUSHING_CACHE || cacheState == ABOUT_TO_FLUSH)
// in case we died before completing the last flushing
setCacheState(INVALID_CACHE);
flushJob = new FlushJob();
// the cache is stale (plug-ins that might be contributing content types were added/removed)
if (getCacheTimestamp() != Platform.getStateStamp())
invalidateCache(false, null);
// register a lifecycle listener
workspace.addLifecycleListener(this);
// register a content type change listener
Platform.getContentTypeManager().addContentTypeChangeListener(this);
// register a registry change listener
Platform.getExtensionRegistry().addRegistryChangeListener(this, Platform.PI_RUNTIME);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources
@Override
public void startup(IProgressMonitor monitor) throws CoreException {
workspace = (Workspace) ResourcesPlugin.getWorkspace();
cache = new Cache(100, 1000, 0.1);
projectContentTypes = new ProjectContentTypes(workspace);
getCacheState();
if (cacheState == FLUSHING_CACHE || cacheState == ABOUT_TO_FLUSH)
// in case we died before completing the last flushing
setCacheState(INVALID_CACHE);
flushJob = new FlushJob();
// the cache is stale (plug-ins that might be contributing content types were added/removed)
if (getCacheTimestamp() != Platform.getStateStamp())
invalidateCache(false, null);
// register a lifecycle listener
workspace.addLifecycleListener(this);
// register a content type change listener
Platform.getContentTypeManager().addContentTypeChangeListener(this);
// register a registry change listener
Platform.getExtensionRegistry().addRegistryChangeListener(this, Platform.PI_RUNTIME);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources
@Override
public void startup(IProgressMonitor monitor) throws CoreException {
workspace = (Workspace) ResourcesPlugin.getWorkspace();
cache = new Cache(100, 1000, 0.1);
projectContentTypes = new ProjectContentTypes(workspace);
getCacheState();
if (cacheState == FLUSHING_CACHE || cacheState == ABOUT_TO_FLUSH)
// in case we died before completing the last flushing
setCacheState(INVALID_CACHE);
flushJob = new FlushJob();
// the cache is stale (plug-ins that might be contributing content types were added/removed)
if (getCacheTimestamp() != Platform.getStateStamp())
invalidateCache(false, null);
// register a lifecycle listener
workspace.addLifecycleListener(this);
// register a content type change listener
Platform.getContentTypeManager().addContentTypeChangeListener(this);
// register a registry change listener
Platform.getExtensionRegistry().addRegistryChangeListener(this, Platform.PI_RUNTIME);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
String currentState = String.valueOf(Platform.getStateStamp());
boolean sameState = currentState.equals(prevState);
if (!sameState) {
内容来源于网络,如有侵权,请联系作者删除!