private void retargetBindingContexts(ContextManager pContextManager) { for (Context context : pContextManager.getDefinedContexts()) { try { if(context.getId().startsWith("miw") && context.getParentId() == null) { context.define(context.getName(), context.getDescription(), "org.eclipse.ui.contexts.window"); logger.log(LogService.LOG_ERROR, context.getId() + " context reparented"); System.out.println(); } } catch (NotDefinedException e) { logger.log(LogService.LOG_ERROR, e.getMessage(), e); } } Map> contexts = new HashMap<>(); for (Context context : pContextManager.getDefinedContexts()) { try { if(context.getParentId() != null) { List list = contexts.get(context.getParentId()); if(list == null) { list = new ArrayList(); contexts.put(context.getParentId(), list); } list.add(context); } } catch (NotDefinedException e) { } } for (Context context : pContextManager.getDefinedContexts()) { try { if(context.getParentId() == null) { printContext(contexts, context, 0); } } catch (NotDefinedException e) { } } } private void printContext(Map> pContexts, Context pContext, int pIndent) throws NotDefinedException { printSpaces(pIndent); System.out.println(pContext.getName()); pIndent++; List children = pContexts.get(pContext.getId()); if(children != null) { for (Context context : children) { printContext(pContexts, context, pIndent); } } } private void printSpaces(int pIndent) { for(int ix=0; ix