Skip to content

Commit f5797e1

Browse files
committed
Merge branch 'feature/divide-configuration-window' into develop
- Divide configuration window with options category - Refactoring class method access modifier and fix incorrect variable name
2 parents a392954 + a9bca98 commit f5797e1

File tree

4 files changed

+89
-59
lines changed

4 files changed

+89
-59
lines changed

src/main/java/com/github/ilovegamecoding/intellijcodexp/form/CodeXPConfigurationForm.form

Lines changed: 82 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,125 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.github.ilovegamecoding.intellijcodexp.form.CodeXPConfigurationForm">
3-
<grid id="27dc6" binding="pMain" layout-manager="GridLayoutManager" row-count="7" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
3+
<grid id="27dc6" binding="pMain" layout-manager="GridLayoutManager" row-count="6" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
44
<margin top="0" left="0" bottom="0" right="0"/>
55
<constraints>
6-
<xy x="20" y="20" width="621" height="400"/>
6+
<xy x="20" y="20" width="640" height="400"/>
77
</constraints>
88
<properties/>
99
<border type="none"/>
1010
<children>
11-
<component id="b610" class="javax.swing.JLabel">
12-
<constraints>
13-
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
14-
</constraints>
15-
<properties>
16-
<font/>
17-
<text resource-bundle="messages/CodeXPBundle" key="TEXT_NOTIFICATION"/>
18-
</properties>
19-
</component>
20-
<component id="9ae23" class="javax.swing.JCheckBox" binding="cbShowLevelUpNotification">
21-
<constraints>
22-
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
23-
</constraints>
24-
<properties>
25-
<text resource-bundle="messages/CodeXPBundle" key="TEXT_SHOW_LEVEL_UP_NOTIFICATION"/>
26-
</properties>
27-
</component>
28-
<component id="629a5" class="javax.swing.JCheckBox" binding="cbShowCompleteChallengeNotification">
29-
<constraints>
30-
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
31-
</constraints>
32-
<properties>
33-
<text resource-bundle="messages/CodeXPBundle" key="TEXT_SHOW_COMPLETE_CHALLENGE_NOTIFICATION"/>
34-
</properties>
35-
</component>
3611
<vspacer id="43cd9">
3712
<constraints>
38-
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
13+
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
3914
</constraints>
4015
</vspacer>
41-
<component id="a4d9f" class="javax.swing.JCheckBox" binding="cbShowGainedXP">
42-
<constraints>
43-
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
44-
</constraints>
45-
<properties>
46-
<text resource-bundle="messages/CodeXPBundle" key="TEXT_SHOW_GAINED_XP"/>
47-
</properties>
48-
</component>
49-
<grid id="1c92c" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
50-
<margin top="0" left="22" bottom="0" right="0"/>
16+
<grid id="2b0a2" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
17+
<margin top="0" left="0" bottom="0" right="0"/>
5118
<constraints>
52-
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
19+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
5320
</constraints>
5421
<properties/>
5522
<border type="none"/>
5623
<children>
57-
<component id="9ca3" class="javax.swing.JComboBox" binding="cbPositionToDisplayGainedXP">
24+
<component id="b610" class="javax.swing.JLabel">
5825
<constraints>
59-
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
26+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
6027
</constraints>
61-
<properties/>
28+
<properties>
29+
<font style="1"/>
30+
<text resource-bundle="messages/CodeXPBundle" key="TEXT_NOTIFICATION"/>
31+
</properties>
6232
</component>
63-
<hspacer id="3944">
33+
<component id="9ae23" class="javax.swing.JCheckBox" binding="cbShowLevelUpNotification">
6434
<constraints>
65-
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
35+
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
6636
</constraints>
67-
</hspacer>
68-
<component id="d236" class="javax.swing.JLabel">
37+
<properties>
38+
<text resource-bundle="messages/CodeXPBundle" key="TEXT_SHOW_LEVEL_UP_NOTIFICATION"/>
39+
</properties>
40+
</component>
41+
<component id="629a5" class="javax.swing.JCheckBox" binding="cbShowCompleteChallengeNotification">
6942
<constraints>
70-
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
43+
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
7144
</constraints>
7245
<properties>
73-
<text resource-bundle="messages/CodeXPBundle" key="TEXT_CARETS"/>
46+
<text resource-bundle="messages/CodeXPBundle" key="TEXT_SHOW_COMPLETE_CHALLENGE_NOTIFICATION"/>
7447
</properties>
7548
</component>
7649
</children>
7750
</grid>
78-
<grid id="9e7ee" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
79-
<margin top="0" left="22" bottom="0" right="0"/>
51+
<grid id="be17d" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
52+
<margin top="16" left="0" bottom="0" right="0"/>
8053
<constraints>
81-
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
54+
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
8255
</constraints>
8356
<properties/>
8457
<border type="none"/>
8558
<children>
86-
<component id="57ce1" class="javax.swing.JLabel">
59+
<component id="e5851" class="javax.swing.JLabel">
8760
<constraints>
8861
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
8962
</constraints>
9063
<properties>
91-
<text resource-bundle="messages/CodeXPBundle" key="TEXT_SHOW_GAINED_XP_DESCRIPTION"/>
64+
<font style="1"/>
65+
<text resource-bundle="messages/CodeXPBundle" key="TEXT_EFFECT"/>
66+
</properties>
67+
</component>
68+
<component id="a4d9f" class="javax.swing.JCheckBox" binding="cbShowGainedXP">
69+
<constraints>
70+
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
71+
</constraints>
72+
<properties>
73+
<text resource-bundle="messages/CodeXPBundle" key="TEXT_SHOW_GAINED_XP"/>
9274
</properties>
9375
</component>
76+
<grid id="9e7ee" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
77+
<margin top="0" left="22" bottom="0" right="0"/>
78+
<constraints>
79+
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
80+
</constraints>
81+
<properties/>
82+
<border type="none"/>
83+
<children>
84+
<component id="57ce1" class="javax.swing.JLabel">
85+
<constraints>
86+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
87+
</constraints>
88+
<properties>
89+
<text resource-bundle="messages/CodeXPBundle" key="TEXT_SHOW_GAINED_XP_DESCRIPTION"/>
90+
</properties>
91+
</component>
92+
</children>
93+
</grid>
94+
<grid id="1c92c" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
95+
<margin top="0" left="22" bottom="0" right="0"/>
96+
<constraints>
97+
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
98+
</constraints>
99+
<properties/>
100+
<border type="none"/>
101+
<children>
102+
<component id="9ca3" class="javax.swing.JComboBox" binding="cbPositionToDisplayGainedXP">
103+
<constraints>
104+
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
105+
</constraints>
106+
<properties/>
107+
</component>
108+
<hspacer id="3944">
109+
<constraints>
110+
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
111+
</constraints>
112+
</hspacer>
113+
<component id="d236" class="javax.swing.JLabel">
114+
<constraints>
115+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
116+
</constraints>
117+
<properties>
118+
<text resource-bundle="messages/CodeXPBundle" key="TEXT_CARETS"/>
119+
</properties>
120+
</component>
121+
</children>
122+
</grid>
94123
</children>
95124
</grid>
96125
</children>

src/main/kotlin/com/github/ilovegamecoding/intellijcodexp/managers/CodeXPNotificationManager.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import com.intellij.notification.NotificationGroupManager
66
import com.intellij.notification.NotificationType
77

88
object CodeXPNotificationManager {
9-
private val notifiationGroup: NotificationGroup =
9+
private val notificationGroup: NotificationGroup =
1010
NotificationGroupManager.getInstance().getNotificationGroup("CodeXP")
1111

12-
fun notify(title: String, content: String) {
13-
notifiationGroup.createNotification(title, content, NotificationType.INFORMATION).notify(null)
12+
private fun notify(title: String, content: String) {
13+
notificationGroup.createNotification(title, content, NotificationType.INFORMATION).notify(null)
1414
}
1515

1616
fun notifyChallengeComplete(codeXPChallenge: CodeXPChallenge) {

src/main/kotlin/com/github/ilovegamecoding/intellijcodexp/services/CodeXPService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class CodeXPService : PersistentStateComponent<CodeXPService.CodeXPState>, CodeX
158158
*
159159
* @param initializeCallback The callback to execute when the plugin is initialized.
160160
*/
161-
fun initialize(initializeCallback: () -> Unit) {
161+
private fun initialize(initializeCallback: () -> Unit) {
162162
if (!codeXPState.hasExecuted) {
163163
initializeCallback()
164164
codeXPState.hasExecuted = true
@@ -180,7 +180,7 @@ class CodeXPService : PersistentStateComponent<CodeXPService.CodeXPState>, CodeX
180180
*
181181
* @param challenge The challenge to add.
182182
*/
183-
fun addChallenge(challenge: CodeXPChallenge) {
183+
private fun addChallenge(challenge: CodeXPChallenge) {
184184
if (!codeXPState.challenges.containsKey(challenge.event)) {
185185
codeXPState.challenges[challenge.event] = challenge
186186
}

src/main/resources/messages/CodeXPBundle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ TEXT_XP=XP
1616
TEXT_SHOW_COMPLETED_CHALLENGES=Show completed challenges
1717
TEXT_SHOW_GAINED_XP=Show gained xp
1818
TEXT_SHOW_GAINED_XP_DESCRIPTION=<html>Gained XP is only displayed for typing-related tasks (characters, Tab, Backspace, Enter, etc.).<br>It is not displayed for other tasks such as Build, Run, Debug.</html>
19-
TEXT_CARETS=Caret's
19+
TEXT_CARETS=Caret's
20+
TEXT_EFFECT=Effect

0 commit comments

Comments
 (0)