- public void initialize() throws IOException {
-
- InputStream is = ComponentPresetDao.class.getResourceAsStream("/datafiles/bodytubepresets.csv");
-
- PresetCSVReader parser = new PresetCSVReader(is);
- List<TypedPropertyMap> list = parser.parse();
- for( TypedPropertyMap o : list ) {
- try {
- ComponentPreset preset = ComponentPreset.create(o);
- this.insert(preset);
- } catch ( InvalidComponentPresetException ex ) {
- throw new BugException( ex );
- }
- }
- }
+ public void insert( ComponentPreset preset );
+
+ public List<ComponentPreset> listForType( ComponentPreset.Type type );
+
+ /**
+ * Return a list of component presets based on the type.
+ * All components returned will be of Type type.
+ *
+ * @param type
+ * @param favorite if true, only return the favorites. otherwise return all matching.
+ * @return
+ */
+ public List<ComponentPreset> listForType( ComponentPreset.Type type, boolean favorite );
+
+ public List<ComponentPreset> listForTypes( ComponentPreset.Type ... type );