@Override
	protected void init() {
		tabPanel = new GTabPanel<Program>("Program");
		tabPanel.setNameFunction(p -> getTabName(p));
		tabPanel.setIconFunction(p -> getIcon(p));
		tabPanel.setToolTipFunction(p -> getToolTip(p));
		tabPanel.setSelectedTabConsumer(p -> programSelected(p));
		tabPanel.setCloseTabConsumer(p -> progService.closeProgram(p, false));

		initOptions();

		progService = tool.getService(ProgramManager.class);
		cvService = tool.getService(CodeViewerService.class);
		cvService.setNorthComponent(tabPanel);
	}
Plugin to show a "tab" for each open program; the selected tab is the activated program.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/progmgr/MultiTabPlugin.java