Package com.smartgwt.client.widgets.tab

Examples of com.smartgwt.client.widgets.tab.TabSet


        });
        hLayout.addMember(removeButton);

        layout.addMember(hLayout);

        TabSet tabSet = new TabSet();
        tabSet.setHeight(400);
        tabSet.setWidth(500);
        Tab fetchTab = new Tab("country_fetch.xml");
        final HTMLPane fetchPane = new HTMLPane();
        fetchPane.setContentsURL("source/rest/country_fetch_rest.xml.html");
        fetchPane.setContentsType(ContentsType.PAGE);
        fetchTab.setPane(fetchPane);

        Tab addTab = new Tab("country_add.xml");
        final HTMLPane addPane = new HTMLPane();
        addPane.setContentsURL("source/rest/country_add_rest.xml.html");
        addPane.setContentsType(ContentsType.PAGE);
        addTab.setPane(addPane);

        Tab updateTab = new Tab("country_update.xml");
        final HTMLPane updatePane = new HTMLPane();
        updatePane.setContentsURL("source/rest/country_update_rest.xml.html");
        updatePane.setContentsType(ContentsType.PAGE);
        updateTab.setPane(updatePane);

        Tab removeTab = new Tab("country_remove.xml");
        final HTMLPane removePane = new HTMLPane();
        removePane.setContentsURL("source/rest/country_remove_rest.xml.html");
        removePane.setContentsType(ContentsType.PAGE);
        removeTab.setPane(removePane);

        tabSet.setTabs(fetchTab, addTab, updateTab, removeTab);
        layout.addMember(tabSet);

        return layout;
    }
View Full Code Here


        }
    }

    public Canvas getViewPanel() {

        final TabSet topTabSet = new TabSet();
        topTabSet.setTabBarPosition(Side.TOP);
        topTabSet.setTabBarAlign(Side.LEFT);
        topTabSet.setWidth(400);
        topTabSet.setHeight(200);

        final Tab preferencesTab = new Tab("Preferences");
        DynamicForm preferencesForm = new DynamicForm();
        CheckboxItem useTabsCheckbox = new CheckboxItem();
        useTabsCheckbox.setTitle("Use Smart GWT tabs");
        preferencesForm.setFields(useTabsCheckbox);
        preferencesTab.setPane(preferencesForm);

        Tab profileTab = new Tab("Profile");
        DynamicForm profileForm = new DynamicForm();
        TextItem nameTextItem = new TextItem();
        nameTextItem.setTitle("Your Name");
        nameTextItem.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent event) {
                String newTitle = (event.getValue() == null ? "" : event.getValue() + "'s ") + "Preferences";
                topTabSet.setTabTitle(preferencesTab, newTitle);
            }
        });
        profileForm.setFields(nameTextItem);
        profileTab.setPane(profileForm);

        topTabSet.addTab(profileTab);
        topTabSet.addTab(preferencesTab);

        VLayout vLayout = new VLayout();
        vLayout.setMembersMargin(15);
        vLayout.addMember(topTabSet);
        vLayout.setHeight("auto");
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        final TabSet topTabSet = new TabSet();
        topTabSet.setTabBarPosition(Side.TOP);
        topTabSet.setTabBarAlign(Side.RIGHT);
        topTabSet.setWidth(400);
        topTabSet.setHeight(200);

        Tab tTab1 = new Tab("Blue", "pieces/16/pawn_blue.png");
        Img tImg1 = new Img("pieces/48/pawn_blue.png", 48, 48);
        tTab1.setPane(tImg1);

        Tab tTab2 = new Tab("Green", "pieces/16/pawn_green.png");
        Img tImg2 = new Img("pieces/48/pawn_green.png", 48, 48);
        tTab2.setPane(tImg2);

        topTabSet.addTab(tTab1);
        topTabSet.addTab(tTab2);

        final TabSet leftTabSet = new TabSet();
        leftTabSet.setTabBarPosition(Side.LEFT);
        leftTabSet.setTabBarAlign(Side.BOTTOM);
        leftTabSet.setWidth(300);
        leftTabSet.setHeight(300);

        Tab lTab1 = new Tab();
        lTab1.setIcon("pieces/16/pawn_blue.png", 16);
        Img lImg1 = new Img("pieces/48/pawn_blue.png", 48, 48);
        lTab1.setPane(lImg1);

        Tab lTab2 = new Tab();
        lTab2.setIcon("pieces/16/pawn_green.png", 16);
        Img lImg2 = new Img("pieces/48/pawn_green.png", 48, 48);
        lTab2.setPane(lImg2);

        leftTabSet.addTab(lTab1);
        leftTabSet.addTab(lTab2);

        VLayout vLayout = new VLayout();
        vLayout.setMembersMargin(15);
        vLayout.addMember(topTabSet);
        vLayout.addMember(leftTabSet);
View Full Code Here

        });

        sideNavLayout.addMember(sideNav);
        hLayout.addMember(sideNavLayout);

        mainTabSet = new TabSet();

        Layout paneContainerProperties = new Layout();
        paneContainerProperties.setLayoutMargin(0);
        paneContainerProperties.setLayoutTopMargin(1);
        mainTabSet.setPaneContainerProperties(paneContainerProperties);
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        final TabSet topTabSet = new TabSet();
        topTabSet.setTabBarPosition(Side.TOP);
        topTabSet.setWidth(400);
        topTabSet.setHeight(200);

        Tab tTab1 = new Tab("Blue", "pieces/16/pawn_blue.png");
        Img tImg1 = new Img("pieces/48/pawn_blue.png", 48, 48);
        tTab1.setPane(tImg1);

        Tab tTab2 = new Tab("Green", "pieces/16/pawn_green.png");
        Img tImg2 = new Img("pieces/48/pawn_green.png", 48, 48);
        tTab2.setPane(tImg2);

        topTabSet.addTab(tTab1);
        topTabSet.addTab(tTab2);

        final TabSet leftTabSet = new TabSet();
        leftTabSet.setTabBarPosition(Side.LEFT);
        leftTabSet.setWidth(400);
        leftTabSet.setHeight(200);

        Tab lTab1 = new Tab();
        lTab1.setIcon("pieces/16/pawn_blue.png", 16);
        Img lImg1 = new Img("pieces/48/pawn_blue.png", 48, 48);
        lTab1.setPane(lImg1);

        Tab lTab2 = new Tab();
        lTab2.setIcon("pieces/16/pawn_green.png", 16);
        Img lImg2 = new Img("pieces/48/pawn_green.png", 48, 48);
        lTab2.setPane(lImg2);

        leftTabSet.addTab(lTab1);
        leftTabSet.addTab(lTab2);

        HLayout buttons = new HLayout();
        buttons.setMembersMargin(15);

        IButton blueButton = new IButton("Select Blue");
        blueButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                topTabSet.selectTab(0);
                leftTabSet.selectTab(0);
            }
        });

        IButton greeButton = new IButton("Select Green");
        greeButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                topTabSet.selectTab(1);
                leftTabSet.selectTab(1);
            }
        });
       
        buttons.addMember(greeButton);
        buttons.addMember(blueButton);
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        final TabSet tabSet = new TabSet();
        tabSet.setTabBarPosition(Side.TOP);

        //required so that the select item doesnt touch the tab pane
        tabSet.setTabBarThickness(25);
        tabSet.setTabBarAlign(Side.LEFT);
        tabSet.setWidth(400);
        tabSet.setHeight(200);

        final Tab statusTab = new Tab("Status");

        final Canvas statusPane = new Canvas();
        statusTab.setPane(statusPane);
        tabSet.addTab(statusTab);
       
        SelectItem selectItem = new SelectItem();
        selectItem.setValueMap("Development", "Staging", "Production");
        selectItem.setShowTitle(false);

        selectItem.setDefaultValue("Development");
        selectItem.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
                statusPane.setContents(event.getValue() + ": <span style='color:green;font-weight:bold'>Normal</span><br>");
            }
        });

        DynamicForm form = new DynamicForm();
        //form.setHeight(1);
        form.setPadding(0);
        form.setMargin(0);
        form.setCellPadding(1);
        form.setNumCols(1);
        form.setFields(selectItem);

        tabSet.setTabBarControls(TabBarControls.TAB_SCROLLER, TabBarControls.TAB_PICKER, form);
        return tabSet;
    }
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        final TabSet topTabSet = new TabSet();
        topTabSet.setTabBarPosition(Side.TOP);
        topTabSet.setTabBarAlign(Side.LEFT);
        topTabSet.setWidth(400);
        topTabSet.setHeight(200);

        Tab tTab1 = new Tab("Blue", "pieces/16/pawn_blue.png");

        tTab1.setCanClose(true);
        Img tImg1 = new Img("pieces/48/pawn_blue.png", 48, 48);
        tTab1.setPane(tImg1);

        Tab tTab2 = new Tab("Green", "pieces/16/pawn_green.png");
        Img tImg2 = new Img("pieces/48/pawn_green.png", 48, 48);
        tTab2.setPane(tImg2);

        topTabSet.addTab(tTab1);
        topTabSet.addTab(tTab2);

        HLayout buttons = new HLayout();
        buttons.setMembersMargin(15);

        IButton addButton = new IButton("Add Tab");
        addButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                String title = topTabSet.getTabs().length % 2 == 0 ? "Yellow" : "Green";
                String iconType = topTabSet.getTabs().length % 2 == 0 ? "pawn" : "cube";
                Tab tTab = new Tab(title, "pieces/16/" + iconType + "_" + title.toLowerCase() + ".png");
                tTab.setCanClose(true);
                Img tImg = new Img("pieces/48/" + iconType + "_" + title.toLowerCase() + ".png", 48, 48);
                tTab.setPane(tImg);
                topTabSet.addTab(tTab);
            }
        });

        IButton removeButton = new IButton("Remove Tab");
        removeButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                topTabSet.removeTab(topTabSet.getTabs().length - 1);
            }
        });

        buttons.addMember(addButton);
        buttons.addMember(removeButton);
View Full Code Here

    }
  }

  public Canvas getViewPanel() {

    final TabSet topTabSet = new TabSet();
    topTabSet.setTabBarPosition(Side.TOP);
    topTabSet.setTabBarAlign(Side.LEFT);
    topTabSet.setTop(40);
    topTabSet.setWidth(400);
    topTabSet.setHeight(250);

    final Tab tab1 = new Tab("Tab1");
    Canvas tab1Content = new Canvas();
    tab1Content.setContents("Contents of Tab1");
    tab1.setPane(tab1Content);
    topTabSet.addTab(tab1);

    final Tab tab2 = new Tab("Tab2");
    ViewLoader tab2loader = new ViewLoader();
    tab2loader.setLoadingMessage("Loading Grid..");
    tab2loader.setViewURL("data/dataIntegration/json/loadedView.js");
    tab2.setPane(tab2loader);
    topTabSet.addTab(tab2);

    VLayout vLayout = new VLayout();
    vLayout.setMembersMargin(15);
    vLayout.addMember(topTabSet);
    vLayout.setHeight("auto");
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        final TabSet tabSet = new TabSet();
        tabSet.setTabBarPosition(Side.TOP);
        tabSet.setTabBarAlign(Side.LEFT);
        tabSet.setWidth(500);
        tabSet.setHeight(200);

        tabSet.setCanEditTabTitles(true);
        tabSet.setTitleEditEvent(TabTitleEditEvent.DOUBLECLICK);
        tabSet.setTitleEditorTopOffset(2);


        Tab tab1 = new Tab("Blue");
        tab1.setIcon("pieces/16/pawn_blue.png", 16);

        tab1.setCanClose(true);
        Img img1 = new Img("pieces/48/pawn_blue.png", 48, 48);
        tab1.setPane(img1);

        Tab tab2 = new Tab("Green");
        tab2.setIcon("pieces/16/pawn_green.png", 16);
        Img img2 = new Img("pieces/48/pawn_green.png", 48, 48);
        tab2.setPane(img2);

        final Tab validatedTab = new Tab("123-Yellow");
        validatedTab.setIcon("pieces/16/pawn_yellow.png", 16);
        final Img validatedTabImg = new Img("pieces/48/pawn_yellow.png", 48, 48);
        validatedTab.setPane(validatedTabImg);

        final Tab uneditableTab = new Tab("Can't Change Me");
        uneditableTab.setIcon("pieces/16/pawn_red.png", 16);
        uneditableTab.setCanEditTitle(false);
        Img uneditableTabImg = new Img("pieces/48/pawn_red.png", 48, 48);
        uneditableTab.setPane(uneditableTabImg);

        tabSet.addTab(tab1);
        tabSet.addTab(tab2);
        tabSet.addTab(validatedTab);
        tabSet.addTab(uneditableTab);

        tabSet.addTabTitleChangedHandler(new TabTitleChangedHandler() {
            @Override
            public void onTabTitleChanged(TabTitleChangedEvent event) {
                Tab tab = event.getTab();
                if (tab.equals(validatedTab) && (event.getNewTitle() == null || !event.getNewTitle().substring(0, 4).equals("123-"))) {
                    SC.warn("Tab title must start with the prefix \"123-\"");
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        TabSet tabSet = new TabSet();
        tabSet.setWidth(580);
        tabSet.setHeight(400);

        Tab smartTab1 = new Tab("Smart GWT Tab &nbsp;", "pieces/16/pawn_blue.png");
        Canvas tabPane1 = new Canvas();
        tabPane1.setWidth100();
        tabPane1.setHeight100();
        tabPane1.addChild(getGwtTab());
        smartTab1.setPane(tabPane1);

        Tab smartTab2 = new Tab("Another Tab &nbsp;", "pieces/16/pawn_blue.png");
        smartTab2.setPane(new CountryListGrid());
        tabSet.setTabs(smartTab1, smartTab2);

        return tabSet;
    }
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.tab.TabSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.