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: corrected deprecated API (#254) #255

Merged
merged 1 commit into from
Apr 22, 2024
Merged
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 @@ -48,7 +48,7 @@ public FuncActionPipeline(String name, Project project, Function function){
this.startTime = System.currentTimeMillis();
this.endTime = -1;
this.actionTasks = new ArrayList<>();
this.stateIcon = new Icon[]{new AnimatedIcon.FS()};
this.stateIcon = new Icon[]{new AnimatedIcon.Default()};
this.state = new String[]{"run tasks ..."};
this.listenerList = new ArrayList<>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected ProcessListener buildProcessListener() {
@Override
public void startNotified(@NotNull ProcessEvent event) {
startTime = System.currentTimeMillis();
stateIcon = new Icon[]{new AnimatedIcon.FS()};
stateIcon = new Icon[]{new AnimatedIcon.Default()};
state = new String[]{""};
FuncActionTask.this.pipeline.fireChangeRunningStep();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected ProcessListener buildProcessListener() {
@Override
public void startNotified(@NotNull ProcessEvent event) {
startTime = System.currentTimeMillis();
stateIcon = new Icon[]{new AnimatedIcon.FS()};
stateIcon = new Icon[]{new AnimatedIcon.Default()};
state = new String[]{""};
pipeline.fireChangeRunningStep();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Function;
import com.redhat.devtools.intellij.common.tree.LabelAndIconDescriptor;
Expand All @@ -33,7 +34,6 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import javax.swing.Icon;
import org.apache.commons.codec.binary.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -249,9 +249,9 @@ private boolean hasContextChanged(Config newConfig, Config currentConfig) {
private boolean hasServerChanged(NamedContext newContext, NamedContext currentContext) {
return newContext == null
|| currentContext == null
|| !StringUtils.equals(currentContext.getContext().getCluster(), newContext.getContext().getCluster())
|| !StringUtils.equals(currentContext.getContext().getUser(), newContext.getContext().getUser())
|| !StringUtils.equals(currentContext.getContext().getNamespace(), newContext.getContext().getNamespace());
|| !StringUtil.equals(currentContext.getContext().getCluster(), newContext.getContext().getCluster())
|| !StringUtil.equals(currentContext.getContext().getUser(), newContext.getContext().getUser())
|| !StringUtil.equals(currentContext.getContext().getNamespace(), newContext.getContext().getNamespace());
}

private boolean hasNewToken(NamedContext newContext, Config newConfig, NamedContext currentContext, Config currentConfig) {
Expand All @@ -267,7 +267,7 @@ private boolean hasNewToken(NamedContext newContext, Config newConfig, NamedCont
return false;
}
String currentToken = KubeConfigUtils.getUserToken(currentConfig, currentContext.getContext());
return !StringUtils.equals(newToken, currentToken);
return !StringUtil.equals(newToken, currentToken);
}

protected void refresh() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.openapi.wm.ex.ToolWindowManagerListener;
import com.intellij.openapi.wm.impl.ToolWindowManagerImpl;
import com.intellij.ui.content.ContentManager;
import com.redhat.devtools.intellij.common.gettingstarted.GettingStartedContent;
import com.redhat.devtools.intellij.common.gettingstarted.GettingStartedCourse;
import com.redhat.devtools.intellij.common.gettingstarted.GettingStartedCourseBuilder;
Expand All @@ -38,7 +39,8 @@ public class GettingStartedToolWindow implements ToolWindowFactory {
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
toolWindow.setIcon(AllIcons.Toolwindows.Documentation);
toolWindow.setStripeTitle("Getting Started");
((ToolWindowManagerImpl)ToolWindowManager.getInstance(project)).addToolWindowManagerListener(new ToolWindowManagerListener() {
ContentManager manager = toolWindow.getContentManager();
project.getMessageBus().connect(manager).subscribe(ToolWindowManagerListener.TOPIC, new ToolWindowManagerListener() {
@Override
public void stateChanged(@NotNull ToolWindowManager toolWindowManager) {
if (hasToShowToolWindow()) {
Expand Down
Loading