/** * Creates a link directly to the address in the specified target frame * <p> * * @param directToAddress * The address to redirect to * @param targetFrameName * The frame to redirect * @param component * Includes raw text in the link */ public Link(String directToAddress, String targetFrameName, ComponentHierarchyBase component) { super("a", ComponentTypes.Link); this.directToAddress = directToAddress; this.targetFrameName = targetFrameName; if (directToAddress != null) { addAttribute(LinkAttributes.HRef, directToAddress); } if (targetFrameName != null) { addAttribute(LinkAttributes.Target, targetFrameName); } add(component); }
@Override public boolean equals(Object o) { return super.equals(o); } }
@Override public int hashCode() { return super.hashCode(); }
/** * Creates a link directly to the address in the specified target frame * <p> * * @param directToAddress * The address to redirect to * @param targetFrameName * The frame to redirect * @param text * Includes raw text in the link */ public Link(String directToAddress, String targetFrameName, String text) { super("a", ComponentTypes.Link); this.directToAddress = directToAddress; this.targetFrameName = targetFrameName; if (directToAddress != null) { addAttribute(LinkAttributes.HRef, directToAddress); } if (targetFrameName != null) { addAttribute(LinkAttributes.Target, targetFrameName); } setText(text); }
li.addClass(BSComponentNavsOptions.Nav_Item); Link link = new Link(); link.addClass(BSComponentNavsOptions.Nav_Link); link.addAttribute(BSToggleAttributes.Data_Toggle, "tab"); link.addAttribute(BSAccordionAttributes.Role, "tab"); link.setDirectToAddress(tab.getTabContent() .getID(true)); if (!li.getText(0) .isEmpty()) link.setText(li.getText(0)); li.setText(""); link.addClass(BSDefaultOptions.Active); tab.getTabContent() .addClass(BSDefaultOptions.Active);
/** * Adds a new list item (tab header that matches the right card-body) to the header with the given active property * * @param text * @param active * * @return */ @NotNull public ListItem<?> addItem(String text, boolean active) { ListItem<?> item = new ListItem<>(); item.addClass(BSNavsOptions.Nav_Item); Link<?> link = new Link<>(StaticStrings.STRING_HASH); link.addClass(BSNavsOptions.Nav_Link); if (active) { link.addClass(BSNavsOptions.Active); } link.setText(text); item.add(link); add(item); return item; }
/** * Gets the panel footer as a link. Class cast exception may occur if you have set the footer to a custom component * * @return */ public Component getPanelFooter() { if (panelFooter == null) { setPanelFooter(new Link(StaticStrings.STRING_HASH)); return panelFooter; } return panelFooter; }
/** * Creates a new theme pack item with the given values * * @param name * @param cssClass * @param iconImageLocation */ public ThemePackItem(String name, String cssClass, String iconImageLocation) { this.name = name; this.cssClass = cssClass; this.iconImageLocation = iconImageLocation; link = new Link(cssClass); add(link); if (iconImageLocation != null && !iconImageLocation.isEmpty()) { image = new Image(iconImageLocation); add(image); } span = new Span(); span.addClass("themeName"); span.setText(this.name); addClass(JQUIThemeBlocks.UI_Widget.toString()); addClass(JQUIThemeBlocks.UI_Widget_Input.toString()); addClass(JQUIThemeBlocks.UI_State_Active.toString()); link.add(span); }
/** * Sets the address to direct to * <p> * * @param directToAddress */ @SuppressWarnings("unchecked") @NotNull public J setDirectToAddress(String directToAddress) { this.directToAddress = directToAddress; addAttribute(LinkAttributes.HRef, directToAddress); return (J) this; }
/** * Sets the component displayed to the left or right (set that in the link) * * @param mediaComponent * * @return */ @Override public BSMedia setMediaComponent(Component mediaComponent) { if (this.mediaComponent != null) { getMediaLink().remove(this.mediaComponent); this.mediaComponent = null; } this.mediaComponent = mediaComponent; if (this.mediaComponent != null) { this.mediaComponent.addClass(BSComponentMediaOptions.Media_Object); getMediaLink().add(this.mediaComponent); } return this; }
li.addClass(BSComponentNavsOptions.Nav_Item); Link link = new Link(); link.addClass(BSComponentNavsOptions.Nav_Link); link.addAttribute(BSToggleAttributes.Data_Toggle, "tab"); link.addAttribute(BSAccordionAttributes.Role, "tab"); link.setDirectToAddress(tab.getTabContent() .getID(true)); if (!li.getText(0) .isEmpty()) link.setText(li.getText(0)); li.setText(""); link.addClass(BSDefaultOptions.Active); tab.getTabContent() .addClass(BSDefaultOptions.Active);
/** * Adds a new list item (tab header that matches the right card-body) to the header with the given active property * * @param text * @param active * * @return */ @NotNull public ListItem<?> addItem(String text, boolean active) { ListItem<?> item = new ListItem<>(); item.addClass(BSNavsOptions.Nav_Item); Link<?> link = new Link<>(StaticStrings.STRING_HASH); link.addClass(BSNavsOptions.Nav_Link); if (active) { link.addClass(BSNavsOptions.Active); } link.setText(text); item.add(link); add(item); return item; }
/** * Returns the associated media link, never null * * @return */ @Override public Link getMediaLink() { if (mediaLink == null) { setMediaLink(new Link(STRING_HASH), true); } return mediaLink; }
/** * Creates a link directly to the address in the specified target frame * <p> * * @param directToAddress * The address to redirect to * @param targetFrameName * The frame to redirect * @param text * Includes raw text in the link */ public Link(String directToAddress, String targetFrameName, String text) { super("a", ComponentTypes.Link); this.directToAddress = directToAddress; this.targetFrameName = targetFrameName; if (directToAddress != null) { addAttribute(LinkAttributes.HRef, directToAddress); } if (targetFrameName != null) { addAttribute(LinkAttributes.Target, targetFrameName); } setText(text); }
/** * Creates a new theme pack item with the given values * * @param name * @param cssClass * @param iconImageLocation */ public ThemePackItem(String name, String cssClass, String iconImageLocation) { this.name = name; this.cssClass = cssClass; this.iconImageLocation = iconImageLocation; link = new Link(cssClass); add(link); if (iconImageLocation != null && !iconImageLocation.isEmpty()) { image = new Image(iconImageLocation); add(image); } span = new Span(); span.addClass("themeName"); span.setText(this.name); addClass(JQUIThemeBlocks.UI_Widget.toString()); addClass(JQUIThemeBlocks.UI_Widget_Input.toString()); addClass(JQUIThemeBlocks.UI_State_Active.toString()); link.add(span); }
/** * Sets the address to direct to * <p> * * @param directToAddress */ @SuppressWarnings("unchecked") @NotNull public J setDirectToAddress(String directToAddress) { this.directToAddress = directToAddress; addAttribute(LinkAttributes.HRef, directToAddress); return (J) this; }
/** * Sets the component displayed to the left or right (set that in the link) * * @param mediaComponent * * @return */ @Override public BSMedia setMediaComponent(Component mediaComponent) { if (this.mediaComponent != null) { getMediaLink().remove(this.mediaComponent); this.mediaComponent = null; } this.mediaComponent = mediaComponent; if (this.mediaComponent != null) { this.mediaComponent.addClass(BSComponentMediaOptions.Media_Object); getMediaLink().add(this.mediaComponent); } return this; }
/** * Adds a new list item (tab header that matches the right card-body) to the header with the given active property * * @param text * @param active * * @return */ @NotNull public ListItem<?> addItem(String text, boolean active) { ListItem<?> item = new ListItem<>(); item.addClass(BSNavsOptions.Nav_Item); Link<?> link = new Link<>(StaticStrings.STRING_HASH); link.addClass(BSNavsOptions.Nav_Link); if (active) { link.addClass(BSNavsOptions.Active); } link.setText(text); item.add(link); add(item); return item; }