Interface ResourceUI
- All Known Implementing Classes:
DefaultResourceUI, IntellijResourceUI
public interface ResourceUI
The definitive strategy interface for providing a host-aware user interface
for V2
Resources.
Implementations are responsible for creating the content visualization, injecting environment-specific actions, and providing modular metadata panels for handles and views.
This interface also defines the Edit/Save lifecycle, allowing the UI to transition between read-only previews and full-file editing.
- Author:
- anahata
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanDetermines if the given resource can be edited in this environment.createContent(Resource resource, AgiPanel agiPanel) Creates the primary content component for the given resource.createHandlePanel(Resource resource, AgiPanel agiPanel) Creates a specialized metadata panel for the resource's handle.createViewPanel(Resource resource, AgiPanel agiPanel) Creates a specialized metadata panel for the resource's view.default StringgetEditorContent(JComponent viewer) Retrieves the current content from the editor component for saving.voidOpens the resource in the host environment's preferred viewer or editor.default voidOpens a generic URI using the host environment's preferred method.voidpopulateActions(JPanel actionContainer, Resource resource, AgiPanel agiPanel) Injects host-specific actions into the provided container.voidSelects and highlights the resource in the host environment's navigation component (e.g., Projects tree).default voidsetEditing(JComponent viewer, boolean editing) Signals the active viewer component for this resource to enter or exit edit mode.
-
Method Details
-
createContent
Creates the primary content component for the given resource.- Parameters:
resource- The resource to render.agiPanel- The parent AgiPanel.- Returns:
- The JComponent representing the content view.
-
populateActions
-
createHandlePanel
-
createViewPanel
-
open
-
select
-
canEdit
Determines if the given resource can be edited in this environment.- Parameters:
resource- The resource instance.- Returns:
- true if editing is supported.
-
openUri
Opens a generic URI using the host environment's preferred method.- Parameters:
uriString- The URI string to open.
-
setEditing
Signals the active viewer component for this resource to enter or exit edit mode.- Parameters:
viewer- The component returned bycreateContent(Resource, AgiPanel).editing- true to enable editing.
-
getEditorContent
Retrieves the current content from the editor component for saving.- Parameters:
viewer- The component returned bycreateContent(Resource, AgiPanel).- Returns:
- The current content string, or null if not available.
-

