Skip to content

Commit

Permalink
fix: corrected deprecated API (#254)
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Dietisheim <[email protected]>
  • Loading branch information
adietish committed Apr 19, 2024
1 parent 13eb6ac commit 44e19da
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
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 @@ -15,6 +15,7 @@
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectUtil;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vfs.LocalFileSystem;
Expand Down Expand Up @@ -230,7 +231,8 @@ private VirtualFile[] getModuleRoots(Module module) {
roots.add(getModuleRootAsDirectory(contentRoot));
}
if (roots.isEmpty()) {
roots.add(getModuleRootAsDirectory(LocalFileSystem.getInstance().findFileByPath(new File(module.getModuleFilePath()).getParent())));
VirtualFile moduleDir = ProjectUtil.guessModuleDir(module);
roots.add(moduleDir);
}
return roots.toArray(new VirtualFile[roots.size()]);
}
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

0 comments on commit 44e19da

Please sign in to comment.