public JMenuItem createMenu(OperationPipeline pipeline, ActivityConnection conn) {
return createMenuItem(pipeline, conn, true);
}
private JMenuItem createMenuItem(OperationPipeline pipeline, ActivityConnection conn, boolean forceMenu) {
ActivityInsertionPolicy policy = pipeline.getInsertionPolicy();
EnumSet<PipelineActivityType> allowedTypes = policy.getAllowedActivities(conn);
List<Action> actions = createInsertActions(allowedTypes, pipeline, conn);
if (actions.size() == 1 && !forceMenu) {
return createSingleActionMenuItem(actions);
} else {
return createMenuImpl(actions);