有没有像听众一样知道视图被移动了?
答案 0 :(得分:3)
如果您尝试使用该视图
public void createPartControl(Composite parent){
parent.getParent().addControlListener(new ControlAdapter(){
public void controlMoved(ControlEvent e) {}
});
}
如果是内置视图
WorkbenchPartReference ref = (WorkbenchPartReference) UIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().findViewReference("viewID");
Control control = ref.getPane().getControl();
control.addControlListener(new ControlAdapter(){
@Override
public void controlMoved(ControlEvent e) {
}
});