@@ -47,6 +47,7 @@ import javax.swing.SwingUtilities
4747
4848class MainPropertiesPanel (private val task : Task , private val taskView : TaskView ) {
4949 val title: String = RootLocalizer .formatText(" general" )
50+ val fxComponent by lazy { getFxNode() }
5051
5152 private val nameOption = ObservableString (" name" , task.name)
5253 private val milestoneOption = ObservableBoolean (" milestone" , task.isMilestone)
@@ -67,6 +68,8 @@ class MainPropertiesPanel(private val task: Task, private val taskView: TaskView
6768 it.putValue(GPAction .TEXT_DISPLAY , ContentDisplay .TEXT_ONLY )
6869 it.isEnabled = earliestStartOption.isWritable.value
6970 }
71+ private var onRequestFocus = {}
72+
7073 private fun onHasEarliestStartChange (hasEarliestStart : Boolean ) {
7174 earliestStartOption.setWritable(hasEarliestStart)
7275 copyStartDateAction.isEnabled = hasEarliestStart
@@ -78,8 +81,8 @@ class MainPropertiesPanel(private val task: Task, private val taskView: TaskView
7881 onHasEarliestStartChange(hasEarliestStart.value)
7982 }
8083
81- fun getFxNode () = StackPane ().apply {
82- background = Background (BackgroundFill (" Panel.background" .colorFromUiManager(), CornerRadii .EMPTY , Insets .EMPTY ))
84+ private fun getFxNode () = StackPane ().apply {
85+ background = Background (BackgroundFill (" Panel.background" .colorFromUiManager(), CornerRadii .EMPTY , Insets .EMPTY ))
8386 val leftPane = PropertySheetBuilder (i18n).pane {
8487 stylesheet(" /biz/ganttproject/task/TaskPropertiesDialog.css" )
8588 title(" section.main" )
@@ -134,6 +137,8 @@ class MainPropertiesPanel(private val task: Task, private val taskView: TaskView
134137 }
135138 }
136139 }
140+ onRequestFocus = leftPane::requestFocus
141+
137142 val grid = GridPane ()
138143
139144 val rightPane = PropertySheetBuilder (i18n).pane {
@@ -200,6 +205,8 @@ class MainPropertiesPanel(private val task: Task, private val taskView: TaskView
200205 taskMutator.setShape(value.paint)
201206 }
202207 }
208+
209+ fun requestFocus () = onRequestFocus()
203210}
204211
205212private fun Task.canBeMilestone () = this .nestedTasks.isEmpty()
0 commit comments