if(l instanceof RibbonActionListener) {
listener = l;
break;
}
}
RibbonApplicationMenuEntrySecondary entry = new RibbonApplicationMenuEntrySecondary(button.getIcon(), button.getText(), listener, kind);
if(callback != null) {
entry.setPopupCallback(callback);
}
KeyStroke ks = (KeyStroke) button.getClientProperty(RibbonActionContributorFactory.ACTION_ACCELERATOR);
if(ks != null) {
AFreeplaneAction action = (AFreeplaneAction) button.getClientProperty(RibbonActionContributorFactory.ACTION_KEY_PROPERTY);
if(action != null) {
RichTooltip tip = RibbonActionContributorFactory.getRichTooltip(action, ks);
if(tip != null) {
entry.setActionRichTooltip(tip);
}
}
}
return entry;
}