Class DefaultResourceUI
java.lang.Object
uno.anahata.asi.swing.agi.resources.DefaultResourceUI
- All Implemented Interfaces:
ResourceUI
- Direct Known Subclasses:
NbResourceUI
The standard, universal implementation of
ResourceUI for Standalone
and generic Swing environments.
It provides capability-based visualization (Text, Image, Audio) and basic OS-level actions with descriptive icons.
- Author:
- anahata
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateContent(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.protected JButtoncreateLinkButton(String text, String tooltip, Icon icon) Helper for creating hyperlink-styled buttons with icons.private JComponentcreateMediaComponent(Resource resource, MediaView mv) Creates a Swing component for media-based resources.createViewPanel(Resource resource, AgiPanel agiPanel) Creates a specialized metadata panel for the resource's view.voidOpens the resource in the host environment's preferred viewer or editor.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).Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResourceUI
canEdit, getEditorContent, setEditing
-
Constructor Details
-
DefaultResourceUI
public DefaultResourceUI()
-
-
Method Details
-
createContent
Creates the primary content component for the given resource.Implementation details: Dispatches to
RSyntaxTextAreaTextResourceViewerfor text resources or a custom label for binary/media resources.- Specified by:
createContentin interfaceResourceUI- Parameters:
resource- The resource to render.agiPanel- The parent AgiPanel.- Returns:
- The JComponent representing the content view.
-
createMediaComponent
Creates a Swing component for media-based resources.- Parameters:
resource- The resource instance.mv- The associated media view.- Returns:
- The media JComponent.
-
populateActions
Injects host-specific actions into the provided container.Implementation details: Injects OS-level actions for physical resources.
- Specified by:
populateActionsin interfaceResourceUI- Parameters:
actionContainer- The container (usually a toolbar or header panel).resource- The resource instance.agiPanel- The parent AgiPanel.
-
createHandlePanel
Creates a specialized metadata panel for the resource's handle.Implementation details: Provides specialized metadata panels based on the handle's connectivity type.
- Specified by:
createHandlePanelin interfaceResourceUI- Parameters:
resource- The resource instance.agiPanel- The parent AgiPanel.- Returns:
- A JPanel configured to show handle-specific attributes.
-
createViewPanel
Creates a specialized metadata panel for the resource's view.Implementation details: Provides specialized metadata panels based on the view's semantic interpreter type.
- Specified by:
createViewPanelin interfaceResourceUI- Parameters:
resource- The resource instance.agiPanel- The parent AgiPanel.- Returns:
- A JPanel configured to show view-specific attributes.
-
open
Opens the resource in the host environment's preferred viewer or editor.Implementation details: Uses
DesktopAPI to open physical or URL resources.- Specified by:
openin interfaceResourceUI- Parameters:
resource- The resource to open.agiPanel- The parent AgiPanel.
-
openUri
Opens a generic URI using the host environment's preferred method.- Specified by:
openUriin interfaceResourceUI- Parameters:
uriString- The URI string to open.
-
select
Selects and highlights the resource in the host environment's navigation component (e.g., Projects tree).Implementation details: Standalone mode does not support project-level selection.
- Specified by:
selectin interfaceResourceUI- Parameters:
resource- The resource to select.agiPanel- The parent AgiPanel.
-
createLinkButton
-

