IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.traceability
Class ModelQueryCommand

java.lang.Object
  extended bycom.ibm.xtools.traceability.ModelQueryCommand

public class ModelQueryCommand
extends Object

ModelQueryCommand is the command to run a model query on certain UML elements.

This command represents the same core functionality of the "Model Query" action on the context menu of the "Model Explorer" view, except the results will not be shown in the "Model Query Results" view.

You can create an instance of this class.
  • To run this command call the run method with the List of UML elements that you would like to perform the model query on.
  • To get the results of the last run of this command, call the method getResults().
  • See Also:
    TraceRelationship

    Field Summary
    static int IMPLEMENTATION
              IMPLEMENTATION indicates to the query to search for implementations of the input elements.
    static int JAVA_IMPLEMENTATION
              JAVA_IMPLEMENTATION indicates to the query to search for implementations of the input elements and extend the search to include the list of java projects.
    static int SPECIFICATION
              SPECIFICATION indicates to the query to search for specifications of the input elements.
     
    Constructor Summary
    ModelQueryCommand()
              Constructor
     
    Method Summary
     HashSet getResults()
              Returns the results of running the Model Query command.
     IStatus run(List elements, int searchDirection, Collection javaProjects, IProgressMonitor progressMonitor)
              Runs this command.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    SPECIFICATION

    public static final int SPECIFICATION
    SPECIFICATION indicates to the query to search for specifications of the input elements.

    See Also:
    Constant Field Values

    IMPLEMENTATION

    public static final int IMPLEMENTATION
    IMPLEMENTATION indicates to the query to search for implementations of the input elements.

    See Also:
    Constant Field Values

    JAVA_IMPLEMENTATION

    public static final int JAVA_IMPLEMENTATION
    JAVA_IMPLEMENTATION indicates to the query to search for implementations of the input elements and extend the search to include the list of java projects.

    See Also:
    Constant Field Values
    Constructor Detail

    ModelQueryCommand

    public ModelQueryCommand()
    Constructor

    Method Detail

    run

    public IStatus run(List elements,
                       int searchDirection,
                       Collection javaProjects,
                       IProgressMonitor progressMonitor)
    Runs this command.

    Runs a model query on the input elements with specified search directions. The scope of the search is all open UML models and optionally the list of Java projects.

    Parameters:
    elements - input elements to query on.
    searchDirection - controls the direction of the query. It could be any combination of the SPECIFICATION, IMPLEMENTATION and/or JAVA_IMPLEMENTATION constants.
    javaProjects - the list of the java projects to consider in the query.
    progressMonitor - progress monitor.
    Returns:
    the IStatus that represents the status of the last run of this command. If it runs successfully, the IStatus.getCode() will return IStatus.OK.

    getResults

    public HashSet getResults()
    Returns the results of running the Model Query command.

    Returns:
    If the command succeeded, it will return a list of TraceRelationship elements that represent the results of this command.

    IBM Rational Software Modeler
    Release 6.0


    Guidelines for using Eclipse APIs.

    Copyright (c) IBM Corp. and others 2004. All rights reserved.