@Override
public void select(Workspace workspace) {
AppearanceUIModel oldModel = model;
model = workspace.getLookup().lookup(AppearanceUIModel.class);
if (model == null) {
AppearanceModel appearanceModel = appearanceController.getModel(workspace);
model = new AppearanceUIModel(AppearanceUIController.this, appearanceModel);
workspace.add(model);
}
model.select();
if (tableObserver != null) {
tableObserver.destroy();
}
tableObserver = new ColumnObserver(workspace);
tableObserver.start();
firePropertyChangeEvent(AppearanceUIModelEvent.MODEL, oldModel, model);
}
@Override
public void unselect(Workspace workspace) {
if (model != null) {
model.unselect();
}
}
@Override
public void close(Workspace workspace) {
}
@Override
public void disable() {
AppearanceUIModel oldModel = model;
model = null;
firePropertyChangeEvent(AppearanceUIModelEvent.MODEL, oldModel, model);
if (tableObserver != null) {
tableObserver.destroy();
}
}
});
if (pc.getCurrentWorkspace() != null) {
model = pc.getCurrentWorkspace().getLookup().lookup(AppearanceUIModel.class);
if (model == null) {
AppearanceModel appearanceModel = appearanceController.getModel(pc.getCurrentWorkspace());
model = new AppearanceUIModel(this, appearanceModel);
pc.getCurrentWorkspace().add(model);
}
}