function inspect(varargin)
%INSPECT Open the inspector and inspect object properties

%   Copyright 1984-2000 The MathWorks, Inc.
%   $Revision: 1.2 $

  import com.mathworks.ide.inspector.Inspector;

  switch nargin

    case 0
      % Show the inspector.
      Inspector.activateInspector;

    case 1
      obj = varargin{1};
      hdl = obj(ishandle(obj) & ~isjava(obj));
      if ~isempty(hdl)
      	len = length(hdl);
      	if len == 1
          obj = requestJavaAdapter(hdl);
          Inspector.inspectObject(obj);
        else
          obj = requestJavaAdapter(hdl);
          Inspector.inspectObjectArray(obj);
        end
      else
        Inspector.inspectObject(obj);
      end

    otherwise
      % bug -- need to make java adapters for multiple arguments
      Inspector.inspectObjectArray(varargin);

  end
