Skip to content
Snippets Groups Projects
Commit 9634c8b7 authored by Daniel Ratiu's avatar Daniel Ratiu
Browse files

implementing category parent of prototypes categories

refs 694
parent ee1f3749
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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;
}
}
......@@ -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);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment