public AttributeContollerImpl() {
projectController = Lookup.getDefault().lookup(ProjectController.class);
projectController.addWorkspaceListener(new WorkspaceListener() {
public void initialize(Workspace workspace) {
AttributeModel m = workspace.getLookup().lookup(AttributeModel.class);
if (m == null) {
workspace.add(new IndexedAttributeModel());
}
}
public void select(Workspace workspace) {
}
public void unselect(Workspace workspace) {
}
public void close(Workspace workspace) {
}
public void disable() {
}
});
if (projectController.getCurrentProject() != null) {
for (Workspace workspace : projectController.getCurrentProject().getLookup().lookup(WorkspaceProvider.class).getWorkspaces()) {
AttributeModel m = workspace.getLookup().lookup(AttributeModel.class);
if (m == null) {
workspace.add(new IndexedAttributeModel());
}
}
}