Skip to content

Commit ff357cd

Browse files
authored
Merge pull request #303 from bndtools/copilot/fix-1130828-2885455-881e3237-2822-4aa1-bb8f-9357fa4f15be
docs: Add Bundle Graph view documentation
2 parents b186e0f + a174818 commit ff357cd

File tree

12 files changed

+132
-0
lines changed

12 files changed

+132
-0
lines changed

_data/sidebar.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ nav:
3434
url: "/manual/bndeditor.html"
3535
- name: The JAR Viewer
3636
url: "/manual/jareditor.html"
37+
- name: Bundle Graph
38+
url: "/manual/bundlegraph.html"
3739
- name: Project Templates
3840
url: "/manual/templates.html"
3941
- title: null

_manual/about.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Introduction
33
description: An overview of the Bndtools manual
4+
layout: prev-next-collection
45
---
56

67
Bndtools is an Eclipse Plugin based on [bnd][1] with the goal to make programming for OSGi easier than in

_manual/bndeditor.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Bnd Editor
33
description: The Bnd properties editor for bnd files
4+
layout: prev-next-collection
45
---
56

67
The bnd editor provides a number of tabs with graphic editors. The following tabs are available:

_manual/bundlegraph.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: Bundle Graph
3+
description: Visualises the dependency graph of OSGi bundles
4+
layout: prev-next-collection
5+
since: 7.3.0
6+
---
7+
8+
9+
![Bundle Graph View](/images/bundle-graph.png){: style="width:100%" class="view"}
10+
11+
The **Bundle Graph** view gives you an interactive, visual picture of how OSGi bundles depend on each other. Instead of reading lists of requirements and capabilities, you can see the relationships between bundles at a glance and quickly understand the impact of adding or removing a bundle from your runtime.
12+
13+
## Opening the View
14+
15+
Open the view via **Window › Show View › Other…** and search for *Graph*. Once open, you can populate it by dragging any of the following onto the *Available bundles* list:
16+
17+
* A project from the Bndtools Explorer / Package Explorer
18+
* A repository (or individual bundles) from the [Repositories View](/manual/repositories-view.html)
19+
* A `.bndrun` file from the workspace
20+
21+
## Interface Overview
22+
23+
The view is split into three areas:
24+
25+
| Area | Purpose |
26+
|---|---|
27+
| **Available bundles** (left panel) | Lists every bundle that was dragged into the view. Use the *Filter* field at the top to narrow down the list by name. |
28+
| **Selected input bundles** (right panel) | The bundles you specifically want to centre the graph on. Move bundles here with the **Add >** button or by double-clicking. |
29+
| **Graph canvas** (bottom) | An interactive diagram showing the bundles and their dependency edges. |
30+
31+
### Toolbar Buttons
32+
33+
The toolbar at the top right of the view provides quick access to common actions:
34+
35+
* **New Graph** – clears the view and starts a fresh graph.
36+
* **Refresh** – re-renders the graph using the current settings.
37+
* **Layout** – switches between available automatic layout algorithms.
38+
* **Minimise / Maximise** – standard Eclipse view controls.
39+
40+
## Controls
41+
42+
### Mode
43+
44+
The **Mode** drop-down (bottom-left of the view) controls which bundles are included in the graph:
45+
46+
| Mode | Description |
47+
|---|---|
48+
| **Selected + dependencies** | Shows the selected input bundles together with all bundles they (transitively) depend on. |
49+
| **Selected + dependants** | Shows the selected input bundles together with all bundles that (transitively) depend on them. |
50+
| **Selected + both** | Combines both directions – ideal for understanding the full neighbourhood of a bundle. |
51+
52+
### Auto-render
53+
54+
When **Auto-render** is checked, the graph is automatically redrawn whenever the selection or settings change. Uncheck it if you want to batch-configure the view before rendering (useful for large graphs), then click **Render** to draw the result.
55+
56+
### Zoom
57+
58+
Use the **** and **+** buttons to zoom the canvas in and out, or choose a fixed percentage from the drop-down between them. The zoom level is shown as a percentage (e.g. *100%*).
59+
60+
### Dependencies Filter
61+
62+
The **Dependencies** drop-down lets you choose which kinds of dependency edges to display:
63+
64+
| Option | Description |
65+
|---|---|
66+
| **All (mandatory + optional)** | Draws both solid (mandatory) and dashed (optional) edges. |
67+
| **Mandatory only** | Hides optional dependency edges to reduce visual noise. |
68+
| **Optional only** | Shows only optional dependency edges. |
69+
70+
### Graph Interactions
71+
72+
* **Pan** – click and drag on the canvas background to pan around.
73+
* **Select** – click on a node to highlight it and its direct neighbours.
74+
* **Add / Remove** – use the **Add >**, **< Remove**, **Add deps**, and **Add dependants** buttons to refine which bundles are in the *Selected input bundles* panel without leaving the view.
75+
* **Remove from available** – select one or more bundles in the *Available bundles* list and click **Remove** to remove them from the pool entirely.
76+
77+
## Reading the Graph
78+
79+
* Each **node** (rectangle) represents one bundle. Its label shows the *Bundle Symbolic Name* and version.
80+
* **Solid arrows** indicate a *mandatory* dependency (the source bundle requires a package or capability that the target bundle provides and that dependency is not optional).
81+
* **Dashed arrows** indicate an *optional* dependency.
82+
* The **selected input bundle(s)** are highlighted with a distinct border so they are easy to spot even in large graphs.
83+
84+
## Use Cases
85+
86+
### Understanding the transitive footprint of a bundle
87+
88+
Select a bundle in *Available bundles* and click **Add >** to move it to *Selected input bundles*. With mode set to **Selected + dependencies**, the graph shows you every bundle that will be pulled in at runtime — helping you judge whether a dependency is too heavy before you commit to it.
89+
90+
### Finding out which bundles depend on a given bundle
91+
92+
Move the bundle of interest to *Selected input bundles* and switch mode to **Selected + dependants**. The graph shows every bundle that (transitively) relies on the chosen bundle, which is invaluable when you plan to update or replace it.
93+
94+
### Investigating a failed resolution
95+
96+
After a failed Resolve in the [bnd / bndrun editor](/manual/bndeditor.html#run), drag the `.bndrun` file into the view. The graph lets you trace dependency chains visually and spot which bundle is the root cause of the missing requirement.
97+
98+
### Comparing dependency chains across two bundles
99+
100+
Drag both bundles into the view, add them both to *Selected input bundles*, and choose **Selected + both**. The graph highlights shared sub-graphs and makes diverging dependency paths immediately apparent.
101+
102+
### Reducing optional dependencies
103+
104+
Set the **Dependencies** filter to **Optional only** to see which optional wiring is active in your runtime. You can then decide which optional bundles are worth including and which can be left out to keep the runtime lean.
105+
106+
## More Information
107+
108+
* [Resolving Dependencies](https://bnd.bndtools.org/chapters/250-resolving.html) – background on OSGi requirements and capabilities.
109+
* [Resolution View](/manual/resolution-view.html) – a complementary view that shows requirements and capabilities in list form.
110+
* [Repositories View](/manual/repositories-view.html) – browse and manage the repositories that supply bundles to the graph.

_manual/jareditor.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: JAR Viewer
33
description: Shows the content of a JAR file with extra attention for OSGi information
4+
layout: prev-next-collection
45
---
56

67
Double clicking a JAR or ZIP file wil open the Bndtools JAR Editor. It will display the JAR file's content with the following tabs:

_manual/packageexplorer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Bndtools Explorer
33
description: An overview of the Bndtools Explorer
4+
layout: prev-next-collection
45
---
56

67
The Bndtools Package Explorer is an extension of the [Eclipse Package Explorer][1]. The explorer provides an overview of the projects and their contents. It is extended with a search bar for projects and some extra filters. You an make simple searches or use the [bnd globbing](https://bnd.bndtools.org/chapters/820-instructions.html#glob). That is, you can wildcards (`example*bar`) but also multiple searches in one, for example, `foo|bar` to find multiple projects.

_manual/repositories-view.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Repositories View
33
description: Shows the repositories and their contents
44
author: Neil Bartlett
5+
layout: prev-next-collection
56
---
67

78
<img src="/images/repositories-view.png" style="width:461px" class="view">

_manual/resolution-view.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Resolution View
33
description: Provides insight into the requirements and capabilities of the selected bundle
44
since: 7.1.0
5+
layout: prev-next-collection
56
---
67

78
![](/images/resolution-view.png)

_manual/templates-osgi-service.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Java OSGi Service
33
description: Bndtools Template to create an OSGi service consisting of bundles for api, impl, consumer
44
since: 7.1.0
5+
layout: prev-next-collection
56
---
67

78
## Java OSGi Service (api, impl, consumer)

_manual/templates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Project Templates
33
description: Get started faster with Bnd Project templates.
4+
layout: prev-next-collection
45
---
56

67
The Bndtools supports wizard-based creation of various elements required for OSGi development. There are templates for Bnd-Workspaces, Projects , Components, .bnd and .bndrun files and even for creating services consisting of multiple bundles.

0 commit comments

Comments
 (0)