- added startNumber to PolytomousKey DetailsView (fixes #3563)
authorPatric Plitzner <p.plitzner@bgbm.org>
Wed, 8 Jan 2014 16:13:13 +0000 (16:13 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Wed, 8 Jan 2014 16:13:13 +0000 (16:13 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailElement.java

index 39aa11e690566c5d5159883e339073cbd25e1485..3c191efe9b277a9099cd99da934e5bf4635d1dd9 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
@@ -9,15 +9,18 @@ import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
 
 /**
  * @author n.hoffmann
- * 
+ *
  */
 public class PolytomousKeyDetailElement extends
                AbstractIdentifiableEntityDetailElement<PolytomousKey> {
 
+    private NumberWithLabelElement numberStartNumber;
+
        public PolytomousKeyDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
@@ -29,15 +32,16 @@ public class PolytomousKeyDetailElement extends
             toggleable_cache = formFactory.createToggleableTextField(formElement,
                     "Title Cache", entity.getTitleCache(),
                     entity.isProtectedTitleCache(), SWT.NULL);
+            numberStartNumber = formFactory.createNumberTextWithLabelElement(formElement, "Start Number", entity.getStartNumber(), style);
        }
-       
+
        public String getText() {
            return toggleable_cache.getText();
        }
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
         * .lang.Object)
@@ -45,6 +49,9 @@ public class PolytomousKeyDetailElement extends
        @Override
        public void handleEvent(Object eventSource) {
                handleToggleableCacheField();
+               if(eventSource==numberStartNumber){
+                   getEntity().setStartNumber(numberStartNumber.getInteger());
+               }
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
 }