void setProgram(Program p) {
		if (p == program) {
			return;
		}

		program = p;

		// get rid of old objects
		disposeOfNodes();
		root.removeAllChildren();
		nodeList.clear();
		listing = null;
		if (transferable != null) {
			transferable.clearTransferData();
		}

		if (program != null) {
			listing = program.getListing();

			ProgramModule rm = listing.getRootModule(treeName);
			if (rm != null) {
				ProgramModule oldRootModule = root.getModule();
				if (oldRootModule == null || !oldRootModule.equals(rm)) {

					createRootNode(program);
				}
				// get first level of children
				layoutProgram();
			}
			else {
				createRootNode(null);
			}
		}
		else {
			createRootNode(null);
		}
	}
Droppable interface method called to know when the drop site is
valid.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramDnDTree.java