Ejemplo n.º 1
0
  public static String commandLabel(Command c, boolean shortonly) {
    String l = shortonly ? null : c.getLongLabel();

    if (l == null || l.length() == 0) {
      l = c.getLabel();
    }
    if (l == null && l.length() == 0) {
      // #ifdef notdef
      // unfortunately there is no way to detect the command type :-(
      int t = c.getType();
      for (int i = 0; i < cmdlabels.length; ++i) {
        if (t == cmdtypes[i]) {
          l = cmdlabels[i];
          break;
        }
      }
      // #endif
      l = "???";
    }
    return l;
  }