This is mostly an Eclipse question. However, I am using BIRT to generate the view from data in CSVeditor.
I would like to retrieve the data immediately when the editor is opened, but that doesn't work. It works when I get the data when it is activated (when clicked). Can someone help?
public void createPartControl(Composite parent) {
canvas=new TimeLineCanvas(parent, SWT.NONE);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(new IPartListener() {
public void partOpened(IWorkbenchPart part) {
if (part.getClass().equals(CsvMultiPageEditor.class)) {
CsvModel model=((CsvMultiPageEditor) part).getModel();
CsvRow[] t=model.getRows();
System.out.println("tlength"+t.length);
Data data = Data.getInstance();
Datum[] d=converttodatums(t);
data.newData(d);
TimeLine timeline = new TimeLine(data);
chart=timeline.getChart();
chartmap.put((CsvMultiPageEditor)part, chart);
canvas.setChart(chart);
canvas.redraw();
}
}
@Override
public void partActivated(IWorkbenchPart part) {
if (part.getClass().equals(CsvMultiPageEditor.class)) {
System.out.println("activated");
}
}
@Override
public void partBroughtToTop(IWorkbenchPart part) {
}
@Override
public void partClosed(IWorkbenchPart part) {
System.out.println("closed");
canvas.dispose();
}
@Override
public void partDeactivated(IWorkbenchPart part) {
System.out.println("deactivated");
}
});