public void run() {
// I belive this menu will have a life-span that coincides with the lifespan
// of the TransformationPage (and thus the TreeMapper), so we should not have
// to worry about removing the PropertyChangeListener.
TreeMapper treeMapper = page.getTreeMapper();
treeMapper.addPropertyChangeListener(TreeMapper.MODE_PROPERTY, new ExternalChangeListener());
updateMenu(treeMapper);
}
private void updateMenu(TreeMapper treeMapper) {
TreeMapperMode currentMode = treeMapper.getMode();