PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
//打开或者刷新视图
try {
IWorkbenchPage activePage = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
PropertySheet part = (PropertySheet)activePage.showView(IPageLayout.ID_PROP_SHEET);
FormPropertySheetPage page = (FormPropertySheetPage) part.getCurrentPage();
page.refresh();
} catch (Exception e) {
e.printStackTrace();
}
}
});
public void run() {
//打开或者刷新视图
try {
IWorkbenchPage activePage = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
PropertySheet part = (PropertySheet)activePage.showView(IPageLayout.ID_PROP_SHEET);
FormPropertySheetPage page = (FormPropertySheetPage) part.getCurrentPage();
page.refresh();
} catch (Exception e) {
e.printStackTrace();
}
}
});
本文介绍了一种在Eclipse中使用PlatformUI刷新PropertySheet视图的方法。通过PlatformUI获取当前激活的工作台窗口,并调用PropertySheet的相关方法实现视图的刷新。
5253

被折叠的 条评论
为什么被折叠?



