Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ServerPackCreator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
JetBrains YouTrack
External 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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Griefed
ServerPackCreator
Commits
09381d8a
Verified
Commit
09381d8a
authored
1 month ago
by
Griefed
Browse files
Options
Downloads
Patches
Plain Diff
fix: Ensure tip-box updates after editing the inclusion or exclusion filters
parent
cf8b00eb
No related branches found
No related tags found
1 merge request
!641
Develop
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/InclusionsEditor.kt
+24
-12
24 additions, 12 deletions
.../window/configs/components/inclusions/InclusionsEditor.kt
with
24 additions
and
12 deletions
serverpackcreator-app/src/main/kotlin/de/griefed/serverpackcreator/app/gui/window/configs/components/inclusions/InclusionsEditor.kt
+
24
−
12
View file @
09381d8a
...
...
@@ -33,6 +33,7 @@ import org.apache.logging.log4j.kotlin.cachedLoggerOf
import
java.awt.BorderLayout
import
java.awt.Dimension
import
java.awt.datatransfer.DataFlavor
import
java.awt.event.ActionListener
import
java.awt.event.MouseAdapter
import
java.awt.event.MouseEvent
import
java.io.File
...
...
@@ -110,8 +111,7 @@ class InclusionsEditor(
private
val
inclusionsReset
=
BalloonTipButton
(
null
,
guiProps
.
resetIcon
,
Translations
.
createserverpack_gui_buttoncopydirs_reset_tip
.
toString
(),
guiProps
)
{
setInclusionsFromStringList
(
apiWrapper
.
apiProperties
.
directoriesToInclude
.
toMutableList
())
}
private
var
selectedInclusion
:
InclusionSpecification
?
=
null
private
val
delay
=
250
private
val
tipUpdateTimer
:
Timer
=
Timer
(
delay
)
{
updateTip
()
}
private
val
tipUpdateTimer
:
TipUpdateTimer
=
TipUpdateTimer
(
500
)
private
val
sourceListener
=
object
:
DocumentChangeListener
{
override
fun
update
(
e
:
DocumentEvent
)
{
...
...
@@ -154,7 +154,7 @@ class InclusionsEditor(
val
index
=
inclusionList
.
locationToIndex
(
e
.
point
)
val
bounds
=
inclusionList
.
getCellBounds
(
index
,
index
)
if
(
bounds
==
null
||
!
bounds
.
contains
(
e
.
point
)
||
inclusionList
.
model
.
size
<=
0
)
{
em
t
pySelection
()
emp
t
ySelection
()
}
else
{
enableInputs
()
}
...
...
@@ -177,16 +177,13 @@ class InclusionsEditor(
fun
checkSize
()
{
if
(
inclusionList
.
model
.
size
<=
0
||
inclusionList
.
isSelectionEmpty
)
{
em
t
pySelection
()
emp
t
ySelection
()
}
}
}
init
{
source
.
isEditable
=
guiProps
.
allowManualEditing
tipUpdateTimer
.
stop
()
tipUpdateTimer
.
delay
=
delay
tipUpdateTimer
.
isRepeats
=
false
dividerLocation
=
150
setLeftComponent
(
leftPanel
)
setRightComponent
(
rightPanel
)
...
...
@@ -234,11 +231,11 @@ class InclusionsEditor(
inclusionList
.
addMouseListener
(
listMouseAdapter
)
inclusionList
.
model
.
addListDataListener
(
listModelDataAdapter
)
if
(
inclusionList
.
model
.
size
<=
0
)
{
em
t
pySelection
()
emp
t
ySelection
()
}
}
private
fun
em
t
pySelection
()
{
private
fun
emp
t
ySelection
()
{
if
(
inclusionList
.
model
.
size
>
0
||
inclusionList
.
valueIsAdjusting
)
{
return
}
...
...
@@ -324,7 +321,7 @@ class InclusionsEditor(
selectedInclusionDetailsScrollPanel
.
isEnabled
=
true
inclusionList
.
isEnabled
=
true
}
else
{
u
pdateTi
p
()
tipU
pdateTi
mer
.
restart
()
}
}
}
...
...
@@ -438,7 +435,7 @@ class InclusionsEditor(
inclusionList
.
valueIsAdjusting
->
return
event
.
valueIsAdjusting
->
return
inclusionList
.
selectedIndex
==
-
1
||
inclusionList
.
model
.
size
<=
0
->
{
em
t
pySelection
()
emp
t
ySelection
()
return
}
}
...
...
@@ -535,7 +532,7 @@ class InclusionsEditor(
inclusionList
.
selectedIndex
=
0
}
if
(
inclusionList
.
model
.
size
<=
0
)
{
em
t
pySelection
()
emp
t
ySelection
()
}
validate
()
return
removed
...
...
@@ -682,4 +679,19 @@ class InclusionsEditor(
return
true
}
}
/**
* Timer responsible for updating the tip in the inclusions-editor.
*
* @author Griefed
*/
inner
class
TipUpdateTimer
(
delay
:
Int
)
:
Timer
(
delay
,
ActionListener
{
updateTip
()
})
{
init
{
stop
()
isRepeats
=
false
}
}
}
\ No newline at end of file
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