Project

General

Profile

Revision 656cc90a

ID656cc90a6ba5dbe24426373b9043fe92413bdcb2
Parent 2aa1d458
Child 7b690399

Added by Patrick Plitzner over 1 year ago

fix #7728 Fix initialisation of form toolkit in DateElement

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
3022 3022
    	 Label label = new Label(formElement.getLayoutComposite(), style);
3023 3023
         label.setText(labelText);
3024 3024
         label.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
3025
         DateElement dateElement = new DateElement(this, formElement.getLayoutComposite(), dateTime, labelText, style, editableText);
3025
         DateElement dateElement = new DateElement(formElement.getLayoutComposite(), dateTime, labelText, style, editableText);
3026 3026
         dateElement.initController(this, formElement);
3027 3027
         dateElement.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
3028 3028
         return dateElement;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/element/DateElement.java
22 22
import org.eclipse.swt.widgets.Button;
23 23
import org.eclipse.swt.widgets.Composite;
24 24
import org.eclipse.swt.widgets.DateTime;
25
import org.eclipse.swt.widgets.Display;
25 26
import org.eclipse.swt.widgets.Shell;
26 27
import org.eclipse.swt.widgets.Text;
27 28
import org.eclipse.ui.forms.widgets.FormToolkit;
......
40 41
 */
41 42
public class DateElement extends AbstractCdmComposite<DateElementController>  {
42 43

  
43
    private final FormToolkit toolkit;
44
    private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
44 45
    private org.joda.time.DateTime initialDateTime;
45 46
    private Text textDate;
46 47
    private final Button openDateDialog;
......
53 54
     * @param parent
54 55
     * @param style
55 56
     */
56
    public DateElement(CdmFormFactory toolkit, Composite parent, org.joda.time.DateTime initDateTime, String label, int style, boolean editableText) {
57
    	super(parent, style);
58
        this.toolkit = toolkit;
59
    	if (initDateTime != null){
57
    public DateElement(Composite parent, org.joda.time.DateTime initDateTime, String label, int style, boolean editableText) {
58
        super(parent, style);
59
        if (initDateTime != null){
60 60
        	this.initialDateTime = initDateTime.toDateTime(DateTimeZone.UTC);
61 61
        }
62 62

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)