Commit 15fce761 authored by yannick legoc's avatar yannick legoc

Implemented family and subfamily structure

parent 614761f8
......@@ -99,7 +99,7 @@ public class ClientServantDescriptor {
}
public String toString() {
return "ClientServantDescriptor " + type + " " + name + " : enabled = " + isEnabled + " visible = " + isVisible + " favourite = " + isFavourite;
return "ClientServantDescriptor " + type + " " + name + " : enabled = " + isEnabled + " visible = " + isVisible + " favourite = " + isFavourite + " family = " + family + " subfamily = " + subfamily;
}
}
\ No newline at end of file
......@@ -112,8 +112,7 @@ public class CorbaControllerManager extends ControllerManager implements ServerC
return servantManager.getPropertiesForGeneric();
}
public String getType(String controllerName) {
ClientServantDescriptor descriptor = ServantDatabase.getInstance().getControllerDescriptor(controllerName);
if (descriptor != null) {
......@@ -123,45 +122,48 @@ public class CorbaControllerManager extends ControllerManager implements ServerC
}
public Map getInstalledControllers() {
Map<String, List<String>> installedControllers = new TreeMap<String, List<String>>();
Map<String, Map<String, List<String>>> installedControllers = new TreeMap<String, Map<String, List<String>>>();
Iterator<ClientServantDescriptor> it = ServantDatabase.getInstance().getControllers().iterator();
while (it.hasNext()) {
ClientServantDescriptor descriptor = it.next();
if (descriptor.isEnabled() && descriptor.isVisible()) {
String family = descriptor.getFamily();
List<String> familyMembers = installedControllers.get(family);
String subfamily = descriptor.getSubfamily();
Map<String, List<String>> familyMembers = installedControllers.get(family);
if (familyMembers == null) {
familyMembers = new ArrayList<String>();
familyMembers = new TreeMap<String, List<String>>();
installedControllers.put(family, familyMembers);
}
familyMembers.add(descriptor.getName());
if (subfamily.equals("none")) {
familyMembers.put(descriptor.getName(), new ArrayList<String>());
} else {
List<String> subfamilyMembers = familyMembers.get(subfamily);
if (subfamilyMembers == null) {
subfamilyMembers = new ArrayList<String>();
familyMembers.put(subfamily, subfamilyMembers);
}
subfamilyMembers.add(descriptor.getName());
}
}
}
return installedControllers;
}
public Map getInstalledCommands() {
Map<String, List<String>> installedCommands = new TreeMap<String, List<String>>();
Iterator<ClientServantDescriptor> it = ServantDatabase.getInstance().getControllers().iterator();
while (it.hasNext()) {
ClientServantDescriptor descriptor = it.next();
if (descriptor.isCommand() && descriptor.isEnabled() && descriptor.isVisible()) {
String family = descriptor.getFamily();
List familyMembers = installedCommands.get(family);
if (familyMembers == null) {
familyMembers = new ArrayList();
installedCommands.put(family, familyMembers);
}
familyMembers.add(descriptor.getName());
}
}
return installedCommands;
return getInstalledControllers();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment