-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
f8e9e76
commit 1482315
Showing
7 changed files
with
74 additions
and
130 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
15 changes: 15 additions & 0 deletions
15
src/main/java/ir/mmd/intellijDev/Actionable/ActionableBundle.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,15 @@ | ||
package ir.mmd.intellijDev.Actionable | ||
|
||
import com.intellij.DynamicBundle | ||
import org.jetbrains.annotations.PropertyKey | ||
|
||
private const val BUNDLE = "strings" | ||
|
||
object ActionableBundle : DynamicBundle(BUNDLE) { | ||
fun string(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = | ||
getMessage(key, *params) | ||
|
||
@Suppress("unused") | ||
fun stringPointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = | ||
getLazyMessage(key, *params) | ||
} |
52 changes: 0 additions & 52 deletions
52
src/main/java/ir/mmd/intellijDev/Actionable/find/settings/UI.form
This file was deleted.
Oops, something went wrong.
49 changes: 18 additions & 31 deletions
49
src/main/java/ir/mmd/intellijDev/Actionable/find/settings/UI.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,36 +1,23 @@ | ||
package ir.mmd.intellijDev.Actionable.find.settings; | ||
package ir.mmd.intellijDev.Actionable.find.settings | ||
|
||
import javax.swing.*; | ||
import java.awt.event.MouseAdapter; | ||
import java.awt.event.MouseEvent; | ||
import com.intellij.ui.dsl.builder.* | ||
import ir.mmd.intellijDev.Actionable.ActionableBundle | ||
import ir.mmd.intellijDev.Actionable.util.observableMutablePropertyOf | ||
|
||
public class UI { | ||
private JPanel component; | ||
private JCheckBox caseSensitiveCheckBox; | ||
private JButton caseSensitiveCheckBoxDefault; | ||
class UI { | ||
private val isCaseSensitiveProperty = observableMutablePropertyOf(SettingsState.Defaults.isCaseSensitive) | ||
var isCaseSensitive by isCaseSensitiveProperty | ||
|
||
public UI() { | ||
initListeners(); | ||
} | ||
|
||
private void initListeners() { | ||
caseSensitiveCheckBoxDefault.addMouseListener(new MouseAdapter() { | ||
@Override | ||
public void mouseClicked(MouseEvent e) { | ||
caseSensitiveCheckBox.setSelected(SettingsState.Defaults.isCaseSensitive); | ||
} | ||
}); | ||
} | ||
|
||
public JPanel getComponent() { | ||
return component; | ||
} | ||
|
||
public boolean isCaseSensitive() { | ||
return caseSensitiveCheckBox.isSelected(); | ||
} | ||
|
||
public void setCaseSensitive(boolean b) { | ||
caseSensitiveCheckBox.setSelected(b); | ||
val component = panel { | ||
row { | ||
checkBox(ActionableBundle.string("findPanel.caseSensitiveCheckBox.label")) | ||
.bindSelected(isCaseSensitiveProperty) | ||
.align(Align.FILL) | ||
.comment(ActionableBundle.string("findPanel.caseSensitiveCheckBox.comment")) | ||
|
||
button(ActionableBundle.string("global.defaultButton.label")) { | ||
isCaseSensitive = SettingsState.Defaults.isCaseSensitive | ||
}.align(AlignX.RIGHT + AlignY.CENTER) | ||
} | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
src/main/java/ir/mmd/intellijDev/Actionable/text/settings/UI.form
This file was deleted.
Oops, something went wrong.
34 changes: 17 additions & 17 deletions
34
src/main/java/ir/mmd/intellijDev/Actionable/text/settings/UI.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,22 +1,22 @@ | ||
package ir.mmd.intellijDev.Actionable.text.settings; | ||
package ir.mmd.intellijDev.Actionable.text.settings | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import com.intellij.ui.dsl.builder.* | ||
import ir.mmd.intellijDev.Actionable.ActionableBundle | ||
import ir.mmd.intellijDev.Actionable.util.observableMutablePropertyOf | ||
|
||
import javax.swing.*; | ||
|
||
public class UI { | ||
private JPanel component; | ||
private JCheckBox preserveCaseCheckbox; | ||
|
||
public @NotNull JPanel getComponent() { | ||
return component; | ||
} | ||
|
||
public boolean getPreserveCase() { | ||
return preserveCaseCheckbox.isSelected(); | ||
} | ||
class UI { | ||
private val preserveCaseProperty = observableMutablePropertyOf(SettingsState.Defaults.preserveCase) | ||
var preserveCase by preserveCaseProperty | ||
|
||
public void setPreserveCase(boolean b) { | ||
preserveCaseCheckbox.setSelected(b); | ||
val component = panel { | ||
row { | ||
checkBox(ActionableBundle.string("textPanel.preserveCase.label")) | ||
.bindSelected(preserveCaseProperty) | ||
.align(Align.FILL) | ||
|
||
button(ActionableBundle.string("global.defaultButton.label")) { | ||
preserveCase = SettingsState.Defaults.preserveCase | ||
}.align(AlignX.RIGHT + AlignY.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