add ide plugin marketplace mechanism
Signed-off-by: pengzhile <pengzhile@gmail.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import com.intellij.openapi.wm.ToolWindowManager;
|
||||
import com.intellij.openapi.wm.ex.ToolWindowManagerEx;
|
||||
import io.zhile.research.intellij.ier.component.ResetTimer;
|
||||
import io.zhile.research.intellij.ier.helper.Constants;
|
||||
import io.zhile.research.intellij.ier.helper.CustomRepository;
|
||||
import io.zhile.research.intellij.ier.helper.ProjectHelper;
|
||||
import io.zhile.research.intellij.ier.tw.MainToolWindowFactory;
|
||||
import io.zhile.research.intellij.ier.ui.dialog.MainDialog;
|
||||
@@ -26,6 +27,8 @@ public class ResetAction extends AnAction implements DumbAware {
|
||||
public ResetAction() {
|
||||
super(ACTION_NAME, "Reset my IDE eval information", AllIcons.General.Reset);
|
||||
new ResetTimer().start(this);
|
||||
|
||||
CustomRepository.checkAndAdd(CustomRepository.DEFAULT_HOST);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package io.zhile.research.intellij.ier.helper;
|
||||
|
||||
import com.intellij.openapi.updateSettings.impl.UpdateSettings;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CustomRepository {
|
||||
public static final String DEFAULT_HOST = "https://plugins.zhile.io";
|
||||
|
||||
public static void checkAndAdd(@NotNull String host) {
|
||||
List<String> hosts = UpdateSettings.getInstance().getStoredPluginHosts();
|
||||
if (hosts.stream().anyMatch(s -> s.equalsIgnoreCase(host))) {
|
||||
return;
|
||||
}
|
||||
|
||||
hosts.add(host);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user