Example usage for com.google.gwt.user.client.ui StackPanel StackPanel

List of usage examples for com.google.gwt.user.client.ui StackPanel StackPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui StackPanel StackPanel.

Prototype

public StackPanel() 

Source Link

Document

Creates an empty stack panel.

Usage

From source file:cl.uai.client.rubric.PreviousCommentsInterface.java

License:Open Source License

/**
 * Creates the interface//  w  w  w  .j ava2  s.  co m
 */
public PreviousCommentsInterface() {

    previousComments = new LinkedList<Comment>();

    // Initialize interface and add CSS style
    mainPanel = new VerticalPanel();
    mainPanel.addStyleName(Resources.INSTANCE.css().previouscomments());

    commentsTabs = new StackPanel();
    commentsTabs.addStyleName(Resources.INSTANCE.css().previouscomments());

    // Add comments table
    previousCommentsAll = new FlowPanel();
    previousCommentsFavorites = new FlowPanel();
    previousCommentsMine = new FlowPanel();
    previousCommentsRecent = new FlowPanel();
    previousCommentsMostUsed = new FlowPanel();
    previousCommentsCriteria = new HashMap<Integer, FlowPanel>();

    commentsTabs.add(previousCommentsFavorites, MarkingInterface.messages.Favorites());
    commentsTabs.add(previousCommentsRecent, MarkingInterface.messages.Recent());
    commentsTabs.add(previousCommentsMostUsed, MarkingInterface.messages.MostUsed());
    commentsTabs.add(previousCommentsMine, MarkingInterface.messages.MyComments());
    commentsTabs.add(previousCommentsAll, MarkingInterface.messages.All());

    for (Criterion criterion : MarkingInterface.submissionData.getRubricfillings().values()) {
        FlowPanel criterionPanel = new FlowPanel();
        previousCommentsCriteria.put(criterion.getId(), criterionPanel);
        commentsTabs.add(criterionPanel, criterion.getDescription());
    }

    if (EMarkingConfiguration.getMarkingType() == EMarkingConfiguration.EMARKING_TYPE_MARKER_TRAINING) {
        previousCommentsDrafts = new HashMap<Integer, FlowPanel>();
        for (int draftid : MarkingInterface.submissionData.getDrafts()) {
            FlowPanel draftPanel = new FlowPanel();
            previousCommentsDrafts.put(draftid, draftPanel);
            commentsTabs.add(draftPanel, MarkingInterface.messages.Exam() + " " + draftid);
        }
    }

    mainPanel.add(commentsTabs);

    this.initWidget(mainPanel);
}

From source file:com.audata.client.AuDoc.java

License:Open Source License

/**
 * Builds the stackpanel/*from   w  w w . j  a v  a 2 s.com*/
 * @return StackPanel containing the stack
 */
private StackPanel buildStack() {
    StackPanel panel = new StackPanel();
    panel.setWidth("180px");
    panel.setHeight("100%");
    this.classBrowser = new ClassBrowser(this, "180px", "100%");
    panel.add(this.classBrowser, LANG.browse_Text());

    this.savedSearchPanel = new SavedSearchPanel(this);
    panel.add(this.savedSearchPanel, LANG.saved_searches_Text());

    this.trayPanel = new TrayPanel(this);
    panel.add(this.trayPanel, LANG.trays_Text());

    this.checkoutsPanel = new CheckoutPanel(this);
    panel.add(this.checkoutsPanel, LANG.checkouts_Text());
    return panel;
}

From source file:com.flatown.client.HelpPanel.java

License:Apache License

private HelpPanel() {
    _controlPanel = new StackPanel();
    _controlPanel.add(makeSearchHelp(), makeHeader("Searching PubMed"), true);
    _controlPanel.add(makeSaveFavHelp(), makeHeader("Saving Favorites"), true);
    _controlPanel.add(makeSaveBookmarkHelp(), makeHeader("Saving Bookmarks"), true);
    _controlPanel.add(makeExportHelp(), makeHeader("Exporting Results"), true);
    _controlPanel.add(makeShareLinkHelp(), makeHeader("Sharing Gadget Links"), true);
    // go to search to begin: search from there and add searches to favorites
    // if you save favorites it will load automatically instead of the help panel
    // you can save multiple favorites and reorder them by dragging and dropping
    // you can change the number of results or use the checkbox
    // click on results -> open the pubmed page
    // save as a bookmark
    // tag it for export
    // perform export from sharepanel

    setWidget(_controlPanel);/*from   w  w w .  jav  a  2 s .co  m*/

    DOM.setStyleAttribute(getElement(), "width", "100%");
    DOM.setStyleAttribute(getElement(), "height", "100%");
    DOM.setStyleAttribute(getElement(), "backgroundColor", "#E5ECF9");
    DOM.setStyleAttribute(getElement(), "maxHeight", Window.getClientHeight() - 40 + "px");

    DOM.setStyleAttribute(_controlPanel.getElement(), "width", "100%");
    DOM.setStyleAttribute(_controlPanel.getElement(), "height", "100%");
}

From source file:com.flatown.client.SharePanel.java

License:Apache License

private SharePanel() {
    _controlPanel = new StackPanel();
    _controlPanel.add(LinkAndCodePanel.Singleton, makeHeader("Link to Gadget"), true);
    _controlPanel.add(ExportPanel.Singleton, makeHeader("Export"), true);
    _controlPanel.add(ImportPanel.Singleton, makeHeader("Import"), true);

    setWidget(_controlPanel);//from   w  ww  .j ava 2  s.  co  m

    DOM.setStyleAttribute(getElement(), "width", "100%");
    DOM.setStyleAttribute(getElement(), "height", "100%");
    DOM.setStyleAttribute(getElement(), "backgroundColor", "#E5ECF9");
    DOM.setStyleAttribute(getElement(), "maxHeight", Window.getClientHeight() - 50 + "px");

    DOM.setStyleAttribute(_controlPanel.getElement(), "width", "100%");
    DOM.setStyleAttribute(_controlPanel.getElement(), "height", "100%");
}

From source file:com.google.appinventor.client.editor.youngandroid.palette.YoungAndroidPalettePanel.java

License:Open Source License

/**
 * Creates a new component palette panel.
 *
 * @param editor parent editor of this panel
 *//*from w  w w.ja va 2 s  . c  o  m*/
public YoungAndroidPalettePanel(YaFormEditor editor) {
    this.editor = editor;
    COMPONENT_DATABASE = SimpleComponentDatabase.getInstance(editor.getProjectId());

    stackPalette = new StackPanel();

    paletteHelpers = new HashMap<ComponentCategory, PaletteHelper>();
    // If a category has a palette helper, add it to the paletteHelpers map here.
    paletteHelpers.put(ComponentCategory.LEGOMINDSTORMS, new LegoPaletteHelper());

    categoryPanels = new HashMap<ComponentCategory, VerticalPanel>();
    simplePaletteItems = new HashMap<String, SimplePaletteItem>();

    for (ComponentCategory category : ComponentCategory.values()) {
        if (showCategory(category)) {
            VerticalPanel categoryPanel = new VerticalPanel();
            categoryPanel.setWidth("100%");
            categoryPanels.put(category, categoryPanel);
            stackPalette.add(categoryPanel,
                    TranslationDesignerPallete.getCorrespondingString(category.getName()));
        }
    }

    initExtensionPanel();

    stackPalette.setWidth("100%");
    initWidget(stackPalette);
}

From source file:com.google.gwt.demos.fasttree.client.FastTreeDemo.java

License:Apache License

public StackPanel createDemo() {
    FastTree.addDefaultCSS();//from  w w w  . j a va 2 s.  com

    StackPanel p = new StackPanel();

    p.add(basicTree(), "Basic tree");
    p.add(lazyTree(), "Lazy tree");
    p.add(verboseTree(), "Verbose tree");
    p.add(profileTree(), "Profiling tree");
    p.add(stubbornTree(), "Stubborn tree");
    return p;
}

From source file:com.google.gwt.examples.StackPanelExample.java

License:Apache License

public void onModuleLoad() {
    // Create a stack panel containing three labels.
    StackPanel panel = new StackPanel();
    panel.add(new Label("Foo"), "foo");
    panel.add(new Label("Bar"), "bar");
    panel.add(new Label("Baz"), "baz");

    // Add it to the root panel.
    RootPanel.get().add(panel);// www.jav a  2 s .  c  o m
}

From source file:com.google.gwt.gen2.demo.fasttree.client.FastTreeDemo.java

License:Apache License

public StackPanel createDemo() {

    // inject default styles
    FastTree.injectDefaultCss();//from   w w w.jav a 2  s.c  o  m

    StackPanel p = new StackPanel();

    if (LocaleInfo.getCurrentLocale().isRTL()) {
        p.add(hebrewTree(), " ");
    }
    p.add(basicTree(), "Basic tree");
    p.add(lazyTree(), "Lazy tree");
    p.add(verboseTree(), "Verbose tree");
    p.add(crazyTree(), "Crazy tree");
    p.add(dynamicTree(), "Dynamic tree");
    p.add(cancelEventTree(), "Cancel event tree");

    return p;
}

From source file:com.ikon.frontend.client.panel.left.HistorySearch.java

License:Open Source License

/**
 * HistorySearch/*  ww w. java2s. c  o m*/
 */
public HistorySearch() {
    stackPanel = new StackPanel();
    searchSaved = new SearchSaved();
    userNews = new UserNews();
    scrollSearchSavedPanel = new ScrollPanel();
    scrollUserNewsSavedPanel = new ScrollPanel();

    scrollSearchSavedPanel.addStyleName("okm-PanelSelected");
    scrollUserNewsSavedPanel.addStyleName("okm-PanelSelected");

    scrollSearchSavedPanel.add(searchSaved);
    scrollSearchSavedPanel.setSize("100%", "100%");

    scrollUserNewsSavedPanel.add(userNews);
    scrollUserNewsSavedPanel.setSize("100%", "100%");

    stackPanel.add(scrollSearchSavedPanel,
            Util.createHeaderHTML("img/icon/stackpanel/find.gif", Main.i18n("leftpanel.label.stored.search")),
            true);
    stackPanel.add(scrollUserNewsSavedPanel,
            Util.createHeaderHTML("img/icon/news.gif", Main.i18n("leftpanel.label.user.search")), true);

    stackPanel.showStack(0);
    stackPanel.setStyleName("okm-StackPanel");
    stackPanel.addStyleName("okm-DisableSelect");
    initWidget(stackPanel);
}

From source file:gwtquery.plugins.enhance.client.gwt.StackPanelWidgetFactory.java

License:Apache License

public StackPanel create(Element e) {
    StackPanel stackPanel = options.isDecorated() ? new DecoratedStackPanel() : new StackPanel();

    WidgetsUtils.replaceOrAppend(e, stackPanel);

    GQuery contents = $(options.getContentSelector(), e);
    GQuery headers = $(options.getHeaderSelector(), e);

    for (int i = 0; i < contents.length(); i++) {
        Element content = contents.get(i);
        Element header = headers.get(i);

        Widget contentWidget = $(content).widget();
        if (contentWidget == null) {
            contentWidget = new WidgetsHtmlPanel(content);
        }/*from  w w w.j  a  va 2 s  .c o  m*/

        stackPanel.add(contentWidget, header != null ? header.getInnerText() : "Undefined");

    }

    return stackPanel;
}