Skip to content

Commit

Permalink
Added docs
Browse files Browse the repository at this point in the history
Added getProjectViewIDs() and
getProjectFromViewID().
  • Loading branch information
bbb999 committed Dec 15, 2020
1 parent d5ecc6b commit fb283dd
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions docs/application/application.rst
Original file line number Diff line number Diff line change
Expand Up @@ -848,3 +848,74 @@ None.
**Returns**

Returns **true** if trace was added.

----

.. _app.getProjectViewIDs:

app.getProjectViewIDs()
*********************************************

``app.getProjectViewIDs()``

**Description**

Returns the view IDs of currently-open views, associated with any project.

**Parameters**

None.

**Returns**

An array of view IDs; can be null.

**Example**

.. code:: javascript
var allViewIDs = app.getProjectViewIDs();
if (allViewIDs){
var firstOne = allViewIDs[0];
} else {
// No views open.
}
----

.. _app.getProjectFromViewID:

app.getProjectFromViewID()
*********************************************

``app.getProjectFromViewID()``

**Description**

Returns the Project associated with the provided View ID.

**Parameters**

A View ID, obtained from `getProjectViewIDs`.

**Returns**

A Project object, for the project associated with the provided View ID. Can be `null`.

**Example**

.. code:: javascript
var allViewIDs = app.getProjectViewIDs();
if (allViewIDs){
var firstOne = allViewIDs[0];
if (firstOne){
var thisProject = getProjectFromViewID(firstOne);
if (thisProject){
var name = thisProject.name;
} else {
// no project associated with that view ID.
}
} else {
// No views open.
}

0 comments on commit fb283dd

Please sign in to comment.