@Override
public void propertyChange(PropertyChangeEvent evt) {
logger.debug("Adjusting commands to new model " + evt.getPropertyName());
final ListModel listModel = (ListModel) evt.getNewValue();
final ValueModel selectionModel = new ListSelectionValueModelAdapter(masterDetailList.getMasterList().getSelectionModel());
final ValueModel vModel = new JListSelectionValueModelAdapter(listModel, (ListSelectionValueModelAdapter) selectionModel);
similarTypesTypeHierarchyCommand.setValueModel(vModel);
similarTypesInspectionCommand.setValueModel(vModel);
numSimilarTypesSchema.setValue(listModel.getSize());
}
});
masterDetailList.addPropertyChangeListener(MasterListDetailList.PC_DETAILLIST_LISTMODEL, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
logger.debug("Adjusting commands to new model " + evt.getPropertyName());
final ListModel listModel = (ListModel) evt.getNewValue();
final ValueModel selectionModel = new ListSelectionValueModelAdapter(masterDetailList.getDetailList().getSelectionModel());
final ValueModel vModel = new JListSelectionValueModelAdapter(listModel, (ListSelectionValueModelAdapter) selectionModel);
typesListTypeHierarchyCommand.setValueModel(vModel);
typesListTypeInspectionCommand.setValueModel(vModel);
numSimilarTypes.setValue(listModel.getSize());
}
});