UIINSPECT - display methods/properties/callbacks of an object
by Yair Altman
08 Dec 2007
(Updated 26 May 2009)
Code covered by BSD License
Inspect an object handle (Java/COM/HG); display its methods/properties/callbacks in a unified window
Download Now
|
Watch this File
|
| File Information |
| Description |
Syntax:
hFig = uiinspect(obj)
Description:
UIINSPECT inspects an object handle (e.g., Java, COM, Handle Graphics etc.) and displays the inspection results in a unified Matlab window. UIINSPECT displays a unified window with all relevant object methods (as can be displayed via Matlab's methodsview function), properties (as can be displayed via Matlab's inspect function), static fields, and callbacks. UIINSPECT also displays properties and fields that are not normally displayed with Matlab's inspect function. Property meta-data such as type, accessibility, visibility and default value are also displayed.
Unlike Matlab's inspect function, multiple UIINSPECT windows can be opened simultaneously.
Object properties and callbacks may be modified interactively within the UIINSPECT window.
hFig = UIINSPECT returns a handle to the created figure window. UIINSPECT opens a regular Matlab figure window which may be accessed via hFig (unlike Matlab's methodsview function which opens a Java frame that is not easily accessible from Matlab).
Examples:
hFig = uiinspect(0);
hFig = uiinspect(handle(0));
hFig = uiinspect(gcf);
hFig = uiinspect(handle(gcf));
uiinspect(get(gcf,'JavaFrame'));
uiinspect(classhandle(handle(gcf)));
uiinspect(findprop(handle(gcf),'MenuBar'));
uiinspect('java.lang.String');
uiinspect(java.lang.String('yes'));
uiinspect(actxserver('Excel.Application'));
uiinspect(Employee) % a Matlab class object
uiinspect(?handle) % a Matlab metaclass object
uiinspect('meta.class') % a Matlab class name
Warning:
This code heavily relies on undocumented and unsupported Matlab functionality. It works on Matlab 7.1+, but use at your own risk!
Bugs and suggestions:
Please send to Yair Altman (altmany at gmail dot com) |
| Acknowledgements |
The author wishes to acknowledge the following in the creation of this submission:
FindJObj - find java handles of Matlab graphic objects
|
| MATLAB release |
MATLAB 7.4 (R2007a)
|
| Zip File Content |
|
| Other Files |
license.txt, uiinspect.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (4) |
| 12 Jun 2008 |
Brandon Baker
|
|
|
| 12 Jun 2008 |
Brandon Baker
|
|
|
| 27 Mar 2009 |
Matthias Höller
|
|
|
| 01 May 2009 |
Darik
|
|
|
| Updates |
| 25 Jan 2008 |
Fixes for many edge-cases |
| 05 Mar 2009 |
Fixed single property edge-case; fixed prop name case sensitivity problem; fixed properties tooltip; now accepts class names - not just object handles; added display of class interfaces & static fields |
| 30 Mar 2009 |
Added Extra method details checkbox (default=off); auto-hide inspectable checkbox if irrelevant; auto-sort methods by args list; hyperlinked classes; fixed title for classname inputs |
| 16 Apr 2009 |
Fixed case of no methods (e.g., uimenus); fixed superclass/interfaces of classname input; auto-hide callbacks pane if no CBs are available; fixed occasional endless loop upon callback update error |
| 03 May 2009 |
Fixed setting callbacks on non-handle('CallbackProperties')ed Java objects; fixed input param edge-case; hyperlinked the className to Sun's javadocs where relevant; auto-checked newer version; removed figure main menu |
| 19 May 2009 |
Improved information display for HG handles; added HG-handle screenshot to animated gif (added to COM and Java screenshots); enabled reuse of uiinspect window |
| 26 May 2009 |
Added support for Matlab classes (helped by Darik Gamble); improved display for classname input; fixed methods info gathering for some handles |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com