@SuppressWarnings("unchecked") // relies on content class filter
	public T getDomainObject(Object consumer, boolean immutable) {
		T dobj = null;
		if (usingOpenProgramList()) {
			dobj = getSelectedOpenDomainObject();
			if (dobj != null) {
				dobj.addConsumer(consumer);
			}
			return dobj;
		}
		int version = DomainFile.DEFAULT_VERSION;
		if (historyPanel != null) {
			version = historyPanel.getSelectedVersionNumber();
		}

		DomainFile domainFile = getDomainFile();
		if (domainFile != null) {
			GetDomainObjectTask task =
				new GetDomainObjectTask(consumer, domainFile, version, immutable);
			tool.execute(task, 1000);
			return (T) task.getDomainObject();
		}
		return null;
	}
Get the selected domain object for read-only or immutable use.
If an existing open object is selected its original mode applies but consumer will 
be added.  The caller/consumer is responsible for releasing the returned domain object
when done using it (see {@link DomainObject#release(Object)}).
@param consumer domain object consumer
@param immutable true if the domain object should be opened immutable, else false for
read-only.  Immutable mode should not be used for content that will be modified.  If 
read-only indicated an upgrade will always be performed if required.
@return opened domain object or null if a file was not selected or if open failed to 
complete.
Ghidra/Features/Base/src/main/java/ghidra/framework/main/OpenVersionedFileDialog.java