读书人

RCP中关于可选项(preferencePages)的

发布时间: 2012-10-24 14:15:58 作者: rapoo

RCP中关于可选项(preferencePages)的使用

?在plugin.xml中添加preferencePages的相关配置:

自定义属性的配置:

?

public class SampleHandler extends AbstractHandler {    private static String CUSTOMPROPERTYPAGE = "com.vnvntrip.plugin.dev.properties.CustomPropertyPage";    /**     * The constructor.     */    public SampleHandler() {    }    /**     * the command has been executed, so extract extract the needed information     * from the application context.     */    public Object execute(ExecutionEvent event) throws ExecutionException {Shell shell = HandlerUtil.getActiveShell(event);// JfaceDialog dialog=new JfaceDialog(shell);// dialog.open();//WorkbenchPreferenceDialog.createDialogOn(shell, preferencePageId)WorkbenchPreferenceDialog dialog = WorkbenchPreferenceDialog.createDialogOn(shell, CUSTOMPROPERTYPAGE);dialog.showOnly(new String[] { CUSTOMPROPERTYPAGE });dialog.open();return null;    }}

?

?

?

?

?

1 楼 yanshanzhu 2011-01-05 WorkbenchPreferenceDialog dialog = WorkbenchPreferenceDialog
.createDialogOn(shell, CUSTOMPROPERTYPAGE);
在eclipse 3.6 中限制访问 2 楼 C_J 2011-01-05 没看明白
你的com.vnvntrip.plugin.dev.preferences.CustomPreferencePage定义呢? 3 楼 longgangbai 2011-10-28 CustomPreferencePageC_J 写道没看明白
你的com.vnvntrip.plugin.dev.preferences.CustomPreferencePage定义呢?
CustomPreferencePage是实现PreferencePage的一个类而已 4 楼 longgangbai 2011-10-28 yanshanzhu 写道 WorkbenchPreferenceDialog dialog = WorkbenchPreferenceDialog
.createDialogOn(shell, CUSTOMPROPERTYPAGE);
在eclipse 3.6 中限制访问
我们当时开发的使用的这样写的,参照eclipse源代码写的当时没有关注这些,实在不好意思。

读书人网 >软件架构设计

热点推荐