Now works with cdmLibrary 0.2.5.
[taxeditor.git] / eclipseprojects / eu.etaxonomy.taxeditor.prototype1 / src / eu / etaxonomy / taxeditor / prototype1 / controller / CreateNameAction.java
1 package eu.etaxonomy.taxeditor.prototype1.controller;
2
3 import org.eclipse.jface.action.Action;
4
5 import eu.etaxonomy.taxeditor.prototype1.Activator;
6 import eu.etaxonomy.cdm.model.name.TaxonName;
7
8 public class CreateNameAction extends Action {
9
10 private TaxonName tn;
11
12 public CreateNameAction(String genus, String spEpithet) {
13 this.tn = new TaxonName();
14 this.tn.setGenus(genus);
15 this.tn.setSpecificEpithet(spEpithet);
16 this.tn.setFullName(genus + " " + spEpithet);
17 this.tn.setName(genus + " " + spEpithet);
18 }
19
20 public void run() {
21 Activator.getDefault().getObjectList().add(tn);
22 }
23 }