@Override
public void select(Workspace workspace) {
model = workspace.getLookup().lookup(RankingUIModel.class);
if (model == null) {
RankingModel rankingModel = rc.getModel(workspace);
model = new RankingUIModel(RankingUIController.this, rankingModel);
workspace.add(model);
}
if (modelChangeListener != null) {
modelChangeListener.stateChanged(new ChangeEvent(model));
}
}
@Override
public void unselect(Workspace workspace) {
if (model != null) {
}
}
@Override
public void close(Workspace workspace) {
}
@Override
public void disable() {
model = null;
if (modelChangeListener != null) {
modelChangeListener.stateChanged(null);
}
}
});
if (pc.getCurrentWorkspace() != null) {
model = pc.getCurrentWorkspace().getLookup().lookup(RankingUIModel.class);
if (model == null) {
RankingModel rankingModel = rc.getModel(pc.getCurrentWorkspace());
model = new RankingUIModel(this, rankingModel);
pc.getCurrentWorkspace().add(model);
}
}
}