- created FieldObservation general element completely uncoupled to any controlling...
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / campanula / FieldObservationGeneralElement.java
index 1303559cddc701c2bcfc0d3f1d2390925373500d..d556e781d6a4f3a1339cd57f1f12160793b2c380 100644 (file)
@@ -26,14 +26,15 @@ import org.eclipse.wb.swt.SWTResourceManager;
  */
 public class FieldObservationGeneralElement extends Composite {
     private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
-    private final Text text;
-    private final Text text_1;
-    private final Text text_2;
-    private final Text text_3;
-    private final Text text_4;
-    private final Text text_5;
-    private final Text text_6;
-    private final Text text_7;
+    private final Text textLocality;
+    private final Text textLatitude;
+    private final Text textLongitude;
+    private final Text textErrorRadius;
+    private final Text textElevation;
+    private final Text textCollectingNumber;
+    private EntitySelectionField countrySelectionField;
+    private EntitySelectionField collectorSelectionField;
+    private ToggleableTextField toggleableTextField;
 
     /**
      * Create the composite.
@@ -41,7 +42,7 @@ public class FieldObservationGeneralElement extends Composite {
      * @param style
      */
     public FieldObservationGeneralElement(Composite parent, int style) {
-        super(parent, style);
+        super(parent, SWT.NONE);
         setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
         {
             TableWrapLayout tableWrapLayout = new TableWrapLayout();
@@ -51,62 +52,71 @@ public class FieldObservationGeneralElement extends Composite {
 
         Label lblTitleCache = formToolkit.createLabel(this, "Title Cache", SWT.NONE);
 
-        text = formToolkit.createText(this, "New Text", SWT.NONE);
-        text.setText("");
-        text.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        toggleableTextField = new ToggleableTextField(this, SWT.NONE);
+        TableWrapData twd_toggleableTextField = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
+        twd_toggleableTextField.grabHorizontal = true;
+        toggleableTextField.setLayoutData(twd_toggleableTextField);
+        formToolkit.adapt(toggleableTextField);
+        formToolkit.paintBordersFor(toggleableTextField);
 
         Label lblNewLabel = new Label(this, SWT.NONE);
         formToolkit.adapt(lblNewLabel, true, true);
         lblNewLabel.setText("Country");
-        new Label(this, SWT.NONE);
+
+        countrySelectionField = new EntitySelectionField(this, SWT.NONE);
+        countrySelectionField.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        formToolkit.adapt(countrySelectionField);
+        formToolkit.paintBordersFor(countrySelectionField);
 
         Label lblLocality = formToolkit.createLabel(this, "Locality", SWT.NONE);
 
-        text_1 = formToolkit.createText(this, "New Text", SWT.NONE);
-        text_1.setText("");
-        text_1.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        textLocality = formToolkit.createText(this, "New Text", SWT.NONE);
+        textLocality.setText("");
+        textLocality.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
 
         Label lblLatitude = formToolkit.createLabel(this, "Latitude", SWT.NONE);
 
-        text_2 = formToolkit.createText(this, "New Text", SWT.NONE);
-        text_2.setText("");
-        text_2.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        textLatitude = formToolkit.createText(this, "New Text", SWT.NONE);
+        textLatitude.setText("");
+        textLatitude.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
 
         Label lblLongitude = formToolkit.createLabel(this, "Longitude", SWT.NONE);
 
-        text_3 = formToolkit.createText(this, "New Text", SWT.NONE);
-        text_3.setText("");
-        text_3.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        textLongitude = formToolkit.createText(this, "New Text", SWT.NONE);
+        textLongitude.setText("");
+        textLongitude.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
 
         Label lblErrorRadiusm = formToolkit.createLabel(this, "Error Radius (m)", SWT.NONE);
 
-        text_4 = formToolkit.createText(this, "New Text", SWT.NONE);
-        text_4.setText("");
-        text_4.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        textErrorRadius = formToolkit.createText(this, "New Text", SWT.NONE);
+        textErrorRadius.setText("");
+        textErrorRadius.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
 
         Label lblReferenceSystem = formToolkit.createLabel(this, "Reference System", SWT.NONE);
         new Label(this, SWT.NONE);
 
         Label lblAbsoluteElevationm = formToolkit.createLabel(this, "Absolute Elevation (m)", SWT.NONE);
 
-        text_5 = formToolkit.createText(this, "New Text", SWT.NONE);
-        text_5.setText("");
-        text_5.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        textElevation = formToolkit.createText(this, "New Text", SWT.NONE);
+        textElevation.setText("");
+        textElevation.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
 
         Label lblDate = formToolkit.createLabel(this, "Date", SWT.NONE);
         new Label(this, SWT.NONE);
 
         Label lblCollector = formToolkit.createLabel(this, "Collector", SWT.NONE);
 
-        text_6 = formToolkit.createText(this, "New Text", SWT.NONE);
-        text_6.setText("");
-        text_6.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        collectorSelectionField = new EntitySelectionField(this, SWT.NONE);
+        collectorSelectionField.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        formToolkit.adapt(collectorSelectionField);
+        formToolkit.paintBordersFor(collectorSelectionField);
+
 
         Label lblCollectingNumber = formToolkit.createLabel(this, "Collecting Number", SWT.NONE);
 
-        text_7 = formToolkit.createText(this, "New Text", SWT.NONE);
-        text_7.setText("");
-        text_7.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        textCollectingNumber = formToolkit.createText(this, "New Text", SWT.NONE);
+        textCollectingNumber.setText("");
+        textCollectingNumber.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
 
     }
 
@@ -114,4 +124,31 @@ public class FieldObservationGeneralElement extends Composite {
     protected void checkSubclass() {
         // Disable the check that prevents subclassing of SWT components
     }
+    public EntitySelectionField getCountrySelectionField() {
+        return countrySelectionField;
+    }
+    public EntitySelectionField getCollectorSelectionField() {
+        return collectorSelectionField;
+    }
+    public Text getTextElevation() {
+        return textElevation;
+    }
+    public Text getTextLocality() {
+        return textLocality;
+    }
+    public Text getTextLatitude() {
+        return textLatitude;
+    }
+    public Text getTextLongitude() {
+        return textLongitude;
+    }
+    public Text getTextErrorRadius() {
+        return textErrorRadius;
+    }
+    public Text getTextCollectingNumber() {
+        return textCollectingNumber;
+    }
+    public ToggleableTextField getToggleableTextField() {
+        return toggleableTextField;
+    }
 }