01: package org.airtodo.gui_common.components.lookup_data;
02:
03: import javax.swing.Icon;
04:
05: import org.air.framework.gui.lookup.ILookupData;
06: import org.air.framework.i18n.NlsMessages;
07: import org.air.framework.properties.Icons;
08: import org.air.framework.records.Attachments;
09: import org.airtodo.db.types.AttachmentType;
10:
11: public class LookupDataAttachment implements ILookupData {
12: public static enum NLS {
13: ATTACHMENT_TYPE_URL, //
14: ATTACHMENT_TYPE_FILE, //
15: ATTACHMENT_TYPE_EMAIL
16: }
17:
18: private static final String NLS_ATTACHMENT_TYPE_URL = NlsMessages
19: .getString(NLS.ATTACHMENT_TYPE_URL);
20: private static final String NLS_ATTACHMENT_TYPE_FILE = NlsMessages
21: .getString(NLS.ATTACHMENT_TYPE_FILE);
22: private static final String NLS_ATTACHMENT_TYPE_EMAIL = NlsMessages
23: .getString(NLS.ATTACHMENT_TYPE_EMAIL);
24: //
25: private static final Icon ICON_ATTACHMENT_TYPE_URL = Icons.ATTACHMENT_URL;
26: private static final Icon ICON_ATTACHMENT_TYPE_FILE = Icons.ATTACHMENT_FILE;
27: private static final Icon ICON_ATTACHMENT_TYPE_EMAIL = Icons.ATTACHMENT_EMAIL;
28: //
29: private static final Object[][] TEXTS_ICONS = new Object[][] { //
30: { NLS_ATTACHMENT_TYPE_URL, ICON_ATTACHMENT_TYPE_URL }, //
31: { NLS_ATTACHMENT_TYPE_FILE, ICON_ATTACHMENT_TYPE_FILE }, //
32: { NLS_ATTACHMENT_TYPE_EMAIL, ICON_ATTACHMENT_TYPE_EMAIL }, //
33: };
34:
35: public Enum getColumn() {
36: return Attachments.TYPE;
37: }
38:
39: public Class getLookupObjectClass() {
40: return AttachmentType.class;
41: }
42:
43: public Object[][] getTextsAndIcons() {
44: return TEXTS_ICONS;
45: }
46:
47: }
|