/** * The participating component == this. * * @see org.apache.wicket.extensions.breadcrumb.IBreadCrumbParticipant#getComponent() */ @Override public Component getComponent() { return decorated.getComponent(); }
/** * @see org.apache.wicket.extensions.breadcrumb.IBreadCrumbParticipant#onActivate(org.apache.wicket.extensions.breadcrumb.IBreadCrumbParticipant) */ public void onActivate(IBreadCrumbParticipant previous) { decorated.onActivate(previous); }
link.setEnabled(enableLink); add(link); link.add(new Label("label", breadCrumbParticipant.getTitle()).setRenderBodyOnly(true));
link.setEnabled(enableLink); add(link); link.add(new Label("label", breadCrumbParticipant.getTitle()).setRenderBodyOnly(true));
/** * The participating component == this. * * @see org.apache.wicket.extensions.breadcrumb.IBreadCrumbParticipant#getComponent() */ public Component getComponent() { return decorated.getComponent(); }
public BreadCrumbComponent(String id, long index, IBreadCrumbModel breadCrumbModel, final IBreadCrumbParticipant participant, boolean enableLink) { super(id); HippoIcon icon = HippoIcon.fromSprite("sep", Icon.CHEVRON_RIGHT); icon.addCssClass("breadcrumbs-separator"); icon.setVisible(enableLink); add(icon); BreadCrumbLink link = new AjaxBreadCrumbLink("link", breadCrumbModel) { private static final long serialVersionUID = 1L; protected IBreadCrumbParticipant getParticipant(String componentId) { return participant; } }; link.setEnabled(enableLink); add(link); IModel<String> title; if (participant instanceof IPanelPluginParticipant) { title = ((IPanelPluginParticipant) participant).getTitle(this); } else { title = participant.getTitle(); } link.add(new Label("label", title).setRenderBodyOnly(true)); } }
/** * @see org.apache.wicket.extensions.breadcrumb.IBreadCrumbParticipant#onActivate(org.apache.wicket.extensions.breadcrumb.IBreadCrumbParticipant) */ @Override public void onActivate(final IBreadCrumbParticipant previous) { decorated.onActivate(previous); }
protected void activateParentAndDisplayInfo(final String infoMsg) { final IBreadCrumbParticipant parentBreadcrumb = activateParent(); parentBreadcrumb.getComponent().info(infoMsg); }
/** * Activates the bread crumb participant. * * @param breadCrumbParticipant * The participant to activate */ protected final void activate(final IBreadCrumbParticipant breadCrumbParticipant) { // get old value IBreadCrumbParticipant previousParticipant = activeParticipant; // and set the provided participant as the active one activeParticipant = breadCrumbParticipant; // fire bread crumb activated event listenerSupport.fireBreadCrumbActivated(previousParticipant, breadCrumbParticipant); // signal the bread crumb participant that it is selected as the // currently active one breadCrumbParticipant.onActivate(previousParticipant); } }
/** * @see org.apache.wicket.markup.html.link.Link#onClick() */ @Override public void onClick() { // get the currently active particpant final IBreadCrumbParticipant active = breadCrumbModel.getActive(); if (active == null) { throw new IllegalStateException("The model has no active bread crumb. Before using " + this + ", you have to have at least one bread crumb in the model"); } // get the participant to set as active final IBreadCrumbParticipant participant = getParticipant(active.getComponent().getId()); // add back button support addStateChange(); // set the next participant as the active one breadCrumbModel.setActive(participant); }
/** * Activates the bread crumb participant. * * @param breadCrumbParticipant * The participant to activate */ protected final void activate(final IBreadCrumbParticipant breadCrumbParticipant) { // get old value IBreadCrumbParticipant previousParticipant = activeParticipant; // and set the provided participant as the active one activeParticipant = breadCrumbParticipant; // fire bread crumb activated event listenerSupport.fireBreadCrumbActivated(previousParticipant, breadCrumbParticipant); // signal the bread crumb participant that it is selected as the // currently active one breadCrumbParticipant.onActivate(previousParticipant); } }
/** * Callback for the onClick event. If ajax failed and this event was generated via a normal link * the target argument will be null * * @param target * ajax target if this linked was invoked using ajax, null otherwise */ @Override public void onClick(AjaxRequestTarget target) { // get the currently active particpant final IBreadCrumbParticipant active = breadCrumbModel.getActive(); if (active == null) { throw new IllegalStateException("The model has no active bread crumb. Before using " + this + ", you have to have at least one bread crumb in the model"); } // get the participant to set as active final IBreadCrumbParticipant participant = getParticipant(active.getComponent().getId()); // add back button support addStateChange(); // set the next participant as the active one breadCrumbModel.setActive(participant); }
/** * @see org.apache.wicket.markup.html.link.Link#onClick() */ @Override public void onClick() { // get the currently active particpant final IBreadCrumbParticipant active = breadCrumbModel.getActive(); if (active == null) { throw new IllegalStateException("The model has no active bread crumb. Before using " + this + ", you have to have at least one bread crumb in the model"); } // get the participant to set as active final IBreadCrumbParticipant participant = getParticipant(active.getComponent().getId()); // add back button support addStateChange(new Change() { private static final long serialVersionUID = 1L; @Override public void undo() { breadCrumbModel.setActive(active); } }); // set the next participant as the active one breadCrumbModel.setActive(participant); }
MarkupContainer parent = previous.getComponent().getParent(); if (parent != null)
MarkupContainer parent = previous.getComponent().getParent(); if (parent != null)