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 #648 & replace deprecated methods #652

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -99,6 +99,8 @@ public NavigatorTabsPanel(ToolWindow toolWindow, Project project) {

setContent(tabs);

NAVIGATOR_TABS_PANEL_DISPOSABLE_MAP.put(id, this);

ApplicationManager.getApplication().executeOnPooledThread(() -> {
User user = getUser();
if (user.isSignedIn()) {
Expand Down Expand Up @@ -148,9 +150,6 @@ public void change(Config oldConfig, Config newConfig) {
Disposer.register(this, (Disposable) n);
}
}

NAVIGATOR_TABS_PANEL_DISPOSABLE_MAP.put(id, this);

}

public void toggle() {
Expand Down
76 changes: 40 additions & 36 deletions src/main/java/icons/LeetCodeEditorIcons.java
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compatible with the historical version of IDE, do not change this API for now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pluginSinceBuild: 203.0

com.intellij.openapi.util.IconLoader#getIcon(java.lang.String, java.lang.Class<?>) already exists in version 202.8194.7 and it is not marked @ deprecated in version 223.

Of course, you can also use IntelliJ Plugin Verifier to verify compatibility. (I have verified its compatibility in my plugin (V) (°,,,,°) (V))

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have modified this API in a certain version, but the display effect is not as expected. I am not sure which version of the IDE has been fixed. 😟

Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,45 @@
* @author shuzijun
*/
public interface LeetCodeEditorIcons {

Icon LEETCODE_TOOL_WINDOW = IconLoader.getIcon("/icons/LeetCode.svg");
Icon EMPEROR_NEW_CLOTHES = IconLoader.getIcon("/icons/emperor_new_clothes.svg");

Icon CLEAN = IconLoader.getIcon("/icons/clean.svg");
Icon CLEAR = IconLoader.getIcon("/icons/clear.svg");
Icon COLLAPSE = IconLoader.getIcon("/icons/collapse.svg");
Icon CONFIG = IconLoader.getIcon("/icons/config_lc.svg");
Icon DESC = IconLoader.getIcon("/icons/desc.svg");
Icon EDIT_DOC = IconLoader.getIcon("/icons/edit_doc.svg");
Icon FAVORITE = IconLoader.getIcon("/icons/favorite.svg");
Icon FILTER = IconLoader.getIcon("/icons/filter.svg");
Icon FIND = IconLoader.getIcon("/icons/find.svg");
Icon HELP = IconLoader.getIcon("/icons/help.svg");
Icon HISTORY = IconLoader.getIcon("/icons/history.svg");
Icon LOGIN = IconLoader.getIcon("/icons/login.svg");
Icon LOGOUT = IconLoader.getIcon("/icons/logout.svg");
Icon POPUP = IconLoader.getIcon("/icons/popup.svg");
Icon POSITION = IconLoader.getIcon("/icons/position.svg");
Icon PROGRESS = IconLoader.getIcon("/icons/progress.svg");
Icon QUESTION = IconLoader.getIcon("/icons/question.svg");
Icon RANDOM = IconLoader.getIcon("/icons/random.svg");
Icon REFRESH = IconLoader.getIcon("/icons/refresh.svg");
Icon RUN = IconLoader.getIcon("/icons/run.svg");
Icon SOLUTION = IconLoader.getIcon("/icons/solution.svg");
Icon SUBMIT = IconLoader.getIcon("/icons/submit.svg");
Icon TIME = IconLoader.getIcon("/icons/time.svg");
Icon SORT_ASC = IconLoader.getIcon("/icons/sortAsc.svg");
Icon SORT_DESC = IconLoader.getIcon("/icons/sortDesc.svg");
Icon NOTE = IconLoader.getIcon("/icons/note.svg");
Icon LCV = IconLoader.getIcon("/icons/lcv.svg");
Icon DONATE = IconLoader.getIcon("/icons/donate.svg");
Icon SHARE = IconLoader.getIcon("/icons/share.svg");
Icon TOGGLE = IconLoader.getIcon("/icons/toggle.svg");
Icon SHOW = IconLoader.getIcon("/icons/show.svg");
Icon PULL = IconLoader.getIcon("/icons/pull.svg");
Icon PUSH = IconLoader.getIcon("/icons/push.svg");
Icon LEETCODE_TOOL_WINDOW = getIcon("/icons/LeetCode.svg");
Icon EMPEROR_NEW_CLOTHES = getIcon("/icons/emperor_new_clothes.svg");

Icon CLEAN = getIcon("/icons/clean.svg");
Icon CLEAR = getIcon("/icons/clear.svg");
Icon COLLAPSE = getIcon("/icons/collapse.svg");
Icon CONFIG = getIcon("/icons/config_lc.svg");
Icon DESC = getIcon("/icons/desc.svg");
Icon EDIT_DOC = getIcon("/icons/edit_doc.svg");
Icon FAVORITE = getIcon("/icons/favorite.svg");
Icon FILTER = getIcon("/icons/filter.svg");
Icon FIND = getIcon("/icons/find.svg");
Icon HELP = getIcon("/icons/help.svg");
Icon HISTORY = getIcon("/icons/history.svg");
Icon LOGIN = getIcon("/icons/login.svg");
Icon LOGOUT = getIcon("/icons/logout.svg");
Icon POPUP = getIcon("/icons/popup.svg");
Icon POSITION = getIcon("/icons/position.svg");
Icon PROGRESS = getIcon("/icons/progress.svg");
Icon QUESTION = getIcon("/icons/question.svg");
Icon RANDOM = getIcon("/icons/random.svg");
Icon REFRESH = getIcon("/icons/refresh.svg");
Icon RUN = getIcon("/icons/run.svg");
Icon SOLUTION = getIcon("/icons/solution.svg");
Icon SUBMIT = getIcon("/icons/submit.svg");
Icon TIME = getIcon("/icons/time.svg");
Icon SORT_ASC = getIcon("/icons/sortAsc.svg");
Icon SORT_DESC = getIcon("/icons/sortDesc.svg");
Icon NOTE = getIcon("/icons/note.svg");
Icon LCV = getIcon("/icons/lcv.svg");
Icon DONATE = getIcon("/icons/donate.svg");
Icon SHARE = getIcon("/icons/share.svg");
Icon TOGGLE = getIcon("/icons/toggle.svg");
Icon SHOW = getIcon("/icons/show.svg");
Icon PULL = getIcon("/icons/pull.svg");
Icon PUSH = getIcon("/icons/push.svg");

static Icon getIcon(String path) {
return IconLoader.getIcon(path, LeetCodeEditorIcons.class);
}
}