* Добавляет элемент в текущую услугу, переводит выделение на него
* @param aClass
*/
private void addDelegateToService(Class<? extends DelegateNode> aClass) {
if (selectedServiceNode != null) {
SerRenLocal selectedService = selectedServiceNode.getDelegate();
try {
DelegateNode leaf = null;
if (aClass.equals(ContraindicationLocal.class)) {
leaf = new ContraindicationLocal(selectedService);
} else if (aClass.equals(CheckupLocal.class)) {
leaf = new CheckupLocal(selectedService);
} else if (aClass.equals(PrescriptionLocal.class)) {
leaf = new PrescriptionLocal(selectedService);
} else if (aClass.equals(DirectionLocal.class)) {
leaf = new DirectionLocal(selectedService);
} else if (aClass.equals(RecommendationLocal.class)) {
leaf = new RecommendationLocal(selectedService);
} else if (aClass.equals(DiagnosisLocal.class)) {
leaf = new DiagnosisLocal(selectedService);
} else if (aClass.equals(PrescriptionDloLocal.class)) {
leaf = new PrescriptionDloLocal(selectedService);
} else {
throw new ClipsException("Попытка создать объект не учтённого типа");
}
if (leaf != null) {
System.out.println("PANEL EMC, LEAF " + leaf + " ADD TO SERVICE " + selectedService);
selectedService.addChild(leaf);
}
} catch (ClipsException e) {
MessageBox.showException(e);
}
}