01: /*--------------------------------------------------------------------------*
02: | Copyright (C) 2006 Christopher Kohlhaas |
03: | |
04: | This program is free software; you can redistribute it and/or modify |
05: | it under the terms of the GNU General Public License as published by the |
06: | Free Software Foundation. A copy of the license has been included with |
07: | these distribution in the COPYING file, if not go to www.fsf.org |
08: | |
09: | As a special exception, you are granted the permissions to link this |
10: | program with every library, which license fulfills the Open Source |
11: | Definition as published by the Open Source Initiative (OSI). |
12: *--------------------------------------------------------------------------*/
13: package org.rapla.gui.internal.edit;
14:
15: import java.util.Vector;
16:
17: import org.rapla.entities.Category;
18: import org.rapla.framework.RaplaContext;
19: import org.rapla.framework.RaplaException;
20:
21: public class CategoryListField extends ListField {
22: Category rootCategory;
23:
24: public CategoryListField(RaplaContext sm, String fieldName,
25: Category rootCategory) throws RaplaException {
26: super (sm, fieldName);
27: this .rootCategory = rootCategory;
28:
29: Category[] obj = rootCategory.getCategories();
30: Vector list = new Vector();
31: list.add(nothingSelected);
32: for (int i = 0; i < obj.length; i++)
33: list.add(obj[i]);
34: setVector(list);
35: }
36: }
|