-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
221 additions
and
81 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
44 changes: 41 additions & 3 deletions
44
src/main/kotlin/com/johnlindquist/acejump/settings/AceConfig.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 |
---|---|---|
@@ -1,7 +1,45 @@ | ||
package com.johnlindquist.acejump.settings | ||
|
||
import javax.swing.* | ||
import com.intellij.openapi.components.State | ||
import com.intellij.openapi.options.Configurable | ||
import com.johnlindquist.acejump.ui.AceUI.defaults | ||
import com.johnlindquist.acejump.ui.AceUI.gui | ||
import com.johnlindquist.acejump.ui.AceUI.settings | ||
import javax.swing.JComponent | ||
|
||
class AceConfig { | ||
lateinit var tagCharacters: JTextField | ||
@State(name = "AceConfig") | ||
object AceConfig : Configurable { | ||
// override fun getState() = settings | ||
// override fun loadState(state: UserSettings) {settings = state} | ||
// | ||
// override fun getId() = "preferences.AceConfigurable" | ||
|
||
override fun getDisplayName() = "AceJump Config" | ||
|
||
override fun createComponent(): JComponent { | ||
gui = AceSettingsPage() | ||
reset() | ||
return gui.rootPanel | ||
} | ||
|
||
override fun isModified() = settings != defaults | ||
|
||
override fun apply() { | ||
settings.allowedChars = gui.allowedChars | ||
settings.jumpModeColor = gui.jumpModeColor ?: defaults.jumpModeColor | ||
settings.targetModeColor = gui.targetModeColor ?: defaults.targetModeColor | ||
settings.textHighLightColor = gui.textHighlighterColor ?: defaults.textHighLightColor | ||
settings.tagForegroundColor = gui.tagForegroundColor ?: defaults.tagForegroundColor | ||
settings.tagBackgroundColor = gui.tagBackgroundColor ?: defaults.tagBackgroundColor | ||
} | ||
|
||
override fun reset() { | ||
gui.allowedChars = defaults.allowedChars | ||
gui.allowedChars | ||
gui.jumpModeColor = defaults.jumpModeColor | ||
gui.targetModeColor = defaults.targetModeColor | ||
gui.textHighlighterColor = defaults.textHighLightColor | ||
gui.tagForegroundColor = defaults.tagForegroundColor | ||
gui.tagBackgroundColor = defaults.tagBackgroundColor | ||
} | ||
} |
36 changes: 0 additions & 36 deletions
36
src/main/kotlin/com/johnlindquist/acejump/settings/AceSettings.form
This file was deleted.
Oops, something went wrong.
106 changes: 106 additions & 0 deletions
106
src/main/kotlin/com/johnlindquist/acejump/settings/AceSettingsPage.form
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,106 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.johnlindquist.acejump.settings.AceSettingsPage"> | ||
<grid id="27dc6" binding="rootPanel" layout-manager="GridLayoutManager" row-count="8" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> | ||
<margin top="0" left="0" bottom="0" right="0"/> | ||
<constraints> | ||
<xy x="830" y="200" width="336" height="319"/> | ||
</constraints> | ||
<properties/> | ||
<border type="none" title=""/> | ||
<children> | ||
<component id="586f2" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Characters allowed in Tags (sorted by priority):"/> | ||
</properties> | ||
</component> | ||
<component id="14f08" class="javax.swing.JTextField" binding="tagCharacters"> | ||
<constraints> | ||
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> | ||
<preferred-size width="150" height="-1"/> | ||
</grid> | ||
</constraints> | ||
<properties> | ||
<text resource-bundle="AceResources" key="tagCharacters"/> | ||
</properties> | ||
</component> | ||
<vspacer id="61505"> | ||
<constraints> | ||
<grid row="7" column="2" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
</vspacer> | ||
<component id="adf58" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Jump mode color:"/> | ||
</properties> | ||
</component> | ||
<component id="60e62" class="com.intellij.ui.ColorPanel" binding="jumpModeColorChooser"> | ||
<constraints> | ||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="e78f1" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Target mode color:"/> | ||
</properties> | ||
</component> | ||
<component id="24934" class="com.intellij.ui.ColorPanel" binding="targetModeColorChooser"> | ||
<constraints> | ||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="b3a37" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Text highlight color:"/> | ||
</properties> | ||
</component> | ||
<component id="6b47a" class="com.intellij.ui.ColorPanel" binding="textHighlightColorChooser"> | ||
<constraints> | ||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="4f1" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Tag foreground color:"/> | ||
</properties> | ||
</component> | ||
<component id="ac9c0" class="com.intellij.ui.ColorPanel" binding="tagForegroundColorChooser"> | ||
<constraints> | ||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
<component id="da110" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Tag background color:"/> | ||
</properties> | ||
</component> | ||
<component id="4a24c" class="com.intellij.ui.ColorPanel" binding="tagBackgroundColorChooser"> | ||
<constraints> | ||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
</component> | ||
</children> | ||
</grid> | ||
</form> |
43 changes: 43 additions & 0 deletions
43
src/main/kotlin/com/johnlindquist/acejump/settings/AceSettingsPage.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,43 @@ | ||
package com.johnlindquist.acejump.settings | ||
|
||
import com.intellij.ui.ColorPanel | ||
import java.awt.Color | ||
import javax.swing.JPanel | ||
import javax.swing.JTextField | ||
|
||
class AceSettingsPage { | ||
lateinit var tagCharacters: JTextField | ||
lateinit var jumpModeColorChooser: ColorPanel | ||
lateinit var targetModeColorChooser: ColorPanel | ||
lateinit var textHighlightColorChooser: ColorPanel | ||
lateinit var tagForegroundColorChooser: ColorPanel | ||
lateinit var tagBackgroundColorChooser: ColorPanel | ||
lateinit var rootPanel: JPanel | ||
|
||
var allowedChars: List<Char> | ||
get() = tagCharacters.text.toList().distinct() | ||
set(value) = tagCharacters.setText(value.joinToString("")) | ||
|
||
var jumpModeColor: Color? | ||
get() = jumpModeColorChooser.selectedColor | ||
set(value) { jumpModeColorChooser.selectedColor = value } | ||
|
||
|
||
var targetModeColor: Color? | ||
get() = targetModeColorChooser.selectedColor | ||
set(value) { targetModeColorChooser.selectedColor = value } | ||
|
||
var textHighlighterColor: Color? | ||
get() = textHighlightColorChooser.selectedColor | ||
set(value) { textHighlightColorChooser.selectedColor = value } | ||
|
||
|
||
var tagForegroundColor: Color? | ||
get() = tagForegroundColorChooser.selectedColor | ||
set(value) { tagForegroundColorChooser.selectedColor = value } | ||
|
||
|
||
var tagBackgroundColor: Color? | ||
get() = tagBackgroundColorChooser.selectedColor | ||
set(value) { tagBackgroundColorChooser.selectedColor = value } | ||
} |
22 changes: 0 additions & 22 deletions
22
src/main/kotlin/com/johnlindquist/acejump/settings/AceSettingsProvider.kt
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.