Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS346
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Wang
CS346
Commits
2df1c924
Commit
2df1c924
authored
2 years ago
by
Simon Wang
Browse files
Options
Downloads
Patches
Plain Diff
File structure on left pane and changes to directory when you open file
parent
a6134e91
No related branches found
No related tags found
No related merge requests found
Pipeline
#84120
passed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
application/src/main/kotlin/net/codebot/application/FolderView.kt
+2
-2
2 additions, 2 deletions
...ion/src/main/kotlin/net/codebot/application/FolderView.kt
application/src/main/kotlin/net/codebot/application/Main.kt
+5
-3
5 additions, 3 deletions
application/src/main/kotlin/net/codebot/application/Main.kt
with
7 additions
and
5 deletions
application/src/main/kotlin/net/codebot/application/FolderView.kt
+
2
−
2
View file @
2df1c924
...
@@ -8,14 +8,14 @@ import javafx.scene.layout.StackPane
...
@@ -8,14 +8,14 @@ import javafx.scene.layout.StackPane
import
java.io.File
import
java.io.File
class
FolderView
{
class
FolderView
{
fun
build
()
:
StackPane
{
fun
build
(
pathname
:
String
=
"src/main/kotlin"
)
:
StackPane
{
val
folder_img
=
ImageView
(
Image
(
"https://png.pngtree.com/png-vector/20190916/ourmid/pngtree-folder-icon-for-your-project-png-image_1731079.jpg"
))
val
folder_img
=
ImageView
(
Image
(
"https://png.pngtree.com/png-vector/20190916/ourmid/pngtree-folder-icon-for-your-project-png-image_1731079.jpg"
))
folder_img
.
fitWidth
=
20.0
folder_img
.
fitWidth
=
20.0
folder_img
.
fitHeight
=
20.0
folder_img
.
fitHeight
=
20.0
val
folderIcon
:
Node
=
folder_img
val
folderIcon
:
Node
=
folder_img
val
rootItem
=
TreeItem
<
Any
?>(
"Inbox"
,
folderIcon
)
val
rootItem
=
TreeItem
<
Any
?>(
"Inbox"
,
folderIcon
)
rootItem
.
isExpanded
=
true
rootItem
.
isExpanded
=
true
File
(
"src/main/kotlin"
).
walk
(
FileWalkDirection
.
BOTTOM_UP
).
forEach
{
File
(
pathname
).
walk
(
FileWalkDirection
.
BOTTOM_UP
).
forEach
{
val
item
=
TreeItem
<
Any
?>(
it
)
val
item
=
TreeItem
<
Any
?>(
it
)
rootItem
.
children
.
add
(
item
)
rootItem
.
children
.
add
(
item
)
}
}
...
...
This diff is collapsed.
Click to expand it.
application/src/main/kotlin/net/codebot/application/Main.kt
+
5
−
3
View file @
2df1c924
...
@@ -52,7 +52,9 @@ class Main : Application() {
...
@@ -52,7 +52,9 @@ class Main : Application() {
val
status
=
HBox
(
label
)
val
status
=
HBox
(
label
)
// code for left pane
// code for left pane
val
left
=
VBox
(
Text
(
"Left Pane"
))
val
tree
=
FolderView
().
build
()
val
left
=
tree
left
.
prefWidth
=
250.0
// code for right pane
// code for right pane
val
display_text
=
TextArea
()
val
display_text
=
TextArea
()
...
@@ -62,7 +64,7 @@ class Main : Application() {
...
@@ -62,7 +64,7 @@ class Main : Application() {
display_text
.
prefColumnCount
=
200
display_text
.
prefColumnCount
=
200
display_text
.
isEditable
=
false
display_text
.
isEditable
=
false
val
right
=
HBox
(
display_text
)
val
right
=
HBox
(
display_text
)
right
.
prefWidth
=
7
50.0
right
.
prefWidth
=
6
50.0
bold
.
setOnMouseClicked
{
bold
.
setOnMouseClicked
{
var
currentHighlight
=
text
.
selectedText
var
currentHighlight
=
text
.
selectedText
...
@@ -153,7 +155,7 @@ class Main : Application() {
...
@@ -153,7 +155,7 @@ class Main : Application() {
}
catch
(
e
:
FileNotFoundException
)
{
}
catch
(
e
:
FileNotFoundException
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
border
.
left
=
FolderView
().
build
(
selectedFile
.
parentFile
.
absolutePath
)
}
}
border
.
top
=
topContainer
border
.
top
=
topContainer
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment