Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.perspective.rse.actions
Class RSECreateISeriesProjectAction

java.lang.Object
  extended by SystemBaseAction
      extended by com.ibm.etools.iseries.rse.ui.actions.QSYSSystemBaseAction
          extended by com.ibm.etools.iseries.perspective.rse.actions.RSECreateISeriesProjectAction

public class RSECreateISeriesProjectAction
extends QSYSSystemBaseAction

This action creates an iSeries Project from the selected iSeries library.
It is only contributed to iSeries libraries that appear in the RSE perspective. It is made public because the code for this action is a good sample on how to use both RSE and iSeries Project perspective APIs and extension points to create custom actions.


Field Summary
static String COPYRIGHT
           
 
Fields inherited from class com.ibm.etools.iseries.rse.ui.actions.QSYSSystemBaseAction
copyright
 
Constructor Summary
RSECreateISeriesProjectAction()
           
RSECreateISeriesProjectAction(Shell shell)
           
 
Method Summary
 AbstractISeriesProject createISeriesProject(IQSYSLibrary library, IBMiConnection connection, Shell shell)
          This method creates an iSeries Project given an IQSYSLibrary and ISeriesConnection.
 boolean getEnabled(Object[] currentlySelected)
          The user has selected one or more objects.
protected static AbstractISeriesProject getFirstExistingProject(Properties projectProperties, Shell shell)
          Gets an existing project given the parameters.
 void run()
          Creates an iSeries project from the selected RSE library.
 void run(IAction a)
           
protected  void selectInISeriesPerspective(AbstractISeriesResource resource)
          This method will open the iSeries Project perspective, and select the given project.
 void selectionChanged(IAction action, ISelection selection)
           
 void setActivePart(IAction action, IWorkbenchPart targetPart)
           
 
Methods inherited from class com.ibm.etools.iseries.rse.ui.actions.QSYSSystemBaseAction
getIBMiConnection, isAvailableOffline, updateSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final String COPYRIGHT
See Also:
Constant Field Values
Constructor Detail

RSECreateISeriesProjectAction

public RSECreateISeriesProjectAction(Shell shell)

RSECreateISeriesProjectAction

public RSECreateISeriesProjectAction()
Method Detail

selectionChanged

public void selectionChanged(IAction action,
                             ISelection selection)

run

public void run(IAction a)

setActivePart

public void setActivePart(IAction action,
                          IWorkbenchPart targetPart)

run

public void run()
Creates an iSeries project from the selected RSE library. The selected library and the RSE connection become the associated library and the associated connection, respectively, for the new iSeries project. No new project is created if an iSeries project who's associated library and host name matches the selected RSE library and host name.

See Also:
com.ibm.etools.systems.core.ui.actions.SystemAbstractPopupMenuExtensionAction#run()

createISeriesProject

public AbstractISeriesProject createISeriesProject(IQSYSLibrary library,
                                                   IBMiConnection connection,
                                                   Shell shell)
This method creates an iSeries Project given an IQSYSLibrary and ISeriesConnection.
The project properties, specifically profile name, connection name, user name and host name, are stripped out of the given connection. The passed AS400library becomes the associated library. The created project is already added to the model, and so there is no need to manually add the new project to the iSeries project root. None of the objects in the passed library are downloaded. The logic behind this method is as follows: Note: This method is run as a WorkspaceModifyOperation, and so all resource modifications are reported as one delta when operation succeeds.

Parameters:
library - the associated library of the new project.
connection - the connection associated with the project.
shell - the parent shell used to present dialogs.
Returns:
AbstractISeriesProject: the newly created project, or an existing iSeries project if one is found.

getFirstExistingProject

protected static AbstractISeriesProject getFirstExistingProject(Properties projectProperties,
                                                                Shell shell)
Gets an existing project given the parameters.


selectInISeriesPerspective

protected void selectInISeriesPerspective(AbstractISeriesResource resource)
This method will open the iSeries Project perspective, and select the given project.


getEnabled

public boolean getEnabled(Object[] currentlySelected)
The user has selected one or more objects. We should only get here for RSE libraries. Disable action on QTEMP, QSYS and QSYS2 libraries, and on libraries with quoted names. (since iSeries projects do not support these as an associated library).


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.