-
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
fb7288c
commit d167761
Showing
11 changed files
with
152 additions
and
223 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
16 changes: 5 additions & 11 deletions
16
src/main/java/ir/mmd/intellijDev/Actionable/action/Actions.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,21 +1,15 @@ | ||
package ir.mmd.intellijDev.Actionable.action; | ||
package ir.mmd.intellijDev.Actionable.action | ||
|
||
/** | ||
* List of action names needed by this plugin | ||
*/ | ||
public final class Actions { | ||
private Actions() { | ||
} | ||
|
||
public static final String MACRO_PREFIX = "Actionable.Macro"; | ||
object Actions { | ||
const val MACRO_PREFIX: String = "Actionable.Macro" | ||
|
||
/** | ||
* List of action group names needed bt this plugin | ||
*/ | ||
public static final class Groups { | ||
private Groups() { | ||
} | ||
|
||
public static final String MACROS = "ir.mmd.intellijDev.Actionable.text.macro.MacrosActionGroup"; | ||
object Groups { | ||
const val MACROS: String = "ir.mmd.intellijDev.Actionable.text.macro.MacrosActionGroup" | ||
} | ||
} |
35 changes: 15 additions & 20 deletions
35
src/main/java/ir/mmd/intellijDev/Actionable/app/Actionable.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,29 +1,24 @@ | ||
package ir.mmd.intellijDev.Actionable.app; | ||
package ir.mmd.intellijDev.Actionable.app | ||
|
||
import com.intellij.notification.Notification; | ||
import com.intellij.notification.NotificationType; | ||
import com.intellij.notification.Notifications; | ||
import com.intellij.openapi.project.Project; | ||
import org.jetbrains.annotations.NotNull; | ||
import com.intellij.notification.Notification | ||
import com.intellij.notification.NotificationType | ||
import com.intellij.notification.Notifications | ||
import com.intellij.openapi.project.Project | ||
|
||
public class Actionable { | ||
private Actionable() { | ||
} | ||
|
||
public static final String PLUGIN_ID = "ir.mmd.intellijDev.Actionable"; | ||
public static final String PLUGIN_NAME = "Actionable"; | ||
public static final String AUTHOR = "MohammadMD1383"; | ||
object Actionable { | ||
const val PLUGIN_ID: String = "ir.mmd.intellijDev.Actionable" | ||
const val PLUGIN_NAME: String = "Actionable" | ||
const val AUTHOR: String = "MohammadMD1383" | ||
|
||
public static final String NOTIFICATION_GROUP = "Actionable Notifications"; | ||
public static final String DOCS_TOOLWINDOW_ID = "Actionable Docs"; | ||
const val NOTIFICATION_GROUP: String = "Actionable Notifications" | ||
const val DOCS_TOOLWINDOW_ID: String = "Actionable Docs" | ||
|
||
public static void showNotification(@NotNull Project project, String content, NotificationType type) { | ||
fun showNotification(project: Project, content: String, type: NotificationType) { | ||
Notifications.Bus.notify( | ||
new Notification(NOTIFICATION_GROUP, content, type), | ||
Notification(NOTIFICATION_GROUP, content, type), | ||
project | ||
); | ||
) | ||
} | ||
|
||
public static class UpToDateException extends Exception { | ||
} | ||
class UpToDateException : Exception() | ||
} |
36 changes: 14 additions & 22 deletions
36
src/main/java/ir/mmd/intellijDev/Actionable/caret/editing/settings/SettingsState.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,28 @@ | ||
package ir.mmd.intellijDev.Actionable.caret.editing.settings; | ||
package ir.mmd.intellijDev.Actionable.caret.editing.settings | ||
|
||
import com.intellij.openapi.components.PersistentStateComponent; | ||
import com.intellij.openapi.components.State; | ||
import com.intellij.openapi.components.Storage; | ||
import com.intellij.util.xmlb.XmlSerializerUtil; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import com.intellij.openapi.components.PersistentStateComponent | ||
import com.intellij.openapi.components.State | ||
import com.intellij.openapi.components.Storage | ||
import com.intellij.util.xmlb.XmlSerializerUtil | ||
|
||
/** | ||
* Settings State for {@code Actionable > Caret > Editing} | ||
* Settings State for `Actionable > Caret > Editing` | ||
*/ | ||
@State( | ||
name = "ir.mmd.intellijDev.Actionable.caret.editing.settings", | ||
storages = @Storage("Actionable.CaretEditingSettingsState.xml") | ||
storages = [Storage("Actionable.CaretEditingSettingsState.xml")] | ||
) | ||
public class SettingsState implements PersistentStateComponent<SettingsState> { | ||
class SettingsState : PersistentStateComponent<SettingsState?> { | ||
/** | ||
* This class holds the default values for the settings | ||
*/ | ||
public static class Defaults { | ||
public static final boolean showPasteActionHints = true; | ||
@Suppress("ConstPropertyName") | ||
object Defaults { | ||
const val showPasteActionHints: Boolean = true | ||
} | ||
|
||
public boolean showPasteActionHints = Defaults.showPasteActionHints; | ||
var showPasteActionHints: Boolean = Defaults.showPasteActionHints | ||
|
||
@Override | ||
public @Nullable SettingsState getState() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public void loadState(@NotNull SettingsState state) { | ||
XmlSerializerUtil.copyBean(state, this); | ||
} | ||
override fun getState() = this | ||
override fun loadState(state: SettingsState) = XmlSerializerUtil.copyBean(state, this) | ||
} |
94 changes: 44 additions & 50 deletions
94
src/main/java/ir/mmd/intellijDev/Actionable/caret/movement/settings/SettingsState.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,80 +1,74 @@ | ||
package ir.mmd.intellijDev.Actionable.caret.movement.settings; | ||
package ir.mmd.intellijDev.Actionable.caret.movement.settings | ||
|
||
import com.intellij.openapi.components.PersistentStateComponent; | ||
import com.intellij.openapi.components.State; | ||
import com.intellij.openapi.components.Storage; | ||
import com.intellij.util.xmlb.XmlSerializerUtil; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import com.intellij.openapi.components.PersistentStateComponent | ||
import com.intellij.openapi.components.State | ||
import com.intellij.openapi.components.Storage | ||
import com.intellij.util.xmlb.XmlSerializerUtil | ||
|
||
/** | ||
* Settings State for {@code Actionable > Caret > Editing} | ||
* Settings State for `Actionable > Caret > Editing` | ||
*/ | ||
@State( | ||
name = "ir.mmd.intellijDev.Actionable.caret.movement.settings.SettingsState", | ||
storages = @Storage("Actionable.CaretMovementSettingsState.xml") | ||
storages = [Storage("Actionable.CaretMovementSettingsState.xml")] | ||
) | ||
public class SettingsState implements PersistentStateComponent<SettingsState> { | ||
class SettingsState : PersistentStateComponent<SettingsState?> { | ||
/** | ||
* <b>enum</b><br> | ||
* for behaviour of <code>move caret ...</code> actions<br> | ||
* see {@link UI} for what these constants mean | ||
* **enum** | ||
* | ||
* for behaviour of `move caret ...` actions | ||
* | ||
* see [UI] for what these constants mean | ||
*/ | ||
public enum WSBehaviour { | ||
enum class WSBehaviour { | ||
/** | ||
* Example of moving caret with this mode | ||
* <pre> | ||
* hello| world from java | ||
* hello |world from java | ||
* hello world| from java | ||
* hello world |from java | ||
* ... | ||
* </pre> | ||
* ``` | ||
* hello| world from java | ||
* hello |world from java | ||
* hello world| from java | ||
* hello world |from java | ||
* ... | ||
* ``` | ||
*/ | ||
StopAtCharTypeChange, | ||
|
||
/** | ||
* Example of moving caret with this mode | ||
* <pre> | ||
* hello| world from java | ||
* hello world| from java | ||
* hello world from| java | ||
* hello world from java| | ||
* ... | ||
* </pre> | ||
* ``` | ||
* hello| world from java | ||
* hello world| from java | ||
* hello world from| java | ||
* hello world from java| | ||
* ... | ||
* ``` | ||
*/ | ||
StopAtNextSameCharType | ||
} | ||
|
||
public enum SEMBehaviour { | ||
enum class SEMBehaviour { | ||
Start, Offset, End | ||
} | ||
|
||
/** | ||
* this class holds default values for settings | ||
*/ | ||
public static class Defaults { | ||
public static final @NotNull String wordSeparators = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?\n\t"; | ||
public static final @NotNull WSBehaviour wordSeparatorsBehaviour = WSBehaviour.StopAtCharTypeChange; | ||
public static final @NotNull String hardStopSeparators = " "; | ||
public static final @NotNull SettingsState.SEMBehaviour sameElementMovementBehaviour = SEMBehaviour.Start; | ||
object Defaults { | ||
const val wordSeparators: String = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?\n\t" | ||
|
||
@JvmField | ||
val wordSeparatorsBehaviour: WSBehaviour = WSBehaviour.StopAtCharTypeChange | ||
const val hardStopSeparators: String = " " | ||
|
||
@JvmField | ||
val sameElementMovementBehaviour: SEMBehaviour = SEMBehaviour.Start | ||
} | ||
|
||
public @NotNull String wordSeparators = Defaults.wordSeparators; | ||
|
||
public @NotNull WSBehaviour wordSeparatorsBehaviour = Defaults.wordSeparatorsBehaviour; | ||
|
||
public @NotNull String hardStopCharacters = Defaults.hardStopSeparators; | ||
var wordSeparators: String = Defaults.wordSeparators | ||
var wordSeparatorsBehaviour: WSBehaviour = Defaults.wordSeparatorsBehaviour | ||
var hardStopCharacters: String = Defaults.hardStopSeparators | ||
var sameElementMovementBehaviour: SEMBehaviour = Defaults.sameElementMovementBehaviour | ||
|
||
public @NotNull SettingsState.SEMBehaviour sameElementMovementBehaviour = Defaults.sameElementMovementBehaviour; | ||
|
||
@Override | ||
public @Nullable SettingsState getState() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public void loadState(@NotNull SettingsState state) { | ||
XmlSerializerUtil.copyBean(state, this); | ||
} | ||
override fun getState() = this | ||
override fun loadState(state: SettingsState) = XmlSerializerUtil.copyBean(state, this) | ||
} |
36 changes: 14 additions & 22 deletions
36
src/main/java/ir/mmd/intellijDev/Actionable/find/settings/SettingsState.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,28 @@ | ||
package ir.mmd.intellijDev.Actionable.find.settings; | ||
package ir.mmd.intellijDev.Actionable.find.settings | ||
|
||
import com.intellij.openapi.components.PersistentStateComponent; | ||
import com.intellij.openapi.components.State; | ||
import com.intellij.openapi.components.Storage; | ||
import com.intellij.util.xmlb.XmlSerializerUtil; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import com.intellij.openapi.components.PersistentStateComponent | ||
import com.intellij.openapi.components.State | ||
import com.intellij.openapi.components.Storage | ||
import com.intellij.util.xmlb.XmlSerializerUtil | ||
|
||
/** | ||
* Settings State for {@code Actionable > Find} | ||
* Settings State for `Actionable > Find` | ||
*/ | ||
@State( | ||
name = "ir.mmd.intellijDev.Actionable.find.settings.SettingsState", | ||
storages = @Storage("Actionable.FindSettingsState.xml") | ||
storages = [Storage("Actionable.FindSettingsState.xml")] | ||
) | ||
public class SettingsState implements PersistentStateComponent<SettingsState> { | ||
class SettingsState : PersistentStateComponent<SettingsState?> { | ||
/** | ||
* This class contains the default values for the settings | ||
*/ | ||
public static class Defaults { | ||
public static final boolean IS_CASE_SENSITIVE = true; | ||
@Suppress("ConstPropertyName") | ||
object Defaults { | ||
const val isCaseSensitive: Boolean = true | ||
} | ||
|
||
public boolean isCaseSensitive = Defaults.IS_CASE_SENSITIVE; | ||
var isCaseSensitive: Boolean = Defaults.isCaseSensitive | ||
|
||
@Override | ||
public @Nullable SettingsState getState() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public void loadState(@NotNull SettingsState state) { | ||
XmlSerializerUtil.copyBean(state, this); | ||
} | ||
override fun getState() = this | ||
override fun loadState(state: SettingsState) = XmlSerializerUtil.copyBean(state, this) | ||
} |
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
32 changes: 11 additions & 21 deletions
32
src/main/java/ir/mmd/intellijDev/Actionable/lang/html/settings/SettingsState.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,30 +1,20 @@ | ||
package ir.mmd.intellijDev.Actionable.lang.html.settings; | ||
package ir.mmd.intellijDev.Actionable.lang.html.settings | ||
|
||
import com.intellij.openapi.components.PersistentStateComponent; | ||
import com.intellij.openapi.components.State; | ||
import com.intellij.openapi.components.Storage; | ||
import com.intellij.util.xmlb.XmlSerializerUtil; | ||
import ir.mmd.intellijDev.Actionable.lang.html.type.ExpandTagOnType; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import com.intellij.openapi.components.PersistentStateComponent | ||
import com.intellij.openapi.components.State | ||
import com.intellij.openapi.components.Storage | ||
import com.intellij.util.xmlb.XmlSerializerUtil | ||
|
||
@State( | ||
name = "ir.mmd.intellijDev.Actionable.lang.html.settings.SettingsState", | ||
storages = @Storage("Actionable.Lang.HTML.SettingsState.xml") | ||
storages = [Storage("Actionable.Lang.HTML.SettingsState.xml")] | ||
) | ||
public class SettingsState implements PersistentStateComponent<SettingsState> { | ||
class SettingsState : PersistentStateComponent<SettingsState?> { | ||
/** | ||
* @see ExpandTagOnType | ||
* @see ir.mmd.intellijDev.Actionable.lang.html.type.ExpandTagOnType | ||
*/ | ||
public boolean expandTagOnTypeEnabled = false; | ||
var expandTagOnTypeEnabled: Boolean = false | ||
|
||
@Override | ||
public @Nullable SettingsState getState() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public void loadState(@NotNull SettingsState state) { | ||
XmlSerializerUtil.copyBean(state, this); | ||
} | ||
override fun getState() = this | ||
override fun loadState(state: SettingsState) = XmlSerializerUtil.copyBean(state, this) | ||
} |
Oops, something went wrong.