Runtime

org.eclipse.gmf.runtime.diagram.ui.util
Class SelectInDiagramHelper

java.lang.Object
  extended byorg.eclipse.gmf.runtime.diagram.ui.util.SelectInDiagramHelper

public class SelectInDiagramHelper
extends java.lang.Object

Helper for selecting an element on a diagram. Works for closed diagrams when you open the diagram first. You can use View's getDiagram() to determine the diagram to open. getDiagram() returns itself if the View is a Diagram.


Method Summary
static DiagramEditor activateDiagram(Diagram diagram)
          Activate the diagram if it's already open.
static void exposeLocation(FigureCanvas canvas, Point location)
          This api will expose the diagram at the location given in absolute co-ordinates.
static void selectElement(View view)
          Select the View element from the DiagramEditor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

activateDiagram

public static DiagramEditor activateDiagram(Diagram diagram)
Activate the diagram if it's already open. If not, return null.

Parameters:
diagram - Diagram to activate
Returns:
DiagramEditor of the activated diagram. null if it was not open and could not be activated.

selectElement

public static void selectElement(View view)
Select the View element from the DiagramEditor. The DiagramEditor for the view must be the active editor for this workbench, otherwise it does not make sense to call this method. Call activateDiagram to set the active DiagramEditor or open it manually.

Parameters:
view - View to select

exposeLocation

public static void exposeLocation(FigureCanvas canvas,
                                  Point location)
This api will expose the diagram at the location given in absolute co-ordinates.

Parameters:
canvas -
location -

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.