testjdt3
Class ASTActionDelegate

java.lang.Object
  extended by testjdt3.ASTActionDelegate
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IWorkbenchWindowActionDelegate

public class ASTActionDelegate
extends java.lang.Object
implements org.eclipse.ui.IWorkbenchWindowActionDelegate

Experiment with JDT to parse and extract component boundaries.

See Also:
jroyer@emn.fr production

Field Summary
static Communications communications
          Table of communications.
static Provided provided
          To store provided interface.
static java.lang.String separation
          For decoration.
static org.eclipse.swt.widgets.Shell shell
          Associated shell.
static java.util.HashMap<java.lang.String,java.lang.String> structure
          Data structure for coding the composite structure
static TypesTable table
          Table of information.
 
Constructor Summary
ASTActionDelegate()
          Default constructor.
 
Method Summary
static java.lang.String displayStructure()
          Display the structure.
 void dispose()
          We can use this method to dispose of any system resources we previously allocated.
 java.util.Vector<org.eclipse.jdt.core.IType> getTypesOfInterest()
          Acces to the main public types declared in the compilation units.
 java.util.Vector<org.eclipse.jdt.core.ICompilationUnit> getUnitsOfInterest()
          Get all the compilation unit corresponding to Java resources in the current Java project.
 org.eclipse.ui.IWorkbenchWindow getWindow()
           
 void implementP3()
          Visit all the type of interest and try to extract the structure.
 void implementP4()
          Visit the types and extract communications.
 void implementP5required()
          Visit the types and get required interfaces.
 void implementR1(org.eclipse.jdt.core.IType it)
          Implementation of R1.
 void init(org.eclipse.ui.IWorkbenchWindow window)
          We will cache window object in order to be able to provide parent shell for the message dialog.
 void run(org.eclipse.jface.action.IAction action)
          The action has been activated.
 void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
          Selection in the workbench has been changed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

separation

public static final java.lang.String separation
For decoration.

See Also:
Constant Field Values

shell

public static org.eclipse.swt.widgets.Shell shell
Associated shell.


table

public static TypesTable table
Table of information.


communications

public static Communications communications
Table of communications.


structure

public static java.util.HashMap<java.lang.String,java.lang.String> structure
Data structure for coding the composite structure


provided

public static Provided provided
To store provided interface.

Constructor Detail

ASTActionDelegate

public ASTActionDelegate()
Default constructor.

Method Detail

run

public void run(org.eclipse.jface.action.IAction action)
The action has been activated. The argument of the method represents the 'real' action sitting in the workbench UI.

Specified by:
run in interface org.eclipse.ui.IActionDelegate
See Also:
IActionDelegate.run(org.eclipse.jface.action.IAction)

getUnitsOfInterest

public java.util.Vector<org.eclipse.jdt.core.ICompilationUnit> getUnitsOfInterest()
Get all the compilation unit corresponding to Java resources in the current Java project. That means classes and interfaces (.java)

Returns:

getTypesOfInterest

public java.util.Vector<org.eclipse.jdt.core.IType> getTypesOfInterest()
Acces to the main public types declared in the compilation units. Simplified version get the first and single one top level

Returns:

implementR1

public void implementR1(org.eclipse.jdt.core.IType it)
Implementation of R1. Look at non constructor and non static method (even main) Parameter types and result type are set data types Compute also the provided services. TODO revoir car resolvedType pas complet cas generic

Parameters:
it -

implementP3

public void implementP3()
Visit all the type of interest and try to extract the structure.


displayStructure

public static java.lang.String displayStructure()
Display the structure.


implementP4

public void implementP4()
Visit the types and extract communications.


implementP5required

public void implementP5required()
Visit the types and get required interfaces.


selectionChanged

public void selectionChanged(org.eclipse.jface.action.IAction action,
                             org.eclipse.jface.viewers.ISelection selection)
Selection in the workbench has been changed. We can change the state of the 'real' action here if we want, but this can only happen after the delegate has been created.

Specified by:
selectionChanged in interface org.eclipse.ui.IActionDelegate
See Also:
IActionDelegate.selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)

dispose

public void dispose()
We can use this method to dispose of any system resources we previously allocated.

Specified by:
dispose in interface org.eclipse.ui.IWorkbenchWindowActionDelegate
See Also:
IWorkbenchWindowActionDelegate.dispose()

init

public void init(org.eclipse.ui.IWorkbenchWindow window)
We will cache window object in order to be able to provide parent shell for the message dialog.

Specified by:
init in interface org.eclipse.ui.IWorkbenchWindowActionDelegate
See Also:
IWorkbenchWindowActionDelegate.init(org.eclipse.ui.IWorkbenchWindow)

getWindow

public org.eclipse.ui.IWorkbenchWindow getWindow()