Skip to content

Commit

Permalink
open Artemis tool window on project load
Browse files Browse the repository at this point in the history
  • Loading branch information
Feuermagier committed Sep 20, 2024
1 parent 04cb848 commit 8557766
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* Licensed under EPL-2.0 2024. */
package edu.kit.kastel.extensions.settings;

import com.intellij.credentialStore.CredentialAttributes;
Expand Down Expand Up @@ -62,7 +63,7 @@ private CredentialAttributes createCredentialAttributes(String key) {
}

private void waitForInitialization() {
synchronized(this) {
synchronized (this) {
while (!initialized) {
try {
this.wait();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/* Licensed under EPL-2.0 2024. */
package edu.kit.kastel.extensions.settings;

import java.util.Objects;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JSeparator;

import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
Expand All @@ -19,12 +26,6 @@
import net.miginfocom.swing.MigLayout;
import org.jetbrains.annotations.Nullable;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JSeparator;
import java.util.Objects;

/**
* This class implements the settings Dialog for this PlugIn.
* Everything directly related to the Setting UI should be in here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
import java.awt.Color;
import java.util.Date;

import com.intellij.credentialStore.CredentialAttributes;
import com.intellij.credentialStore.CredentialAttributesKt;
import com.intellij.credentialStore.Credentials;
import com.intellij.ide.passwordSafe.PasswordSafe;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.ui.JBColor;
import com.intellij.util.xmlb.XmlSerializer;
import com.intellij.util.xmlb.XmlSerializerUtil;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* Licensed under EPL-2.0 2024. */
package edu.kit.kastel.listeners;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.ProjectActivity;
import com.intellij.openapi.wm.ToolWindowManager;
import edu.kit.kastel.highlighter.HighlighterManager;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
Expand All @@ -15,6 +17,12 @@ public class OnStartupCompleted implements ProjectActivity, DumbAware {
@Override
public Object execute(@NotNull Project project, @NotNull Continuation<? super Unit> continuation) {
HighlighterManager.initialize();

// Open the Artemis tool window
ApplicationManager.getApplication().invokeLater(() -> ToolWindowManager.getInstance(project)
.getToolWindow("Artemis")
.show());

return null;
}
}
9 changes: 5 additions & 4 deletions src/main/java/edu/kit/kastel/login/CefUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* Licensed under EPL-2.0 2024. */
package edu.kit.kastel.login;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;

import javax.swing.SwingUtilities;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.Disposer;
import com.intellij.ui.jcef.JBCefApp;
Expand All @@ -11,10 +16,6 @@
import org.cef.CefApp;
import org.cef.handler.CefFocusHandler;

import javax.swing.SwingUtilities;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;

public final class CefUtils {
private static JBCefClient browserClient = JBCefApp.getInstance().createClient();

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/edu/kit/kastel/state/ActiveAssessment.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ public void run(@NotNull ProgressIndicator indicator) {
return;
}
} else {
ArtemisUtils.displayGenericWarningBalloon("Autograder Already Loaded", "Not reloading it from the specified file. Restart the IDE to reload it.");
ArtemisUtils.displayGenericWarningBalloon(
"Autograder Already Loaded",
"Not reloading it from the specified file. Restart the IDE to reload it.");
}
}

Expand Down

0 comments on commit 8557766

Please sign in to comment.