Skip to content

Commit

Permalink
Issue JonathanGiles#52: Expose the result of Node.toString() in the d…
Browse files Browse the repository at this point in the history
…etails pane. Also made the details pane horizontally scrollable to see all text displayed for the various properties.
  • Loading branch information
afester committed Jul 10, 2019
1 parent 1034f14 commit 1bee01b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/org/fxconnector/details/NodeDetailPaneInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
class NodeDetailPaneInfo extends DetailPaneInfo {

Detail nodeClassName;
Detail nodeToString;
Detail pseudoClassStateDetail;
Detail styleClassDetail;
Detail managedDetail;
Expand Down Expand Up @@ -88,6 +89,7 @@ class NodeDetailPaneInfo extends DetailPaneInfo {

@Override protected void createDetails() {
nodeClassName = addDetail("className", "className:");
nodeToString = addDetail("toString", "toString:");
styleClassDetail = addDetail("styleClass", "styleClass:");
pseudoClassStateDetail = addDetail(null, "pseudoClassState:");
visibleDetail = addDetail("visible", "visible:");
Expand Down Expand Up @@ -249,8 +251,10 @@ private void fillPseudoStates(final Node node) {
final boolean all = propertyName.equals("*") ? true : false;

final Node node = (Node) getTarget();

if (all && node != null) {
nodeClassName.setValue(node.getClass().getName());
nodeToString.setValue(node.toString());
}

if (node != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/scenicview/view/tabs/DetailsTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public DetailsTab(final ScenicViewGui view, final Consumer<String> loader) {
this.loader = loader;

ScrollPane scrollPane = new ScrollPane();
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
scrollPane.setFitToWidth(true);
vbox = new VBox();
vbox.setFillWidth(true);
Expand Down

0 comments on commit 1bee01b

Please sign in to comment.