protected void handlePropertyChangeFrozen(boolean oldValue, boolean newValue) { myEntriesTable.getSelectionModel().clearSelection(); myEntriesTable.setEnabled(!newValue); theirEntriesTable.getSelectionModel().clearSelection(); theirEntriesTable.setEnabled(!newValue); mergedEntriesTable.getSelectionModel().clearSelection(); mergedEntriesTable.setEnabled(!newValue); freezeAction.putValue(FreezeActionProperties.PROP_SELECTED, newValue); if (newValue) { lblFrozenState.setText( tr( "<html>Click <strong>{0}</strong> to start merging my and their entries.</html>", freezeAction.getValue(Action.NAME))); } else { lblFrozenState.setText( tr( "<html>Click <strong>{0}</strong> to finish merging my and their entries.</html>", freezeAction.getValue(Action.NAME))); } }
protected void wireActionsToSelectionModels() { myEntriesTable.getSelectionModel().addListSelectionListener(copyStartLeftAction); myEntriesTable.getSelectionModel().addListSelectionListener(copyBeforeCurrentLeftAction); mergedEntriesTable.getSelectionModel().addListSelectionListener(copyBeforeCurrentLeftAction); myEntriesTable.getSelectionModel().addListSelectionListener(copyAfterCurrentLeftAction); mergedEntriesTable.getSelectionModel().addListSelectionListener(copyAfterCurrentLeftAction); myEntriesTable.getSelectionModel().addListSelectionListener(copyEndLeftAction); theirEntriesTable.getSelectionModel().addListSelectionListener(copyStartRightAction); theirEntriesTable.getSelectionModel().addListSelectionListener(copyBeforeCurrentRightAction); mergedEntriesTable.getSelectionModel().addListSelectionListener(copyBeforeCurrentRightAction); theirEntriesTable.getSelectionModel().addListSelectionListener(copyAfterCurrentRightAction); mergedEntriesTable.getSelectionModel().addListSelectionListener(copyAfterCurrentRightAction); theirEntriesTable.getSelectionModel().addListSelectionListener(copyEndRightAction); mergedEntriesTable.getSelectionModel().addListSelectionListener(moveUpMergedAction); mergedEntriesTable.getSelectionModel().addListSelectionListener(moveDownMergedAction); mergedEntriesTable.getSelectionModel().addListSelectionListener(removeMergedAction); model.addObserver(copyAllLeft); model.addObserver(copyAllRight); model.addPropertyChangeListener(copyAllLeft); model.addPropertyChangeListener(copyAllRight); }
public void unlinkAsListener() { myEntriesTable.unlinkAsListener(); mergedEntriesTable.unlinkAsListener(); theirEntriesTable.unlinkAsListener(); }