generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gui): add welcome panel with features description and context-aw…
…are code generation introduction. This commit introduces a new welcome panel to the GUI, providing a clear and concise introduction to the features of AutoDev. The panel includes a list of welcome items, each describing a feature using messages from the `AutoDevBundle`. It also includes a link to learn more about AutoDev, which opens a web page in the user's default browser. The welcome panel is designed with a clean layout and appropriate margins to ensure a good user experience.
- Loading branch information
Showing
5 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/kotlin/cc/unitmesh/devti/gui/chat/welcome/WelcomeItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package cc.unitmesh.devti.gui.chat.welcome | ||
|
||
data class WelcomeItem(val text: String) { | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/kotlin/cc/unitmesh/devti/gui/chat/welcome/WelcomePanel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package cc.unitmesh.devti.gui.chat.welcome | ||
|
||
import cc.unitmesh.devti.AutoDevBundle | ||
import cc.unitmesh.devti.AutoDevIcons | ||
import com.intellij.ui.Gray | ||
import com.intellij.ui.dsl.builder.RightGap | ||
import com.intellij.ui.dsl.builder.panel | ||
import java.awt.BorderLayout | ||
import javax.swing.JLabel | ||
import javax.swing.JPanel | ||
|
||
class WelcomePanel: JPanel(BorderLayout()) { | ||
val welcomeItems: List<WelcomeItem> = listOf( | ||
WelcomeItem(AutoDevBundle.message("settings.welcome.feature.context")), | ||
WelcomeItem(AutoDevBundle.message("settings.welcome.feature.lifecycle")), | ||
WelcomeItem(AutoDevBundle.message("settings.welcome.feature.custom.action")), | ||
WelcomeItem(AutoDevBundle.message("settings.welcome.feature.custom.agent")), | ||
) | ||
|
||
init { | ||
background = Gray.x00 | ||
|
||
|
||
val panel = panel { | ||
row { | ||
text(AutoDevBundle.message("settings.welcome.message")) | ||
} | ||
welcomeItems.forEachIndexed { index, it -> | ||
row { | ||
// icon | ||
icon(AutoDevIcons.AI_COPILOT).gap(RightGap.SMALL) | ||
text(it.text) | ||
} | ||
} | ||
row { | ||
text(AutoDevBundle.message("settings.welcome.feature.features")) | ||
} | ||
}.apply { | ||
// set margin 20 | ||
border = javax.swing.BorderFactory.createEmptyBorder(20, 20, 20, 20) | ||
} | ||
|
||
add(panel, BorderLayout.CENTER) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters