{
final IGuide[] mergeGuides = GlobalController.SINGLETON.getSelectedGuides();
final GuidesSet cgs = GlobalModel.SINGLETON.getGuidesSet();
StandardGuide[] guides = GuidesUtils.filterGuides(cgs.getStandardGuides(null), mergeGuides);
MergeGuideDialog dialog = new MergeGuideDialog(GlobalController.SINGLETON.getMainFrame());
dialog.setMergeGuides(guides);
dialog.open();
if (!dialog.hasBeenCanceled())
{
final StandardGuide mergeGuide = dialog.getSelectedMergeGuide();
if (mergeGuide != null)
{
GlobalController.SINGLETON.mergeGuides(mergeGuides, mergeGuide);
}
}