@Override
	DataType initializeStructureData(Program program, Structure localStructure) {

		Data data = program.getListing().getDataContaining(getStructureAddress());
		Data comp1 = data.getComponent(fromPath);
		Data comp2 = data.getComponent(toPath);
		int dataLength = (comp2.getParentOffset() + comp2.getLength()) - comp1.getParentOffset();

		DataType parentDataType = comp1.getParent().getBaseDataType();
		if (!(parentDataType instanceof Structure)) {
			throw new IllegalArgumentException("Data not in a structure");
		}
		Structure originalStructure = (Structure) parentDataType;

		// clear and initialize the original structure and then get the new
		// data
		clearStruct(originalStructure, comp1.getParentOffset(), dataLength);
		originalStructure.replace(comp1.getComponentIndex(), localStructure,
			localStructure.getLength());
		comp1 = data.getComponent(fromPath);

		return comp1.getDataType();
	}
Constructs a new command for creating structures inside other structures.

@param name The name of the structure.
@param addr the address of the outer-most structure.
@param fromPath the componentPath of the first component to be consumed in 
the new structure.
@param toPath the componentPath of the second component to be consumed in the
the new structure.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/data/CreateStructureInStructureCmd.java