@Override
	public void writeDataState(SaveState saveState) {
		componentProvider.writeDataState(saveState);

		saveState.putInt(NUMBER_OF_VIEWS, providerMap.size());
		int idx = 0;
		for (String treeName : providerMap.keySet()) {
			saveState.putString(TREE_NAME + "-" + idx, treeName);
			TreeViewProvider provider = providerMap.get(treeName);
			provider.writeDataState(saveState);
			++idx;
		}
		saveState.putBoolean(TOGGLE_STATE, selectionToggleAction.isSelected());
	}
Write data for plugin; writes the current selection.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreePlugin.java