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

Method removeTab

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

Removes the tab at the specified index. @param index the tab number @param saveChanges @return the removed tab, or null if none removed

(int index, boolean saveChanges)

Source from the content-addressed store, hash-verified

544 * @return the removed tab, or null if none removed
545 */
546 public DataToolTab removeTab(int index, boolean saveChanges) {
547 if ((index >= 0) && (index < tabbedPane.getTabCount())) {
548 if (saveChanges && !saveChangesAt(index)) {
549 return null;
550 }
551 DataToolTab tab = getTab(index);
552 getFitBuilder().curveFitters.remove(tab.getCurveFitter());
553 tab.getCurveFitter().notifyTabRemoved();
554// String title = tabbedPane.getTitleAt(index);
555 //OSPLog.finer("removing tab " + title); //$NON-NLS-1$
556 tabbedPane.removeTabAt(index);
557 refreshTabTitles();
558 refreshMenubar();
559 refreshDataBuilder();
560 return tab;
561 }
562 return null;
563 }
564
565 /**
566 * Removes a specified tab.

Callers 2

addTabMethod · 0.95
actionPerformedMethod · 0.95

Calls 11

saveChangesAtMethod · 0.95
getTabMethod · 0.95
getFitBuilderMethod · 0.95
getCurveFitterMethod · 0.95
refreshTabTitlesMethod · 0.95
refreshMenubarMethod · 0.95
refreshDataBuilderMethod · 0.95
getTabIndexMethod · 0.95
notifyTabRemovedMethod · 0.80
removeMethod · 0.65
getTabCountMethod · 0.45

Tested by

no test coverage detected