Bug #1106

RCP: 0.7.6, automatically opening exported chart file (and other files ?) in TXM text editor doesn't work

Ajouté par Sebastien Jacquot il y a environ 3 ans. Mis à jour il y a 7 mois.

Statut:Feedback Début:05/11/2014
Priorité:Normal Echéance:
Assigné à:- % réalisé:

100%

Catégorie:Export Temps passé: -
Version cible:TXM 0.7.9

Description

The preference "Show export result in the text editor" raises a null pointer exception when trying to open the exported chart file with internal viewer. It seems normal because TXM tries to open a Text editor and give it some SVG, PNG, etc. files
But after some further tests I have the same problem with concordance, index, etc. under Windows. The bug comes from window.getActivePage() in org.txm.rcpapplication.commands.OpenFile.openfile(File). window is null.

Solution 1

  • fix the text editor bug with .csv
  • rename the preference as something like "Display exported results in internal viewer" or "Open exported results in TXM" since it could concern chart files too ?
  • manage the opening of other internal editor according to the file format: TXMBrowser for raster formats: PNG, JPG; SVG Batik Editor for SVG; external viewer for PS, PDF (or add some libs for these formats)

Solution 2

  • fix the text editor bug with .csv
  • add a preference as "Show/Open/Display exported charts in external viewer" ?

Solution 3

  • mix solution 1 and 2, i.e. manage internal viewer opening and also external viewer opening for all TXM result types

Misc

  • I think the word "Open" or "Display" would be better than "Show" ?

Sous-tâches

Bug #1108: RCP: 0.7.6, automatically opening exported result file do...Closed

Bug #1107: RCP: 0.7.6, automatically opening exported chart editor v...Feedback

Historique

#1 Mis à jour par Sebastien Jacquot il y a environ 3 ans

  • Description mis à jour (diff)

#2 Mis à jour par Sebastien Jacquot il y a environ 3 ans

  • Description mis à jour (diff)

#3 Mis à jour par Sebastien Jacquot il y a environ 3 ans

  • Description mis à jour (diff)

#4 Mis à jour par Sebastien Jacquot il y a environ 3 ans

This bug/question is also linked to the menu entry "Open..." which always opens a Text editor despite of the file format. We may rewrite the OpenFile command for it opens editor according to file format:

  • SVG => Batik or TXMBrowser (but user may want to open the SVG XML source ?)
  • Rasters => TXMBrowser
  • CSV, TXT => TextEditor
  • XML => XML editor (about this, I think it would be nice to include the XML Editor in TXM base and not as an extension because XML is the base format)

If we do that, we may remove the "Open in browser..." command.

There is another bug with the commands "Open..." and "Open in browser..." leading to "Caused by: java.lang.ClassCastException: org.eclipse.jface.text.TextSelection cannot be cast to org.eclipse.jface.viewers.IStructuredSelection" when trying to run it from menu entry when the Corpus view is not active (have not the focus).

#5 Mis à jour par Sebastien Jacquot il y a environ 3 ans

Actually the commands already exist:

  • org.txm.rcp/src/main/java/org/txm/rcpapplication/commands/OpenBrowser.java
  • org.txm.rcp/src/main/java/org/txm/rcpapplication/commands/OpenFile.java (open a TXT editor)
  • org.txm.rcp/src/main/java/org/txm/rcpapplication/commands/OpenGraph.java (open a Batik SVG editor for .svg extension and a TXMBrowser for .png, .jpeg and .jpg extensions)
  • org.txm.rcp/src/main/java/org/txm/rcpapplication/commands/OpenSVGGraph.java

we may just have to link them to the "Open..." command.

#6 Mis à jour par Sebastien Jacquot il y a plus de 2 ans

  • Version cible changé de TXM 0.7.7 à TXM 0.7.8

#7 Mis à jour par Matthieu Decorde il y a environ 2 ans

  • Version cible changé de TXM 0.7.8 à TXM 0.7.9

#8 Mis à jour par Sebastien Jacquot il y a 7 mois

  • Catégorie changé de Commands / Export à Export

Formats disponibles : Atom PDF