|
|
|
@ -12,6 +12,7 @@ import io.zhile.research.intellij.ier.common.Resetter;
|
|
|
|
|
import io.zhile.research.intellij.ier.helper.Constants;
|
|
|
|
|
import io.zhile.research.intellij.ier.helper.NotificationHelper;
|
|
|
|
|
import io.zhile.research.intellij.ier.helper.PluginHelper;
|
|
|
|
|
import io.zhile.research.intellij.ier.helper.ResetTimeHelper;
|
|
|
|
|
import io.zhile.research.intellij.ier.tw.MainToolWindowFactory;
|
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
|
|
|
|
|
@ -42,23 +43,25 @@ public class PluginListener implements DynamicPluginListener, PluginStateListene
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void pluginLoaded(@NotNull IdeaPluginDescriptor pluginDescriptor) {
|
|
|
|
|
if (!PluginHelper.myself(pluginDescriptor)) {
|
|
|
|
|
public void pluginLoaded(@NotNull IdeaPluginDescriptor descriptor) {
|
|
|
|
|
if (!PluginHelper.myself(descriptor)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ActionManager.getInstance().getAction(Constants.RESET_ACTION_ID);
|
|
|
|
|
|
|
|
|
|
String link = "https://zhile.io/2020/11/18/jetbrains-eval-reset-da33a93d.html";
|
|
|
|
|
String autoResetTip = "Auto reset switch state: " + (Resetter.isAutoReset() ? "<b>on</b>" : "<b>off<b>");
|
|
|
|
|
String autoLogoutTip = "Auto logout switch state: " + (Resetter.isAutoLogout() ? "<b>on</b>" : "<b>off<b>");
|
|
|
|
|
String content = String.format("Plugin installed successfully!<br>For more information, visit <a href='%s'>this link</a>.<br><br>%s<br>%s", link, autoResetTip, autoLogoutTip);
|
|
|
|
|
String versionTip = "Plugin version: <b>v" + descriptor.getVersion() + "</b>";
|
|
|
|
|
String autoResetTip = "Auto reset option state: " + (Resetter.isAutoReset() ? "<b>on</b>" : "<b>off</b>");
|
|
|
|
|
String autoLogoutTip = "Auto logout option state: " + (Resetter.isAutoLogout() ? "<b>on</b>" : "<b>off</b>");
|
|
|
|
|
String lastResetTime = "Last reset time: <b>" + ResetTimeHelper.getLastResetTimeStr() + "</b>";
|
|
|
|
|
String content = String.format("Plugin installed successfully!<br>For more information, <a href='%s'>visit here</a>.<br><br>%s<br>%s<br>%s<br>%s", link, versionTip, autoResetTip, autoLogoutTip, lastResetTime);
|
|
|
|
|
NotificationHelper.showInfo(null, content);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void beforePluginUnload(@NotNull IdeaPluginDescriptor pluginDescriptor, boolean isUpdate) {
|
|
|
|
|
if (!PluginHelper.myself(pluginDescriptor)) {
|
|
|
|
|
public void beforePluginUnload(@NotNull IdeaPluginDescriptor descriptor, boolean isUpdate) {
|
|
|
|
|
if (!PluginHelper.myself(descriptor)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|