}
});
mainButton.setPopupCallback(new PopupPanelCallback() {
@Override
public JPopupPanel getPopupPanel(JCommandButton commandButton) {
return new SamplePopupMenu(commandButton
.getComponentOrientation());
}
});
mainButton
.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
RichTooltip mainRichTooltip = new RichTooltip();
mainRichTooltip.setTitle("Paste");
mainRichTooltip
.addDescriptionSection("Paste the contents of the Clipboard");
mainButton.setActionRichTooltip(mainRichTooltip);
mainButton.setPopupKeyTip("V");
RichTooltip mainPopupRichTooltip = new RichTooltip();
mainPopupRichTooltip.setTitle("Paste");
mainPopupRichTooltip
.addDescriptionSection("Click here for more options such as pasting only the values or formatting");
mainButton.setPopupRichTooltip(mainPopupRichTooltip);
clipboardBand.addCommandButton(mainButton, RibbonElementPriority.TOP);
JCommandButton cutButton = new JCommandButton("Cut", new edit_cut());
cutButton.setPopupCallback(new PopupPanelCallback() {
@Override
public JPopupPanel getPopupPanel(JCommandButton commandButton) {
return new SamplePopupMenu(commandButton
.getComponentOrientation());
}
});
cutButton
.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
RichTooltip cutRichTooltip = new RichTooltip();
cutRichTooltip.setTitle("Cut");
cutRichTooltip
.addDescriptionSection("Cut the selection from the document and put it on the Clipboard");
cutButton.setActionRichTooltip(cutRichTooltip);
cutButton.setPopupKeyTip("X");
clipboardBand.addCommandButton(cutButton, RibbonElementPriority.MEDIUM);
JCommandButton copyButton = new JCommandButton("Copy", new edit_copy());
copyButton.setPopupCallback(new PopupPanelCallback() {
@Override
public JPopupPanel getPopupPanel(JCommandButton commandButton) {
return new SamplePopupMenu(commandButton
.getComponentOrientation());
}
});
copyButton
.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_AND_POPUP_MAIN_POPUP);