Task #2113

Updated by Sebastien Jacquot about 3 years ago

Use the new TXMResult and TXMEditor hierarchy.

WIP:

To factorize and share a bunch of functions/code:

TBX:
* base results must extend Function, TXMResult or implement ITXMResult
* chart results must extend ChartResult or implement IChartResult
* result must define the abstract methods getName(), getSimpleName(), etc.
* result must define the abstract methods getType() that must return a translatable string representation of the objetct/result.
=> to use for sorting nodes on type independently of the current lang
=> may also be used create the part name prefix (tab title), eg. : Progression: ["faire"], CA: xx, AFC : xx


RCP:
* editor inputs must use or extend TXMEditorInput or ChartEditorInput
** TXMEditorInput stores a TXMResult member, used by RCP platform for checking an editor is not already open (equals()), to define the name of the input, also to future persistence
* editor parts must use or extend TXMEditorPart or ChartEditorPart
** TXMEditorPart stores a TXMEditorInput and retrieves information from it as the name or the tooltip tab
* result adapter factory and result adapter must extend TXMResultAdapterFactory and TXMResultAdapter that use the tree hierarchy of TXMResult (getChildren, getParent, etc.)
** adapters are used in the Corpora view to display icon and node name
* (plugin.xml) display "export data" menu entry is now based on ITXMResult instanceof test on the current node selection
* (plugin.xml) display "export chart" menu entry is now based on IChartResult instanceof test on the current node selection

Still need to discuss about the name methods, getName(), getSimpleName(), createFileName(), etc. and which ones to use at what locations.

WIP: These modifications are pretty tricky to track and check so here is a canvas to help to define progression in the sub-tasks of this task.
WIP: need to split this canvas and move one part to plug-ins extraction issues

* TXMResult inheritance / ITXMResult implementation
* TXMEditor
* AdapterFactory
* getName(), etc.

h3. Cascade naming and user naming

* currently 2 objects can have a user-defined name: Subcorpus and Partition
=> both extends TxmObject
=> these objects must store the user-defined name
=> add a member userName in TXMResult or TXMObject
=> modify code in a way that getName() returns the userName if exists otherwise the cascading name
* other results can use cascade naming: parent.getName() + this.name, etc.
* we may introduce the notion of internal name, especially for CQP and R objects, to easily manage names used for display and names used when dialoging with the 3rd-party tools (eg. CQP name and R symbol can be considered as internal names)

h3. Sub-tasks canvas for name and information strings generated in TXMResult class

WIP: Current state and usage locations

h3. UI

* Editor/Tab title
** getName()
* Editor/Tab tool tip
** getDetails()
* Tree node label through TXMResultAdapter
** getSimpleName()
* Status bar when clicking on a result node
** getName()

* getDetails()
* getAdvancedName()
* etc.

h3. Core/logs

* console

h3. Validation tests base canvas

WIP...

* compute a non-chart command result
* check the node name
* check the editor/tab title
* check the editor/tab tool tip
* click on the result node => check the status bar message
* export the data from right click on the node (or editor tool bar) and check the pre-filled generated file name of the export dialog box
* change the command parameters
* check the new name of the tree result node (may change, or not)

* compute a chart command result
* check the node name
* check the editor/tab title
* check the editor/tab tool tip
* click on the result node => check the status bar message
* export the data from right click on the node and check the pre-filled generated file name of the export dialog box
* export the chart from right click on the node and check the pre-filled generated file name of the export dialog box
* export the chart view from the editor tool bar and check the pre-filled generated file name of the export dialog box
* change the command and/or rendering parameters
* check the new name of the tree result node (may change, or not)

Back