com.ibm.lab.soln.resources
Class ActionProcessResourceTree

java.lang.Object
  |
  +--com.ibm.lab.soln.resources.ActionResourceAction
        |
        +--com.ibm.lab.soln.resources.ActionProcessResourceTree
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IObjectActionDelegate, org.eclipse.ui.IViewActionDelegate, org.eclipse.core.resources.IWorkspaceRunnable

public class ActionProcessResourceTree
extends ActionResourceAction
implements org.eclipse.ui.IViewActionDelegate, org.eclipse.core.resources.IWorkspaceRunnable

Multi-headed action where the processing depends on invocation point as determined by the UI action that triggered the request. Processing paths include:

Demonstrates the workspace get of a handle and existence checking with respect to the workspace and event management using a workspace runnable.

See Also:
IFile, IFolder, IProject, IMarker, IResource, IWorkspaceRoot, IWorkspaceRunnable

Fields inherited from class com.ibm.lab.soln.resources.ActionResourceAction
selection
 
Constructor Summary
ActionProcessResourceTree()
          ActionProcessResourceTree default constructor.
 
Method Summary
 void addMarker(org.eclipse.core.resources.IResource resource)
          Add marker to identified resource.
 org.eclipse.core.resources.IFile copyBasics(org.eclipse.core.resources.IFolder folder)
          Creates a file in the passed folder using content copied from a standard file found in the plug-in's install directory.
 boolean createFolder(org.eclipse.core.resources.IFolder newFolder)
          Creates a folder if it does not exist, returns true if a folder was created.
 void createFolderFile(org.eclipse.core.resources.IProject project)
          Resource processing logic to add resources to a given project one step at a time.
 java.lang.String fileStatus(org.eclipse.core.resources.IFile txtFile, boolean txtFileAdded)
          Returns string that describes if the file was created or already existed.
 java.lang.String folderStatus(org.eclipse.core.resources.IFolder imageFolder, boolean imageFolderAdded)
          Returns string that describes if the folder was created or already existed.
 java.io.InputStream getInitialContents()
          Return input stream used to create initial file contents.
 void init(org.eclipse.ui.IViewPart view)
          Not used in this action - implemented per IViewActionDelegate interface.
 void pathPlay()
          Produces a list of path values based on the selected resource.
 void run(org.eclipse.jface.action.IAction action)
          Uses saved reference to selected project to call custom logic that processes the resource tree.
 void run(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void showProjectDetails()
          Finds all projects in the workspace and produces a short list of project details (such as path location).
 
Methods inherited from class com.ibm.lab.soln.resources.ActionResourceAction
resultError, resultInformation, resultQuestion, selectionChanged, setActivePart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IActionDelegate
selectionChanged
 

Constructor Detail

ActionProcessResourceTree

public ActionProcessResourceTree()
ActionProcessResourceTree default constructor.
Method Detail

addMarker

public void addMarker(org.eclipse.core.resources.IResource resource)
Add marker to identified resource. Bookmark marker is added using predefined CHAR_START, CHAR_END, and MESSAGE values.

copyBasics

public org.eclipse.core.resources.IFile copyBasics(org.eclipse.core.resources.IFolder folder)
Creates a file in the passed folder using content copied from a standard file found in the plug-in's install directory.
Parameters:
folder - - folder where standard image file should be created

createFolder

public boolean createFolder(org.eclipse.core.resources.IFolder newFolder)
Creates a folder if it does not exist, returns true if a folder was created.
Parameters:
newFolder -  
Returns:
boolean

createFolderFile

public void createFolderFile(org.eclipse.core.resources.IProject project)
Resource processing logic to add resources to a given project one step at a time. Steps are:

fileStatus

public java.lang.String fileStatus(org.eclipse.core.resources.IFile txtFile,
                                   boolean txtFileAdded)
Returns string that describes if the file was created or already existed.
Parameters:
txtFile -  
txtFileAdded -  
Returns:
String

folderStatus

public java.lang.String folderStatus(org.eclipse.core.resources.IFolder imageFolder,
                                     boolean imageFolderAdded)
Returns string that describes if the folder was created or already existed.
Parameters:
imageFolder -  
imageFolderAdded -  
Returns:
String

getInitialContents

public java.io.InputStream getInitialContents()
Return input stream used to create initial file contents.

init

public void init(org.eclipse.ui.IViewPart view)
Not used in this action - implemented per IViewActionDelegate interface.
Specified by:
init in interface org.eclipse.ui.IViewActionDelegate
See Also:
IViewActionDelegate.init(IViewPart)

pathPlay

public void pathPlay()
Produces a list of path values based on the selected resource.

run

public void run(org.eclipse.jface.action.IAction action)
Uses saved reference to selected project to call custom logic that processes the resource tree. Multiple plugin.xml defined actions map to this implementation. The current action is detected and the appropriate logic is triggered based on the plugin.xml defined action id.
Specified by:
run in interface org.eclipse.ui.IActionDelegate
Parameters:
action - action proxy that handles the presentation portion of the plugin action
See Also:
IActionDelegate.run(IAction)

run

public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
         throws org.eclipse.core.runtime.CoreException
Specified by:
run in interface org.eclipse.core.resources.IWorkspaceRunnable
See Also:
IWorkspaceRunnable.run(IProgressMonitor)

showProjectDetails

public void showProjectDetails()
Finds all projects in the workspace and produces a short list of project details (such as path location).