diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/PrototypeProviderBase.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/PrototypeProviderBase.java index 622608431e3dae4617ea44b67d0442ef7b53d410..c1c948eae916a4c78240f042b083aff03db4638f 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/PrototypeProviderBase.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/PrototypeProviderBase.java @@ -39,7 +39,7 @@ import org.fortiss.tooling.kernel.extension.data.PrototypeCategory; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 266A6634327794A801F21F8E9018C35B + * @ConQAT.Rating YELLOW Hash: 07BDC65FD4A4D5A8C6EA22DB8128CDDA */ public abstract class PrototypeProviderBase implements IPrototypeProvider { @@ -103,6 +103,7 @@ public abstract class PrototypeProviderBase implements IPrototypeProvider { registerPrototypeCategory(PrototypeCategory parent, String category) { PrototypeCategory cat = registerPrototypeCategory(category); parent.add(cat); + cat.setPrototypeCategoryParent(parent); return cat; } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/PrototypeCategory.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/PrototypeCategory.java index ef4c1920f38c5cfa9f1954d530d65d48fbb0ae07..3388957edc9c53669681cce760f30d94f283aa79 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/PrototypeCategory.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/PrototypeCategory.java @@ -26,24 +26,27 @@ import java.util.List; * @author doebber * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: E51B16B14246DBE6D73D62B1424E852F + * @ConQAT.Rating YELLOW Hash: 2C2B8C827EDAFE098F4D62B3EF94C1FC */ public class PrototypeCategory { - /** Constructor. */ - public PrototypeCategory(String category) { - categoryName = category; - } - /** Stores the name of the category. */ private final String categoryName; + /** Stores the parent of the category. */ + private PrototypeCategory parentCategory; + /** Stores the prototypes affiliated with this category. */ private List<Prototype> children = new ArrayList<Prototype>(); /** Stores the sub-categories of this category. */ private List<PrototypeCategory> subCategories = new ArrayList<PrototypeCategory>(); + /** Constructor. */ + public PrototypeCategory(String category) { + categoryName = category; + } + /** Adds the prototype. */ public void add(Prototype prototype) { children.add(prototype); @@ -66,4 +69,14 @@ public class PrototypeCategory { public String getName() { return categoryName; } + + /** Sets the parent of this category. */ + public void setPrototypeCategoryParent(PrototypeCategory parent) { + parentCategory = parent; + } + + /** Returns parent of this category. */ + public PrototypeCategory getParentCategory() { + return parentCategory; + } } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java index a3b5cada3e15ec981e824f1476cf3451737654f1..936d455a0201494b36cebc4cbf53fc1a64c3a48c 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java @@ -44,7 +44,7 @@ import org.osgi.framework.Bundle; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 7348244C108974051B1E151F2B83BD61 + * @ConQAT.Rating YELLOW Hash: CC514D89E2985B7503F6EFA6E701B5A6 */ public class PrototypeService implements IPrototypeService { @@ -130,7 +130,9 @@ public class PrototypeService implements IPrototypeService { for(IPrototypeProvider provider : prototypeProviderList) { for(PrototypeCategory currentCategory : provider.getCategories()) { - result.add(currentCategory); + if(currentCategory.getParentCategory() == null) { + result.add(currentCategory); + } } }