org.eclipse.core.runtime.Platform.getStateLocation()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.eclipse.core.runtime.Platform.getStateLocation()方法的一些代码示例,展示了Platform.getStateLocation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Platform.getStateLocation()方法的具体详情如下:
包路径:org.eclipse.core.runtime.Platform
类名称:Platform
方法名:getStateLocation

Platform.getStateLocation介绍

[英]Returns the location in the local file system of the plug-in state area for the given bundle. If the plug-in state area did not exist prior to this call, it is created.

The plug-in state area is a file directory within the platform's metadata area where a plug-in is free to create files. The content and structure of this area is defined by the plug-in, and the particular plug-in is solely responsible for any files it puts there. It is recommended for plug-in preference settings and other configuration parameters.
[中]返回给定包的插件状态区域在本地文件系统中的位置。如果在此调用之前插件状态区域不存在,则会创建它。
插件状态区域是平台元数据区域内的一个文件目录,插件可以在其中自由创建文件。该区域的内容和结构由插件定义,特定插件对其放置的任何文件全权负责。建议用于插件首选项设置和其他配置参数。

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-libs-bugtracking

public final IPath getStateLocation() throws IllegalStateException {
  return Platform.getStateLocation(null);
}

代码示例来源:origin: org.eclipse.recommenders.extdoc/rcp

static File store(String filename) {
  Bundle bundle = FrameworkUtil.getBundle(ManualModelStoreWiring.class);
  File basedir = Platform.getStateLocation(bundle).toFile();
  return new File(basedir, VERSION + filename);
}

代码示例来源:origin: org.eclipse/org.eclipse.jem.util

/**
 * DefaultUILogRenderer constructor.
 * 
 * @param logger
 */
public DefaultPluginTraceRenderer(Logger logger) {
  super(logger);
  fTraceFile = Platform.getStateLocation(fMyBundle).toString() + PluginTraceFileName;
  (new File(fTraceFile)).delete(); // Start from fresh ... do not want to leak on disk space
}

代码示例来源:origin: org.eclipse.net4j/util

public String getStateLocation()
 {
  Bundle bundle = getBundleContext().getBundle();
  return Platform.getStateLocation(bundle).toString();
 }
}

代码示例来源:origin: org.eclipse.recommenders.completion.rcp/calls

@Override
protected void configure() {
  final IPath stateLocation = Platform.getStateLocation(FrameworkUtil.getBundle(getClass()));
  final File index = new File(stateLocation.toFile(), format("call-models-%s.json", MODEL_VERSION));
  bind(File.class).annotatedWith(CallCompletion.class).toInstance(index);
  bind(STORE).to(CallModelArchiveStore.class).in(Scopes.SINGLETON);
  final IPreferenceStore prefStore = CallsCompletionPlugin.getDefault().getPreferenceStore();
  bind(IPreferenceStore.class).annotatedWith(CallCompletion.class).toInstance(prefStore);
}

代码示例来源:origin: org.eclipse.mylyn.builds/ui

protected IPath getBuildsFile() {
  IPath stateLocation = Platform.getStateLocation(getBundle());
  IPath cacheFile = stateLocation.append("builds.xmi"); //$NON-NLS-1$
  return cacheFile;
}

代码示例来源:origin: rombert/ereviewboard

public IPath getRepostioryAttributeCachePath() {
  IPath stateLocation = Platform.getStateLocation(getBundle());
  IPath cacheFile = stateLocation.append("repositoryClientDataCache");
  return cacheFile;
}

代码示例来源:origin: org.eclipse.mylyn.hudson/core

protected static File getCacheFile() {
  if (Platform.isRunning()) {
    Bundle bundle = Platform.getBundle(HudsonCorePlugin.ID_PLUGIN);
    if (bundle != null) {
      IPath stateLocation = Platform.getStateLocation(bundle);
      IPath cacheFile = stateLocation.append("configuration.obj"); //$NON-NLS-1$
      return cacheFile.toFile();
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.mylyn.builds/ui

private File getStateFile() {
  IPath stateLocation = Platform.getStateLocation(BuildsUiPlugin.getDefault().getBundle());
  return stateLocation.append("BuildView.xml").toFile(); //$NON-NLS-1$
}

代码示例来源:origin: com.ibm.jaggr/jaggr-service

File baseDir = new File(Platform.getStateLocation(contributingBundle).toFile(), "JAGGR"); //$NON-NLS-1$
baseDir.mkdir();
workdir = super.initWorkingDirectory(baseDir, configMap, versionString, versionsToRetain);

相关文章