Bug #2721

Failed to reopen an editor in some cases / Wrong context menu in corpora view

Added by Sebastien Jacquot about 1 month ago. Updated 21 days ago.

Status:New Start date:01/16/2020
Priority:High Due date:
Assignee:- % Done:

20%

Category:UI / Link / Command Spent time: -
Target version:TXM 0.8.1

Description

This issue seems linked with the Corpora view focus bug that makes, in some cases, commands context menu not accessible from corpora view (displayed context menu is not the right one).
After some investigations, it may be linked with some editor problem. Only some editor seemsto trigger this issue.

Minimal steps to reproduce

- create a cooccurrence of "faire" on VOEUX
- double-click on the cooccurrence node that has been created
After some other tries: behavior is the same with some other editors.

Behavior is provoked by these results:

  • Cooccurrence
  • Edition
  • Internal View
  • Lexical Table
  • Lexicon
  • Property

Behavior is not provoked by these results:

  • Concordance
  • Index / Partition Index
  • Specificities
  • all chart editors commands

Temporary workaround

- click on the "Files" view
- click back on the "Corpora" view

Conclusion

  • EditorPart.setFocus() must give the focus to a composite for editor activation system works well
  • some of the editors quoted above do that, some others don't

Solution

Step 1

  • in base class, TXMEditor.setFocus() should give the focus to this.parent

Step 2, mixed solutions/notes

  • ensure that all editor implementations give well the focus to a composite, if they need to give it to a special composite (e.g. a query area)
  • ensure that all editor implementations, in any case, call super.setFocus()
  • as for _createControlPart(), force sub-classes to implement an abstract method _setFocus() that is called by TXMEditor.setFocus()

Old tests, for history

Minimal steps to reproduce, issue #1 (issue not completely identified)

- launch InternalView/Browser command
- the editor opens but we can see it is not activated (it stays gray). The corpora view remains activated
- right click on a corpora => it's not the right context menu

Minimal steps to reproduce, issue #2 (issue not completely identified)

- create a concordance then close its editor
- launch InternalView/Browser command
- the editor opens but we can see it is not activated (it stays gray). The corpora view remains activated
- double click on the previously created concordance node => failed with exception:

Aucun paramètre Requête, commande annulée.
Stacktrace: 
[1]  org.txm.links.rcp.handlers.SendSelectionToQueryable.       execute  SendSelectionToQueryable.java, 79
[2]             org.txm.rcp.handlers.BaseAbstractHandler.executeCommand  BaseAbstractHandler.java, 247
[3]             org.txm.rcp.handlers.BaseAbstractHandler.executeCommand  BaseAbstractHandler.java, 169
[4]              org.txm.rcp.views.corpora.CorporaView$4.   doubleClick  CorporaView.java, 382
[5]                              org.txm.rcp.Application.         start  Application.java, 241

Need to check the InternalView editor and also if some other editors have the same behavior.


Related issues

related to Bug #2556: RCP: 0.8.0, fix corpus view contextual menu on Windows Closed 04/11/2019

History

#1 Updated by Sebastien Jacquot 22 days ago

  • Description updated (diff)
  • Target version changed from TXM 0.8.2 to TXM 0.8.1

#2 Updated by Sebastien Jacquot 22 days ago

  • Description updated (diff)

#3 Updated by Sebastien Jacquot 21 days ago

  • Description updated (diff)
  • % Done changed from 0 to 20

#4 Updated by Sebastien Jacquot 21 days ago

  • Description updated (diff)

Also available in: Atom PDF