Wizard: add MPP mobile application project skeleton

This commit is contained in:
Ilya Kirillov
2020-03-22 21:32:26 +03:00
parent 732154cef5
commit b169d260d3
10 changed files with 209 additions and 53 deletions
@@ -10,7 +10,7 @@ import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.*
import org.jetbrains.kotlin.tools.projectWizard.settings.DisplayableSettingItem
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Module
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModuleKind
import org.jetbrains.kotlin.tools.projectWizard.wizard.ui.htmlText
import org.jetbrains.kotlin.tools.projectWizard.wizard.ui.fullTextHtml
import org.jetbrains.kotlin.tools.projectWizard.wizard.ui.icon
import javax.swing.Icon
@@ -46,7 +46,7 @@ class CreateModuleOrTargetPopup private constructor(
}
) {
override fun getIconFor(value: ModuleConfigurator): Icon = value.icon
override fun getTextFor(value: ModuleConfigurator): String = value.htmlText
override fun getTextFor(value: ModuleConfigurator): String = value.fullTextHtml
override fun onChosen(selectedValue: ModuleConfigurator?, finalChoice: Boolean): PopupStep<*>? =
when (selectedValue) {
@@ -71,7 +71,7 @@ class CreateModuleOrTargetPopup private constructor(
else -> null
}
override fun getTextFor(value: DisplayableSettingItem): String = value.htmlText
override fun getTextFor(value: DisplayableSettingItem): String = value.fullTextHtml
override fun onChosen(selectedValue: DisplayableSettingItem?, finalChoice: Boolean): PopupStep<*>? {
when {
@@ -77,20 +77,6 @@ fun ValidationResult.ValidationError.asHtml() = when (messages.size) {
}
}
val DisplayableSettingItem.htmlText
get() = (text + greyText?.let { " <i>($greyText)</i>" }.orEmpty()).asHtml()
fun splitterFor(
vararg components: JComponent,
vertical: Boolean = false
) = components.reduce { left, right ->
JBSplitter(vertical, 1f / components.size).apply {
firstComponent = left
secondComponent = right
dividerWidth = 1
}
}
val ModuleType.icon: Icon
get() = when (this) {
ModuleType.jvm -> KotlinIcons.SMALL_LOGO