listeners.add((TimelineTopComponent) tc);
}
//Workspace events
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
final DynamicController dynamicController = Lookup.getDefault().lookup(DynamicController.class);
pc.addWorkspaceListener(new WorkspaceListener() {
public void initialize(Workspace workspace) {
}
public void select(Workspace workspace) {
model = workspace.getLookup().lookup(TimelineModelImpl.class);
if (model == null) {
model = new TimelineModelImpl(TimelineControllerImpl.this);
workspace.add(model);
}
DynamicModel dynamicModel = dynamicController.getModel(workspace);
model.setup(dynamicModel);
}
public void unselect(Workspace workspace) {
model.unsetup();
}
public void close(Workspace workspace) {
}
public void disable() {
model.disable();
model = null;
}
});
if (pc.getCurrentWorkspace() != null) {
model = pc.getCurrentWorkspace().getLookup().lookup(TimelineModelImpl.class);
if (model == null) {
model = new TimelineModelImpl(TimelineControllerImpl.this);
pc.getCurrentWorkspace().add(model);
}
DynamicModel dynamicModel = dynamicController.getModel(pc.getCurrentWorkspace());
model.setup(dynamicModel);
}
}