001package Torello.Browser.BrowserAPI;
002
003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
004// Java-HTML Imports
005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
006
007import Torello.Browser.*;
008import Torello.Browser.helper.*;
009import Torello.Browser.JavaScriptAPI.*;
010import Torello.JSON.*;
011
012import Torello.Java.ReadOnly.ReadOnlyList;
013import Torello.Java.ReadOnly.ReadOnlyArrayList;
014
015import Torello.JavaDoc.Annotations.StaticFunctional;
016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg;
017
018
019// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
020// JDK Imports
021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
022
023import javax.json.JsonObject;
024import javax.json.JsonValue;
025
026/**
027 * <SPAN CLASS=COPIEDJDK><B><CODE>[No Description Provided by Google]</CODE></B></SPAN>
028 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE>
029 */
030@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE")
031public class Inspector
032{
033    // No Pubic Constructors
034    private Inspector() { }
035
036
037    // ********************************************************************************************
038    // ********************************************************************************************
039    // Marker Events
040    // ********************************************************************************************
041    // ********************************************************************************************
042
043
044    /**
045     * Fired when debugging target has crashed
046
047     * 
048     * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.MarkerEvent
049     *     DATA-NAME=targetCrashed>
050     */
051    public static final String targetCrashed = "Inspector.targetCrashed Marker Event";
052
053    /**
054     * Fired when debugging target has reloaded after crash
055
056     * 
057     * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.MarkerEvent
058     *     DATA-NAME=targetReloadedAfterCrash>
059     */
060    public static final String targetReloadedAfterCrash = "Inspector.targetReloadedAfterCrash Marker Event";
061
062
063
064    // ********************************************************************************************
065    // ********************************************************************************************
066    // Event Types
067    // ********************************************************************************************
068    // ********************************************************************************************
069
070
071    /**
072     * Fired when remote debugging connection is about to be terminated. Contains detach reason.
073     * 
074     * <EMBED CLASS=globalDefs DATA-DOMAIN=Inspector DATA-API=BrowserAPI>
075     */
076    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
077    public static class detached
078        extends BrowserEvent<detached>
079        implements java.io.Serializable
080    {
081        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
082        protected static final long serialVersionUID = 1;
083
084        private static final NestedHelper<Inspector.detached> singleton =
085            Torello.Browser.BrowserAPI.NestedHelpers.Events.
086                Inspector$$detached$$.singleton;
087
088        /** The reason why connection has been terminated. */
089        public final String reason;
090
091        /** Constructor.  Please review this class' fields for documentation. */
092        public detached(ReadOnlyList<Boolean> isPresent, String reason)
093        {
094            super(singleton, Domains.Inspector, "detached", 1);
095
096            this.reason = reason;
097
098            this.isPresent = (isPresent == null)
099                ? singleton.generateIsPresentList(this)
100                : THROWS.check(isPresent, 1, "Inspector.detached");
101        }
102
103        /** Creates an instance of this class from a {@link JsonObject}.*/
104        public static detached fromJSON(JsonObject jo)
105        { return singleton.fromJSON(jo); }
106
107        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
108        public static NestedDescriptor<detached> descriptor()
109        { return singleton.descriptor(); }
110    }
111
112
113
114
115    // ********************************************************************************************
116    // ********************************************************************************************
117    // Commands
118    // ********************************************************************************************
119    // ********************************************************************************************
120
121
122    /**
123     * Disables inspector domain notifications.
124     * 
125     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
126     *
127     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
128     * browser receives the invocation-request.
129     *
130     * <BR /><BR /><DIV CLASS=JDHint>
131     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
132     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
133     * the Browser Function has run to completion.
134     * </DIV>
135     */
136    public static Script<Void> disable()
137    {
138        // Ultra-Simple Request JSON - Because this method has no parameters
139        final String requestJSON = "{\"method\":\"Inspector.disable\"}";
140
141        return Script.NO_RET(Domains.Inspector, "disable", requestJSON);
142    }
143
144    /**
145     * Enables inspector domain notifications.
146     * 
147     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
148     *
149     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
150     * browser receives the invocation-request.
151     *
152     * <BR /><BR /><DIV CLASS=JDHint>
153     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
154     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
155     * the Browser Function has run to completion.
156     * </DIV>
157     */
158    public static Script<Void> enable()
159    {
160        // Ultra-Simple Request JSON - Because this method has no parameters
161        final String requestJSON = "{\"method\":\"Inspector.enable\"}";
162
163        return Script.NO_RET(Domains.Inspector, "enable", requestJSON);
164    }
165
166
167}