Skip to content

Commit

Permalink
Merge pull request #122 from dw-0/fix/MYPY-120
Browse files Browse the repository at this point in the history
fix: ActionUpdateThread deprecation warnings
  • Loading branch information
leinardi authored Oct 4, 2024
2 parents 410d620 + eae3833 commit 7c6576b
Show file tree
Hide file tree
Showing 16 changed files with 131 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

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 Down Expand Up @@ -79,11 +78,6 @@ public void update(final @NotNull AnActionEvent event) {
}
}

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

protected void setProgressText(final ToolWindow toolWindow, final String progressTextKey) {
actOnToolWindowPanel(toolWindow, panel -> panel.setProgressText(MypyBundle.message(progressTextKey)));
}
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,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.
*/

package com.leinardi.pycharm.mypy.actions;
Expand All @@ -34,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 All @@ -58,9 +66,4 @@ public void setSelected(final @NotNull AnActionEvent event, final boolean select
panel.filterDisplayedResults();
});
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
}
13 changes: 8 additions & 5 deletions src/main/java/com/leinardi/pycharm/mypy/actions/DisplayNote.java
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.
*/

package com.leinardi.pycharm.mypy.actions;
Expand All @@ -35,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 All @@ -59,9 +67,4 @@ public void setSelected(final @NotNull AnActionEvent event, final boolean select
panel.filterDisplayedResults();
});
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
}
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.
*/

package com.leinardi.pycharm.mypy.actions;
Expand All @@ -34,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 All @@ -58,9 +66,4 @@ public void setSelected(final @NotNull AnActionEvent event, final boolean select
panel.filterDisplayedResults();
});
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
}
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,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.
*/

package com.leinardi.pycharm.mypy.actions;
Expand All @@ -33,6 +36,11 @@
*/
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 Expand Up @@ -78,9 +86,4 @@ public void setSelected(final AnActionEvent event, final boolean selected) {
((MypyToolWindowPanel) content.getComponent()).setScrollToSource(selected);
}
}

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

0 comments on commit 7c6576b

Please sign in to comment.