Revision dd665bef
Added by Katja Luther almost 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java | ||
---|---|---|
2897 | 2897 |
Label label = new Label(formElement.getLayoutComposite(), style); |
2898 | 2898 |
label.setText(labelText); |
2899 | 2899 |
label.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1)); |
2900 |
DateElement dateElement = new DateElement(formElement.getLayoutComposite(), dateTime, style, editableText); |
|
2900 |
DateElement dateElement = new DateElement(formElement.getLayoutComposite(), dateTime, labelText, style, editableText);
|
|
2901 | 2901 |
dateElement.initController(this, formElement); |
2902 | 2902 |
return dateElement; |
2903 | 2903 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/element/DateElement.java | ||
---|---|---|
66 | 66 |
* @param parent |
67 | 67 |
* @param style |
68 | 68 |
*/ |
69 |
public DateElement(Composite parent, org.joda.time.DateTime initialDateTime, int style, boolean editableText) { |
|
69 |
public DateElement(Composite parent, org.joda.time.DateTime initialDateTime, String label, int style, boolean editableText) {
|
|
70 | 70 |
super(parent, style); |
71 | 71 |
this.initialDateTime = initialDateTime; |
72 | 72 |
addDisposeListener(new DisposeListener() { |
... | ... | |
117 | 117 |
final Shell dialog = new Shell (parent.getShell(), SWT.DIALOG_TRIM); |
118 | 118 |
|
119 | 119 |
dialog.setLayout (new GridLayout (3, false)); |
120 |
dialog.setText(label); |
|
120 | 121 |
|
121 | 122 |
final DateTime calendar = new DateTime (dialog, SWT.CALENDAR | SWT.BORDER); |
123 |
|
|
122 | 124 |
final DateTime time = new DateTime (dialog, SWT.TIME | SWT.SHORT); |
125 |
if (initialDateTime != null){ |
|
126 |
calendar.setDate(initialDateTime.getYear(), initialDateTime.getMonthOfYear(), initialDateTime.getDayOfMonth()); |
|
127 |
time.setHours(initialDateTime.getHourOfDay()); |
|
128 |
time.setMinutes(initialDateTime.getMinuteOfHour()); |
|
129 |
time.setSeconds(initialDateTime.getSecondOfMinute()); |
|
130 |
} |
|
131 |
|
|
123 | 132 |
|
124 | 133 |
new Label (dialog, SWT.NONE); |
125 | 134 |
new Label (dialog, SWT.NONE); |
Also available in: Unified diff
ref #6658: show actual data in DateElement and add title