コード例 #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.
  }
コード例 #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;
  }