Skip to content

Commit 6fef1db

Browse files
committed
Merge branch 'scrollbars'
2 parents 396f6be + 6c245ed commit 6fef1db

File tree

3 files changed

+31
-9
lines changed

3 files changed

+31
-9
lines changed

src/main/java/net/sourceforge/pmd/util/fxdesigner/SourceEditorController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161

6262
import javafx.fxml.FXML;
6363
import javafx.geometry.Insets;
64+
import javafx.scene.Parent;
6465
import javafx.scene.control.Alert.AlertType;
6566
import javafx.scene.control.Button;
6667
import javafx.scene.control.MenuButton;
@@ -120,6 +121,8 @@ public class SourceEditorController extends AbstractController {
120121
@FXML
121122
private NodeEditionCodeArea nodeEditionCodeArea;
122123
@FXML
124+
private Parent codeAreaParent;
125+
@FXML
123126
private NodeParentageCrumbBar focusNodeParentageCrumbBar;
124127

125128
private final PopOverWrapper<LiveTestCase> violationsPopover;
@@ -285,12 +288,12 @@ private void toggleTestEditMode(boolean isTestCaseMode) {
285288
AnchorPane otherPane = emptyPane();
286289
testCaseToolsTitledPane.setContent(otherPane);
287290

288-
otherPane.getChildren().addAll(nodeEditionCodeArea);
291+
otherPane.getChildren().addAll(codeAreaParent);
289292
pane.getChildren().addAll(testCaseToolsTitledPane);
290293
} else {
291294
AnchorPane otherPane = emptyPane();
292295
editorTitledPane.setContent(otherPane);
293-
otherPane.getChildren().addAll(nodeEditionCodeArea);
296+
otherPane.getChildren().addAll(codeAreaParent);
294297
}
295298
}
296299

src/main/resources/net/sourceforge/pmd/util/fxdesigner/fxml/editor.fxml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- One editor, ie source + ast view + crumb bar -->
44

55

6+
<?import org.fxmisc.flowless.VirtualizedScrollPane?>
67
<?import org.kordamp.ikonli.javafx.FontIcon?>
78
<?import net.sourceforge.pmd.util.fxdesigner.util.controls.AstTreeView?>
89
<?import net.sourceforge.pmd.util.fxdesigner.util.controls.DynamicWidthChoicebox?>
@@ -71,16 +72,21 @@
7172
<padding>
7273
<Insets/>
7374
</padding>
74-
<NodeEditionCodeArea fx:id="nodeEditionCodeArea"
75-
stylesheets="@../css/editor-theme.css"
76-
AnchorPane.bottomAnchor="0.0"
77-
AnchorPane.leftAnchor="0.0"
78-
AnchorPane.rightAnchor="0.0"
79-
AnchorPane.topAnchor="0.0">
75+
<VirtualizedScrollPane
76+
fx:id="codeAreaParent"
77+
AnchorPane.bottomAnchor="0.0"
78+
AnchorPane.leftAnchor="0.0"
79+
AnchorPane.rightAnchor="0.0"
80+
AnchorPane.topAnchor="0.0">
81+
<content>
82+
<NodeEditionCodeArea fx:id="nodeEditionCodeArea"
83+
stylesheets="@../css/editor-theme.css">
84+
</NodeEditionCodeArea>
85+
</content>
8086
<BorderPane.margin>
8187
<Insets/>
8288
</BorderPane.margin>
83-
</NodeEditionCodeArea>
89+
</VirtualizedScrollPane>
8490
</AnchorPane>
8591
</content>
8692
</ToolbarTitledPane>

src/main/resources/net/sourceforge/pmd/util/fxdesigner/less/scrolling.less

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@
5353
-fx-background-color: white;
5454
}
5555

56+
.virtualized-scroll-pane {
57+
58+
-fx-background-color: #eaeaea;
59+
60+
& > .scroll-bar {
61+
& > .track-background, & > .track {
62+
-fx-background-color: #E3E3E3;
63+
}
64+
}
65+
}
66+
67+
68+
5669

5770
.no-horizontal-scroll {
5871

0 commit comments

Comments
 (0)