Skip to content

Commit

Permalink
Adding entity class name as a header to entity properties pane
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaskelly committed Apr 17, 2020
1 parent 1809a3c commit 1bf3992
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ public PropertiesMenu(Skin skin, final EditorFrame editorFrame, final Array<Enti
classes.removeAll(nonCommon, true);

try {
// Show entity name as pane header.
String[] nameParts = entity.getClass().getName().split("\\.");

String entityName = "Unknown";
if (nameParts.length > 0) {
entityName = nameParts[nameParts.length - 1];
}

add(new Label(entityName, EditorUi.mediumSkin))
.align(Align.left)
.padLeft(-12f);
row();

// gather all of the fields into groups
for (Class oClass : classes) {
Field[] fields = oClass.getDeclaredFields();
Expand Down

0 comments on commit 1bf3992

Please sign in to comment.