@Test
	public void testChangeEnumDescriptionEtcAndInStructure() throws Exception {

		Category category = program.getListing()
				.getDataTypeManager()
				.getCategory(new CategoryPath(CategoryPath.ROOT, "Category1"));
		Enum enumm = createEnum(category, "EnumX", 2);

		tx(program, () -> {
			enumm.add("Zero", 0);
			enumm.add("One", 1);
			enumm.setDescription("ABCD");

			Structure structX = new StructureDataType("StructX", 0);
			structX.setPackingEnabled(true);
			structX.add(new ByteDataType());
			structX.add(enumm);
			structX.add(new ByteDataType());
			category.addDataType(structX, DataTypeConflictHandler.DEFAULT_HANDLER);

			Structure structY = new StructureDataType("StructY", 0);
			structY.setPackingEnabled(false);
			structY.add(new ByteDataType());
			structY.add(enumm);
			category.addDataType(structY, DataTypeConflictHandler.DEFAULT_HANDLER);
		});

		edit(enumm);

		final EnumEditorPanel panel = findEditorPanel(tool.getToolFrame());
		assertNotNull(panel);
		final JTable table = panel.getTable();

		// size should be "2"
		final JTextField nameField = (JTextField) getInstanceField("nameField", panel);
		assertNotNull(nameField);
		String name = nameField.getText();

		final JTextField descField = (JTextField) getInstanceField("descField", panel);
		assertNotNull(descField);
		String description = descField.getText();

		@SuppressWarnings("unchecked")
		JComboBox<Object> sizeComboBox =
			(JComboBox<Object>) getInstanceField("sizeComboBox", panel);
		assertNotNull(sizeComboBox);
		Object selectedItem = sizeComboBox.getSelectedItem();
		int size = Integer.parseInt(selectedItem.toString());

		assertEquals("EnumX", name);
		assertEquals("ABCD", description);
		assertEquals(2, size);

		runSwing(() -> {
			nameField.setText("EnumY");
			descField.setText("XYZ");
			sizeComboBox.setSelectedItem(4);

			table.editCellAt(1, NAME_COL);

			TableCellEditor editor = table.getCellEditor(1, NAME_COL);

			Component c = getEditorComponent(editor);
			JTextField tf = (JTextField) c;
			// change the name for value of 1.
			tf.setText("Single");
			editor.stopCellEditing();
		});
		apply();

		// name=EnumY, description=XYZ, size=4, Components=[Zero 0, Single 1]
		Enum enumX = (Enum) category.getDataType("EnumX");
		assertNull(enumX);
		Enum enumY = (Enum) category.getDataType("EnumY");
		assertNotNull(enumY);
		assertEquals("XYZ", enumY.getDescription());
		assertEquals(4, enumY.getLength());
		assertEquals(2, enumY.getCount());
		long value0 = enumY.getValue("Zero");
		try {
			enumY.getValue("One");
			Assert.fail("Not expecting One to still be there.");
		}
		catch (NoSuchElementException e) {
			// This exception is expected
		}
		long value1 = enumY.getValue("Single");
		assertEquals(0, value0);
		assertEquals(1, value1);

		Structure structX = (Structure) category.getDataType("StructX");
		assertTrue(structX.isPackingEnabled());
		assertEquals(3, structX.getNumComponents());
		assertEquals(1, structX.getComponent(0).getLength());
		assertEquals(4, structX.getComponent(1).getLength());
		assertEquals(1, structX.getComponent(2).getLength());
		assertEquals(12, structX.getLength());

		Structure structY = (Structure) category.getDataType("StructY");
		assertFalse(structY.isPackingEnabled());
		assertEquals(2, structY.getNumComponents());
		assertEquals(1, structY.getComponent(0).getLength());
		assertEquals(4, structY.getComponent(1).getLength());
		assertEquals(5, structY.getLength());
	}
Tests for editing an Enumerated data type.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/editor/EnumEditor1Test.java