Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "MoDisco/DiscoverersManager"

(User manual)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A discoverer is a component that injects an element in a model which represents this element. To allow an easy manipulation of different discoverers and to be independent of discoverer implementation, we will provide a standard contract for discoverers. Through that, we will provide a set of common tools:
+
#REDIRECT[[MoDisco/Components/DiscoverersManager]]
* a registry of all discoverers available in eclipse platform
+
* a contextual menu to use discoverers available on a single selected resource
+
* a launch configuration to run discoverers and encapsulate them in a workflow
+
 
+
 
+
== Features ==
+
 
+
=== Discoverer extension point ===
+
 
+
A discoverer shall have a name and provide an implementation of Discoverer interface to be managed by DiscoverersManager. For each discoverer, a new entry in MoDisco menu will be added. However, each discoverer should provide a resource filter to adapt menu depending on a single selected element.
+
 
+
Description of informations in contract of discoverer extension point :
+
 
+
* '''name''' - Required - information to identify a discoverer in registry, it shall be unique. This name will also be used to populate menu.
+
* '''class''' - Required - A class that implements Discoverer interface to be managed and used by Discoverers manager. When a corresponding element has been selected (filter provided by informations in extension part), a model could usually be retrieved by calling method "discoverElement", and it returns an EMF Resource.
+
* '''path''' - Optional- To allow sub-menu path into root menu provided by Discoverers Manager. For example, if your path is "j2se5/filters", the provided menu will be : <root menu> -> j2se5 -> filters -> Your Discoverer name
+
 
+
See an example in chapter 6.
+
 
+
=== Discoverers registry ===
+
 
+
The registry of discoverers references all discoverer extensions installed in current eclipse platform. And DiscoversManager provides an access to this registry. There are two methods, one to retrieve all discoverers and one to retrieve only one discoverer using its name to identify it.
+
 
+
  /**
+
  * Accessor to all discoverers registered in DiscoverersManager
+
  * through extensions.
+
  *
+
  * @return the list of discoverers available in registry
+
  */
+
  public static List<? extends Discoverer> getDiscoverers()
+
 
+
  /**
+
  * Accessor to one discoverer registered in DiscoverersManager
+
  * through extensions.
+
  *
+
  * @param discovererName name of a discoverer
+
  * @return the discoverer with specified name,
+
  *  or null if there is no discoverer registered with specified name.
+
  */
+
  public static Discoverer getDiscoverer(String discovererName)
+
 
+
 
+
=== Dynamic contextual menu ===
+
 
+
The contextual menu will be completed dynamically when a discoverer is able to manage selected resource.
+
Example, when a java project is selected (instance of IJavaProject):
+
 
+
[[Image:MoDisco-DiscoverersManager dynamic contextual menu.jpg|frame|center|Example with J2se5 discoverer]]
+
 
+
=== Launch configuration framework ===
+
 
+
The launch configuration framework provides a new type of configuration launch (named MoDisco Discoverers) accessible through menu “Run Configurations …”.
+
 
+
[[Image:MoDisco-DiscoverersManager launch configuration type.jpg|frame|center|Presentation of discoverer type]]
+
 
+
And here is an example of a discovery configuration.
+
 
+
[[Image:MoDisco-DiscoverersManager launch configuration example.jpg|frame|center|Discovery configuration example]]
+
 
+
== Install ==
+
 
+
You will find a version of this plug-in in [http://dev.eclipse.org/viewsvn/index.cgi/plugins/trunk/org.eclipse.gmt.modisco.discoverersmanager/?root=Modeling_MODISCO SVN repository].
+
 
+
Here are installation instructions :
+
 
+
* Import project in your workspace using a SVN client.
+
* Use "export" menu to export this project as a plug-in (Deployable plug-ins and fragments) in your Eclipse installation. Don't forget to choose "Package plug-ins as individual jar archives" option.
+
* Re-start your Eclipse to take this plug-in into account.
+
 
+
== User manual ==
+
 
+
First step: in your plug-in properties (plugin.xml or META-INF/MANIFEST.MF), add a dependency to plug-in “org.eclipse.gmt.modisco.discoverersmanager”.
+
 
+
[[Image:MoDisco-DiscoverersManager plugin dependency initialisation.jpg|frame|center|Dependency to plug-in DiscoverersManager]]
+
 
+
Second step: create a class in your plug-in that implements Discoverer interface provided by DiscoverersManager plug-in. See javadoc of this interface for details of methods.
+
 
+
[[Image:MoDisco-DiscoverersManager class implementing Discoverer.jpg|frame|center|Creation of class which implements Discoverer]]
+
 
+
Third step: in your plug-in properties (plugin.xml or META-INF/MANIFEST.MF), create a “discoverers” extension.
+
 
+
[[Image:MoDisco-DiscoverersManager creation of discoverers extension.jpg|frame|center|Creation of discoverers extension]]
+
 
+
Fourth step: in discoverers extension, a discoverer declaration has been created automatically. You will have to fill element details to validate discoverer declaration.
+
 
+
[[Image:MoDisco-DiscoverersManager fill discoverer extension details.jpg|frame|center|Fill discoverer details]]
+
 
+
 
+
Congratulations, your first discoverer has been successfully defined.
+
 
+
If you want to add several discoverers in your plug-in, first you will have to add a discoverer in your “discoverers” extension.
+
 
+
[[Image:MoDisco-DiscoverersManager add another discoverer declaration in your extension.jpg|frame|center|Add another discoverer declaration in your extension]]
+
 
+
Then, you will have to fill element details to obtain a second valid discoverer.
+
 
+
[[Image:MoDisco-DiscoverersManager several discoverer declarations in your extension.jpg|frame|center|Several discoverer declarations in your extension]]
+

Latest revision as of 08:42, 7 September 2010

Back to the top