Package org.eclipse.gef.requests

Examples of org.eclipse.gef.requests.SelectionRequest


   */
  protected DiagramDocumentEditor openDiagram(EditPart sourcePart) throws Exception {
    assertNotNull(sourcePart);
   
    // based on org.eclipse.gef.tools.SelectEditPartTracker#performOpen()
    SelectionRequest request = new SelectionRequest();
    request.setLocation(null);    // the location isn't actually required
    request.setModifiers(0 /*getCurrentInput().getModifiers()*/);
    request.setType(RequestConstants.REQ_OPEN);
    sourcePart.performRequest(request);

    // we should have loaded up a new editor
    IWorkbenchPage activePage = PlatformUI.getWorkbench()
      .getActiveWorkbenchWindow().getActivePage();
View Full Code Here


   *   it is up to the client to close this new editor.
   */
  protected DiagramDocumentEditor openSubDiagram(GraphicalEditPart sourcePart) {
   
    // based on org.eclipse.gef.tools.SelectEditPartTracker#performOpen()
    SelectionRequest request = new SelectionRequest();
    request.setLocation(null);    // the location isn't actually required
    request.setModifiers(0 /*getCurrentInput().getModifiers()*/);
    request.setType(RequestConstants.REQ_OPEN);
    if (!sourcePart.understandsRequest(request)) {
      return null;
    }
    if (sourcePart.getDiagramEditDomain() == null) {
      return null;
View Full Code Here

   * via {@link EditPart#performRequest(org.eclipse.gef.Request)}. Possible uses are to open
   * the selected item in another editor or replace the current editor's
   * contents based on the selected item.
   */
  protected void performOpen() {
    SelectionRequest request = new SelectionRequest();
    request.setLocation(getLocation());
    request.setType(RequestConstants.REQ_OPEN);
    getSourceEditPart().performRequest(request);
  }
View Full Code Here

        performDirectEdit();
      }
    }
    else if (request.getType().equals(REQ_OPEN) && (request instanceof SelectionRequest))
    {
      SelectionRequest selRequest = (SelectionRequest)request;
      Point pt = selRequest.getLocation();
      TextPart textPart = getTextPart(pt);
      if (textPart != null)
      {
        performDirectEdit(textPart);
      }
View Full Code Here

        performDirectEdit();
      }
    }
    else if (request.getType().equals(REQ_OPEN) && (request instanceof SelectionRequest))
    {
      SelectionRequest selRequest = (SelectionRequest)request;
      Point pt = selRequest.getLocation();
      TextPart textPart = getTextPart(pt);
      if (textPart != null)
      {
        performDirectEdit(textPart);
      }
View Full Code Here

  @Override
  public void showTargetFeedback(Request request) {
    if (getActivityPart() instanceof BorderedActivityPart) {
      BorderedActivityPart part = (BorderedActivityPart) getActivityPart();
      if (request instanceof SelectionRequest) {
        SelectionRequest selection = (SelectionRequest) request;
        Point location = selection.getLocation();
        showConnectionLabel(part, location);
      }
    }
    super.showTargetFeedback(request);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.gef.requests.SelectionRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.