我在Eclipse RCP App中有四个视图。在那3视图负责显示多线图。我正在使用一个开关盒来连续绘制图形,直到其他视图聚焦为止。但该视图未显示更新的图表。 以下是更新图表的情况。我有两个数据集用于视图的样本更新。
所有回复都表示赞赏。
案例1:
System.out.println("in Case "+selectedViewId);
while(selectedViewId==1){
try {
Display.getDefault().syncExec(new Runnable() {
public void run() {
while(count<20) {
count++;
System.err.println("Countttttttt "+count);
if(count%2==0){
System.err.println(".....Oneeeeeeee");
IViewPart vp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("RCP.CPU");
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(vp);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective();
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("RCP.CPU");
} catch (PartInitException e1) {
e1.printStackTrace();
}
int value = CPU.value=1;
CPU cpuView = CPUSingleton.getCPUObject();
}
else {
System.err.println(".....tWOOOOOOOOOOOOOO");
IViewPart vp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("RCP.CPU");
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(vp);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective();
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("RCP.CPU");
} catch (PartInitException e) {
e.printStackTrace();
}
int value = CPU.value=2;
CPU cpuView = CPUSingleton.getCPUObject();
}
}
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
break;