Class NbResourceUI
- All Implemented Interfaces:
ResourceUI
ResourceUI.
This strategy leverages NetBeans native APIs for high-fidelity navigation
and visualization within the IDE. It provides the NetBeansTextResourceViewer
for 100% IDE fidelity (line numbers, folds, errors).
- 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.private StringResolves the physical path from the handle for IDE navigation.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 DefaultResourceUI
createLinkButton, createViewPanelMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResourceUI
canEdit, getEditorContent, setEditing
-
Constructor Details
-
NbResourceUI
public NbResourceUI()
-
-
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.Implementation details: Returns a native
NetBeansTextResourceViewerfor textual resources, providing real IDE editor frames.- Specified by:
createContentin interfaceResourceUI- Overrides:
createContentin classDefaultResourceUI- Parameters:
resource- The resource to render.agiPanel- The parent AgiPanel.- Returns:
- The JComponent representing the content view.
-
createHandlePanel
Creates a specialized metadata panel for the resource's handle.Implementation details: Provides specialized metadata panels based on the handle's connectivity type.
Implementation details: Provides specialized metadata panels based on the handle's connectivity type.
- Specified by:
createHandlePanelin interfaceResourceUI- Overrides:
createHandlePanelin classDefaultResourceUI- Parameters:
resource- The resource instance.agiPanel- The parent AgiPanel.- Returns:
- A JPanel configured to show handle-specific attributes.
-
populateActions
Injects host-specific actions into the provided container.Implementation details: Injects OS-level actions for physical resources.
Implementation details: Injects IDE-specific 'Open' and 'Select' actions for physical resources.
- Specified by:
populateActionsin interfaceResourceUI- Overrides:
populateActionsin classDefaultResourceUI- Parameters:
actionContainer- The container (usually a toolbar or header panel).resource- The resource instance.agiPanel- The parent AgiPanel.
-
open
Opens the resource in the host environment's preferred viewer or editor.Implementation details: Uses
DesktopAPI to open physical or URL resources.Implementation details: Uses the NetBeans
OpenCookieto open physical files in the native code editor.- Specified by:
openin interfaceResourceUI- Overrides:
openin classDefaultResourceUI- 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- Overrides:
openUriin classDefaultResourceUI- 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.
Implementation details: Uses the ASI
IDEtool to focus the resource in the Projects window.- Specified by:
selectin interfaceResourceUI- Overrides:
selectin classDefaultResourceUI- Parameters:
resource- The resource to select.agiPanel- The parent AgiPanel.
-
getPath
-

