Exemplo n.º 1
0
  @Override
  public Location getDefault() {
    Session session = this.getContext().getSession();

    LocationsManager manager = session.getLocationsManager();

    if (manager == null) {
      return null;
    }

    return manager.getLocation(32811); // Greece.
  }
Exemplo n.º 2
0
  @Override
  public HierarchicalBeanItemContainer<Location> getHierarchy() {
    Session session = this.getContext().getSession();

    LocationsManager manager = session.getLocationsManager();

    if (manager == null) {
      return null;
    }

    List<Location> rootLocations = manager.getRootLocations();

    HierarchicalBeanItemContainer<Location> container =
        new HierarchicalBeanItemContainer<Location>(
            Location.class, rootLocations, new LocationsHierarchicalModel());

    return container;
  }