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