use of org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupSubMenu in project webtools.sourceediting by eclipse.
the class XSDRefactorGroupActionDelegate method fillMenu.
/**
* Fills the menu with applicable refactor sub-menues
* @param menu The menu to fill
*/
protected void fillMenu(Menu menu) {
if (fSelection == null) {
return;
}
if (workbenchPart != null) {
IWorkbenchPartSite site = workbenchPart.getSite();
if (site == null)
return;
IEditorPart editor = site.getPage().getActiveEditor();
if (editor != null) {
XSDSchema schema = (XSDSchema) editor.getAdapter(XSDSchema.class);
ISelectionMapper mapper = (ISelectionMapper) editor.getAdapter(ISelectionMapper.class);
if (schema != null) {
ISelection selection = mapper != null ? mapper.mapSelection(fSelection) : fSelection;
RefactorActionGroup refactorMenuGroup = new XSDRefactorActionGroup(selection, schema);
RefactorGroupSubMenu subMenu = new RefactorGroupSubMenu(refactorMenuGroup);
subMenu.fill(menu, -1);
}
}
}
}
Aggregations