Skip to content

Commit c6a4ade

Browse files
committed
Remove info pane from project creator
1 parent 52086af commit c6a4ade

File tree

2 files changed

+185
-280
lines changed

2 files changed

+185
-280
lines changed

src/main/kotlin/com/demonwav/mcdev/creator/PlatformChooserWizardStep.kt

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,19 @@ import com.demonwav.mcdev.platform.velocity.creator.VelocityProjectConfig
2222
import com.intellij.ide.util.projectWizard.ModuleWizardStep
2323
import com.intellij.openapi.ui.popup.Balloon
2424
import com.intellij.openapi.ui.popup.JBPopupFactory
25-
import com.intellij.ui.IdeBorderFactory
2625
import com.intellij.ui.LightColors
2726
import com.intellij.ui.awt.RelativePoint
2827
import com.intellij.util.ui.UIUtil
29-
import java.awt.Desktop
3028
import javax.swing.JCheckBox
3129
import javax.swing.JComponent
32-
import javax.swing.JEditorPane
3330
import javax.swing.JLabel
3431
import javax.swing.JPanel
35-
import javax.swing.event.HyperlinkEvent
3632

3733
class PlatformChooserWizardStep(private val creator: MinecraftProjectCreator) : ModuleWizardStep() {
3834

3935
private lateinit var chooserPanel: JPanel
4036
private lateinit var panel: JPanel
41-
private lateinit var infoPanel: JPanel
4237

43-
private lateinit var infoPane: JEditorPane
4438
private lateinit var spongeIcon: JLabel
4539
private lateinit var bukkitPluginCheckBox: JCheckBox
4640
private lateinit var spigotPluginCheckBox: JCheckBox
@@ -53,19 +47,6 @@ class PlatformChooserWizardStep(private val creator: MinecraftProjectCreator) :
5347
private lateinit var liteLoaderModCheckBox: JCheckBox
5448

5549
override fun getComponent(): JComponent {
56-
chooserPanel.border = IdeBorderFactory.createBorder()
57-
infoPanel.border = IdeBorderFactory.createBorder()
58-
59-
// HTML parsing and hyperlink support
60-
infoPane.contentType = "text/html"
61-
infoPane.addHyperlinkListener { e ->
62-
if (e.eventType == HyperlinkEvent.EventType.ACTIVATED) {
63-
if (Desktop.isDesktopSupported()) {
64-
Desktop.getDesktop().browse(e.url.toURI())
65-
}
66-
}
67-
}
68-
6950
// Set types
7051
bukkitPluginCheckBox.addActionListener {
7152
toggle(
@@ -88,12 +69,10 @@ class PlatformChooserWizardStep(private val creator: MinecraftProjectCreator) :
8869
spigotPluginCheckBox
8970
)
9071
}
91-
spongePluginCheckBox.addActionListener { fillInInfoPane() }
9272
forgeModCheckBox.addActionListener { toggle(forgeModCheckBox, liteLoaderModCheckBox) }
9373
liteLoaderModCheckBox.addActionListener { toggle(liteLoaderModCheckBox, forgeModCheckBox) }
9474
bungeeCordPluginCheckBox.addActionListener { toggle(bungeeCordPluginCheckBox, waterfallPluginCheckBox) }
9575
waterfallPluginCheckBox.addActionListener { toggle(waterfallPluginCheckBox, bungeeCordPluginCheckBox) }
96-
velocityPluginCheckBox.addActionListener { fillInInfoPane() }
9776

9877
if (UIUtil.isUnderDarcula()) {
9978
spongeIcon.icon = PlatformAssets.SPONGE_ICON_2X_DARK
@@ -108,32 +87,6 @@ class PlatformChooserWizardStep(private val creator: MinecraftProjectCreator) :
10887
if (one.isSelected) {
10988
others.forEach { it.isSelected = false }
11089
}
111-
fillInInfoPane()
112-
}
113-
114-
private fun fillInInfoPane() {
115-
val sb = StringBuilder("<html><font size=\"4\">")
116-
117-
fun StringBuilder.append(checkbox: JCheckBox, text: String) {
118-
if (checkbox.isSelected) {
119-
append(text)
120-
append("<p/>")
121-
}
122-
}
123-
124-
sb.append(bukkitPluginCheckBox, bukkitInfo)
125-
sb.append(spigotPluginCheckBox, spigotInfo)
126-
sb.append(paperPluginCheckBox, paperInfo)
127-
sb.append(spongePluginCheckBox, spongeInfo)
128-
sb.append(forgeModCheckBox, forgeInfo)
129-
sb.append(liteLoaderModCheckBox, liteLoaderInfo)
130-
sb.append(bungeeCordPluginCheckBox, bungeeCordInfo)
131-
sb.append(waterfallPluginCheckBox, waterfallInfo)
132-
sb.append(velocityPluginCheckBox, velocityInfo)
133-
134-
sb.append("</font></html>")
135-
136-
infoPane.text = sb.toString()
13790
}
13891

13992
override fun updateDataModel() {
@@ -210,34 +163,4 @@ class PlatformChooserWizardStep(private val creator: MinecraftProjectCreator) :
210163

211164
return result
212165
}
213-
214-
companion object {
215-
private const val bukkitInfo = "Create a standard " +
216-
"<a href=\"https://bukkit.org/\">Bukkit</a> plugin, for use " +
217-
"on CraftBukkit, Spigot, and Paper servers."
218-
private const val spigotInfo = "Create a standard " +
219-
"<a href=\"https://www.spigotmc.org/\">Spigot</a> plugin, for use " +
220-
"on Spigot and Paper servers."
221-
private const val paperInfo = "Create a standard " +
222-
"<a href=\"https://paper.emc.gs\">Paper</a> plugin, for use " +
223-
"on Paper servers."
224-
private const val bungeeCordInfo = "Create a standard " +
225-
"<a href=\"https://www.spigotmc.org/wiki/bungeecord/\">BungeeCord</a> plugin, for use " +
226-
"on BungeeCord and Waterfall servers."
227-
private const val waterfallInfo = "Create a standard " +
228-
"<a href=\"https://aquifermc.org/\">Waterfall</a> plugin, for use " +
229-
"on Waterfall servers."
230-
private const val velocityInfo = "Create a standard " +
231-
"<a href=\"https://www.velocitypowered.com//\">Velocity</a> plugin, for use " +
232-
"on Velocity servers."
233-
private const val spongeInfo = "Create a standard " +
234-
"<a href=\"https://www.spongepowered.org/\">Sponge</a> plugin, for use " +
235-
"on Sponge servers."
236-
private const val forgeInfo = "Create a standard " +
237-
"<a href=\"https://files.minecraftforge.net/\">Forge</a> mod, for use " +
238-
"on Forge servers and clients."
239-
private const val liteLoaderInfo = "Create a standard " +
240-
"<a href=\"http://www.liteloader.com/\">LiteLoader</a> mod, for use " +
241-
"on LiteLoader clients."
242-
}
243166
}

0 commit comments

Comments
 (0)