[service-view] IJPL-163799 draft javadoc for the ServiceViewDescriptor and ServiceViewDescriptor

GitOrigin-RevId: a4135d769fcf4112dda5cf430cf74edbedcc35d8
This commit is contained in:
Nicolay Mitropolsky
2024-10-09 21:24:50 +02:00
committed by intellij-monorepo-bot
parent 608093cb2c
commit cf9de7effe
2 changed files with 18 additions and 0 deletions

View File

@@ -8,6 +8,14 @@ import org.jetbrains.annotations.Nullable;
import java.util.List;
/// Implementation of this interface represents a (parent) node in the Service View Tree that could have multiple child nodes.
/// Top root [ServiceViewContributor]-s should be registered as a `serviceViewContributor` extension-point.
/// Nested [ServiceViewContributor]-s are returned by the [#getServices(Project)] of the parent.
///
/// @param <T> domain model type of children, if for instance, the Service View represents a list of connections to a server
/// then [T] is a single connection. If [T] implements [ServiceViewContributor] then it would have a nested tree inside
/// @see ServiceViewDescriptor
/// @see ServiceViewManager
public interface ServiceViewContributor<T> {
ExtensionPointName<ServiceViewContributor<?>> CONTRIBUTOR_EP_NAME =
ExtensionPointName.create("com.intellij.serviceViewContributor");
@@ -16,12 +24,15 @@ public interface ServiceViewContributor<T> {
return CONTRIBUTOR_EP_NAME.findExtension(contributorClass);
}
/// @return a [ServiceViewDescriptor] for this (parent) node
@NotNull
ServiceViewDescriptor getViewDescriptor(@NotNull Project project);
/// @return list of child domain model entities, contained in this [ServiceViewContributor]
@NotNull
List<T> getServices(@NotNull Project project);
/// @return a [ServiceViewDescriptor] for the child node [T]
@NotNull
ServiceViewDescriptor getServiceDescriptor(@NotNull Project project, @NotNull T service);
}

View File

@@ -15,8 +15,15 @@ import javax.swing.*;
import java.awt.event.MouseEvent;
import java.util.List;
/// Implementation of this interface represents a node in the Service View.
/// It provides information on how the node will be represented in the Service View Tree (by the [#getPresentation()]) method,
/// how it should be shown in the detail panel (be the [#getContentComponent()])
/// and available actions ([#getPopupActions()] and [#getToolbarActions()])
///
/// Subclasses could also implement the [UiDataProvider] to provide the [DataContext]
/// for the actions returned by [#getToolbarActions()] and [#getPopupActions()]
///
/// @see ServiceViewContributor
public interface ServiceViewDescriptor {
Key<Boolean> ACTION_HOLDER_KEY = Key.create("ServiceViewActionHolderContentComponent");