File Exchange

image thumbnail

UIINSPECT - display methods, properties & callbacks of an object

version 1.28.0.0 (130 KB) by Yair Altman
Inspect an object handle (Java/COM/HG); display its methods/properties/callbacks in a unified window

14.4K Downloads

Updated 02 Mar 2015

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 (2021). 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!