This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from d-wojciechowski/dev
0.8.0 release
- Loading branch information
Showing
43 changed files
with
451 additions
and
257 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Plugin Verification | ||
|
||
# on: | ||
# pull_request: | ||
# branches: [ master, dev ] | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: submodules-init | ||
uses: snickerbockers/submodules-init@v4 | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew build | ||
|
||
- name: Verify Plugin on IntelliJ Platforms | ||
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' | ||
id: verify | ||
uses: ChrisCarini/[email protected] | ||
with: | ||
ide-versions: | | ||
ideaIC:2020.1 | ||
ideaIC:LATEST-EAP-SNAPSHOT | ||
- name: Get log file path and print contents | ||
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' | ||
run: | | ||
echo "The verifier log file [${{steps.verify.outputs.verification-output-log-filename}}] contents : " ; | ||
cat ${{steps.verify.outputs.verification-output-log-filename}} |
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
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
34 changes: 34 additions & 0 deletions
34
src/main/kotlin/pl/dwojciechowski/action/RemoteCommandAction.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,34 @@ | ||
package pl.dwojciechowski.action | ||
|
||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.project.DumbAwareAction | ||
import com.intellij.openapi.project.Project | ||
import kotlinx.coroutines.GlobalScope | ||
import kotlinx.coroutines.launch | ||
import pl.dwojciechowski.action.utils.ActionSubscription | ||
import pl.dwojciechowski.model.ServerStatus | ||
|
||
abstract class RemoteCommandAction : DumbAwareAction() { | ||
|
||
private val actionSubscription = ActionSubscription() | ||
private var isEnabled = false | ||
|
||
abstract fun action(project: Project) | ||
abstract fun isEnabled(status: ServerStatus, statusControlled: Boolean): Boolean | ||
|
||
override fun update(e: AnActionEvent) { | ||
actionSubscription.subscriptionRoutine(e) { status, statusControlled -> | ||
isEnabled = isEnabled(status, statusControlled) | ||
} | ||
e.presentation.isEnabled = isEnabled | ||
} | ||
|
||
override fun actionPerformed(e: AnActionEvent) { | ||
GlobalScope.launch { | ||
e.project?.let { | ||
action(it) | ||
} | ||
} | ||
} | ||
|
||
} |
20 changes: 5 additions & 15 deletions
20
src/main/kotlin/pl/dwojciechowski/action/RestartWncAction.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,27 +1,17 @@ | ||
package pl.dwojciechowski.action | ||
|
||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.project.DumbAwareAction | ||
import pl.dwojciechowski.action.utils.ActionSubscription | ||
import com.intellij.openapi.project.Project | ||
import pl.dwojciechowski.model.ServerStatus | ||
import pl.dwojciechowski.service.RemoteService | ||
|
||
class RestartWncAction : DumbAwareAction() { | ||
|
||
private val actionSubscription = ActionSubscription() | ||
class RestartWncAction : RemoteCommandAction() { | ||
|
||
private val enabledStatusList = listOf(ServerStatus.RUNNING) | ||
private var isEnabled = false | ||
|
||
override fun update(e: AnActionEvent) { | ||
actionSubscription.subscriptionRoutine(e) { status, statusControlled -> | ||
isEnabled = !statusControlled || status == ServerStatus.NOT_SCANNING || enabledStatusList.contains(status) | ||
} | ||
e.presentation.isEnabled = isEnabled | ||
} | ||
override fun action(project: Project) = RemoteService.getInstance(project).restartWnc() | ||
|
||
override fun actionPerformed(e: AnActionEvent) { | ||
e.project?.let { RemoteService.getInstance(it).restartWnc() } | ||
override fun isEnabled(status: ServerStatus, statusControlled: Boolean): Boolean { | ||
return !statusControlled || status == ServerStatus.NOT_SCANNING || enabledStatusList.contains(status) | ||
} | ||
|
||
} |
20 changes: 5 additions & 15 deletions
20
src/main/kotlin/pl/dwojciechowski/action/StartWncAction.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,27 +1,17 @@ | ||
package pl.dwojciechowski.action | ||
|
||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.project.DumbAwareAction | ||
import pl.dwojciechowski.action.utils.ActionSubscription | ||
import com.intellij.openapi.project.Project | ||
import pl.dwojciechowski.model.ServerStatus | ||
import pl.dwojciechowski.service.RemoteService | ||
|
||
class StartWncAction : DumbAwareAction() { | ||
|
||
private val actionSubscription = ActionSubscription() | ||
class StartWncAction : RemoteCommandAction() { | ||
|
||
private val disabledStatusList = listOf(ServerStatus.RUNNING) | ||
private var isEnabled = false | ||
|
||
override fun update(e: AnActionEvent) { | ||
actionSubscription.subscriptionRoutine(e) { status, statusControlled -> | ||
isEnabled = !statusControlled || status == ServerStatus.NOT_SCANNING || !disabledStatusList.contains(status) | ||
} | ||
e.presentation.isEnabled = isEnabled | ||
} | ||
override fun action(project: Project) = RemoteService.getInstance(project).startWnc() | ||
|
||
override fun actionPerformed(e: AnActionEvent) { | ||
e.project?.let { RemoteService.getInstance(it).startWnc() } | ||
override fun isEnabled(status: ServerStatus, statusControlled: Boolean): Boolean { | ||
return !statusControlled || status == ServerStatus.NOT_SCANNING || !disabledStatusList.contains(status) | ||
} | ||
|
||
} |
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,27 +1,17 @@ | ||
package pl.dwojciechowski.action | ||
|
||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.project.DumbAwareAction | ||
import pl.dwojciechowski.action.utils.ActionSubscription | ||
import com.intellij.openapi.project.Project | ||
import pl.dwojciechowski.model.ServerStatus | ||
import pl.dwojciechowski.service.RemoteService | ||
|
||
class StopWncAction : DumbAwareAction() { | ||
|
||
private val actionSubscription = ActionSubscription() | ||
class StopWncAction : RemoteCommandAction() { | ||
|
||
private val enabledStatusList = listOf(ServerStatus.RUNNING) | ||
private var isEnabled = false | ||
|
||
override fun update(e: AnActionEvent) { | ||
actionSubscription.subscriptionRoutine(e) { status, statusControlled -> | ||
isEnabled = !statusControlled || status == ServerStatus.NOT_SCANNING || enabledStatusList.contains(status) | ||
} | ||
e.presentation.isEnabled = isEnabled | ||
} | ||
override fun action(project: Project) = RemoteService.getInstance(project).stopWnc() | ||
|
||
override fun actionPerformed(e: AnActionEvent) { | ||
e.project?.let { RemoteService.getInstance(it).stopWnc() } | ||
override fun isEnabled(status: ServerStatus, statusControlled: Boolean): Boolean { | ||
return !statusControlled || status == ServerStatus.NOT_SCANNING || enabledStatusList.contains(status) | ||
} | ||
|
||
} |
20 changes: 5 additions & 15 deletions
20
src/main/kotlin/pl/dwojciechowski/action/XConfReloadWncAction.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,27 +1,17 @@ | ||
package pl.dwojciechowski.action | ||
|
||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.project.DumbAwareAction | ||
import pl.dwojciechowski.action.utils.ActionSubscription | ||
import com.intellij.openapi.project.Project | ||
import pl.dwojciechowski.model.ServerStatus | ||
import pl.dwojciechowski.service.RemoteService | ||
|
||
class XConfReloadWncAction : DumbAwareAction() { | ||
|
||
private val actionSubscription = ActionSubscription() | ||
class XConfReloadWncAction : RemoteCommandAction() { | ||
|
||
private val enabledStatusList = listOf(ServerStatus.RUNNING) | ||
private var isEnabled = false | ||
|
||
override fun update(e: AnActionEvent) { | ||
actionSubscription.subscriptionRoutine(e) { status, statusControlled -> | ||
isEnabled = !statusControlled || status == ServerStatus.NOT_SCANNING || enabledStatusList.contains(status) | ||
} | ||
e.presentation.isEnabled = isEnabled | ||
} | ||
override fun action(project: Project) = RemoteService.getInstance(project).xconf() | ||
|
||
override fun actionPerformed(e: AnActionEvent) { | ||
e.project?.let { RemoteService.getInstance(it).xconf() } | ||
override fun isEnabled(status: ServerStatus, statusControlled: Boolean): Boolean { | ||
return !statusControlled || status == ServerStatus.NOT_SCANNING || enabledStatusList.contains(status) | ||
} | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,5 +54,4 @@ class RemoteCommandProcessHandler( | |
} | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.