Posted on 2008-09-18 18:55
jr4e 阅读(180)
评论(0) 编辑 收藏 所属分类:
Eclipse
1.通过获得当前激活的editor来得到NameManager
IEditorPart editor = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
ReportEditor reportEditor = null;
if (editor instanceof ReportEditor)
reportEditor = (ReportEditor) editor;
String dsDisplayName = reportEditor.getDisplaynameByQDSName(table
.getDataSet());
INameManager nameManager = ((ReportEditorInput) reportEditor
.getEditorInput()).getNameManager();
2.获得editPart的祖先的方法
GefUtilities.getAncestorOfClass(Class c, EditPart editPart)
public static EditPart getAncestorOfClass(Class c, EditPart editPart)
3.获得模型祖先的方法
ModelUtilities.getAncestorOfClass(Class c, EObject model));
public static EObject getAncestorOfClass(Class c, EObject model)