Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with input editor conflicts #28

Open
jordandouglas opened this issue Nov 3, 2022 · 1 comment
Open

Dealing with input editor conflicts #28

jordandouglas opened this issue Nov 3, 2022 · 1 comment

Comments

@jordandouglas
Copy link
Member

jordandouglas commented Nov 3, 2022

If there are multiple input editors which apply to the same class, it is not clear how beauti will resolve the multiple matches by picking just one input editor.

For example, the TypeTraitSetInputEditor used by both MASCOT and MultiTypeTree may differ, and they both edit the TraitSet class. If one has both packages installed, its not clear which version of the editor will be used and which will be ignored.

Could there be a way of specifying in the xml file which input editor beauti shoud load?

@rbouckaert
Copy link
Member

An InputEditor e declares the type, and any BEASTInterfaceo matching the type will use the InputEditor.
Matching types is done by checking the class of the object o equals that of e.
If no editor has class of o declared, a match is sought with the super-class of o till a match is found.

For example, TypeTraitSetInputEditor returns TraitSet as type, and in MASCOT mascot.util.InitializedTraitSet derives from TraitSet. There is no input editor for InitializedTraitSet, but there is for its super class, namely TypeTraitSetInputEditor, so that is the input editor that should be returned by the InputEditorFactory.

If you need a different editor for the same class X, a workaround is to derive from that class Y extends X and specify an input editor for Y with different behaviour than the input editor for X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants