boolean setCurrentView(String viewName) {

		ViewProviderService v = map.get(viewName);
		if (v == null) {
			return false;
		}

		JComponent c = v.getViewComponent();
		if (tabbedPane.getSelectedComponent() == c) {
			viewChanged();
		}

		int index = tabbedPane.indexOfComponent(c);
		if (index == -1) {
			// odd case where creating/deleting program trees and then rapidly performing
			// undo/redo operations can lead to a stack trace.
			return true;
		}

		tabbedPane.setSelectedComponent(c); // causes a state change event

		updateLocalActions(v);
		for (String key : map.keySet()) {

			ViewProviderService vps = map.get(key);
			JComponent comp = vps.getViewComponent();
			if (c != comp) {
				vps.setHasFocus(false);
			}
		}
		return true;
	}
Set the current view to be the component with the given name.

@param viewName name of view to be current
@return true if the viewName was found in the provider map
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ViewPanel.java