newMethod.init(this,context); return newMethod;
@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); } } }
@Override public IMethod getMethod(IMethodContext dataObject) { try { IMethod newMethod=null; if(MethodPlace.DATA_TABLE.equals(dataObject.getPlace())){ newMethod = getTableIMethodClass().newInstance(); }else{ newMethod = getIMethodClass().newInstance(); } if (newMethod!=null){ newMethod.init(this, dataObject); return newMethod; } } catch (InstantiationException | IllegalAccessException e) { LOG.error("Can't obtain a method", e); } return null; }