import java.io.IOException;
public class PrintChartMenuItemRenderer extends MenuItemRenderer {
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
MenuItem menuItem = (MenuItem) component;
if (menuItem.getValue() == null)
menuItem.setValue("Print");
menuItem.setOnclick(new ScriptBuilder().functionCall("O$.ChartMenu._printChart",
getChart("<o:printChartMenuItem>", menuItem)).getScript());
if (menuItem.getIconUrl() == null)
menuItem.setIconUrl(Resources.internalURL(
context, null, "chart/print.png", false));
super.encodeBegin(context, component);
Resources.includeJQuery(context);
Resources.renderJSLinkIfNeeded(context,