/** * Adds a help icon at the top right corner of the field set. * * @param tooltip * @return The created IconPanel. */ public IconPanel addHelpIcon(final String tooltip, final FieldSetIconPosition iconPosition) { final IconPanel icon = new IconPanel(newIconChildId(), IconType.HELP, tooltip).setColor(CSSColor.GRAY); add(icon, iconPosition); return icon; }
public IconPanel(final String id, final IconType type, final IModel<String> title, final IModel<String> tooltip) { super(id); div = new WebMarkupContainer("div"); add(div); appendAttribute("class", type.getClassAttrValue()); this.tooltipTitle = title; this.tooltipText = tooltip; this.color = getColor(type); }
@Override protected void onEvent(final AjaxRequestTarget target) { IconPanel.this.onClick(); } };
IconPanel icon = new IconPanel(repeater.newChildId(), IconType.PLUS_SIGN).setOnClick("javascript:showBusinessAssessment();"); icon.setMarkupId("showBusinessAssessment").setOutputMarkupId(true); repeater.add(icon); icon = new IconPanel(repeater.newChildId(), IconType.MINUS_SIGN).setOnClick("javascript:hideBusinessAssessment();").appendAttribute( "style", "display: none;"); icon.setMarkupId("hideBusinessAssessment").setOutputMarkupId(true); repeater.add(icon);
final FieldsetPanel fs = gridBuilder.newFieldset(getString("searchFilter")); if (parentPage.getBaseDao().isHistorizable() == true) { IconPanel icon = new IconPanel(fs.newIconChildId(), IconType.PLUS_SIGN, getString("filter.extendedSearch")) .setOnClick("javascript:showExtendedFilter();"); icon.setMarkupId("showExtendedFilter"); fs.add(icon, FieldSetIconPosition.BOTTOM_LEFT); icon = new IconPanel(fs.newIconChildId(), IconType.MINUS_SIGN).setOnClick("javascript:hideExtendedFilter();"); icon.setMarkupId("hideExtendedFilter"); fs.add(icon, FieldSetIconPosition.BOTTOM_LEFT); div.add(modifiedSearchExpressionLabel); fs.addHelpIcon(getString("tooltip.lucene.link"), FieldSetIconPosition.TOP_RIGHT).setOnClickLocation( getRequestCycle(), WebConstants.DOC_LINK_HANDBUCH_LUCENE, true);
final IconPanel image = new IconPanel("acceptImage", IconType.ACCEPT); image.setTooltip(new ResourceModel("fibu.projekt.edit.kost2DoesAlreadyExists")); colItem.add(image); if (kost2Art.isExistsAlready() == true) { checkBox.setVisible(false); } else { image.setVisibilityAllowed(false);
/** * Uses "jiraSupportTooltipImage" as component id. * * @param parent only needed for localization * @param id * @return IconPanel which is invisible if JIRA isn't configured. */ public static IconPanel getJIRASupportTooltipIcon(final Component parent, final String id) { final IconPanel icon = new IconPanel(id, IconType.JIRA_SUPPORT, Model.of(parent.getString("tooltip.jiraSupport.field.title")), Model.of(parent.getString("tooltip.jiraSupport.field.content"))); if (isJIRAConfigured() == false) { icon.setVisible(false); } return icon; }
searchField.add(WicketUtils.setFocus()); fs.add(new InputPanel(fs.newChildId(), searchField)); fs.add(new IconPanel(fs.newIconChildId(), IconType.HELP, getString("tooltip.lucene.link")).setOnClickLocation( getRequestCycle(), WebConstants.DOC_LINK_HANDBUCH_LUCENE, true), FieldSetIconPosition.TOP_RIGHT);
/** * Adds a JIRA icon at the bottom right corner of the field set (only if JIRA is configured, otherwise this method does nothing). This * method is automatically called by {@link #addJIRAField()}. * * @param tooltip * @return this for chaining. */ public FieldsetPanel addJIRASupportHelpIcon() { if (WicketUtils.isJIRAConfigured() == true) { return add(WicketUtils.getJIRASupportTooltipIcon(this).setColor(CSSColor.GRAY), FieldSetIconPosition.TOP_RIGHT); } else { // No JIRA configured. return this; } }
/** * Appends attribute onclick and changes the cursor to pointer. * * @return */ public IconPanel setOnClick(final String onclick) { appendAttribute("style", "cursor: pointer;"); appendAttribute("onclick", onclick); return this; }
/** * @param id * @param type * @param link Must have component id {@link #LINK_ID} * @param tooltip */ public IconLinkPanel(final String id, final IconType type, final IModel<String> tooltip) { super(id); this.type = type; this.tooltip = tooltip; this.color = IconPanel.getColor(type); }
public FieldsetPanel add(final IconPanel icon, final FieldSetIconPosition iconPosition) { icon.getDiv().add(AttributeModifier.append("class", iconPosition.getStyleAttrValue())); if (iconContainer == null) { throw new IllegalArgumentException("No icons container given! May-be you forget to call newIconChildId() before adding an image."); } iconContainer.add(icon).setRenderBodyOnly(true); return this; }
public ContentMenuEntryPanel(final String id, final AbstractLink link, final IconType iconType) { this(id); this.link = link; labelComponent = new IconPanel(LABEL_ID, iconType); }
/** * Adds a JIRA icon at the bottom right corner of the field set (only if JIRA is configured, otherwise this method does nothing). * * @param tooltip * @return this for chaining. */ public FieldsetPanel addJIRAField(final IModel<String> model) { if (WicketUtils.isJIRAConfigured() == true) { add(new JiraIssuesPanel(newChildId(), model)); add(WicketUtils.getJIRASupportTooltipIcon(this).setColor(CSSColor.GRAY), FieldSetIconPosition.TOP_RIGHT); } return this; }
/** * Appends attribute onclick and changes the cursor to pointer. onclick results in location.href. * * @param location url to go on click. * @param newWindow If true then a new browser with the given url is opened. * @return */ public IconPanel setOnClickLocation(final RequestCycle requestCycle, final String location, final boolean newWindow) { appendAttribute("style", "cursor: pointer;"); final String url = WicketUtils.getUrl(requestCycle, location, false); if (newWindow == true) { appendAttribute("onclick", "window.open('" + url + "'); return false;"); } else { appendAttribute("onclick", "location.href='" + url + "';"); } return this; }
/** * Adds a help icon at the top right corner of the field set. * * @param tooltip * @return The created IconPanel. */ public IconPanel addHelpIcon(final IModel<String> tooltip) { final IconPanel icon = new IconPanel(newIconChildId(), IconType.HELP, tooltip).setColor(CSSColor.GRAY); add(icon, FieldSetIconPosition.TOP_RIGHT); return icon; }
public ContentMenuEntryPanel(final String id, final IconType iconType) { this(id); labelComponent = new IconPanel(LABEL_ID, iconType); }
/** * Enable Ajax onclick event. If clicked by the user {@link #onClick()} is called. */ @SuppressWarnings("serial") public IconPanel enableAjaxOnClick() { appendAttribute("style", "cursor: pointer;"); final AjaxEventBehavior behavior = new AjaxEventBehavior("click") { @Override protected void onEvent(final AjaxRequestTarget target) { IconPanel.this.onClick(); } }; div.add(behavior); return this; }
/** * Adds a keyboard icon at the bottom right corner of the field set. * * @param tooltip * @return this for chaining. */ public FieldsetPanel addKeyboardHelpIcon(final String tooltip) { return add(new IconPanel(newIconChildId(), IconType.KEYBOARD, tooltip).setColor(CSSColor.GRAY), FieldSetIconPosition.BOTTOM_RIGHT); }