コード例 #1
0
 /**
  * Returns a command for graphical delete (with local conditions also deleted).
  *
  * @see org.eclipse.gef.EditPolicy#getCommand(Request)
  * @return the command or null
  */
 @Override
 public Command getCommand(Request request) {
   if (RequestConstants.REQ_DELETE.equals(request.getType())) {
     if (request instanceof GroupRequest) {
       // List of parts from the request is not up to date. Consider the host only.
       List<?> parts = Collections.singletonList(getHost());
       ((GroupRequest) request).setEditParts(getHost());
       // inspect the list of parts to add linked local conditions
       List<EditPart> partsToAdd = getListOfLinkedLocalConditionsParts(parts);
       ((GroupRequest) request).getEditParts().addAll(partsToAdd);
       return getDeleteCommand((GroupRequest) request);
     }
   }
   return null;
 }
コード例 #2
0
 /**
  * Returns true when the request is a graphical delete
  *
  * @see org.eclipse.gef.EditPolicy#understandsRequest(Request)
  * @return true for a graphical delete request
  */
 @Override
 public boolean understandsRequest(Request req) {
   return RequestConstants.REQ_DELETE.equals(req.getType());
 }