UIINSPECT - display methods, properties & callbacks of an object

Inspect an object handle (Java/COM/HG); display its methods/properties/callbacks in a unified window
14.6K Downloads
Updated Mon, 02 Mar 2015 08:17:52 +0000

View License

Syntax:
hFig = uiinspect(obj)

Description:
UIINSPECT inspects an object handle (e.g., Java, COM, Handle Graphics, Matlab class, Dot-Net 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); % Matlab root (desktop) handle
hFig = uiinspect(handle(0));
hFig = uiinspect(gcf); % Figure handle
hFig = uiinspect(handle(gcf));
uiinspect(get(gcf,'JavaFrame'));
uiinspect(classhandle(handle(gcf))); % UDD handle
uiinspect(findprop(handle(gcf),'MenuBar')); % Meta-data handle
uiinspect('java.lang.String'); % Java class name
uiinspect(java.lang.String('yes')); % Java class object reference
uiinspect(actxserver('Excel.Application')); % COM/ActiveX object
uiinspect(Employee) % Matlab class object
uiinspect(?handle) % Matlab metaclass object
uiinspect('meta.class') % Matlab class name
uiinspect(System.Diagnostics.Process.GetCurrentProcess) % Dot-Net object

Warning:
This code heavily relies on undocumented and unsupported Matlab functionality. It works on Matlab 7.1 and later releases, but use at your own risk!
Technical explanation and details:
http://undocumentedmatlab.com/blog/uiinspect

Bugs and suggestions:
Please send to Yair Altman (altmany at gmail dot com)

Cite As

Yair Altman (2024). UIINSPECT - display methods, properties & callbacks of an object (https://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-methods-properties-callbacks-of-an-object), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.28.0.0

Fix for R2014a and older Matlab releases

1.27.0.0

Additional fixes for R2014b (HG2) - a lot of changes were indeed required for 14b, which broke numerous things!

1.26.0.0

Fixed properties panel for .Net objects

1.25.0.0

Fixed a reported "invalid object handle" bug

1.24.0.0

Fixes for multiple edge cases

1.23.0.0

Fixed for R2014a, R2014b

1.22.0.0

Fixes for the upcoming HG2

1.21.0.0

Added context-menu options to export handle to workspace; prevented intermittent crash reported for uiinspect(0); fixed and improved callbacks table; added hidden properties to the properties tooltip; updated help section

1.18.0.0

Prevented intermittent error reported for uiinspect(0); added hidden properties to the properties tooltip; updated help section; updated javadoc hyperlinks; fixed and improved callbacks table

1.17.0.0

Fixes for R2012a+

1.16.0.0

Fixed R2011b crash when inspecting COM; fixed problems with Value field in "Other properties" table of static fields; fixed display of non-static Java fields; fixed display of some cases of Java class names; minor fixes for Matlab class properties

1.15.0.0

Fixed several issues in the Value field of the "Other properties" table

1.14.0.0

Removed R2010b warning messages; minor fix for Dot-Net classes; minor fixes for callbacks table; fixed online docpage for Java Swing classes

1.13.0.0

Major fix for pre-R2010 compatibility

1.12.0.0

Major fix for pre-R2010 compatibility

1.11.0.0

Minor fix suggested by Andrew Stamps; added automatic callbacks grouping

1.10.0.0

Displayed class modifiers; improved performance; removed empty panels by default; fixed warning msgs when sorting props table; fixes for R2010b; fixed download (m-file => zip-file)

1.9.0.0

Displayed class modifiers; improved performance; removed empty panels by default; fixed warning msgs when sorting props table; fixes for R2010b

1.8.0.0

Fixes for R2010a

1.7.0.0

Added CaretPositionChanged & InputMethodTextChanged to list of standard callbacks; minor fix to requesting focus of Java handles; minor fix to version-check display; fixed a few bugs in properties meta-info of Matlab classes

1.6.0.0

Added support for Matlab classes (helped by Darik Gamble); improved display for classname input; fixed methods info gathering for some handles

1.5.0.0

Improved information display for HG handles; added HG-handle screenshot to animated gif (added to COM and Java screenshots); enabled reuse of uiinspect window

1.4.0.0

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

1.3.0.0

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

1.2.0.0

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

1.1.0.0

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

1.0.0.0

Fixes for many edge-cases