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

resolving this issue

refs 1151
parent 1a7eec0d
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,9 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.internal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.kernel.extension.ILibraryElementHandler;
......@@ -34,7 +36,7 @@ import org.fortiss.tooling.kernel.service.ILibraryService;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: C80FA91F50ADA9FFBC25CE927814BF6C
* @ConQAT.Rating YELLOW Hash: C6CEC15D2930553DD96080E74D1FFF14
*/
public class LibraryPrototypeProvider extends PrototypeProviderBase {
......@@ -44,6 +46,7 @@ public class LibraryPrototypeProvider extends PrototypeProviderBase {
*/
public void refreshPrototypes() {
prototypes.clear();
categories.clear();
registerPrototypes();
}
......@@ -51,6 +54,9 @@ public class LibraryPrototypeProvider extends PrototypeProviderBase {
@Override
protected void registerPrototypes() {
PrototypeCategory libraryCategory = registerPrototypeCategory("Library");
Map<String, PrototypeCategory> registeredCategoriesMap =
new HashMap<String, PrototypeCategory>();
for(ILibraryElement libElem : ILibraryService.INSTANCE
.getLibraryElementsFromAllWorkspaceLibraries()) {
List<ILibraryElementHandler<EObject>> handlers =
......@@ -64,7 +70,13 @@ public class LibraryPrototypeProvider extends PrototypeProviderBase {
prototypes.add(prot);
String categoryName = ((ILibraryPackage)libElem.eContainer()).getName();
PrototypeCategory current = registerPrototypeCategory(libraryCategory, categoryName);
PrototypeCategory current = registeredCategoriesMap.get(categoryName);
if(current == null) {
current = registerPrototypeCategory(libraryCategory, categoryName);
registeredCategoriesMap.put(categoryName, current);
}
current.add(prot);
}
}
......
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