public JSItem[] getItems(String... itemmasks) {
        ArrayList<JSItem> items = new ArrayList<JSItem>();
        for (Widget i = wdg().child; i != null; i = i.next) {
            if (i instanceof Item) {
                Item buf = (Item) i;
                if (itemmasks.length > 0 && itemmasks[0].equals(""))
                    items.add(new JSItem(UI.instance.getId(buf)));
                else {
                    for (String iname : itemmasks) {
                        boolean exclude = iname.startsWith("!");
                        if (buf.GetResName().contains(iname) && !exclude) {
                            items.add(new JSItem(UI.instance.getId(buf)));
                            break;
                        }
                    }
                }
            }
        }
        JSItem[] ret = new JSItem[items.size()];
        for (int i = 0; i < items.size(); i++)
            ret[i] = items.get(i);
        return ret;
    }