*/
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.
* @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();
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));
}
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;
+ }
}