Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ActionUpdateThread deprecation warnings #122

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading