@SuppressWarnings("unchecked") private <T> void populateInternal(ICommandsSupportComponent<T> commandSupport, MethodPlace place, IModel<?> mainObjectModel, Component relatedComponent, BootstrapType bootstrapType, boolean overrideBootstrapType) { AbstractWidget<?> widget = getWidget(commandSupport); MethodContext ctx = new MethodContext(mainObjectModel, widget, place, relatedComponent); List<IMethod> methods = getMethods(ctx); for (IMethod method : methods) { Command<T> component = (Command<T>) method.createCommand(commandSupport.newCommandId()); if (component !=null){ if (overrideBootstrapType){ component.setBootstrapType(bootstrapType); } commandSupport.addCommand(component); } } }