Beispiel #1
0
  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);
  }
Beispiel #2
0
 protected JPanel buildComparePairSelectionPanel() {
   JPanel p = new JPanel();
   p.setLayout(new FlowLayout(FlowLayout.LEFT));
   p.add(new JLabel(tr("Compare ")));
   JosmComboBox cbComparePair = new JosmComboBox(model.getComparePairListModel());
   cbComparePair.setRenderer(new ComparePairListCellRenderer());
   p.add(cbComparePair);
   return p;
 }
Beispiel #3
0
 @Override
 public void update(Observable o, Object arg) {
   lblMyVersion.setText(
       trn(
           "My version ({0} entry)",
           "My version ({0} entries)", model.getMyEntriesSize(), model.getMyEntriesSize()));
   lblMergedVersion.setText(
       trn(
           "Merged version ({0} entry)",
           "Merged version ({0} entries)",
           model.getMergedEntriesSize(),
           model.getMergedEntriesSize()));
   lblTheirVersion.setText(
       trn(
           "Their version ({0} entry)",
           "Their version ({0} entries)",
           model.getTheirEntriesSize(),
           model.getTheirEntriesSize()));
 }
Beispiel #4
0
 /**
  * Constructs a new {@code ListMerger}.
  *
  * @param model
  */
 public ListMerger(ListMergeModel<T> model) {
   this.model = model;
   model.addObserver(this);
   build();
   model.addPropertyChangeListener(this);
 }