generated from dynatrace-oss/template-project
-
Notifications
You must be signed in to change notification settings - Fork 2
[DQL] Improving DQL execution services #124
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
src/main/java/pl/thedeem/intellij/common/services/ManagedServiceGroup.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,4 @@ | ||
| package pl.thedeem.intellij.common.services; | ||
|
|
||
| import com.intellij.execution.services.ServiceViewDescriptor; | ||
| import com.intellij.openapi.Disposable; | ||
|
|
||
| public interface ManagedServiceGroup extends ServiceViewDescriptor, Disposable { | ||
| public interface ManagedServiceGroup extends ManagedService { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
src/main/java/pl/thedeem/intellij/dql/services/ui/ConnectedTenantsServiceGroup.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| package pl.thedeem.intellij.dql.services.ui; | ||
|
|
||
| import com.intellij.icons.AllIcons; | ||
| import com.intellij.navigation.ItemPresentation; | ||
| import com.intellij.openapi.actionSystem.*; | ||
| import com.intellij.openapi.project.Project; | ||
| import org.jetbrains.annotations.NotNull; | ||
| import org.jetbrains.annotations.Nullable; | ||
| import pl.thedeem.intellij.common.StandardItemPresentation; | ||
| import pl.thedeem.intellij.common.services.ManagedServiceGroup; | ||
| import pl.thedeem.intellij.dql.DQLBundle; | ||
| import pl.thedeem.intellij.dql.DQLIcon; | ||
| import pl.thedeem.intellij.dql.fileProviders.DQLQueryConsoleVirtualFile; | ||
| import pl.thedeem.intellij.dql.settings.DQLSettingsConfigurable; | ||
| import pl.thedeem.intellij.dql.settings.tenants.DynatraceTenantsConfigurable; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public class ConnectedTenantsServiceGroup implements ManagedServiceGroup { | ||
| private static final ConnectedTenantsServiceGroup INSTANCE = new ConnectedTenantsServiceGroup(); | ||
| private DefaultActionGroup actions; | ||
|
|
||
| protected ConnectedTenantsServiceGroup() { | ||
| } | ||
|
|
||
| public static ConnectedTenantsServiceGroup getInstance() { | ||
| return INSTANCE; | ||
| } | ||
|
|
||
| @Override | ||
| public @NotNull ItemPresentation getPresentation() { | ||
| return new StandardItemPresentation( | ||
| DQLBundle.message("services.connectedTenants.groupName"), | ||
| null, | ||
| DQLIcon.DYNATRACE_LOGO | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| public void dispose() { | ||
| } | ||
|
|
||
| @Override | ||
| public @Nullable ActionGroup getToolbarActions() { | ||
| if (actions == null) { | ||
| actions = new DefaultActionGroup(); | ||
| actions.add(new AnAction( | ||
| DQLBundle.message("services.connectedTenants.actions.openConsole.title"), | ||
| null, | ||
| DQLIcon.QUERY_CONSOLE | ||
| ) { | ||
| @Override | ||
| public void actionPerformed(@NotNull AnActionEvent e) { | ||
| Project project = e.getProject(); | ||
| if (project == null) { | ||
| return; | ||
| } | ||
| DQLQueryConsoleVirtualFile.open(project); | ||
| } | ||
| }); | ||
| actions.add(new AnAction( | ||
| DQLBundle.message("services.connectedTenants.actions.allSettings.title"), | ||
| null, | ||
| AllIcons.General.GearPlain | ||
| ) { | ||
| @Override | ||
| public void actionPerformed(@NotNull AnActionEvent e) { | ||
| Project project = e.getProject(); | ||
| if (project == null) { | ||
| return; | ||
| } | ||
| DQLSettingsConfigurable.showSettings(project); | ||
| } | ||
| }); | ||
| actions.addAction(new AnAction( | ||
| DQLBundle.message("services.connectedTenants.actions.manageTenants.title"), | ||
| null, | ||
| DQLIcon.MANAGE_TENANTS | ||
| ) { | ||
| @Override | ||
| public void actionPerformed(@NotNull AnActionEvent anActionEvent) { | ||
| DynatraceTenantsConfigurable.showSettings(); | ||
| } | ||
|
|
||
| @Override | ||
| public @NotNull ActionUpdateThread getActionUpdateThread() { | ||
| return ActionUpdateThread.BGT; | ||
| } | ||
| }); | ||
| } | ||
| return actions; | ||
| } | ||
|
|
||
| @Override | ||
| public @NotNull String getServiceId() { | ||
| return "DynatraceTenants"; | ||
| } | ||
|
|
||
| @Override | ||
| public @NotNull List<ManagedServiceGroup> getParentGroups() { | ||
| return List.of(); | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
...ain/java/pl/thedeem/intellij/dql/services/ui/ServicesAutoRegistrationStartupActivity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package pl.thedeem.intellij.dql.services.ui; | ||
|
|
||
| import com.intellij.openapi.project.Project; | ||
| import com.intellij.openapi.startup.ProjectActivity; | ||
| import kotlin.Unit; | ||
| import kotlin.coroutines.Continuation; | ||
| import org.jetbrains.annotations.NotNull; | ||
| import pl.thedeem.intellij.common.services.ProjectServicesManager; | ||
|
|
||
| public final class ServicesAutoRegistrationStartupActivity implements ProjectActivity { | ||
| @Override | ||
| public @NotNull Object execute(@NotNull Project project, @NotNull Continuation<? super Unit> continuation) { | ||
| ProjectServicesManager.getInstance(project).registerService(ConnectedTenantsServiceGroup.getInstance()); | ||
| return Unit.INSTANCE; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.