Task #2045

Updated by Sebastien Jacquot over 2 years ago

Mutualize and clarify TXMResult, Function, TXMObject, HasResults. It will also permit to avoid cyclic dependencies in plug-ins.

WIP (Framapad):

Define:

* getName()
* getSimpleName()
* getAdvancedName()?
* getDetails()?
* toString()

Uses these methods to display in:
* console log
* corpora view tree node label (AdapterFactory)
* Editor tab title
* status bar (when clicking a node result)
* prefilled file name when exporting a result (could be the editor tab title, it is not uniformed at this moment)

getAdvancedName() could return a string dedicated to "advanced users" following XML pattern with @ showing what is SU and what is SUP, eg.:

* partition name: DISCOURS_text@loc

.h3 Solution

* define abstract methods in TXMResult
* checks that all results extend TXMResult
* create a class TXMEditorInput that stores the TXMResult object as in the ChartEditorInput (checks and reuse the source code of CustomizableEditor)
* use one of these methods in TXMEditorPart.init() to set part name with: setPartName(editorInput.getResult().getName())
** see here if we can use public Object getAdapter(Class adapter) of the editor input to set the title and the icon of the EditorPArt, I tried but didn't manage to do it
* use one of these methods in the CorporaView click listener to update the status bar (location: org/txm/rcpapplication/views/CorporaView.java)
* use one of these methods in the export dialog to fill the file name
* define methods Log.info(TXMResult), severe(TXMResult), etc. that call TXMResult.toString() and use them for looging

Back