Hide class property, but retain autocomplete?
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Philip Ohnewein
il 15 Nov 2018
Commentato: Philip Ohnewein
il 18 Nov 2018
Hi all,
Following question:
I have a handle class, and I'd like to hide certain properties from being displayed in the command window when I type an object. To do this, I define the property as hidden:
classdef xy < handle
properties (Hidden)
abc
end
end
Now if do so, I lose autocomplete capability in the command window:
my_obj = xy();
xy.[TAB]
(autocomplete only works if abc has no Hidden attribute).
So, my question is: How can I can hide a property from display, but keep it autocompleting in the command window?
Thank you very much!
Philip
0 Commenti
Risposta accettata
Guillaume
il 17 Nov 2018
Hidden means hidden, from display and autocompletion. There's no workaround.
However, what you could do is customise the display of your class, so that it only displays whatever you want even if the property is not hidden. For that you'd have to derive your class from matlab.mixin.CustomDisplay and override getPropertyGroups to omit the property you want to hide.
All in all, a lot of works for something that doesn't sound very logical.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!