public void setSelection(ProgramSelection sel, EventTrigger trigger) {
		if (sel == null) {
			fieldPanel.setSelection(layoutModel.getFieldSelection(null), trigger);
			return;
		}

		InteriorSelection interior = sel.getInteriorSelection();
		if (interior != null) {
			FieldLocation loc1 = layoutModel.getFieldLocation(interior.getFrom());
			FieldLocation loc2 = layoutModel.getFieldLocation(interior.getTo());
			if (loc1 != null && loc2 != null) {
				FieldSelection fieldSel = new FieldSelection();
				int fieldNum1 = -1;
				Layout layout = layoutModel.getLayout(loc1.getIndex());
				if (layout != null) {
					fieldNum1 = layout.getBeginRowFieldNum(loc1.getFieldNum());
				}

				Layout layout2 = layoutModel.getLayout(loc2.getIndex());

				if (fieldNum1 >= 0 && layout2 != null) {
					BigInteger index2 = loc2.getIndex();
					int fieldNum2 = layout.getEndRowFieldNum(loc2.getFieldNum());
					if (fieldNum2 >= layout2.getNumFields()) {
						index2 = loc2.getIndex().add(BigInteger.ONE);
						fieldNum2 = 0;
					}
					fieldSel.addRange(new FieldLocation(loc1.getIndex(), fieldNum1, 0, 0),
						new FieldLocation(index2, fieldNum2, 0, 0));
					fieldPanel.setSelection(fieldSel, trigger);
					return;
				}
			}
		}
		fieldPanel.setSelection(layoutModel.getFieldSelection(sel), trigger);
	}
Sets the selection.

@param sel the new selection
@param trigger the cause of the change
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ListingPanel.java