~ubuntu-branches/ubuntu/trusty/jabref/trusty

« back to all changes in this revision

Viewing changes to src/java/net/sf/jabref/collab/StringAddChange.java

  • Committer: Bazaar Package Importer
  • Author(s): gregor herrmann
  • Date: 2009-12-01 18:52:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20091201185251-08e2unpn1jl8ijq8
Tags: 2.6~beta2-1
* Remove alternative dependency on sun-java5-jre which was removed from the
  archive. Also adjust README.Debian and /usr/bin/jabref.
* New upstream beta release:
  - fixes "allow to disable (re)storing of current tab for entries"
    (closes: #447767)
  - thanks again to Philip Rinn for his help with the upgrade
* debian/copyright: add new developer.
* Refresh patches 01_free_javac.patch and 06_BibtexEntry.patch.
* Adjust debian/jabref.links and debian/jabref.install to new jar file.
* Simplify debian/jabref.dirs.
* Add a presubj fragment for reportbug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import javax.swing.JComponent;
4
4
import javax.swing.JScrollPane;
5
5
 
6
 
import net.sf.jabref.BasePanel;
7
 
import net.sf.jabref.BibtexString;
8
 
import net.sf.jabref.Globals;
9
 
import net.sf.jabref.KeyCollisionException;
 
6
import net.sf.jabref.*;
10
7
import net.sf.jabref.undo.NamedCompound;
11
8
import net.sf.jabref.undo.UndoableInsertString;
12
9
 
35
32
 
36
33
  }
37
34
 
38
 
  public void makeChange(BasePanel panel, NamedCompound undoEdit) {
 
35
  public void makeChange(BasePanel panel, BibtexDatabase secondary, NamedCompound undoEdit) {
39
36
 
40
37
    if (panel.database().hasStringLabel(string.getName())) {
41
38
      // The name to change to is already in the database, so we can't comply.
49
46
    } catch (KeyCollisionException ex) {
50
47
      Globals.logger("Error: could not add string '"+string.getName()+"': "+ex.getMessage());
51
48
    }
52
 
 
 
49
    try {
 
50
        secondary.addString(new BibtexString(Util.createNeutralId(), string.getName(),
 
51
                string.getContent()));
 
52
    } catch (KeyCollisionException ex) {
 
53
        Globals.logger("Error: could not add string '"+string.getName()+"' to tmp database: "+ex.getMessage());
 
54
    }
53
55
  }
54
56
 
55
57