/*
 * Copyright 2015 - 2016 Nebula Bay.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.tascape.qa.th.ios.model;

import com.tascape.qa.th.ios.comm.Instruments;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author linsong wang
 */
public class UIAWindow extends UIAElement {
    private static final Logger LOG = LoggerFactory.getLogger(UIAWindow.class);

    @Override
    public void setInstruments(Instruments instruments) {
        super.setInstruments(instruments);
    }

    /**
     * Finds UI element recursively.
     *
     * @param <T>  type of element
     * @param type type of element
     * @param name name of element
     *
     * @return element found, or null
     */
    @Override
    public <T extends UIAElement> T findElement(Class<T> type, String name) {
        LOG.debug("Look for {}['{}']", type.getSimpleName(), name);
        return type.cast(super.findElement(type, name));
    }

    /**
     * Finds UI element recursively.
     *
     * @param <T>         type of element
     * @param type        type of element
     * @param partialName name of element
     *
     * @return element found, or null
     */
    @Override
    public <T extends UIAElement> T findElementPartialName(Class<T> type, String partialName) {
        LOG.debug("Look for {}['{}'] (partial name)", type.getSimpleName(), partialName);
        return type.cast(super.findElementPartialName(type, partialName));
    }

    public UIAButton findButton(String name) {
        return this.findElement(UIAButton.class, name);
    }

    public UIAStaticText findStaticText(String name) {
        return this.findElement(UIAStaticText.class, name);
    }

    public UIATextView findTextView(String name) {
        return this.findElement(UIATextView.class, name);
    }

    public UIALink findLink(String name) {
        return this.findElement(UIALink.class, name);
    }

    public UIATableCell findCell(String name) {
        return this.findElement(UIATableCell.class, name);
    }
}

@@ -1013,32 +1013,357 @@
 uments);%0A    %7D%0A%0A
+    /**%0A     * Finds UI element recursively. Using default name %22(null)%22.%0A     *%0A     * @param %3CT%3E  type of element%0A     * @param type type of element%0A     *%0A     * @return element found, or null%0A     */%0A    public %3CT extends UIAElement%3E T findElement(Class%3CT%3E type) %7B%0A        return this.findElement(type, %22(null)%22);%0A    %7D%0A%0A
     /**%0A     * F

add shortcut method