// commented out as we already have a "add route" menu entry
//addMenuItem(rootMenu, Messages.paletteRouteTitle, Messages.paletteRouteDescription, Route.class, context, fp);
onlyEndpoints = true;
}
ContextMenuEntry endpointsEntry = new ContextMenuEntry(null, null);
endpointsEntry.setText(Messages.endpointsDrawerTitle);
endpointsEntry.setSubmenu(true);
ContextMenuEntry routingEntry = new ContextMenuEntry(null, context);
routingEntry.setText(Messages.routingDrawerTitle);
routingEntry.setSubmenu(true);
ContextMenuEntry controlFlowEntry = new ContextMenuEntry(null, context);
controlFlowEntry.setText(Messages.controlFlowDrawerTitle);
controlFlowEntry.setSubmenu(true);
ContextMenuEntry transformationEntry = new ContextMenuEntry(null, context);
transformationEntry.setText(Messages.transformationDrawerTitle);
transformationEntry.setSubmenu(true);
ContextMenuEntry miscEntry = new ContextMenuEntry(null, context);
miscEntry.setText(Messages.miscellaneousDrawerTitle);
miscEntry.setSubmenu(true);
// then we need to fill the shelves menus
fillEndpointsContextMenu(endpointsEntry, context, fp);
if (!onlyEndpoints) {
fillRoutingContextMenu(routingEntry, context, fp);
fillControlFlowContextMenu(controlFlowEntry, context, fp);
fillTransformationContextMenu(transformationEntry, context, fp);
fillMiscellaneousContextMenu(miscEntry, context, fp);
}
// lets find what endpoints are available...
if (selectedNode != null) {
Set<Endpoint> endpoints = AbstractNodes.getAllEndpoints(selectedNode);
Map<String, String> beans = AbstractNodes.getAllBeans(selectedNode);
if (endpoints.size() > 0 || beans.size() > 0) {
/*
// TODO add a separator...
ContextMenuEntry menuEntry = new ContextMenuEntry(null, null);
menuEntry.setSubmenu(false);
// add entry to parent
endpointsEntry.add(menuEntry);
*/
}
if (endpoints.size() > 0) {
boolean useChildMenu = false;
if (useChildMenu) {
ContextMenuEntry values = new ContextMenuEntry(null, null);
values.setText(Messages.endpointsDrawerTitle);
values.setSubmenu(true);
addEndpointInstances(values, endpoints, context, fp);
endpointsEntry.add(values);
} else {
addEndpointInstances(endpointsEntry, endpoints, context, fp);
}
}
if (beans.size() > 0) {
boolean useChildMenu = false;
if (useChildMenu) {
ContextMenuEntry values = new ContextMenuEntry(null, null);
values.setText(Messages.endpointsDrawerTitle);
values.setSubmenu(true);
addBeanInstances(values, beans, context, fp);
endpointsEntry.add(values);
} else {
addBeanInstances(endpointsEntry, beans, context, fp);