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

Method removeAllTabs

src/org/opensourcephysics/tools/Launcher.java:1193–1218  ·  view source on GitHub ↗

Removes all tabs. @return true if all tabs were removed

()

Source from the content-addressed store, hash-verified

1191 * @return true if all tabs were removed
1192 */
1193 protected boolean removeAllTabs() {
1194 int n = tabbedPane.getTabCount();
1195 if (n == 0) {
1196 return true;
1197 }
1198 boolean post = postEdits;
1199 postEdits = false;
1200 for (int i = n - 1; i >= 0; i--) {
1201 tabbedPane.removeTabAt(i);
1202 }
1203 if (tabbedPane.getTabCount() == 0) {
1204 tabSetName = null;
1205 title = null;
1206 password = null;
1207 } else {
1208 previousNode = selectedNode;
1209 newNodeSelected = true;
1210 }
1211 refreshGUI();
1212 tabs.clear();
1213 for (int i = 0; i < tabbedPane.getTabCount(); i++) {
1214 tabs.add(tabbedPane.getComponentAt(i));
1215 }
1216 postEdits = post;
1217 return tabbedPane.getTabCount() == 0;
1218 }
1219
1220 /**
1221 * Refreshes string resources.

Callers 2

openMethod · 0.95
actionPerformedMethod · 0.95

Calls 4

refreshGUIMethod · 0.95
clearMethod · 0.65
getTabCountMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected