mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
35 lines
1.2 KiB
Java
35 lines
1.2 KiB
Java
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
|
package com.intellij.platform.execution.serviceView;
|
|
|
|
import com.intellij.openapi.actionSystem.ActionUpdateThread;
|
|
import com.intellij.openapi.actionSystem.AnActionEvent;
|
|
import com.intellij.openapi.actionSystem.Presentation;
|
|
import com.intellij.openapi.project.DumbAwareAction;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import static com.intellij.platform.execution.serviceView.ServiceViewActionProvider.getSelectedView;
|
|
|
|
final class JumpToServicesAction extends DumbAwareAction {
|
|
|
|
@Override
|
|
public void actionPerformed(@NotNull AnActionEvent e) {
|
|
ServiceView selectedView = getSelectedView(e);
|
|
if (selectedView == null) return;
|
|
|
|
selectedView.jumpToServices();
|
|
}
|
|
|
|
@Override
|
|
public @NotNull ActionUpdateThread getActionUpdateThread() {
|
|
return ActionUpdateThread.BGT;
|
|
}
|
|
|
|
@Override
|
|
public void update(@NotNull AnActionEvent e) {
|
|
Presentation presentation = e.getPresentation();
|
|
presentation.setVisible(false);
|
|
ServiceView selectedView = getSelectedView(e);
|
|
presentation.setEnabled(selectedView != null && !(selectedView.getModel() instanceof ServiceViewModel.SingeServiceModel));
|
|
}
|
|
}
|