Outils pour utilisateurs

Outils du site


Panneau latéral

public:dev_plugin_creation

Creating TXM plug-in

[WIP]

notes

Ah oui au fait, j'ai procédé comme ça pour l'extraction, si ça peut t'aider :
- chaque fois que je prends un truc du plugin XML de la TBX ou de la RCP (commande, editor, icon, etc.), je le vire ensuite directement pour savoir ce qu'il reste à traiter dans ces 2 plugins. Tout ce qu'il reste dedans n'est donc normalement pas traité et à faire.
- Idem pour les chaines des messages, je les vire direct une fois extraites.

TBX (core)

Project structure

The project name must be like org.txm.[extension_name].core

The basic project and packages structure is as follow, for example for the extension org.txm.wordcloud.core:

  • org.txm.wordcloud.core
    • chartsengine [optional, only if the command needs to generate a chart]
      • jfreechart
        • JFCWordCloudChartCreator.java (extends JFCChartCreator)
      • r
        • RWordCloudChartCreator.java (extends RChartCreator)
    • functions
      • WordCloud.java [extends Function]
    • messages
      • WordCloudCoreMessages.java
      • message.properties
      • message_fr.properties
    • preferences
      • WordCloudPreferences.java (extends TXMPreferences)

plugin.xml

dependencies
  • org.txm.core
  • org.txm.chartsengine.jfreechart.core [optional, used by JFCChartCreator]
  • org.txm.chartsengine.r.core [optional, used by RChartCreator]
extensions
  • org.eclipse.runtime.preferences
  • org.txm.chartsengine.chartcreator
vendor

TXM? or Textometrie.org? or Universities list?

TXM result

Preferences

Each plug-in needs its preference initializer.

Charts

Chart creator

Extension org.txm.chartsengine.chartcreator

= Attributes =

  • chartEngineName = the charts engine internal name the creator is linked to (eg. jfreechart_charts_engine, r_charts_engine, …)
  • resultDataType = the class name of TXMResult the creator can render (eg. org.txm.progression.tbx.Progression)
  • chartType = the type of the chart the creator can create
    • this field is optional and is dedicated to render most charts from a same TXMResult (eg. PieChart, BarChart, …), leave empty if only one chart is needed. If empty, the chart creator will be assigned to the resultDataType class name

These attributes are used by charts engine createChart() methods to retrieve a creator matching requirements.

RCP

Project structure

The project name must be like org.txm.[extension_name].rcp

The basic project and packages structure is as follow, for example for the extension org.txm.wordcloud.rcp:

  • org.txm.wordcloud.rcp
    • adapters
      • WordCloudAdapterFactory.java [extends BaseAdaperFactory, optional, needed only if a node must be created in the corpora view]
    • editors [optional, only if the editor must contribute to the parameters composite or the chart tool bar]
      • WordCloudEditor.java [extends either ChartEditorPart either TXMEditorPart if no chart is needed]
      • NOTE: the parameters composite and chart tool bar can also be extended without creating an editor class.
    • handlers
      • ComputeWordCloud.java [TODO: extends org.txm.rcp.handlers.BaseAbstractHandler]
    • messages
      • WordCloudUIMessages.java
      • messages.properties
      • messages_fr.properties
    • preferences [optional]
      • WordCloudPreferencesPage.java [extends TXMPreferencesPage]

plugin.xml

dependencies

org.txm.wordcloud.core

extensions

Command/handler

RCP handler that computes some result and opens an editor.

Editor

Tool bar (parameters form)

Accessing the parameters form can be done this way: TXMEditor.getParametersComposite()

Context menu

Commands are accessible from 3 UI locations.

  • main menu
  • main tool bar
  • context menu of corpus view

Preferences Page

Store

Corpus view

Adapter factory

Used to populate the corpus tree view, defines icon and tree node label.

Double click listener

Registering a double click listener to re-open a result node.

Charts

If no chart creator is available for a type of chart and a type of TXM data result the SWT charts components provider will look for other charts engines that can manage the chart rendering.

Tool bar

Contributing to the tool bar of a ChartEditorPart using plugin.xml can be done by adding the extension org.eclipse menus. The tool bar Id is “ChartEditorToolBar” so the URI is “toolbar:ChartEditorToolBar”.

[TO CHECK + advanced toolbar : The tool bar is also accessible through code in ChartEditorPart, member “toolBar” or outside with ChartEditorPart.getToolBar().]

Context menu

Contributing to context menu of a ChartEditorPart can be done by adding the extension org.eclipse menus.

TODO: explain here the Areas (Empry area, Item area, …) managed by the EventCallBack of charts engine.

GWT

Project structure

Hello Word plug-in

TODO: put an Hello Word empty skeleton plugin in SVN that shows the basics (Editor, Charts, accessing corpus and R stats, etc.). Use team set for this to add all required dependencies.

public/dev_plugin_creation.txt · Dernière modification: 2017/06/27 17:08 par matthieu.decorde@ens-lyon.fr