Skip to content

Commit 91227ee

Browse files
committed
docs: add required files to API docs
1 parent b40bd42 commit 91227ee

File tree

10 files changed

+1755
-82
lines changed

10 files changed

+1755
-82
lines changed

docs/API-Reference/command/CommandManager.md

Lines changed: 107 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,110 @@
33
const CommandManager = brackets.getModule("command/CommandManager")
44
```
55

6+
<a name="Command"></a>
7+
8+
## Command
9+
**Kind**: global class
10+
11+
* [Command](#Command)
12+
* [new Command(name, id, commandFn, [options])](#new_Command_new)
13+
* [.getID()](#Command+getID) ⇒ <code>string</code>
14+
* [.execute()](#Command+execute) ⇒ <code>$.Promise</code>
15+
* [.getEnabled()](#Command+getEnabled) ⇒ <code>boolean</code>
16+
* [.setEnabled(enabled)](#Command+setEnabled)
17+
* [.setChecked(checked)](#Command+setChecked)
18+
* [.getChecked()](#Command+getChecked) ⇒ <code>boolean</code>
19+
* [.setName(name)](#Command+setName)
20+
* [.getName()](#Command+getName) ⇒ <code>string</code>
21+
22+
<a name="new_Command_new"></a>
23+
24+
### new Command(name, id, commandFn, [options])
25+
Events:
26+
- enabledStateChange
27+
- checkedStateChange
28+
- keyBindingAdded
29+
- keyBindingRemoved
30+
31+
32+
| Param | Type | Description |
33+
| --- | --- | --- |
34+
| name | <code>string</code> | text that will be displayed in the UI to represent command |
35+
| id | <code>string</code> | |
36+
| commandFn | <code>function</code> | the function that is called when the command is executed. TODO: where should this be triggered, The Command or Exports? |
37+
| [options] | | |
38+
39+
<a name="Command+getID"></a>
40+
41+
### command.getID() ⇒ <code>string</code>
42+
Get command id
43+
44+
**Kind**: instance method of [<code>Command</code>](#Command)
45+
<a name="Command+execute"></a>
46+
47+
### command.execute() ⇒ <code>$.Promise</code>
48+
Executes the command. Additional arguments are passed to the executing function
49+
50+
**Kind**: instance method of [<code>Command</code>](#Command)
51+
**Returns**: <code>$.Promise</code> - a jQuery promise that will be resolved when the command completes.
52+
<a name="Command+getEnabled"></a>
53+
54+
### command.getEnabled() ⇒ <code>boolean</code>
55+
Is command enabled?
56+
57+
**Kind**: instance method of [<code>Command</code>](#Command)
58+
<a name="Command+setEnabled"></a>
59+
60+
### command.setEnabled(enabled)
61+
Sets enabled state of Command and dispatches "enabledStateChange"
62+
when the enabled state changes.
63+
64+
**Kind**: instance method of [<code>Command</code>](#Command)
65+
66+
| Param | Type |
67+
| --- | --- |
68+
| enabled | <code>boolean</code> |
69+
70+
<a name="Command+setChecked"></a>
71+
72+
### command.setChecked(checked)
73+
Sets enabled state of Command and dispatches "checkedStateChange"
74+
when the enabled state changes.
75+
76+
**Kind**: instance method of [<code>Command</code>](#Command)
77+
78+
| Param | Type |
79+
| --- | --- |
80+
| checked | <code>boolean</code> |
81+
82+
<a name="Command+getChecked"></a>
83+
84+
### command.getChecked() ⇒ <code>boolean</code>
85+
Is command checked?
86+
87+
**Kind**: instance method of [<code>Command</code>](#Command)
88+
<a name="Command+setName"></a>
89+
90+
### command.setName(name)
91+
Sets the name of the Command and dispatches "nameChange" so that
92+
UI that reflects the command name can update.
93+
94+
Note, a Command name can appear in either HTML or native UI
95+
so HTML tags should not be used. To add a Unicode character,
96+
use \uXXXX instead of an HTML entity.
97+
98+
**Kind**: instance method of [<code>Command</code>](#Command)
99+
100+
| Param | Type |
101+
| --- | --- |
102+
| name | <code>string</code> |
103+
104+
<a name="Command+getName"></a>
105+
106+
### command.getName() ⇒ <code>string</code>
107+
Get command name
108+
109+
**Kind**: instance method of [<code>Command</code>](#Command)
6110
<a name="EventDispatcher"></a>
7111

8112
## EventDispatcher
@@ -40,7 +144,7 @@ Other trigger types.
40144
**Kind**: global constant
41145
<a name="register"></a>
42146

43-
## register(name, id, commandFn, [options]) ⇒ [<code>Command</code>](#new_Command_new)
147+
## register(name, id, commandFn, [options]) ⇒ [<code>Command</code>](#Command)
44148
Registers a global command.
45149

46150
**Kind**: global function
@@ -55,7 +159,7 @@ Registers a global command.
55159

56160
<a name="registerInternal"></a>
57161

58-
## registerInternal(id, commandFn) ⇒ [<code>Command</code>](#new_Command_new)
162+
## registerInternal(id, commandFn) ⇒ [<code>Command</code>](#Command)
59163
Registers a global internal only command.
60164

61165
**Kind**: global function
@@ -67,7 +171,7 @@ Registers a global internal only command.
67171

68172
<a name="get"></a>
69173

70-
## get(id) ⇒ [<code>Command</code>](#new_Command_new)
174+
## get(id) ⇒ [<code>Command</code>](#Command)
71175
Retrieves a Command object by id
72176

73177
**Kind**: global function

0 commit comments

Comments
 (0)