示例#1
0
  protected boolean isSamePlace(Place newPlace, Place menuPlace) {
    if (newPlace == null || menuPlace == null) {
      return false;
    }

    if (newPlace instanceof EntityProxyPlace && menuPlace instanceof EntityProxyPlace) {
      EntityProxyPlace newEntityPlace = (EntityProxyPlace) newPlace;
      EntityProxyPlace menuEntityPlace = (EntityProxyPlace) menuPlace;
      return newEntityPlace.getProxyClass().equals(menuEntityPlace.getProxyClass());
    } else if (newPlace instanceof EntitySearchPlace && menuPlace instanceof EntitySearchPlace) {
      EntitySearchPlace newEntityPlace = (EntitySearchPlace) newPlace;
      EntitySearchPlace menuEntityPlace = (EntitySearchPlace) menuPlace;
      return newEntityPlace.getProxyClass().equals(menuEntityPlace.getProxyClass());
    }
    return newPlace.getClass().equals(menuPlace.getClass());
  }
示例#2
0
  private String tokenForPlace(Place newPlace) {
    if (defaultPlace.equals(newPlace)) {
      return "";
    }

    String token = mapper.getToken(newPlace);
    if (token != null) {
      return token;
    }

    log().warning("Place not mapped to a token: " + newPlace);
    return "";
  }