+ @Override
+ public DataType getDataType() {
+ return DataType.DATA;
+ }
+
+ @Override
+ public List<KeyAction> getKeyBindings() {
+ // TODO Auto-generated method stub
+ List<KeyAction> actions = new LinkedList<KeyAction>();
+
+ // TODO: add, remove
+ actions.add(new KeyAction(Mode.ASK_USER, KeyType.Enter,
+ Trans.StringId.DUMMY) {
+ @Override
+ public Object getObject() {
+ return contact.get(getSelectedIndex());
+ }
+
+ @Override
+ public String getQuestion() {
+ Data data = getData();
+ if (data != null) {
+ return data.getName();
+ }
+
+ return null;
+ }
+
+ @Override
+ public String getDefaultAnswer() {
+ Data data = getData();
+ if (data != null) {
+ return data.getValue();
+ }
+
+ return null;
+ }
+
+ @Override
+ public String callback(String answer) {
+ Data data = getData();
+ if (data != null) {
+ data.setValue(answer);
+ return null;
+ }
+
+ // TODO: i18n
+ return "Cannot modify value";
+ }
+ });
+ actions.add(new KeyAction(Mode.NONE, KeyType.Tab,
+ Trans.StringId.KEY_ACTION_SWITCH_FORMAT) {
+ @Override
+ public boolean onAction() {
+ mode++;
+ if (mode > 1)
+ mode = 0;
+
+ return false;
+ }
+ });
+
+ return actions;
+ }
+
+ @Override
+ public String getTitle() {
+ String title = null;
+
+ if (contact != null) {
+ title = contact.getPreferredDataValue("FN");
+ if (title == null || title.length() == 0)
+ title = contact.getPreferredDataValue("N");
+ }
+
+ return title;
+ }
+
+ @Override
+ public String move(int x, int y) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+