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); } }
@Override protected void initialize() { IModel<String> title = getTitle(); Label titleLabel = new Label("text", title); titleLabel.add(TitleAttribute.set(getTooltip())); add(titleLabel); } });
private AttributeModifier createTitleModifierOrNull(final Node node) { return TitleAttribute.append(new NodeNameModel(new JcrNodeModel(node))); }
private AjaxLink deleteLink(String id, final JcrPropertyModel model) throws RepositoryException { AjaxLink deleteLink = new AjaxLink<Property>(id, model) { private static final long serialVersionUID = 1L; @Override protected void onComponentTag(final ComponentTag tag) { super.onComponentTag(tag); tag.put("class", "property-remove"); } @Override public void onClick(AjaxRequestTarget target) { try { Property prop = model.getProperty(); prop.remove(); } catch (RepositoryException e) { log.error(e.getMessage()); } NodeEditor editor = findParent(NodeEditor.class); target.add(editor); } }; deleteLink.add(TitleAttribute.set(getString("property.remove"))); return deleteLink; }
@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; }
private void load() { linkText = null; linkModel = null; final String relativeNodePath = getModelObject(); if (StringUtils.isBlank(relativeNodePath)) { return; } if (relativeNodePath.startsWith("/")) { linkText = "The value is not correct: Value may not start with a forward slash."; } else { try { final Node targetNode = getHstReferencedNode(relativeNodePath); linkModel = new JcrNodeModel(targetNode); linkText = targetNode.getPath(); final String title = determineTitle(targetNode); if (StringUtils.isNotBlank(title)) { this.add(TitleAttribute.set(title)); } } catch (PathNotFoundException e) { linkText = "(Reference not found. Might be used in inheriting structure though.)"; } catch (RepositoryException e) { linkText = "Repository Exception: " + e.getMessage(); log.error("Error loading target node by reference " + getModelObject()); } } }
/** * 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; }
@Override public Component getLazyLoadComponent(String markupId) { Fragment fragment = new Fragment(markupId, "lazy-load-document-hits-container", DocumentHitsPlugin.this); final String url = getGraphUrl(); ExternalImage image = new ExternalImage("document-hits-image", url); image.add(TitleAttribute.set(getGraphInfo())); image.setOutputMarkupId(true); fragment.add(image); Label label = new Label("document-hits-label", getGraphLabel()); fragment.add(label); return fragment; } };
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); } }
private void addOpenLink() { AjaxLink openLink = new AjaxLink("openLink") { @Override public boolean isVisible() { return hasFilledDocbase(); } @Override public void onClick(AjaxRequestTarget target) { open(); } }; openLink.add(new Label("value",getLocalizedNameModel())); openLink.add(TitleAttribute.set(getPathModel())); openLink.setOutputMarkupId(true); fragment.add(openLink); }
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:
public TopPlugin(final IPluginContext context, final IPluginConfig config) { super(context, config); final WebMarkupContainer logo = new WebMarkupContainer("logo"); logo.add(TitleAttribute.set("Hippo Release Version: " + SYSTEM_INFO.getReleaseVersion())); add(logo); final WebComponent toolbar = new WebComponent(BAR_STYLES); final String style = obtainBreadcrumbStyle(config); if (StringUtils.isNotBlank(style)) { toolbar.add(AttributeModifier.replace("style", style)); } add(toolbar); }
@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; } }
private void addOpenLinkPickerLink() { final IModel<String> displayModel = getLocalizedNameModel(); final IPluginContext context = getPluginContext(); DialogLink openPickerLink = new DialogLink("openLinkPickerLink", displayModel, getDialogFactory(context), getDialogService()) { @Override public boolean isVisible() { return hasFilledDocbase(); } }; openPickerLink.add(TitleAttribute.set(getPathModel())); fragment.add(openPickerLink); }
@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; } }
removeLink.add(TitleAttribute.set(getString("property.value.remove")));
@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; } }
deleteLink.add(TitleAttribute.set(getString("property.value.remove"))); deleteLink.add(new InputBehavior(new KeyType[] {KeyType.Enter}, EventType.click) { @Override