Skip to content

Commit

Permalink
Scrollable pane
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian-panek-vmltech committed Nov 3, 2022
1 parent 960e0b8 commit 60d884d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions plugin/src/main/kotlin/io/wttech/gradle/config/Definition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ open class Definition(val name: String, val project: Project) {
}
}

init {
labelAbbrs(
"id", "url", "http", "https", "sftp", "ftp", "ssh", "aws", "az", "gcp",
"ad", "tf", "tcp", "udp", "html", "css", "js", "sso"
)
}

companion object {
const val TEMPLATE_PROP = "config"
}
Expand Down
8 changes: 6 additions & 2 deletions plugin/src/main/kotlin/io/wttech/gradle/config/gui/Gui.kt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Gui(val definition: Definition) {
else -> throw ConfigException("Config property '${prop.name}' has invalid type!")
}

class GroupTab(val group: Group, val panel: JPanel)
class GroupTab(val group: Group, val panel: JComponent)
private val groupTabs = mutableListOf<GroupTab>()

private val tabPane = JTabbedPane().also { tabs ->
Expand Down Expand Up @@ -178,7 +178,11 @@ class Gui(val definition: Definition) {
}, "growx, wrap, top, hidemode 1")
}
}
groupTabs.add(GroupTab(group, panel))
val scrollPane = JScrollPane(panel).apply {
horizontalScrollBarPolicy = JScrollPane.HORIZONTAL_SCROLLBAR_NEVER
verticalScrollBarPolicy = JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED
}
groupTabs.add(GroupTab(group, scrollPane))
}
}

Expand Down

0 comments on commit 60d884d

Please sign in to comment.