MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / getTabIndex

Method getTabIndex

src/org/opensourcephysics/tools/DataTool.java:2438–2446  ·  view source on GitHub ↗

Returns the index of the tab containing the specified Data object. @param data the Data @return the index, or -1 if not found

(Data data)

Source from the content-addressed store, hash-verified

2436 * @return the index, or -1 if not found
2437 */
2438 protected int getTabIndex(Data data) {
2439 for (int i = 0; i < tabbedPane.getTabCount(); i++) {
2440 DataToolTab tab = (DataToolTab) tabbedPane.getComponentAt(i);
2441 if (tab.isOwnedBy(data)) {
2442 return i;
2443 }
2444 }
2445 return -1;
2446 }
2447
2448 /**
2449 * Returns the index of a specified tab.

Callers 2

removeTabMethod · 0.95
getTabMethod · 0.95

Calls 2

isOwnedByMethod · 0.95
getTabCountMethod · 0.45

Tested by

no test coverage detected