本文整理汇总了Java中org.eclipse.cdt.core.settings.model.ICConfigurationDescription.getStorage方法的典型用法代码示例。如果您正苦于以下问题:Java ICConfigurationDescription.getStorage方法的具体用法?Java ICConfigurationDescription.getStorage怎么用?Java ICConfigurationDescription.getStorage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.cdt.core.settings.model.ICConfigurationDescription
的用法示例。
在下文中一共展示了ICConfigurationDescription.getStorage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performOK
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; //导入方法依赖的package包/类
@Override
protected void performOK() {
final ICResourceDescription resDesc = getResDesc();
if (resDesc == null)
return;
final ICConfigurationDescription cfgd= resDesc.getConfiguration();
if(cfgd instanceof ICMultiConfigDescription){
// this tab does not support editing of multiple configurations
return;
}
try {
// NB: defines & undefines are modified by the widget listeners directly
CMakePreferences prefs = ConfigurationManager.getInstance().get(cfgd);
// save as project settings..
ICStorageElement storage = cfgd.getStorage(
CMakePreferences.CFG_STORAGE_ID, true);
prefs.saveToStorage(storage);
} catch (CoreException ex) {
log.log(new Status(IStatus.ERROR, CdtPlugin.PLUGIN_ID, null, ex));
}
}
示例2: performOK
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; //导入方法依赖的package包/类
@Override
protected void performOK() {
final ICResourceDescription resDesc = getResDesc();
if (resDesc == null)
return;
ICConfigurationDescription cfgd= resDesc.getConfiguration();
if(cfgd instanceof ICMultiConfigDescription){
// this tab does not support editing of multiple configurations
return;
}
saveToModel();
try {
// save as project settings..
ICStorageElement storage = cfgd.getStorage(
CMakePreferences.CFG_STORAGE_ID, true);
prefs.saveToStorage(storage);
} catch (CoreException ex) {
log.log(new Status(IStatus.ERROR, CdtPlugin.PLUGIN_ID, null, ex));
}
}
示例3: getOrLoad
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; //导入方法依赖的package包/类
/**
* Tries to get the {@code CMakePreferences} object associated with the
* specified {@code ICConfigurationDescription}. If no
* {@code CMakePreferences} object is found, a new one is created, then loaded
* from its storage via {@link CMakePreferences#loadFromStorage}.
*
* @return the stored {@code CMakePreferences} object, or a freshly loaded one
* if this object contains no mapping for the configuration
* description.
* @throws CoreException
* if {@link ICConfigurationDescription#getStorage} throws a
* CoreException.
*/
public CMakePreferences getOrLoad(ICConfigurationDescription cfgd)
throws CoreException {
CMakePreferences pref = map.get(cfgd.getId());
if (pref == null) {
pref = new CMakePreferences();
ICStorageElement storage = cfgd.getStorage(
CMakePreferences.CFG_STORAGE_ID, false);
pref.loadFromStorage(storage);
map.put(cfgd.getId(), pref);
}
return pref;
}