/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2010 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* A panel containing a label an a help icon. A customized tool tip is used,
* the tool tip is also displayed when the user clicks on the help icon.
* The main difference with {@code LabelWithHelpIcon} is that this uses
* a {@code JEditorPane} as label.
*
*/
{
/**
* The label with the text.
*/
/**
* The label with the icon.
*/
/**
* The left inset of the help icon.
*/
/**
* The constructor of this panel.
* @param text the text of the panel.
* @param tooltipIcon the tool tip of the help icon.
*/
{
super(new GridBagLayout());
setOpaque(false);
if (tooltipIcon != null)
{
}
}
/**
* Sets the text on the label. The text is assumed to be in HTML format
* but the font will be imposed by the font specified using {@link #setFont}.
* @param text the text to be displayed.
*/
{
}
/**
* Returns the text displayed on the panel.
* @return the text displayed on the panel.
*/
{
}
/**
* Sets the font to be used in this panel.
* @param font the font.
*/
{
// This is called by the constructor of JPanel.
{
}
}
/**
* Sets the tool tip to be used in the help icon.
* @param tooltip the tool tip text.
*/
{
}
/**
* Returns the tool tip to be used in the help icon.
* @return the tool tip to be used in the help icon.
*/
{
return iconLabel.getToolTipText();
}
/**
* Sets whether the help icon is visible or not.
* @param visible whether the help icon is visible or not.
*/
{
if (visible)
{
{
}
}
{
}
}
/**
* Sets the foreground color for the text in this panel.
* @param color the foreground color for the text in this panel.
*/
{
super.setForeground(color);
{
// This is called in the constructor of the object.
}
}
/** {@inheritDoc} */
{
if (display)
{
return getHelpTooltip();
}
else
{
return null;
}
}
}