Skip to content

Commit

Permalink
fix: ActionUpdateThread deprecation warnings
Browse files Browse the repository at this point in the history
fixes #120

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
  • Loading branch information
dw-0 committed Oct 3, 2024
1 parent ef091d7 commit 690487c
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 3 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

import org.commonmark.node.Node
Expand All @@ -32,7 +35,7 @@ buildscript {
}

plugins {
id 'org.jetbrains.intellij' version '1.15.0'
id 'org.jetbrains.intellij' version '1.17.4'
id 'net.ltgt.errorprone' version '3.1.0'
id 'idea'
id 'java'
Expand Down
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
version=0.16.2
ideVersion=PC-2022.1.4
# Modifications:
# - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
#
version=0.16.3
ideVersion=PC-2023.1.3
pythonPlugin=python-ce
sinceBuild=221.6008
untilBuild=
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/leinardi/pycharm/mypy/actions/ClearAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.leinardi.pycharm.mypy.toolwindow.MypyToolWindowPanel;
import org.jetbrains.annotations.NotNull;
Expand All @@ -28,6 +32,11 @@
*/
public class ClearAll extends BaseAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> actOnToolWindowPanel(toolWindow(project),
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/leinardi/pycharm/mypy/actions/Close.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import org.jetbrains.annotations.NotNull;

Expand All @@ -26,6 +30,11 @@
*/
public class Close extends BaseAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> toolWindow(project).hide(null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.leinardi.pycharm.mypy.toolwindow.MypyToolWindowPanel;
import org.jetbrains.annotations.NotNull;
Expand All @@ -28,6 +32,11 @@
*/
public class CollapseAll extends BaseAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> actOnToolWindowPanel(toolWindow(project),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareToggleAction;
import com.intellij.openapi.project.Project;
Expand All @@ -33,6 +37,11 @@
*/
public class DisplayErrors extends DumbAwareToggleAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public boolean isSelected(final @NotNull AnActionEvent event) {
final Project project = getEventProject(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.DumbAwareToggleAction;
Expand All @@ -34,6 +38,11 @@
*/
public class DisplayNote extends DumbAwareToggleAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public boolean isSelected(final AnActionEvent event) {
final Project project = PlatformDataKeys.PROJECT.getData(event.getDataContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareToggleAction;
import com.intellij.openapi.project.Project;
Expand All @@ -33,6 +37,11 @@
*/
public class DisplayWarnings extends DumbAwareToggleAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public boolean isSelected(final @NotNull AnActionEvent event) {
final Project project = getEventProject(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.leinardi.pycharm.mypy.toolwindow.MypyToolWindowPanel;
import org.jetbrains.annotations.NotNull;
Expand All @@ -28,6 +32,11 @@
*/
public class ExpandAll extends BaseAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> actOnToolWindowPanel(toolWindow(project), MypyToolWindowPanel::expandTree));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.diagnostic.Logger;
Expand All @@ -39,6 +43,11 @@ public class ScanCurrentChangeList extends BaseAction {

private static final Logger LOG = Logger.getInstance(ScanCurrentChangeList.class);

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

@Override
public final void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.editor.Editor;
Expand All @@ -37,6 +41,11 @@
*/
public class ScanCurrentFile extends BaseAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

@Override
public void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.diagnostic.Logger;
Expand All @@ -36,6 +40,11 @@ public class ScanModifiedFiles extends BaseAction {

private static final Logger LOG = Logger.getInstance(ScanModifiedFiles.class);

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

@Override
public final void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.application.ReadAction;
Expand All @@ -39,6 +43,11 @@
*/
public class ScanModule extends BaseAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

@Override
public final void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.application.ReadAction;
Expand All @@ -33,6 +37,11 @@
*/
public class ScanProject extends BaseAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}

@Override
public void actionPerformed(final @NotNull AnActionEvent event) {
project(event).ifPresent(project -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modifications:
* - 2024-10-03: Modified by Dominik Willner to fix ActionUpdateThread deprecation warnings.
*/

package com.leinardi.pycharm.mypy.actions;

import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.DumbAwareToggleAction;
Expand All @@ -25,12 +29,18 @@
import com.intellij.ui.content.Content;
import com.leinardi.pycharm.mypy.MypyPlugin;
import com.leinardi.pycharm.mypy.toolwindow.MypyToolWindowPanel;
import org.jetbrains.annotations.NotNull;

/**
* Toggle the scroll to source setting.
*/
public final class ScrollToSource extends DumbAwareToggleAction {

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}

@Override
public boolean isSelected(final AnActionEvent event) {
final Project project = PlatformDataKeys.PROJECT.getData(event.getDataContext());
Expand Down
Loading

0 comments on commit 690487c

Please sign in to comment.