- fixed initial setting of parameters of GatheringEventDescription
authorPatric Plitzner <p.plitzner@bgbm.org>
Fri, 16 Aug 2013 09:20:03 +0000 (09:20 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Fri, 16 Aug 2013 09:20:03 +0000 (09:20 +0000)
 - finished FieldObservation details view (except Date-field)

.gitattributes
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntityCollectionElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventDetailsElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/fieldObservation/GatheringEventDetailsElementController.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java

index d276fcbefbac33c7f4996b4cbb62b938bfe02c54..fbabd11477e173eff9c490067716723eb4d2be40 100644 (file)
@@ -1228,6 +1228,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermMana
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermStore.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/internal/TaxeditorStorePlugin.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/bar/AuthenticatedUserBar.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntityCollectionElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntitySelectionField.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntitySelectionFieldController.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/LanguageTextFieldController.java -text
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntityCollectionElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntityCollectionElement.java
new file mode 100644 (file)
index 0000000..37590d9
--- /dev/null
@@ -0,0 +1,79 @@
+// $Id$
+/**
+* Copyright (C) 2013 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.campanula.basicFields;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.wb.swt.ResourceManager;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+/**
+ * @author pplitzner
+ * @date 16.08.2013
+ *
+ */
+public class EntityCollectionElement extends ExpandableComposite {
+    private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
+
+    /**
+     * Create the composite.
+     * @param parent
+     * @param style
+     */
+    public EntityCollectionElement(Composite parent, int style) {
+        super(parent, style);
+        setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
+        setExpanded(true);
+
+        ToolBar toolBar = new ToolBar(this, SWT.FLAT | SWT.RIGHT);
+        setTextClient(toolBar);
+
+        Label label = formToolkit.createLabel(this, "", SWT.NONE);
+        setClient(label);
+
+        ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+
+        Action addAction = new Action("add", IAction.AS_PUSH_BUTTON){
+            /* (non-Javadoc)
+             * @see org.eclipse.jface.action.Action#run()
+             */
+            @Override
+            public void run() {
+//                ELEMENT element = createNewElement();
+//                if(element != null){
+//                    addElement(element);
+//                    if(! getSection().isExpanded()) {
+//                        getSection().setExpanded(true);
+//                    }
+//                    internalUpdateSection(true);
+//                }
+            }
+        };
+        addAction.setImageDescriptor(ResourceManager.getPluginImageDescriptor("eu.etaxonomy.taxeditor.store", "icons/add_no_bg2.gif"));
+//        addAction.setToolTipText(getTooltipString());
+
+        toolBarManager.add(addAction);
+
+    }
+
+    @Override
+    protected void checkSubclass() {
+        // Disable the check that prevents subclassing of SWT components
+    }
+
+}
index eb7e03387da8f99025be8a61c661b7f580690d57..d1d436e3e401d18ad93b135a34120ebdaade5d2a 100644 (file)
@@ -14,7 +14,6 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
@@ -34,8 +33,6 @@ public class GatheringEventDetailsElement extends Composite {
     private Text text_DistanceToGround;
     private Text text_DistanceToWaterSurface;
     private Text text_GatheringEventDescription;
-    private ExpandableComposite section_collectingAreas;
-    private Composite composite;
 
     /**
      * Create the composite.
@@ -99,16 +96,6 @@ public class GatheringEventDetailsElement extends Composite {
         text_GatheringEventDescription.setText("");
         text_GatheringEventDescription.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
 
-        section_collectingAreas = formToolkit.createExpandableComposite(this, ExpandableComposite.TWISTIE);
-        section_collectingAreas.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 2));
-        formToolkit.paintBordersFor(section_collectingAreas);
-        section_collectingAreas.setText("Collecting Areas");
-        section_collectingAreas.setExpanded(true);
-
-        composite = formToolkit.createComposite(section_collectingAreas, SWT.NONE);
-        formToolkit.paintBordersFor(composite);
-        section_collectingAreas.setClient(composite);
-
     }
 
     @Override
index 5b2c7e3f601123bd68d89231a7f5faf0a7235993..3fa01f509a4012571e558c22f93fb7c008e1a95a 100644 (file)
@@ -68,13 +68,13 @@ public class GatheringEventDetailsElementController extends AbstractCdmDetailEle
     @Override
     protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
 
-        number_absoluteElevationError = new NumberFieldController(gatheringEventDetailsElement.getTextElevationError(), formFactory, this, (Integer)null);
-        number_absoluteElevationMinimum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMinimum(), formFactory, this, (Integer)null);
-        number_absoluteElevationMaximum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMaximum(), formFactory, this, (Integer)null);
-        text_collectingMethod = new TextFieldController(gatheringEventDetailsElement.getText_CollectingMethod(), formFactory, this, null, null);
-        number_distanceToGround = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToGround(), formFactory, this, (Integer)null);
-        number_distanceToWaterSurface = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToWaterSurface(), formFactory, this, (Integer)null);
-        text_gatheringEventDescription = new TextFieldController(gatheringEventDetailsElement.getText_GatheringEventDescription(), formFactory, this, null, null);
+        number_absoluteElevationError = new NumberFieldController(gatheringEventDetailsElement.getTextElevationError(), formFactory, this, entity.getAbsoluteElevation());
+        number_absoluteElevationMinimum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMinimum(), formFactory, this, entity.getAbsoluteElevationMinimum());
+        number_absoluteElevationMaximum = new NumberFieldController(gatheringEventDetailsElement.getText_ElevationMaximum(), formFactory, this, entity.getAbsoluteElevationMaximum());
+        text_collectingMethod = new TextFieldController(gatheringEventDetailsElement.getText_CollectingMethod(), formFactory, this, entity.getCollectingMethod(), null);
+        number_distanceToGround = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToGround(), formFactory, this, entity.getDistanceToGround());
+        number_distanceToWaterSurface = new NumberFieldController(gatheringEventDetailsElement.getText_DistanceToWaterSurface(), formFactory, this, entity.getDistanceToWaterSurface());
+        text_gatheringEventDescription = new TextFieldController(gatheringEventDetailsElement.getText_GatheringEventDescription(), formFactory, this, entity.getGatheringEventDescription(), null);
         section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
         section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         section_collectingAreas.setEntity(entity);
index d6b6bcd640ab811887e39761a1a6bc5eca135621..be8f7a5bddbe503c250977d1178e3238f233e179 100644 (file)
@@ -74,8 +74,6 @@ import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
 import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
 import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.DeterminationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GeneralDetailSection;
@@ -553,17 +551,17 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
-
-        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+//        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+//
+//        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+//
+//        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
 
         addPart(generalDetailSection);
         addPart(gatheringEventDetailSection);
         addPart(fieldObservationDetailSection);
-        addPart(derivedUnitBaseDetailSection);
-        addPart(determinationDetailSection);
+//        addPart(derivedUnitBaseDetailSection);
+//        addPart(determinationDetailSection);
     }
 
     /**