@Override public boolean select(Element e) { boolean isMapped = e.eResource().getResourceSet() instanceof IUIElementMapMap && ((IUIElementMapMap) e.eResource().getResourceSet()).getElementFor(e) != null; if (isMapped) { if (e instanceof TypedElement && e instanceof MultiplicityElement && ((TypedElement) e).getType() != null) { return EmfClassifierUtil.isPersistentComplexStructure(((TypedElement) e).getType()); } } return false; }
/** * @see * org.eclipse.nebula.widgets.nattable.edit.gui.AbstractDialogCellEditor#createDialogInstance() * @return */ @Override public Object createDialogInstance() { int columnIndex = this.layerCell.getColumnIndex(); int rowIndex = this.layerCell.getRowIndex(); Object row = this.manager.getRowElement(rowIndex); Object column = this.manager.getColumnElement(columnIndex); row = AxisUtils.getRepresentedElement(row); column = AxisUtils.getRepresentedElement(column); Element editedElement = null; Object feature = null; if (row instanceof EObject && column == this.axisElement) { editedElement = (Element) row; feature = column; } else { editedElement = (Element) column; feature = row; } EStructuralFeature realFeature = null; EObject realEditedObject = null; Stereotype stereotype = null; List<Stereotype> stereotypesWithEditedFeatureAppliedOnElement = null; if (feature instanceof EStructuralFeature) { realFeature = (EStructuralFeature) feature; realEditedObject = editedElement; } else { final String id = AxisUtils.getPropertyId(this.axisElement); stereotypesWithEditedFeatureAppliedOnElement = UMLTableUtils.getAppliedSteretoypesWithThisProperty(editedElement, id); stereotype = stereotypesWithEditedFeatureAppliedOnElement.get(0); realEditedObject = editedElement.getStereotypeApplication( stereotypesWithEditedFeatureAppliedOnElement.get(0)); Property prop = UMLTableUtils.getRealStereotypeProperty(editedElement, id); realFeature = realEditedObject.eClass().getEStructuralFeature(prop.getName()); } if (stereotypesWithEditedFeatureAppliedOnElement != null && stereotypesWithEditedFeatureAppliedOnElement.size() > 1) { // FIXME : not yet managed } else { this.dialog = createDialog( realEditedObject, realFeature, stereotype, editedElement.eResource().getResourceSet()); } return this.dialog; }