Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement Path Navigation bar (Breadcrumb bar) control [closed]

I want to generate an UI where someone can navigate through the path of a tree structure. Here is an example of what I want, taken from JavaFX Scene Builder.

Depending on the actual position in an TreeView, this UI is updated. By clicking on individual items the tree is updated.

enter image description here

My question: What Nodes/Controls are best used for this approach? (no full code required. Just mention the name of the controls).

My first idea is to generate a row of buttons closely to each other, but maybe there are better ideas.

Thanks.

like image 789
BerndGit Avatar asked Nov 17 '16 15:11

BerndGit


People also ask

How do you implement breadcrumb navigation?

Step 1: We simply add aria-label=”breadcrumb” to the nav element. Step 2: We next add class=”breadcrumb-item” in the list elements. Step 3: Add class=”breadcrumb-item active” in the current list element.

What is a breadcrumb explain with example?

A breadcrumb is a small text path, often located at the top of a page indicating where the user is on the site. On yoast.com, for instance, the path to our Yoast SEO plugin page is Home > WordPress Plugins > Yoast SEO for WordPress. This breadcrumb trail immediately shows you where you are.

What is meant by breadcrumb navigation?

Breadcrumb navigation is a feature usually located at the top of the webpage and tells the user exactly what pages they've been on and how they have ended up where they are.

When should you not use breadcrumbs?

Breadcrumbs aren't necessary (or useful) for sites with flat hierarchies that are only 1 or 2 levels deep, or sites that are linear in structure.


1 Answers

You can use ControlsFx's BreadCrumbBar

enter image description here

Pane root = ...
Label selectedCrumbLbl = new Label();

BreadCrumbBar<String> sampleBreadCrumbBar = new BreadCrumbBar<>();
root.getChildren().addAll(sampleBreadCrumbBar, selectedCrumbLbl);

TreeItem<String> model = BreadCrumbBar.buildTreeModel("Hello", "World", "This", "is", "cool");
sampleBreadCrumbBar.setSelectedCrumb(model);

sampleBreadCrumbBar.setOnCrumbAction(new EventHandler<BreadCrumbBar.BreadCrumbActionEvent<String>>() {
        @Override public void handle(BreadCrumbActionEvent<String> bae) {
            selectedCrumbLbl.setText("You just clicked on '" + bae.getSelectedCrumb() + "'!");
        }
});

https://github.com/controlsfx/controlsfx/blob/master/controlsfx-samples/src/main/java/org/controlsfx/samples/button/HelloBreadCrumbBar.java

like image 180
Omid Avatar answered Sep 28 '22 18:09

Omid