Bug #1106

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

Added by Sebastien Jacquot over 4 years ago. Updated 2 months ago.

Status:Feedback Start date:11/05/2014
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:Export Spent time: -
Target version:TXM 0.8.1

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" ?

Subtasks

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

History

#1 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)

#2 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)

#3 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)

#4 Updated by Sebastien Jacquot over 4 years ago

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 Updated by Sebastien Jacquot over 4 years ago

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 Updated by Sebastien Jacquot about 4 years ago

  • Target version changed from TXM 0.7.7 to TXM 0.7.8

#7 Updated by Matthieu Decorde over 3 years ago

  • Target version changed from TXM 0.7.8 to TXM 0.8.0a (split/restructuration)

#8 Updated by Sebastien Jacquot about 2 years ago

  • Category changed from Commands / Export to Export

#9 Updated by Sebastien Jacquot 11 months ago

  • Target version changed from TXM 0.8.0a (split/restructuration) to TXM 0.8.0

#10 Updated by Sebastien Jacquot 2 months ago

  • Target version changed from TXM 0.8.0 to TXM 0.8.1

#11 Updated by Serge Heiden 2 months ago

Is this functionality really important?

Also available in: Atom PDF