Package com.smartgwt.client.widgets

Examples of com.smartgwt.client.widgets.Canvas


        canvasItem.setColSpan(2);
        canvasItem.setShowTitle(false);
        canvasItem.setWidth("*");
        canvasItem.setHeight("*");

        Canvas canvas = new Canvas();
        canvas.setContents(contents);
        canvasItem.setCanvas(canvas);

        form.setItems(canvasItem);
        layout.addMember(form);

View Full Code Here


    if (!view.getConnHelper().isOnline()) shortenUrlButton.setDisabled(true);
    return shortenUrlButton;
  }

  private Canvas getLinkText() {
    urlTextBoxAnim = new Canvas();
    urlTextBoxAnim.setWidth100();
    DynamicForm form = new DynamicForm();
    form.setWidth100();

    urlTextBox = new TextItem();
View Full Code Here

    }
    addCsvDownload(url);
  }
 
  private void addDisabledDownload() {
    disabledIcon = new Canvas();
    disabledIcon.setHeight(HEIGHT);
    disabledIcon.setWidth(WIDTH);
    HTMLFlow html = new HTMLFlow();
    html.setWidth(WIDTH);
    html.setHeight(HEIGHT+5);
View Full Code Here

    html.setContents(disabledIconHtml);
    disabledIcon.addChild(html);
    addChild(disabledIcon);
  }
  private void addRegularDownload(String url, Type contentType) {
    downloadIcon = new Canvas();
    downloadIcon.setHeight(HEIGHT);
    downloadIcon.setWidth(WIDTH);
    HTMLFlow html = new HTMLFlow();
    html.setWidth(WIDTH);
    html.setHeight(HEIGHT+5);
View Full Code Here

    downloadIcon.addChild(html);
    addChild(downloadIcon);
  }
 
  private void addCsvDownload(String url) {
    csvIcon = new Canvas();
    csvIcon.setHeight(HEIGHT);
    csvIcon.setWidth(WIDTH);
    HTMLFlow html = new HTMLFlow();
    html.setWidth(WIDTH);
    html.setHeight(HEIGHT+5);
View Full Code Here

    }
  }

  private Canvas getEmptyCanvas() {
    if (emptyRollOverCanvas == null) {
      emptyRollOverCanvas = new Canvas();
      emptyRollOverCanvas.setWidth(1);
      emptyRollOverCanvas.setHeight(1);
    }
    return emptyRollOverCanvas;
  }
View Full Code Here

 
 
  private Canvas getEmptyCanvas() {
    if (emptyRollOverCanvas == null) {
      emptyRollOverCanvas = new Canvas();
      emptyRollOverCanvas.setWidth(1);
      emptyRollOverCanvas.setHeight(1);
    }
    return emptyRollOverCanvas;
  }
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        Canvas canvas = new Canvas();

        final ListGrid countryGrid = new ListGrid();
        countryGrid.setWidth(500);
        countryGrid.setHeight(224);
        countryGrid.setShowAllRecords(true);
        countryGrid.setTop(50);

        ListGridField countryCodeField = new ListGridField("countryCode", "Flag", 40);
        countryCodeField.setAlign(Alignment.CENTER);
        countryCodeField.setType(ListGridFieldType.IMAGE);
        countryCodeField.setImageURLPrefix("flags/16/");
        countryCodeField.setImageURLSuffix(".png");

        ListGridField nameField = new ListGridField("countryName", "Country");
        ListGridField capitalField = new ListGridField("capital", "Capital");
        ListGridField continentField = new ListGridField("continent", "Continent");
        countryGrid.setFields(countryCodeField, nameField, capitalField, continentField);
        countryGrid.setCanResizeFields(true);
        countryGrid.setData(CountryData.getRecords());
        canvas.addChild(countryGrid);

        IButton nameButton = new IButton("\"Name\"");
        nameButton.setLeft(0);
        nameButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                countryGrid.setFieldTitle("countryName", "Name");
            }
        });
        canvas.addChild(nameButton);

        IButton countryButton = new IButton("\"Country\"");
        countryButton.setLeft(120);
        countryButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                countryGrid.setFieldTitle("countryName", "Country");
            }
        });
        canvas.addChild(countryButton);

        return canvas;
    }
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        Canvas canvas = new Canvas();

        final ListGrid countryGrid = new ListGrid();
        countryGrid.setWidth(500);
        countryGrid.setHeight(224);
        countryGrid.setShowAllRecords(true);
        countryGrid.setWrapCells(true);
        // taller rows to fit 'government' values
        countryGrid.setCellHeight(32);
        countryGrid.setHoverWidth(300);

        ListGridField countryCodeField = new ListGridField("countryCode", "Flag", 50);
        countryCodeField.setAlign(Alignment.CENTER);
        countryCodeField.setType(ListGridFieldType.IMAGE);
        countryCodeField.setImageURLPrefix("flags/16/");
        countryCodeField.setImageURLSuffix(".png");

        ListGridField nameField = new ListGridField("countryName", "Country");
        ListGridField governmentField = new ListGridField("government", "Government", 120);
        governmentField.setShowHover(true);
        governmentField.setHoverCustomizer(new HoverCustomizer() {
            public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
                CountryRecord countryRecord = (CountryRecord) record;
                int governmentDesc = countryRecord.getGovernmentDesc();
                return governmentDescription[governmentDesc];
            }
        });

        countryGrid.setFields(countryCodeField, nameField, governmentField);
        countryGrid.setCanResizeFields(true);
        countryGrid.setData(CountryData.getRecords());
        canvas.addChild(countryGrid);

        IButton everyCell = new IButton("Show Hover on every cell");
        everyCell.setWidth(250);
        everyCell.setTop(250);
        everyCell.setActionType(SelectionType.RADIO);
        everyCell.setRadioGroup("canHover");
        everyCell.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                // When canHover is true on a ListGrid, cells will show hover text unless field.showHover is false
                countryGrid.setCanHover(true);
            }
        });
        canvas.addChild(everyCell);

        IButton governmentCell = new IButton("Show Hover on <i>Government</i> cells only");
        governmentCell.setWidth(250);
        governmentCell.setTop(300);
        governmentCell.setActionType(SelectionType.RADIO);
        governmentCell.setRadioGroup("canHover");
        governmentCell.setSelected(true);
        governmentCell.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                // When canHover is unset on a ListGrid, cells will show hover text if field.showHover is true
                countryGrid.setCanHover(null);
            }
        });
        canvas.addChild(governmentCell);

        IButton noCell = new IButton("Suppress all cell hovers");
        noCell.setWidth(250);
        noCell.setTop(350);
        noCell.setActionType(SelectionType.RADIO);
        noCell.setRadioGroup("canHover");
        noCell.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                // When canHover is false on a ListGrid, cells will not show any hover text
                countryGrid.setCanHover(false);
                //countryGrid.setHoverWidth(5);
            }
        });
        canvas.addChild(noCell);

        return canvas;
    }
View Full Code Here

        }
    }

    public Canvas getViewPanel() {

        Canvas canvas = new Canvas();

        final ListGrid countryGrid = new ListGrid();
        countryGrid.setWidth(500);
        countryGrid.setHeight(1);
        countryGrid.setTop(50);
        countryGrid.setShowAllRecords(true);
        countryGrid.setBodyOverflow(Overflow.VISIBLE);
        countryGrid.setOverflow(Overflow.VISIBLE);
        countryGrid.setLeaveScrollbarGap(false);

        ListGridField nameField = new ListGridField("countryName", "Country", 120);
        ListGridField backgroundField = new ListGridField("background", "Background");
        ListGridField countryCodeField = new ListGridField("countryCode", "Flag", 50);
        countryCodeField.setAlign(Alignment.CENTER);
        countryCodeField.setType(ListGridFieldType.IMAGE);
        countryCodeField.setImageURLPrefix("flags/16/");
        countryCodeField.setImageURLSuffix(".png");

        countryGrid.setFields(nameField, backgroundField, countryCodeField);

        canvas.addChild(countryGrid);

        final CountryRecord[] records = CountryData.getRecords();

        final CountryRecord[] records5 = new CountryRecord[5];
        System.arraycopy(records, 0, records5, 0, 5);

        final CountryRecord[] records10 = new CountryRecord[10];
        System.arraycopy(records, 0, records10, 0, 10);

        IButton show5Button = new IButton("Show 5");
        show5Button.setLeft(0);
        show5Button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                countryGrid.setData(records5);
            }
        });
        canvas.addChild(show5Button);

        IButton show10Button = new IButton("Show 10");
        show10Button.setLeft(120);
        show10Button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                countryGrid.setData(records10);
            }
        });
        canvas.addChild(show10Button);

        IButton showAllButton = new IButton("Show All");
        showAllButton.setLeft(240);
        showAllButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                countryGrid.setData(records);
            }
        });
        canvas.addChild(showAllButton);

        return canvas;
    }
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.Canvas

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.