Ejemplo n.º 1
0
  public MenuGrid(Coord c, Widget parent) {
    super(c, Inventory.invsz(gsz), parent);
    ui.mnu = this;
    Glob glob = ui.sess.glob;
    Collection<Pagina> p = glob.paginae;
    p.add(glob.paginafor(Resource.load("paginae/act/add")));
    p.add(glob.paginafor(Resource.load("paginae/add/timer")));
    p.add(glob.paginafor(Resource.load("paginae/add/wiki")));
    //	p.add(glob.paginafor(Resource.load("paginae/add/anime/lol")));
    //	p.add(glob.paginafor(Resource.load("paginae/add/anime/raeg")));
    //	p.add(glob.paginafor(Resource.load("paginae/add/anime/facepalm")));

    // cons(null);
  }
Ejemplo n.º 2
0
 private static boolean matches(Object stringOrPattern, String name) {
   if (stringOrPattern instanceof String) {
     return name.equals(stringOrPattern);
   } else {
     return Glob.matches((Pattern) stringOrPattern, name);
   }
 }
Ejemplo n.º 3
0
 @Override
 protected void attach(UI ui) {
   super.attach(ui);
   Glob glob = ui.sess.glob;
   ObservableCollection<Pagina> p = glob.paginae;
   p.add(glob.paginafor(Resource.local().load("paginae/custom/plant-tree")));
   p.add(glob.paginafor(Resource.local().load("paginae/custom/fill-trough")));
   p.add(glob.paginafor(Resource.local().load("paginae/custom/fill-coop")));
   p.add(glob.paginafor(Resource.local().load("paginae/custom/fill-tarkiln")));
   p.add(glob.paginafor(Resource.local().load("paginae/custom/pick-mussels")));
   p.add(glob.paginafor(Resource.local().load("paginae/custom/fill-smelter")));
   p.add(glob.paginafor(Resource.local().load("paginae/custom/arrow-autoloader")));
 }
Ejemplo n.º 4
0
  /** @param lst array of patterns */
  private Object[] compileTail(List<String> lst, int start) {
    Object head;
    Object[] tail;

    if (start == lst.size()) {
      return null;
    } else {
      head = Glob.compile(lst.get(start), ignoreCase);
      tail = compileTail(lst, start + 1);
      if (head == Glob.STARSTAR) {
        if (tail == null) {
          throw new IllegalArgumentException("** must be followed by some content");
        }
        if (tail[0] == Glob.STARSTAR) {
          throw new IllegalArgumentException("**/** is not allowed");
        }
      }
    }
    return new Object[] {head, tail};
  }