@Override
	public int[] getSelectedColumns() {
		if (selectionModel != null) {
			int iMin = selectionModel.getMinSelectionIndex();
			int iMax = selectionModel.getMaxSelectionIndex();

			if ((iMin == -1) || (iMax == -1)) {
				return new int[0];
			}

			int[] tmp = new int[1 + (iMax - iMin)];
			int n = 0;
			for (int i = iMin; i <= iMax; i++) {
				if (selectionModel.isSelectedIndex(i)) {
					tmp[n++] = i;
				}
			}
			int[] selectedColumns = new int[n];
			System.arraycopy(tmp, 0, selectedColumns, 0, n);
			return selectedColumns;
		}
		return new int[0];
	}
This returns all columns known by this model, both visible and not seen.
@return all columns known by this model, both visible and not seen.
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableColumnModel.java