/** * @see org.apache.wicket.extensions.breadcrumb.IBreadCrumbModel#setActive(org.apache.wicket.extensions.breadcrumb.IBreadCrumbParticipant) */ public void setActive(IBreadCrumbParticipant breadCrumbParticipant) { decorated.setActive(breadCrumbParticipant); }
@Override public void setActive(final IBreadCrumbParticipant breadCrumbParticipant) { decorated.setActive(breadCrumbParticipant); }
@Override public void undo() { breadCrumbModel.setActive(active); } });
@Override public void undo() { breadCrumbModel.setActive(active); } });
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } }.setDefaultFormProcessing(false));
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } }.setDefaultFormProcessing(false));
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } }.setDefaultFormProcessing(false));
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } }.setDefaultFormProcessing(false));
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } }.setDefaultFormProcessing(false));
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } }.setDefaultFormProcessing(false));
protected IBreadCrumbParticipant activateParent() { final IBreadCrumbModel breadCrumbModel = getBreadCrumbModel(); final List<IBreadCrumbParticipant> allBreadCrumbs = breadCrumbModel.allBreadCrumbParticipants(); final IBreadCrumbParticipant parentBreadCrumb = allBreadCrumbs.get(allBreadCrumbs.size() - 2); breadCrumbModel.setActive(parentBreadCrumb); return parentBreadCrumb; }
/** * Activates the provided participant, which typically has the effect of replacing this current * panel with the one provided - as the participant typically would be a {@link BreadCrumbPanel * bread crumb panel} - and updating the bread crumb model of this panel, pushing the bread * crumb for the given participant on top. * * @param participant * The participant to set as the active one */ public void activate(final IBreadCrumbParticipant participant) { // get the currently active participant 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"); } // add back button support addStateChange(); // set the bread crumb panel 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(); // set the next participant as the active one breadCrumbModel.setActive(participant); }
/** * 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); }
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { User user = (User) model.getObject(); String username = user.getUsername(); try { user.save(); log.info("User '" + username + "' saved by " + ((UserSession) Session.get()).getJcrSession().getUserID()); Session.get().info(getString("user-saved", model)); // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } catch (RepositoryException e) { Session.get().warn(getString("user-save-failed", model)); log.error("Unable to save user '" + username + "' : ", e); } } @Override
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { String username = user.getUsername(); try { user.savePassword(password); log.info("User '" + username + "' password set by " + ((UserSession) Session.get()).getJcrSession().getUserID()); Session.get().info(getString("user-password-set", model)); // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } catch (RepositoryException e) { Session.get().warn(getString("user-save-failed", model)); log.error("Unable to set password for user '" + username + "' : ", e); } } @Override
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { Group group = (Group) model.getObject(); String groupname = group.getGroupname(); try { group.save(); log.info("Group '" + groupname + "' saved by " + ((UserSession) Session.get()).getJcrSession().getUserID()); UserDataProvider.setDirty(); Session.get().info(getString("group-saved", model)); // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } catch (RepositoryException e) { Session.get().warn(getString("group-save-failed", model)); log.error("Unable to save group '" + groupname + "' : ", e); } } });
private void deleteGroup(IModel model) { Group group = (Group) model.getObject(); String groupname = group.getGroupname(); try { group.delete(); log.info("Group '" + groupname + "' deleted by " + ((UserSession) Session.get()).getJcrSession().getUserID()); GroupDataProvider.setDirty(); Session.get().info(getString("group-removed", model)); // one up List<IBreadCrumbParticipant> l = getBreadCrumbModel().allBreadCrumbParticipants(); getBreadCrumbModel().setActive(l.get(l.size() -2)); } catch (RepositoryException e) { Session.get().warn(getString("group-remove-failed", model)); log.error("Unable to delete group '" + groupname + "' : ", e); } }
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { Group group = groupModel.getGroup(); String groupname = group.getGroupname(); try { group.create(); log.info("Group '" + groupname + "' created by " + ((UserSession) Session.get()).getJcrSession().getUserID()); GroupDataProvider.setDirty(); Session.get().info(getString("group-created", groupModel)); // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } catch (RepositoryException e) { Session.get().warn(getString("group-create-failed", groupModel)); log.error("Unable to create group '" + groupname + "' : ", e); } } @Override
@Override protected void onSubmit(AjaxRequestTarget target, Form form) { User user = userModel.getUser(); String username = user.getUsername(); try { user.create(); user.savePassword(password); log.info("User '" + username + "' created by " + ((UserSession) Session.get()).getJcrSession().getUserID()); UserDataProvider.setDirty(); Session.get().info(getString("user-created", userModel)); // one up List<IBreadCrumbParticipant> l = breadCrumbModel.allBreadCrumbParticipants(); breadCrumbModel.setActive(l.get(l.size() -2)); } catch (RepositoryException e) { Session.get().warn(getString("user-create-failed", userModel)); log.error("Unable to create user '" + username + "' : ", e); } } @Override