Package com.smartgwt.client.widgets.toolbar

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


    final RibbonBarLayout ribbonBar = new RibbonBarLayout(mapWidget, "ribbon-bar-1");
    ribbonBar.setSize("100%", "94px");

    ToolStrip toolStrip = new ToolStrip();
    toolStrip.setWidth100();
    ToolStripButton btn1 = new ToolStripButton("Toggle group title");
    btn1.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        ribbonBar.setShowGroupTitles(!ribbonBar.isShowGroupTitles());
      }
    });
View Full Code Here


    final RibbonTabLayout ribbon = new RibbonTabLayout(mapWidget, "ribbon-1");
    ribbon.setSize("100%", "120px");

    ToolStrip toolStrip = new ToolStrip();
    toolStrip.setWidth100();
    ToolStripButton btn1 = new ToolStripButton("Toggle group title");
    btn1.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        ribbon.getRibbonBar(0).setShowGroupTitles(!ribbon.getRibbonBar(0).isShowGroupTitles());
      }
    });
View Full Code Here

    title.setStyleName("sgwtTitle");
    title.setWidth(300);
    topBar.addMember(title);
    topBar.addFill();

    ToolStripButton devConsoleButton = new ToolStripButton();
    devConsoleButton.setTitle("Developer Console");
    devConsoleButton.setIcon("[ISOMORPHIC]/geomajas/silk/bug.png");
    devConsoleButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {

      public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
        SC.showConsole();
      }
    });
View Full Code Here

      super(layer.getLabel());
      this.handler = handler;
      setOverflow(Overflow.HIDDEN);
      ToolStrip toolStrip = new ToolStrip();
      toolStrip.setWidth100();
      focusButton = new ToolStripButton(messages.multiFeatureListGridButtonFocusSelection());
      showButton = new ToolStripButton(messages.multiFeatureListGridButtonShowDetail());
      exportButton = new ToolStripButton(messages.multiFeatureListGridButtonExportToCSV());
      focusButton.setIcon(BTN_FOCUSSELECTION);
      showButton.setIcon(BTN_SHOWDETAIL);
      exportButton.setIcon(BTN_EXPORT);
      focusButton.setTooltip(messages.multiFeatureListGridButtonFocusSelectionTooltip());
      showButton.setTooltip(messages.multiFeatureListGridButtonShowDetailTooltip());
View Full Code Here

        searchTextItem.setTooltip(MSG.view_searchBar_buttonTooltip());
        searchTextItem.setHint("Search");

        searchTextItem.setShowHintInField(true);

        saveSearchButton = new ToolStripButton();
        saveSearchButton.setIcon(IconEnum.STAR_OFF.getIcon16x16Path());
        saveSearchButton.setTooltip(MSG.view_searchBar_savedSearch_buttonTooltip());
        saveSearchButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
View Full Code Here

        DataSourceTextField stateField = new DataSourceTextField("viewState", "View State");
        preferencesDS.setFields(pkField, preferenceField, stateField);
        preferencesDS.setClientOnly(true);
        preferecesGrid.setDataSource(preferencesDS);

        ToolStripButton formulaButton = new ToolStripButton("Formula Builder", "crystal/oo/sc_insertformula.png");
        formulaButton.setAutoFit(true);
        formulaButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                countryGrid.addFormulaField();
            }
        });

        ToolStripButton summaryBuilder = new ToolStripButton("Summary Builder", "crystal/16/apps/tooloptions.png");
        summaryBuilder.setAutoFit(true);
        summaryBuilder.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                countryGrid.addSummaryField();
            }
        });

        final SelectItem preferenceSelectItem = new SelectItem("name");
        preferenceSelectItem.setTitle("Preference");
        ListGrid pickListProperties = new ListGrid();
        pickListProperties.setEmptyMessage("No Saved Preferences");
        preferenceSelectItem.setPickListProperties(pickListProperties);
        preferenceSelectItem.setOptionDataSource(preferencesDS);

        //apply the selected preference from the SelectItem
        preferenceSelectItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                String preferenceName = (String) preferenceSelectItem.getValue();
                Criteria criteria = new Criteria("name", preferenceName);
                preferencesDS.fetchData(criteria, new DSCallback() {
                    @Override
                    public void execute(DSResponse response, Object rawData, DSRequest request) {
                        Record[] data = response.getData();
                        if (data.length != 0) {
                            PreferenceRecord record = (PreferenceRecord) data[0];
                            countryGrid.setViewState(record.getViewState());
                        }
                    }
                });
            }
        });
        preferenceSelectItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
                String preferenceName = (String) preferenceSelectItem.getValue();
                Criteria criteria = new Criteria("name", preferenceName);
                preferencesDS.fetchData(criteria, new DSCallback() {
                    @Override
                    public void execute(DSResponse response, Object rawData, DSRequest request) {
                        Record[] data = response.getData();
                        if (data.length != 0) {
                            PreferenceRecord record = (PreferenceRecord) data[0];
                            countryGrid.setViewState(record.getViewState());
                        }
                    }
                });
            }
        });

        ToolStripButton savePreference = new ToolStripButton("Save Preference", "silk/database_gear.png");
        savePreference.setAutoFit(true);
        savePreference.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                SC.askforValue("Enter Preference name :", new ValueCallback() {
                    @Override
                    public void execute(String value) {
                        if (value != null && !value.equals("")) {
                            String viewState = countryGrid.getViewState();
                            PreferenceRecord record = new PreferenceRecord(PK_COUNTER++, value, viewState);
                            preferecesGrid.addData(record);
                            preferenceSelectItem.setValue(value);
                        }
                    }
                });
            }
        });

        //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(countryGrid);
        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");
View Full Code Here

     */
    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) {
View Full Code Here

        DataSourceTextField stateField = new DataSourceTextField("viewState", "View State");
        preferencesDS.setFields(pkField, preferenceField, stateField);
        preferencesDS.setClientOnly(true);
        preferecesGrid.setDataSource(preferencesDS);

        ToolStripButton formulaButton = new ToolStripButton("Formula Builder", "crystal/oo/sc_insertformula.png");
        formulaButton.setAutoFit(true);
        formulaButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                treeGrid.addFormulaField();
            }
        });

        ToolStripButton summaryBuilder = new ToolStripButton("Summary Builder", "crystal/16/apps/tooloptions.png");
        summaryBuilder.setAutoFit(true);
        summaryBuilder.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                treeGrid.addSummaryField();
            }
        });

        final SelectItem preferenceSelectItem = new SelectItem("name");
        preferenceSelectItem.setTitle("Preference");
        ListGrid pickListProperties = new ListGrid();
        pickListProperties.setEmptyMessage("No Saved Preferences");
        preferenceSelectItem.setPickListProperties(pickListProperties);
        preferenceSelectItem.setOptionDataSource(preferencesDS);

        //apply the selected preference from the SelectItem
        preferenceSelectItem.addChangedHandler(new ChangedHandler() {
            @Override
            public void onChanged(ChangedEvent event) {
                String preferenceName = (String) preferenceSelectItem.getValue();
                Criteria criteria = new Criteria("name", preferenceName);
                preferencesDS.fetchData(criteria, new DSCallback() {
                    @Override
                    public void execute(DSResponse response, Object rawData, DSRequest request) {
                        Record[] data = response.getData();
                        if (data.length != 0) {
                            PreferenceRecord record = (PreferenceRecord) data[0];
                            treeGrid.setViewState(record.getViewState());
                        }
                    }
                });
            }
        });
        preferenceSelectItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
                String preferenceName = (String) preferenceSelectItem.getValue();
                Criteria criteria = new Criteria("name", preferenceName);
                preferencesDS.fetchData(criteria, new DSCallback() {
                    @Override
                    public void execute(DSResponse response, Object rawData, DSRequest request) {
                        Record[] data = response.getData();
                        if (data.length != 0) {
                            PreferenceRecord record = (PreferenceRecord) data[0];
                            treeGrid.setViewState(record.getViewState());
                        }
                    }
                });
            }
        });

        ToolStripButton savePreference = new ToolStripButton("Save Preference", "silk/database_gear.png");
        savePreference.setAutoFit(true);
        savePreference.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                SC.askforValue("Enter Preference name :", new ValueCallback() {
                    @Override
                    public void execute(String value) {
                        if (value != null && !value.equals("")) {
                            String viewState = treeGrid.getViewState();
                            PreferenceRecord record = new PreferenceRecord(PK_COUNTER++, value, viewState);
                            preferecesGrid.addData(record);
                            preferenceSelectItem.setValue(value);
                        }
                    }
                });
            }
        });

        //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");
View Full Code Here

            }
        });
        countryGrid.setFields(countryCodeField, nameField, capitalField, populationField, areaField);


        ToolStripButton formulaButton = new ToolStripButton("Formula Builder", "crystal/oo/sc_insertformula.png");
        formulaButton.setAutoFit(true);
        formulaButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                countryGrid.addFormulaField();
            }
        });

        ToolStripButton summaryBuilder = new ToolStripButton("Summary Builder", "crystal/16/apps/tooloptions.png");
        summaryBuilder.setAutoFit(true);
        summaryBuilder.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                countryGrid.addSummaryField();
            }
        });


        ToolStripButton savePreference = new ToolStripButton("Persist State", "silk/database_gear.png");
        savePreference.setAutoFit(true);
        savePreference.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                String viewState = countryGrid.getViewState();
                Offline.put("exampleState", viewState);
                SC.say("Preferences persisted.");
            }
View Full Code Here

            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);
View Full Code Here

TOP

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

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.