コード例 #1
0
 @Override
 protected Request createTargetRequest() {
   // DirectEditRequest request = new DirectEditRequest();
   EPackage epackage =
       org.eclipse.emf.ecore.EPackage.Registry.INSTANCE.getEPackage("http://vespucci.editor");
   Vespucci_modelPackage vesPackage = (Vespucci_modelPackage) epackage;
   IElementType elementType =
       ElementTypeRegistry.getInstance().getElementType(vesPackage.getEnsemble());
   // TODO is there a way to get VespucciElementTypes.Ensemble_2001 over a methode call?
   elementType = VespucciElementTypes.Ensemble_2001;
   // Get the selected edit part
   EditPart epart = getTargetEditPart();
   if (epart == null)
     return new CreateViewRequest(new CreateViewRequest.ViewDescriptor(null, null));
   // GraphicalEditPart p = (GraphicalEditPart) epart;
   DiagramEditPart p = (DiagramEditPart) epart;
   CreateViewRequest request =
       CreateViewRequestFactory.getCreateShapeRequest(elementType, p.getDiagramPreferencesHint());
   request.setType(REQ_DROPNEWENSEMBLE);
   return request;
 }
コード例 #2
0
 @Override
 protected CreateViewRequest createViewRequestShapeContainer() {
   return CreateViewRequestFactory.getCreateShapeRequest(
       UMLElementTypes.Lifeline_3001, getDiagramEditPart().getDiagramPreferencesHint());
 }