Message d'erreur GWT/Eclipse
Bonjour, je débute et j'essaye de reproduire le calendrier que l'on trouve sur le site de GWT : ICI
Voici le code complet qui n'est pas très long :
(j'ai mis l'interface onInitialize à part dans le même projet)
Code:
1 2 3
| public @interface onInitialize {
} |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
package com.client;
import java.util.Date;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.i18n.client.Constants;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.datepicker.client.DateBox;
import com.google.gwt.user.datepicker.client.DatePicker;
import com.google.gwt.user.client.ui.Widget;
public class Calendrier implements EntryPoint {
public static interface CwConstants extends Constants {
String cwDatePickerBoxLabel();
String cwDatePickerDescription();
String cwDatePickerLabel();
String cwDatePickerName();
}
public void onModuleLoad() {
final CwConstants constants;
@SuppressWarnings("deprecation")
public Widget onInitialize() { <--Syntax error on token "Widget", @ expected
// Create a basic date picker
DatePicker datePicker = new DatePicker(); <-- Illegal modifier for parameter datePicker; only final is permitted
final Label text = new Label();
// Set the value in the text box when the user selects a date
datePicker.addValueChangeHandler(new ValueChangeHandler<Date>() {
public void onValueChange(ValueChangeEvent<Date> event) {
Date date = event.getValue();
@SuppressWarnings("deprecation")
String dateString = DateTimeFormat.getMediumDateFormat().format(date);
text.setText(dateString);
}
});
datePicker.setValue(new Date(), true);
@SuppressWarnings("deprecation")
DateTimeFormat dateFormat = DateTimeFormat.getLongDateFormat();
DateBox dateBox = new DateBox();
dateBox.setFormat(new DateBox.DefaultFormat(dateFormat));
// Combine the widgets into a panel and return them
VerticalPanel vPanel = new VerticalPanel();
vPanel.add(new HTML(constants.cwDatePickerLabel()));
vPanel.add(text);
vPanel.add(datePicker);
vPanel.add(new HTML(constants.cwDatePickerBoxLabel()));
vPanel.add(dateBox);
return;
} <-- Syntax error on token "}", delete this token
}
} |
Donc comme vous pouvez le voir, j'ai 3 erreurs : lignes 32, 34 et 63 avec les messages ci-dessus qui ne me semble pas très cohérents. Pour l'accolade signalée en trop, bin non elle est pas en trop.
Je cherche depuis un bon moment, si quelqu'un pourrait m'aider ?