Package com.smartgwt.client.widgets.toolbar

Examples of com.smartgwt.client.widgets.toolbar.ToolStrip


    /**
     * Create the toolbar.
     */
    private void createToolBar() {
        ToolStrip toolStrip = new ToolStrip();
       
        //button to manage  products.
        ToolStripButton iconButton = new ToolStripButton();
        iconButton.setIcon("postit.jpg");
        iconButton.setTitle(constants.manageProducts());
        iconButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                try {
                    RootPanel.get().add(new ProductListPanel(username, canvasPrincipal));
                } catch (Exception ex) {
                    init();
                }
            }
        });

        //button to manage  users
        ToolStripButton genteButton = new ToolStripButton();
        genteButton.setIcon("gente.jpg");
        genteButton.setTitle(constants.manageUsers());
        genteButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                try {
                    RootPanel.get().add(new AdminUserPanel(canvasPrincipal));
                } catch (Exception ex) {
                    init();
                }
            }
        });


        //button to manage  users
        ToolStripButton helpButton = new ToolStripButton();
        helpButton.setIcon("help.png");
        helpButton.setTitle(constants.help());
        helpButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                try {
                    RootPanel.get().add(new HelpPanel(canvasPrincipal));
                } catch (Exception ex) {
                    init();
                }
            }
        });

        //button to see authors
        ToolStripButton aboutButton = new ToolStripButton();
        aboutButton.setIcon("about.png");
        aboutButton.setTitle(constants.about());
        aboutButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                try {
                    RootPanel.get().add(new AboutPanel(canvasPrincipal));
                } catch (Exception ex) {
                    init();
                }
            }
        });

        //button to access the help page
        ToolStripMenuButton menuButton = getToolStripMenuButton();
        toolStrip.addMenuButton(menuButton);

        toolStrip.addButton(iconButton);
        toolStrip.addButton(genteButton);
        toolStrip.addButton(helpButton);
        toolStrip.addButton(aboutButton);
        toolStrip.setAlign(VerticalAlignment.TOP);
        toolStrip.setAlign(Alignment.CENTER);
        toolStrip.setPageTop(0);
        canvasPrincipal.addChild(toolStrip);
        canvasPrincipal.show();
    }
View Full Code Here


                });
            }
        });

        //toolstrip to attach to the country grid
        ToolStrip countryGridToolStrip = new ToolStrip();
        countryGridToolStrip.setWidth100();
        countryGridToolStrip.addFill();
        countryGridToolStrip.addButton(formulaButton);
        countryGridToolStrip.addButton(summaryBuilder);
        countryGridToolStrip.addSeparator();
        countryGridToolStrip.addButton(savePreference);
        countryGridToolStrip.addSeparator();
        countryGridToolStrip.addFormItem(preferenceSelectItem);

        VLayout countryGridLayout = new VLayout(0);
        countryGridLayout.setWidth(650);
        countryGridLayout.addMember(countryGridToolStrip);
        countryGridLayout.addMember(treeGrid);
        layout.addMember(countryGridLayout);

        VLayout preferencesGridLayout = new VLayout(0);
        preferencesGridLayout.setWidth(650);
        preferencesGridLayout.addMember(preferecesGrid);

        //toolstrip to attach to the preferences grid
        ToolStrip preferencesToolStrip = new ToolStrip();
        preferencesToolStrip.setWidth100();
        preferencesToolStrip.addFill();

        ToolStripButton restoreButton = new ToolStripButton("Restore State", "silk/database_gear.png");
        restoreButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                Record record = preferecesGrid.getSelectedRecord();
                if (record != null) {
                    String viewState = record.getAttribute("viewState");
                    treeGrid.setViewState(viewState);
                }
            }
        });
        preferencesToolStrip.addButton(restoreButton);
        preferencesGridLayout.addMember(preferencesToolStrip);

        layout.addMember(preferencesGridLayout);

        layout.addDrawHandler(new DrawHandler() {
View Full Code Here

                SC.say("Preferences persisted.");
            }
        });

        //toolstrip to attach to the country grid
        ToolStrip countryGridToolStrip = new ToolStrip();
        countryGridToolStrip.setWidth100();
        countryGridToolStrip.addFill();
        countryGridToolStrip.addButton(formulaButton);
        countryGridToolStrip.addButton(summaryBuilder);
        countryGridToolStrip.addSeparator();
        countryGridToolStrip.addButton(savePreference);


        VLayout countryGridLayout = new VLayout(0);
        countryGridLayout.setWidth(650);
        countryGridLayout.addMember(countryGridToolStrip);
View Full Code Here

            }
        }

        if (sourceUrls != null) {

            ToolStrip topBar = new ToolStrip();
            topBar.setWidth100();
            topBar.addFill();

            ToolStripButton printButton = new ToolStripButton();
            printButton.setTitle("Print");
            printButton.setIcon("silk/printer.png");
            printButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    Canvas.showPrintPreview(viewPanel);
                }
            });
            topBar.addMember(printButton);

            topBar.addSeparator();

            ToolStripButton sourceButton = new ToolStripButton();
            sourceButton.setTitle("View Source");
            sourceButton.setIcon("silk/page_white_cup.png");
            final SourceEntity[] finalSourceUrls = sourceUrls;
            sourceButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    showSource(finalSourceUrls, 640, 600);
                }
            });
            topBar.addMember(sourceButton);

            topBar.addSpacer(new ToolStripSpacer(6));
            addMember(topBar);
        }

        boolean topIntro = isTopIntro();
        Layout layout = topIntro ? new VLayout() : new HLayout();
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        ToolStrip toolStrip = new ToolStrip();
        toolStrip.setVertical(true);
        toolStrip.setHeight(160);
        toolStrip.setWidth(30);

        ToolStripButton iconButton = new ToolStripButton();
        iconButton.setIcon("silk/printer.png");
        iconButton.setPrompt("Print");
        toolStrip.addButton(iconButton);

        toolStrip.addResizer();

        ToolStripButton boldButton = new ToolStripButton();
        boldButton.setIcon("[SKIN]/RichTextEditor/text_bold.png");
        boldButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addButton(boldButton);

        ToolStripButton italicsButton = new ToolStripButton();
        italicsButton.setIcon("[SKIN]/RichTextEditor/text_italic.png");
        italicsButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addButton(italicsButton);

        ToolStripButton underlineButton = new ToolStripButton();
        underlineButton.setIcon("[SKIN]/RichTextEditor/text_underline.png");
        underlineButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addButton(underlineButton);

        toolStrip.addSeparator();

        ToolStripButton alignLeftButton = new ToolStripButton();
        alignLeftButton.setIcon("[SKIN]/RichTextEditor/text_align_left.png");
        alignLeftButton.setActionType(SelectionType.RADIO);
        alignLeftButton.setRadioGroup("textAlign");
        toolStrip.addButton(alignLeftButton);

        ToolStripButton alignRightButton = new ToolStripButton();
        alignRightButton.setIcon("[SKIN]/RichTextEditor/text_align_right.png");
        alignRightButton.setActionType(SelectionType.RADIO);
        alignRightButton.setRadioGroup("textAlign");
        toolStrip.addButton(alignRightButton);

        ToolStripButton alignCenterButton = new ToolStripButton();
        alignCenterButton.setIcon("[SKIN]/RichTextEditor/text_align_center.png");
        alignCenterButton.setActionType(SelectionType.RADIO);
        alignCenterButton.setRadioGroup("textAlign");
        toolStrip.addButton(alignCenterButton);

        //push all buttons to the top
        toolStrip.addFill();
        return toolStrip;
    }
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        ToolStrip toolStrip = new ToolStrip();
        toolStrip.setWidth(600);

        //push all buttons to the right
        toolStrip.addFill();

        ToolStripMenuButton menuButton = getToolStripMenuButton();
        toolStrip.addMenuButton(menuButton);

        toolStrip.addSeparator();

        ToolStripButton iconButton = new ToolStripButton();
        iconButton.setIcon("silk/printer.png");
        iconButton.setTitle("Print");
        toolStrip.addButton(iconButton);

        toolStrip.addResizer();

        ToolStripButton boldButton = new ToolStripButton();
        boldButton.setIcon("[SKIN]/RichTextEditor/text_bold.png");
        boldButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addButton(boldButton);
       
        ToolStripButton italicsButton = new ToolStripButton();
        italicsButton.setIcon("[SKIN]/RichTextEditor/text_italic.png");
        italicsButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addButton(italicsButton);
       
        ToolStripButton underlineButton = new ToolStripButton();
        underlineButton.setIcon("[SKIN]/RichTextEditor/text_underline.png");
        underlineButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addButton(underlineButton);

        toolStrip.addSeparator();
       
        ToolStripButton alignLeftButton = new ToolStripButton();
        alignLeftButton.setIcon("[SKIN]/RichTextEditor/text_align_left.png");
        alignLeftButton.setActionType(SelectionType.RADIO);
        alignLeftButton.setRadioGroup("textAlign");
        toolStrip.addButton(alignLeftButton);
       
        ToolStripButton alignRightButton = new ToolStripButton();
        alignRightButton.setIcon("[SKIN]/RichTextEditor/text_align_right.png");
        alignRightButton.setActionType(SelectionType.RADIO);
        alignRightButton.setRadioGroup("textAlign");
        toolStrip.addButton(alignRightButton);
       
        ToolStripButton alignCenterButton = new ToolStripButton();
        alignCenterButton.setIcon("[SKIN]/RichTextEditor/text_align_center.png");
        alignCenterButton.setActionType(SelectionType.RADIO);
        alignCenterButton.setRadioGroup("textAlign");
        toolStrip.addButton(alignCenterButton);

        toolStrip.addSeparator();

        SelectItem fontItem = new SelectItem();
        fontItem.setShowTitle(false);
        fontItem.setWidth(120);

        LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
        valueMap.put("courier", "<span style='font-family:courier'>Courier</span>");
        valueMap.put("verdana", "<span style='font-family:verdana'>Verdana</span>");
        valueMap.put("times", "<span style='font-family:times'>Times</span>");
        fontItem.setValueMap(valueMap);
        fontItem.setDefaultValue("verdana");

        toolStrip.addFormItem(fontItem);

        toolStrip.addResizer();

        SelectItem zoomItems = new SelectItem();
        zoomItems.setName("selectName");
        zoomItems.setShowTitle(false);
        zoomItems.setWidth(100);
        zoomItems.setValueMap("50%", "75%", "100%", "200%", "Fit");
        zoomItems.setDefaultValue("100%");

        toolStrip.addFormItem(zoomItems);
       
        return toolStrip;
    }
View Full Code Here

                    onHistoryChanged(initToken);
                }
            }
        };

        ToolStrip topBar = new ToolStrip();
        topBar.setHeight(33);
        topBar.setWidth100();

        topBar.addSpacer(6);
        ImgButton sgwtHomeButton = new ImgButton();
        sgwtHomeButton.setSrc("pieces/24/cube_green.png");
        sgwtHomeButton.setWidth(24);
        sgwtHomeButton.setHeight(24);
        sgwtHomeButton.setPrompt("Smart GWT Project Page");
        sgwtHomeButton.setHoverStyle("interactImageHover");
        sgwtHomeButton.setShowRollOver(false);
        sgwtHomeButton.setShowDownIcon(false);
        sgwtHomeButton.setShowDown(false);
        sgwtHomeButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
            public void onClick(ClickEvent event) {
                com.google.gwt.user.client.Window.open("http://code.google.com/p/smartgwt/", "sgwt", null);
            }
        });
        topBar.addMember(sgwtHomeButton);
        topBar.addSpacer(6);

        Label title = new Label("Smart GWT Showcase");
        title.setStyleName("sgwtTitle");
        title.setWidth(300);
        topBar.addMember(title);

        topBar.addFill();

        ToolStripButton devConsoleButton = new ToolStripButton();
        devConsoleButton.setTitle("Developer Console");
        devConsoleButton.setIcon("silk/bug.png");
        devConsoleButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
            public void onClick(ClickEvent event) {
                SC.showConsole();
            }
        });

        topBar.addButton(devConsoleButton);

        topBar.addSeparator();

        ImgButton imgButton = new ImgButton();
        imgButton.setWidth(18);
        imgButton.setHeight(18);
        imgButton.setSrc("silk/emoticon.png");
        imgButton.setShowFocused(false);
        imgButton.setShowFocusedIcon(false);
        imgButton.setPrompt("I'm feeling lucky");
        imgButton.setHoverWidth(110);
        imgButton.setHoverStyle("interactImageHover");

        imgButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
            public void onClick(ClickEvent event) {
                ExplorerTreeNode[] data = sideNav.getShowcaseData();
                int size = data.length;
                for (int i = 0; i < 15; i++) {
                    int sampleIndex = (int) (size * java.lang.Math.random());
                    ExplorerTreeNode sample = data[sampleIndex];
                    if (sample.getFactory() != null && !(sample instanceof CommandTreeNode)) {
                        showSample(sample);
                        break;
                    }
                }
            }
        });

        topBar.addMember(imgButton);

        topBar.addSpacer(6);

        main.addMember(topBar);

        main.setWidth100();
        main.setHeight100();
View Full Code Here

            return DESCRIPTION;
        }
    }

    public Canvas getViewPanel() {
        ToolStrip toolStrip = new ToolStrip();
        toolStrip.setWidth(200);
        toolStrip.setHeight(24);

        ImgButton boldButton = new ImgButton();
        boldButton.setSize(24);
        boldButton.setShowRollOver(false);
        boldButton.setSrc("icons/24/text_bold.png");
        boldButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addMember(boldButton);
       
        ImgButton italicsButton = new ImgButton();
        italicsButton.setSize(24);
        italicsButton.setShowRollOver(false);
        italicsButton.setSrc("icons/24/text_italics.png");
        italicsButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addMember(italicsButton);
       
        ImgButton underlineButton = new ImgButton();
        underlineButton.setSize(24);
        underlineButton.setShowRollOver(false);
        underlineButton.setSrc("icons/24/text_underlined.png");
        underlineButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addMember(underlineButton);
       
        ImgButton alignLeftButton = new ImgButton();
        alignLeftButton.setSize(24);
        alignLeftButton.setShowRollOver(false);
        alignLeftButton.setSrc("icons/24/text_align_left.png");
        alignLeftButton.setActionType(SelectionType.RADIO);
        alignLeftButton.setRadioGroup("textAlign");
        toolStrip.addMember(alignLeftButton);
       
        ImgButton alignRightButton = new ImgButton();
        alignRightButton.setSize(24);
        alignRightButton.setShowRollOver(false);
        alignRightButton.setSrc("icons/24/text_align_right.png");
        alignRightButton.setActionType(SelectionType.RADIO);
        alignRightButton.setRadioGroup("textAlign");
        toolStrip.addMember(alignRightButton);
       
        ImgButton alignCenterButton = new ImgButton();
        alignCenterButton.setSize(24);
        alignCenterButton.setShowRollOver(false);
        alignCenterButton.setSrc("icons/24/text_align_center.png");
        alignCenterButton.setActionType(SelectionType.RADIO);
        alignCenterButton.setRadioGroup("textAlign");
        toolStrip.addMember(alignCenterButton);
       
        VLayout layout = new VLayout();
        layout.setAutoHeight();
        layout.addMember(toolStrip);
        return layout;
View Full Code Here

    /**
     * Create the toolbar.
     */
    private void createToolBar() {
        ToolStrip toolStrip = new ToolStrip();
       
        //button to manage  products.
        ToolStripButton iconButton = new ToolStripButton();
        iconButton.setIcon("postit.jpg");
        iconButton.setTitle(constants.manageProducts());
        iconButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                try {
                    RootPanel.get().add(new ProductListPanel(username, canvasPrincipal));
                } catch (Exception ex) {
                    init();
                }
            }
        });

        //button to manage  users
        ToolStripButton genteButton = new ToolStripButton();
        genteButton.setIcon("gente.jpg");
        genteButton.setTitle(constants.manageUsers());
        genteButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                try {
                    //RootPanel.get().add(new AdminUserPanel(canvasPrincipal));
                } catch (Exception ex) {
                    init();
                }
            }
        });


        //button to manage  users
        ToolStripButton helpButton = new ToolStripButton();
        helpButton.setIcon("help.png");
        helpButton.setTitle(constants.help());
        helpButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                try {
                    RootPanel.get().add(new HelpPanel(canvasPrincipal));
                } catch (Exception ex) {
                    init();
                }
            }
        });

        //button to see authors
        ToolStripButton aboutButton = new ToolStripButton();
        aboutButton.setIcon("about.png");
        aboutButton.setTitle(constants.about());
        aboutButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                try {
                    RootPanel.get().add(new AboutPanel(canvasPrincipal));
                } catch (Exception ex) {
                    init();
                }
            }
        });

        //button to access the help page
        ToolStripMenuButton menuButton = getToolStripMenuButton();
        toolStrip.addMenuButton(menuButton);

        toolStrip.addButton(iconButton);
        toolStrip.addButton(genteButton);
        toolStrip.addButton(helpButton);
        toolStrip.addButton(aboutButton);
        toolStrip.setAlign(VerticalAlignment.TOP);
        toolStrip.setAlign(Alignment.CENTER);
        toolStrip.setPageTop(0);
        canvasPrincipal.addChild(toolStrip);
        canvasPrincipal.show();
    }
View Full Code Here

        logo.setHeight(30);
        logo.setWidth(190);
        logo.setValign(VerticalAlignment.CENTER);
       
       
        ToolStrip strip = new ToolStrip();
        strip.setHeight(50);
        strip.setWidth100();
       
        strip.addSpacer(120);
        strip.addMember(logo);
        strip.addSpacer(10);
        strip.addSeparator();
       
//        Img homeImg = new Img();
//        homeImg.setSrc("icons/bullet_blue.png");
//        homeImg.setWidth(5);
//        homeImg.setHeight(5);
               
//        strip.addMember(homeImg);
//        strip.addSeparator();
       
        strip.addFill();
       
       
        VLayout p = new VLayout();
        p.setAlign(VerticalAlignment.CENTER);
        DynamicForm form = new DynamicForm();
       
//        form.setNumCols(1);
        p.addMember(form);
        p.setWidth(300);
       
        final TextItem search = new TextItem();
        search.setTitle("Search");
        search.setWidth(300);
        search.setValue("");
        search.setTop(30);
       
        form.setItems(search);
       
        strip.setAlign(VerticalAlignment.CENTER);
        strip.addMember(p);
      
        ToolStripButton go = new ToolStripButton();
        go.setTitle("Go");
        go.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                console.jcrService.findRepositories(search.getValueAsString(), new AsyncCallback<Collection<RepositoryName>>() {

                    @Override
                    public void onFailure(Throwable caught) {
                        SC.say(caught.getMessage());
                    }

                    @Override
                    public void onSuccess(Collection<RepositoryName> result) {
                        console.showRepositories(result);
                    }
                });
            }
        });
       
        strip.addButton(go);
       
        userName.setContents("okulikov");
        userName.setIcon("icons/bullet_blue.png");
       
        strip.addSpacer(140);
        strip.addSeparator();
       
        strip.addMember(userName);
        strip.addSeparator();

        ToolStripButton loging = new ToolStripButton();
        loging.setTitle("Log in");
        loging.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                new LoginDialog(console);
            }
        });
       
        ToolStripButton logout = new ToolStripButton();
        logout.setTitle("Log out");
        logout.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                console.jcrService.logout(new AsyncCallback<Object>() {
                    @Override
                    public void onFailure(Throwable caught) {
                        SC.say(caught.getMessage());
                    }

                    @Override
                    public void onSuccess(Object result) {
                        console.updateUserName(null);
                        console.showContent();
                    }
                });
            }
        });
       
        strip.addButton(loging);
        strip.addButton(logout);
       
        addMember(strip);
        setBackgroundColor("#d3d3d3");
       
    }
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.toolbar.ToolStrip

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.