public BreadcrumbLabel(final String id, final IModel<String> name) { super(id); setCssClass("breadcrumb-label"); final Label label = new Label("label", name); label.add(TitleAttribute.append(name)); add(label); } }
private AttributeModifier createTitleModifierOrNull(final Node node) { return TitleAttribute.append(new NodeNameModel(new JcrNodeModel(node))); }
@Override public AttributeModifier[] getCellAttributeModifiers(IModel<Revision> model) { Revision revision = model.getObject(); StateIconAttributes attrs = new StateIconAttributes((JcrNodeModel) revision.getDocument()); AttributeModifier[] attributes = new AttributeModifier[2]; attributes[0] = CssClass.append(new PropertyModel<>(attrs, "cssClass")); attributes[1] = TitleAttribute.append(new PropertyModel<>(attrs, "summary")); return attributes; }
/** * Create a component representing the icon for a node tree. What icon to show and * whether or not it has a tooltip depends on the underlying JCR node. * * @param id wicket ID of the component * @param node of the tree for which to create the icon * @return a node-specific icon, or a default icon */ public static Component createJcrNodeIcon(final String id, final TreeNode node) { final IModel<Node> nodeModel = ((IJcrTreeNode) node).getNodeModel(); if (nodeModel == null || nodeModel.getObject() == null) { return createUnknownNodeIcon(id); } final Node jcrNode = nodeModel.getObject(); final Label icon = new Label(id, StringUtils.EMPTY); icon.add(CssClass.append(JcrNodeIcon.getIconCssClass(jcrNode))); final String tooltip = determineNodeTooltip(jcrNode); if (StringUtils.isNotBlank(tooltip)) { icon.add(TitleAttribute.append(tooltip)); } return icon; }
public BreadcrumbLink(final String id, final IModel<String> name, final OnClickHandler onClickHandler) { super(id); setCssClass("breadcrumb-link"); AjaxLink link = new AjaxLink("link") { @Override public void onClick(AjaxRequestTarget target) { if (onClickHandler != null) { onClickHandler.onClick(target); } } }; link.add(new Label("name", name).setRenderBodyOnly(true)); link.add(TitleAttribute.append(name)); add(link); } }
case 0: validationIcon.add(CssClass.append(FontAwesomeIcon.EXCLAMATION.cssClass() + " check-false")); validationIcon.add(TitleAttribute.append("Web File not found at this path.")); break; case 1:
@Override public AttributeModifier[] getCellAttributeModifiers(Node node) { StateIconAttributes attrs = new StateIconAttributes(new JcrNodeModel(node)); AttributeModifier[] attributes = new AttributeModifier[2]; attributes[0] = CssClass.appendAndObserve(new ObservablePropertyModel<>(attrs, "cssClass")); attributes[1] = TitleAttribute.append(new ObservablePropertyModel<>(attrs, "summary")); return attributes; } }
@Override public AttributeModifier[] getCellAttributeModifiers(Node node) { StateIconAttributes attrs = new StateIconAttributes(new JcrNodeModel(node)); AttributeModifier[] attributes = new AttributeModifier[2]; attributes[0] = CssClass.appendAndObserve(new ObservablePropertyModel<>(attrs, "cssClass")); attributes[1] = TitleAttribute.append(new ObservablePropertyModel<>(attrs, "summary")); return attributes; } }
@Override public AttributeModifier[] getCellAttributeModifiers(Node node) { final TypeStateAttributes attrs = new TypeStateAttributes(new JcrNodeModel(node)); final AttributeModifier[] attributes = new AttributeModifier[2]; attributes[0] = CssClass.appendAndObserve(new ObservablePropertyModel<>(attrs, "cssClass")); attributes[1] = TitleAttribute.append(new ObservablePropertyModel<>(attrs, "description")); return attributes; } }
protected AttributeModifier getCellAttributeModifier(Node node) { IModel<String> documentType = null; try { if (node.isNodeType(HippoNodeType.NT_HANDLE)) { //isFolder = false; NodeIterator nodeIt = node.getNodes(); while (nodeIt.hasNext()) { Node childNode = nodeIt.nextNode(); if (childNode.isNodeType(HippoNodeType.NT_DOCUMENT)) { documentType = new TypeTranslator(new JcrNodeTypeModel(childNode.getPrimaryNodeType())) .getTypeName(); break; } } } else { documentType = new TypeTranslator(new JcrNodeTypeModel(node.getPrimaryNodeType())).getTypeName(); } } catch (RepositoryException ex) { log.error("Unable to determine type of document", ex); return null; } return TitleAttribute.append(documentType); }
@Override protected void populateItem(Item<ILayoutTransition> item) { final ILayoutTransition transition = item.getModelObject(); AjaxLink<Void> link = new AjaxLink<Void>("link") { @Override public void onClick(AjaxRequestTarget target) { layoutContext.apply(transition); } @Override protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); attributes.getAjaxCallListeners().add(new EventStoppingDecorator()); } }; link.setVisible(editable); final String name = transition.getName(); final Icon icon = getTransitionIconByName(name); link.add(CssClass.append(name)); link.add(TitleAttribute.append(name)); link.add(HippoIcon.fromSprite("icon", icon)); item.add(link); }
link.add(TitleAttribute.append(new LoadableDetachableModel<String>() { private static final long serialVersionUID = 1L;