Project

General

Profile

Revision e38ddfee

IDe38ddfeee4a59c876fedd950b64cb99147e4f865
Parent da38b436
Child a4857bda

Added by Katja Luther about 3 years ago

fix #6658: remove the indentation from text field of dateElement

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
2920 2920
    	 Label label = new Label(formElement.getLayoutComposite(), style);
2921 2921
         label.setText(labelText);
2922 2922
         label.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
2923
         DateElement dateElement = new DateElement(formElement.getLayoutComposite(), dateTime, labelText, style, editableText);
2923
         DateElement dateElement = new DateElement(this, formElement.getLayoutComposite(), dateTime, labelText, style, editableText);
2924 2924
         dateElement.initController(this, formElement);
2925
         dateElement.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
2925 2926
         return dateElement;
2926 2927
    }
2927 2928

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/element/DateElement.java
44 44
 */
45 45
public class DateElement extends AbstractCdmComposite<DateElementController>  {
46 46

  
47
    private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
47
    private final FormToolkit toolkit;
48 48
    private org.joda.time.DateTime initialDateTime;
49 49
    private Text textDate;
50 50
    private final Button openDateDialog;
......
57 57
     * @param parent
58 58
     * @param style
59 59
     */
60
    public DateElement(Composite parent, org.joda.time.DateTime initDateTime, String label, int style, boolean editableText) {
61
        super(parent, style);
62
        if (initDateTime != null){
60
    public DateElement(CdmFormFactory toolkit, Composite parent, org.joda.time.DateTime initDateTime, String label, int style, boolean editableText) {
61
    	super(parent, style);
62
        this.toolkit = toolkit;
63
    	if (initDateTime != null){
63 64
        	this.initialDateTime = initDateTime.toDateTime(DateTimeZone.UTC);
64 65
        }
65 66
        
......
87 88
    	GridLayout layout = new GridLayout ();
88 89
    
89 90
    	layout.numColumns = 2;
91
    	layout.marginWidth = 0;
90 92
    	 	
91 93
    	composite.setLayout(layout);
92 94
    	
93 95
    	
94
       // textDate = new Text(composite, SWT.BORDER|SWT.FILL);new Text(parent, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
95
    	textDate = toolkit.createText(composite, null, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
96
     	textDate = toolkit.createText(composite, null, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
96 97
    	
97 98
        textDate.setEditable(editableText);
98 99
       
......
124 125
    			}
125 126
    			
126 127

  
127
    			new Label (dialog, SWT.NONE);
128
    			new Label (dialog, SWT.NONE);
128
//    			new Label (dialog, SWT.NONE);
129
//    			new Label (dialog, SWT.NONE);
129 130
    			Button ok = new Button (dialog, SWT.PUSH);
130 131
    			ok.setText ("OK");
131 132
    			ok.setLayoutData(new GridData (SWT.FILL, SWT.CENTER, false, false));
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
79 79
        text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style);
80 80
        selection_artist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), element, "Artist", null, EntitySelectionElement.ALL, style);
81 81
        addElement(selection_artist);
82
        DateTime mediaCreatedValue = null;
83
        if (getEntity().getMediaCreated() != null){
84
        	mediaCreatedValue =  getEntity().getMediaCreated();
85
        }
86
        mediaCreated = formFactory.createDateElement(element, "Media Created", mediaCreatedValue, style, false);
82
       
83
        mediaCreated = formFactory.createDateElement(element, "Media Created", getEntity().getMediaCreated(), style, false);
87 84
        addElement(mediaCreated.getController());
88 85
        text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, true, style);
89 86
        

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)