Project

General

Profile

Revision 854084b7

ID854084b70890c0143cd2a3d2edc01fd035ff47aa
Parent a4c2890e
Child dd863ea4

Added by Patrick Plitzner over 6 years ago

  • made orig. label data field writable
    • save original label data to DerivedUnit

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataController.java
9 9
*/
10 10
package eu.etaxonomy.taxeditor.ui.mvc;
11 11

  
12
import org.eclipse.swt.events.ModifyEvent;
13
import org.eclipse.swt.events.ModifyListener;
14

  
12 15
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
13 16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
14 17
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
......
20 23
 * @date 17.06.2014
21 24
 *
22 25
 */
23
public class OriginalLabelDataController extends AbstractCdmDetailElement<DerivedUnitFacade> implements CdmCompositeController{
26
public class OriginalLabelDataController extends AbstractCdmDetailElement<DerivedUnitFacade> implements CdmCompositeController, ModifyListener{
24 27

  
25 28
    private final OriginalLabelDataElement originalLabelDataElement;
26 29

  
......
34 37
    public OriginalLabelDataController(CdmFormFactory formFactory, ICdmFormElement parentElement, OriginalLabelDataElement originalLabelDataElement, int style) {
35 38
        super(formFactory, parentElement);
36 39
        this.originalLabelDataElement = originalLabelDataElement;
40
        this.originalLabelDataElement.getText().addModifyListener(this);
37 41
    }
38 42

  
39 43
    /* (non-Javadoc)
......
66 70
     */
67 71
    @Override
68 72
    protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
69
        originalLabelDataElement.getText().setText(entity.getTitleCache());
73
        String originalLabelInfo = entity.innerDerivedUnit().getOriginalLabelInfo();
74
        if(originalLabelInfo!=null){
75
            originalLabelDataElement.getText().setText(originalLabelInfo);
76
        }
77
    }
78

  
79
    /* (non-Javadoc)
80
     * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
81
     */
82
    @Override
83
    public void modifyText(ModifyEvent e) {
84
        getEntity().innerDerivedUnit().setOriginalLabelInfo(originalLabelDataElement.getText().getText());
70 85
    }
71 86

  
72 87
    /* (non-Javadoc)
......
75 90
    @Override
76 91
    public void handleEvent(Object eventSource) {
77 92
    }
93

  
78 94
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataElement.java
49 49
        lblOriginalLabelData.setLayoutData(new TableWrapData(TableWrapData.RIGHT, TableWrapData.TOP, 1, 1));
50 50
        lblOriginalLabelData.setText("Original Label Data");
51 51

  
52
        text = new Text(this, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.MULTI);
53
        text.setEditable(false);
52
        text = new Text(this, SWT.BORDER | SWT.WRAP | SWT.MULTI);
54 53
        text.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
55 54
        new Label(this, SWT.NONE);
56 55

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)