SubNavigator - Vaadin Add-on Directory
SubNavigator - is an addon which extends the capabilities of the standard Navigator and allows easier to organize a hierarchical multilevel structure of vaadin-application with support of browser bookmarks, navigation history, Forward/Back buttons, etc._Sorry for my english._
_Addon temporary is not available from vaadin repository. Temporary solution - add another repo to your pom ([see here] (https://github.com/indvd00m/vaadin-sub-navigator#using))_
SubNavigator - is a server-side addon which extends the capabilities of the standard object Navigator and allows easier to organize a hierarchical multilevel structure of vaadin-application.
SubNavigator allows you to explicitly specify a hierarchy of objects, and when the user moves from one address (URI Fragment) to another SubNavigator will notify the appropriate objects on the need to clean/refresh the data in that prioritization as they are in the hierarchy.
### Description
Two main interfaces in [SubNavigator](https://github.com/indvd00m/vaadin-sub-navigator/blob/master/sub-navigator-api/src/main/java/com/indvd00m/vaadin/navigator/api/ISubNavigator.java) - is a `ISubView` and `ISubContainer`.
```
public interface ISubView extends Component {
String getRelativePath();
void clean();
void build();
}
```
```
public interface ISubContainer extends ISubView {
ISubView getSelectedView();
void setSelectedView(ISubView view);
void deselectView(ISubView view);
}
```
`ISubContainer` is a container, and generally can contain any other` ISubContainer`, or `ISubView`. Let's look in situation where you will need to display some data at address `#!/path1/path2/path3`. Both `path1` and `path2` is a `ISubContainer` implementation, `path3` can be either `ISubView` or `ISubContainer`. The method `getRelativePath()` of these objects determine their relative path `path1`, `path2`, `path3`. `path1` is a root element which contains other elements. For example, `path1` could be `Panel` element with nested `TabSheet`, `path2` - Tab, `path3` - `VerticalLayout`.
To define the object tree in the application you can use `addView(ISubContainer container, ISubView view)`:
```
// registering views
ISubNavigator subNavigator = new SubNavigator(ui, path1View); // path1View - root view
subNavigator.addView(path1View, path2View); // path2View contained in path1View
subNavigator.addView(path2View, path3View);
subNavigator.addView(path1View, path4View);
subNavigator.addView(path4View, path5View);
```
When user navigates from `#!/path1/path2/path3` to `#!/path1/path4/path5`, SubNavigator first call methods `clean()` and `deselectView(ISubView view)` for objects with relative path `path3` and `path2`, then call methods `build()` and `setSelectedView(ISubView view )` for objects with path `path4` and` path5`:
```
// log of navigating from #!/path1/path2/path3 to #!/path1/path4/path5
path3View.clean()
path2View.deselectView(path3View)
path2View.clean()
path1View.deselectView(path2View)
path1View.setSelectedView(path4View)
path4View.build()
path4View.setSelectedView(path5View)
path5View.build()
```
`SubNavigator` also support dynamic containers, exceptions handling, hierarchical page titles. See [Wiki](https://github.com/indvd00m/vaadin-sub-navigator/wiki) at github.
Author HomepageOnline Demo
Issue Tracker
Source Code
SubNavigator version 0.9.4
null
SubNavigator version 1.0.0
Addon well tested in real project.
SubNavigator version 1.0.1
### Version 1.0.0
- Addon well tested in real project.
### Version 1.0.1
- Addon well tested in Vaadin 7.7 branch.