【发布时间】:2013-03-12 17:24:41
【问题描述】:
我正在使用 Eclipse RCP 应用程序并为其配置 p2 更新。
我遇到了this 的例子。
包org.eclipse.equinox.p2.examples.rcp.cloud.p2;
导入 org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery; 导入 org.eclipse.equinox.p2.examples.rcp.cloud.Activator; 导入 org.eclipse.equinox.p2.query.QueryUtil; 导入 org.eclipse.equinox.p2.ui.Policy; 导入 org.eclipse.jface.preference.IPreferenceStore; 导入 org.eclipse.swt.graphics.Point;
/** * CloudPolicy 为 p2 UI 定义了 RCP 云示例策略。政策 * 在示例包启动时注册为 OSGi 服务。 * * @从 3.5 开始 */ 公共类 CloudPolicy 扩展策略 {
public void updateForPreferences() {
IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
setRepositoriesVisible(prefs
.getBoolean(PreferenceConstants.REPOSITORIES_VISIBLE));
setRestartPolicy(prefs.getInt(PreferenceConstants.RESTART_POLICY));
setShowLatestVersionsOnly(prefs
.getBoolean(PreferenceConstants.SHOW_LATEST_VERSION_ONLY));
setGroupByCategory(prefs
.getBoolean(PreferenceConstants.AVAILABLE_GROUP_BY_CATEGORY));
setShowDrilldownRequirements(prefs
.getBoolean(PreferenceConstants.SHOW_DRILLDOWN_REQUIREMENTS));
setFilterOnEnv(prefs.getBoolean(PreferenceConstants.FILTER_ON_ENV));
setUpdateWizardStyle(prefs.getInt(PreferenceConstants.UPDATE_WIZARD_STYLE));
int preferredWidth = prefs.getInt(PreferenceConstants.UPDATE_DETAILS_WIDTH);
int preferredHeight = prefs.getInt(PreferenceConstants.UPDATE_DETAILS_HEIGHT);
setUpdateDetailsPreferredSize(new Point(preferredWidth, preferredHeight));
if (prefs.getBoolean(PreferenceConstants.AVAILABLE_SHOW_ALL_BUNDLES))
setVisibleAvailableIUQuery(QueryUtil.ALL_UNITS);
else
setVisibleAvailableIUQuery(QueryUtil.createIUGroupQuery());
if (prefs.getBoolean(PreferenceConstants.INSTALLED_SHOW_ALL_BUNDLES))
setVisibleAvailableIUQuery(QueryUtil.ALL_UNITS);
else
setVisibleAvailableIUQuery(new UserVisibleRootQuery());
}
}
这里类型 IQuery 和 QueryUtil 不可访问,因为我无法访问包 org.eclipse.equinox.p2.query
我正在使用 eclipse Indigo (3.7),我在插件中添加的依赖项是:
org.eclipse.equinox.p2.ui.sdk
org.eclipse.equinox.p2.ui
org.eclipse.equinox.p2.engine
请指导我。
【问题讨论】:
标签: eclipse eclipse-rcp p2