Example usage for com.vaadin.ui TabSheet setDebugId

List of usage examples for com.vaadin.ui TabSheet setDebugId

Introduction

In this page you can find the example usage for com.vaadin.ui TabSheet setDebugId.

Prototype

@Deprecated
public void setDebugId(String id) 

Source Link

Usage

From source file:com.expressui.core.view.util.CodePopup.java

License:Open Source License

/**
 * Opens popup for given classes.//  w  w w  .j  a  v  a  2  s .c o  m
 *
 * @param classes classes for displaying related source code and Javadoc. If
 *                class is within com.expressui.core or com.expressui.domain,
 *                then Javadoc is displayed, otherwise source code.
 */
public void open(Class... classes) {

    Window codeWindow = new Window();
    codeWindow.addStyleName("code-popup");
    codeWindow.setPositionX(20);
    codeWindow.setPositionY(40);
    codeWindow.setWidth("90%");
    codeWindow.setHeight("90%");

    TabSheet codePopupTabSheet = new TabSheet();
    String id = StringUtil.generateDebugId("e", this, codePopupTabSheet, "codePopupTabSheet");
    codePopupTabSheet.setDebugId(id);

    codePopupTabSheet.setSizeFull();
    codeWindow.addComponent(codePopupTabSheet);

    String windowCaption = "";
    Set<String> shownUrls = new HashSet<String>();
    for (Class clazz : classes) {
        String tabCaption;
        String url;
        if (clazz.getName().startsWith("com.expressui.core")
                || clazz.getName().startsWith("com.expressui.domain")) {
            url = applicationProperties.getDocUrl(clazz);
            if (shownUrls.contains(url))
                continue;
            tabCaption = clazz.getSimpleName() + " API";
            Embedded embedded = getEmbeddedDoc(url);
            codePopupTabSheet.addTab(embedded, tabCaption);
        } else {
            url = applicationProperties.getCodeUrl(clazz);
            if (shownUrls.contains(url))
                continue;
            tabCaption = clazz.getSimpleName() + ".java";
            String code = getCodeContents(url);
            Label label = new CodeLabel(code);
            codePopupTabSheet.addTab(label, tabCaption);
        }
        shownUrls.add(url);
        if (windowCaption.length() > 0)
            windowCaption += ", ";

        windowCaption += tabCaption;
    }

    codeWindow.setCaption(windowCaption);
    MainApplication.getInstance().getMainWindow().addWindow(codeWindow);
}