/** * @param parent * @return */ public static PageflowModelSelectionDialog createDialog(Shell parent, List<Pageflow> elements) { ComposedAdapterFactory factory = PageflowAdapterFactoryProvider.getAdapterFactory(); final ILabelProvider elementRenderer = new AdapterFactoryLabelProvider(factory); ILabelProvider qualifierRenderer = new LabelProvider() { public Image getImage(Object element) { EObject eObject = (EObject) element; return elementRenderer.getImage(eObject.eResource()); } public String getText(Object element) { EObject eObject = (EObject) element; return elementRenderer.getText(eObject.eResource()); } }; PageflowModelSelectionDialog dialog = new PageflowModelSelectionDialog(parent, elementRenderer, qualifierRenderer); dialog.setElements(elements.toArray(new Pageflow[0])); return dialog; }
/** * @param parent * @param ofsProject * @return */ public static PageflowModelSelectionDialog createDialog(Shell parent, IOfsProject ofsProject) { PageflowModelLookup lookup = new PageflowModelLookup(ofsProject); PageflowModelSelectionDialog dialog = createDialog(parent, lookup.getAllPageflows()); dialog.setTitle(""); return dialog; }