/** * Suffixes an exception message with useful information about this. component. * * @param message * The message * @return The modified message */ protected final String exceptionMessage(final String message) { return message + ":\n" + toString(); }
/** * Gets the string representation of this component. * * @return The path to this component */ @Override public String toString() { return toString(false); }
/** * Suffixes an exception message with useful information about this. component. * * @param message * The message * @return The modified message */ protected final String exceptionMessage(final String message) { return message + ":\n" + toString(); }
/** * Gets the string representation of this component. * * @return The path to this component */ @Override public String toString() { return toString(false); }
/** * Prefixes an exception message with useful information about this. component. * * @param message * The message * @return The modified message */ protected final String exceptionMessage(final String message) { return message + ":\n" + toString(); }
/** * Gets the string representation of this component. * * @return The path to this component */ @Override public String toString() { return toString(false); }
/** * Gets the string representation of this component. * * @return The path to this component */ public String toString() { return toString(true); }
/** * Prefixes an exception message with useful information about this. component. * * @param message * The message * @return The modified message */ protected final String exceptionMessage(final String message) { return message + ":\n" + toString(); }
private static String detail(Component component, Behavior behavior) { StringBuilder detail = new StringBuilder("Component: ").append(component.toString(false)); if (behavior != null) { detail.append(" Behavior: ").append(behavior.toString()); } return detail.toString(); }
private static String detail(Component component, Behavior behavior) { StringBuilder detail = new StringBuilder("Component: ").append(component.toString(false)); if (behavior != null) { detail.append(" Behavior: ").append(behavior.toString()); } return detail.toString(); }
@Override public void addComponent(Component component) { if (component == null) { throw new IllegalArgumentException("component cannot be null"); } if (component.getOutputMarkupId() == false) { throw new IllegalArgumentException("cannot update component that does not have setOutputMarkupId property set to true. Component: " + component.toString()); } this.updates.add(component); }
/** * @see org.wicketstuff.minis.behavior.veil.VeilResources#bind(org.apache.wicket.Component) */ @Override public void bind(final Component component) { super.bind(component); if (this.component != null) throw new IllegalStateException( "This behavior is already bound to component. An instance of this behavior cannot be reused between components. Bound component: " + this.component.toString()); this.component = component; }
/** * {@inheritDoc} */ @Override public void bind(final Component component) { super.bind(component); if (this.component != null) throw new IllegalStateException( "This behavior is already bound to component. An instance of this behavior cannot be reused between components. Bound component: " + this.component.toString()); this.component = component; }
private void initializeInstances(List<Field> pFields, Component pComponent) { for(Field field : pFields) { try { if (!field.isAccessible()) { field.setAccessible(true); } if (field.get(pComponent) == null) { field.set(pComponent, new Instance<Object>(field, pComponent)); } } catch(IllegalAccessException pException) { throw new RuntimeException("An error while injecting object instance into field [" + field.getName() + "] of component [" + pComponent.toString() + "]", pException); } } }
@Override public final void focusComponent(Component component) { if (component != null && component.getOutputMarkupId() == false) { throw new IllegalArgumentException( "cannot update component that does not have setOutputMarkupId property set to true. Component: " + component.toString()); } final String id = component != null ? ("'" + component.getMarkupId() + "'") : "null"; appendJavaScript("Wicket.Focus.setFocusOnId(" + id + ");"); }
@Override public final void focusComponent(Component component) { if (component != null && component.getOutputMarkupId() == false) { throw new IllegalArgumentException( "cannot update component that does not have setOutputMarkupId property set to true. Component: " + component.toString()); } final String id = component != null ? ("'" + component.getMarkupId() + "'") : "null"; appendJavaScript("Wicket.Focus.setFocusOnId(" + id + ");"); }
@Override public final void focusComponent(Component component) { if (component != null && component.getOutputMarkupId() == false) { throw new IllegalArgumentException( "cannot update component that does not have setOutputMarkupId property set to true. Component: " + component.toString()); } final String id = component != null ? ("'" + component.getMarkupId() + "'") : "null"; appendJavaScript("Wicket.Focus.setFocusOnId(" + id + ");"); }
@Override public final void focusComponent(Component component) { if (component != null && component.getOutputMarkupId() == false) { throw new IllegalArgumentException( "cannot update component that does not have setOutputMarkupId property set to true. Component: " + component.toString()); } final String id = component != null ? ("'" + component.getMarkupId() + "'") : "null"; appendJavaScript("Wicket.Focus.setFocusOnId(" + id + ");"); }
@Override public void add(Component... components) { for (final Component component : components) { Args.notNull(component, "component"); if (component.getOutputMarkupId() == false && !(component instanceof Page)) { throw new IllegalArgumentException( "Cannot update component that does not have setOutputMarkupId property set to true. Component: " + component.toString()); } add(component, component.getMarkupId()); } }
@Override public void add(Component... components) { for (final Component component : components) { Args.notNull(component, "component"); if (component.getOutputMarkupId() == false) { throw new IllegalArgumentException( "cannot update component that does not have setOutputMarkupId property set to true. Component: " + component.toString()); } add(component, component.getMarkupId()); } }