From 79e1e3b4edbb4a0947f1b8bd53f7caf7b6fbc177 Mon Sep 17 00:00:00 2001 From: Pieter De Clercq Date: Sat, 20 Apr 2024 11:28:42 +0200 Subject: [PATCH] Fix some deprecations (#289) --- .../authentication/ui/DodonaLoginDialog.java | 30 +++++++++---------- .../details/SubmissionDetailsDialog.java | 16 +++++----- src/main/resources/META-INF/plugin.xml | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/main/java/io/github/thepieterdc/dodona/plugin/authentication/ui/DodonaLoginDialog.java b/src/main/java/io/github/thepieterdc/dodona/plugin/authentication/ui/DodonaLoginDialog.java index 28c5bae8..5a729a15 100644 --- a/src/main/java/io/github/thepieterdc/dodona/plugin/authentication/ui/DodonaLoginDialog.java +++ b/src/main/java/io/github/thepieterdc/dodona/plugin/authentication/ui/DodonaLoginDialog.java @@ -39,13 +39,13 @@ public final class DodonaLoginDialog extends DialogWrapper { @NonNls private static final String API_TOKEN_URL = "https://dodona-edu.github.io/guides/creating-an-api-token/"; - + private final DodonaLoginPanel loginPanel; - + private DodonaServer server; private String token; private User user; - + /** * DodonaLoginDialog constructor. * @@ -54,21 +54,21 @@ public final class DodonaLoginDialog extends DialogWrapper { */ public DodonaLoginDialog(@Nullable final Project project, @Nullable final Component parent) { - super(project, parent, false, IdeModalityType.PROJECT); - + super(project, parent, false, IdeModalityType.IDE); + this.loginPanel = new DodonaLoginPanel(project); - + this.setOKButtonText(DodonaBundle.message("auth.dialog.sign_in")); this.setTitle(DodonaBundle.message("auth.dialog.title")); this.init(); } - + @Nonnull @Override protected JComponent createCenterPanel() { return this.loginPanel; } - + @Nonnull @Override protected JPanel createSouthAdditionalPanel() { @@ -80,7 +80,7 @@ protected JPanel createSouthAdditionalPanel() { })) .addToRight(new JBLabel(AllIcons.Ide.External_link_arrow)); } - + @Override protected void doOKAction() { final EmptyProgressIndicator indicator = new EmptyProgressIndicator(ModalityState.stateForComponent(this.loginPanel)); @@ -96,18 +96,18 @@ protected void doOKAction() { } }); } - + @NotNull @Override protected List doValidateAll() { return this.loginPanel.doValidateAll(); } - + @Override public JComponent getPreferredFocusedComponent() { return this.loginPanel.getPreferredFocus(); } - + /** * Gets the server url. * @@ -117,7 +117,7 @@ public JComponent getPreferredFocusedComponent() { public DodonaServer getServer() { return this.server; } - + /** * Gets the authentication token. * @@ -126,7 +126,7 @@ public DodonaServer getServer() { public String getToken() { return this.token; } - + /** * Gets the authenticated user. * @@ -136,4 +136,4 @@ public String getToken() { public User getUser() { return this.user; } -} \ No newline at end of file +} diff --git a/src/main/java/io/github/thepieterdc/dodona/plugin/ui/resources/submission/details/SubmissionDetailsDialog.java b/src/main/java/io/github/thepieterdc/dodona/plugin/ui/resources/submission/details/SubmissionDetailsDialog.java index d98ef0ab..915118e6 100644 --- a/src/main/java/io/github/thepieterdc/dodona/plugin/ui/resources/submission/details/SubmissionDetailsDialog.java +++ b/src/main/java/io/github/thepieterdc/dodona/plugin/ui/resources/submission/details/SubmissionDetailsDialog.java @@ -27,9 +27,9 @@ */ public final class SubmissionDetailsDialog extends DialogWrapper { private static final Action[] NO_ACTIONS = {}; - + private final SubmissionDetailsPanel detailsPanel; - + /** * SubmissionCodeDialog constructor. * @@ -42,29 +42,29 @@ public SubmissionDetailsDialog(final Project project, final DodonaExecutorHolder executor, final SubmissionInfo submissionInfo, @Nullable final Component parent) { - super(project, parent, false, IdeModalityType.PROJECT); + super(project, parent, false, IdeModalityType.IDE); this.detailsPanel = new SubmissionDetailsPanel( project, executor, submissionInfo ); - + // Set the title of the dialog. this.setTitle(DodonaBundle.message("dialog.submission_details.title")); - + this.init(); } - + @NotNull @Override protected Action[] createActions() { return NO_ACTIONS; } - + @Nonnull @Override protected JComponent createCenterPanel() { return this.detailsPanel; } - + @Override public void dispose() { Disposer.dispose(this.detailsPanel); diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index f70dfae8..9742411f 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1,5 +1,5 @@ - + be.ugent.piedcler.dodona Dodona