Package com.smartgwt.client.widgets

Examples of com.smartgwt.client.widgets.ImgButton


      if (rollOverTools == null) {
        rollOverTools = new HLayout();
        rollOverTools.setSnapTo("TR");
        rollOverTools.setWidth(40);
        rollOverTools.setHeight(22);
        ImgButton searchBtn = new ImgButton();
        searchBtn.setShowDown(false);
        searchBtn.setShowRollOver(false);
        searchBtn.setLayoutAlign(Alignment.CENTER);
        searchBtn.setSrc(BTN_SEARCH_IMG);
        searchBtn.setPrompt(messages.searchWidgetSearch());
        searchBtn.setHeight(16);
        searchBtn.setWidth(16);
        searchBtn.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
            favouriteItems.deselectAllRecords();
            favouriteItems.selectRecord(rollOverRecord);
            parent.startSearch();
          }
        });
        filterBtn = new ImgButton();
        filterBtn.setActionType(SelectionType.CHECKBOX);
        filterBtn.setShowDown(false);
        filterBtn.setShowRollOver(false);
        filterBtn.setSrc(BTN_FILTER_IMG);
        filterBtn.setLayoutAlign(Alignment.CENTER);
View Full Code Here


          rollOverTools.setHeight(LAYERTREEBUTTON_SIZE);
          emptyRollOver = new HLayout();
          emptyRollOver.setWidth(1);
          emptyRollOver.setHeight(LAYERTREEBUTTON_SIZE);

          ImgButton showInfo = new ImgButton();
          showInfo.setShowDown(false);
          showInfo.setShowRollOver(false);
          showInfo.setLayoutAlign(Alignment.CENTER);
          showInfo.setSrc(SHOW_LAYERINFO_ICON);
          showInfo.setPrompt(messages.layerTreeWithLegendLayerActionsToolTip());
          showInfo.setHeight(16);
          showInfo.setWidth(16);
          showInfo.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
              LayerActions la = new LayerActions(rollOverLayerTreeNode.getLayer());
              la.draw();
            }
          });
View Full Code Here

    public ImgButtonItem(String imagePath) {
        construct(imagePath);
    }

    private void construct(String imagePath) {
        imageButton = new ImgButton();

        if(null != imagePath){
           imageButton.setIcon(imagePath);
        }
        imageButton.setHeight("30px");
View Full Code Here

    controlsSpacer.setWidth100();
    controls.addMember(controlsSpacer);
    controls.setWidth(INDENT_TABBAR_START - 2);
    controls.setHeight(27);
   
    addTabButton = new ImgButton();
    addTabButton.setSrc(Imgs.ADD_TAB.get());
    addTabButton.setShowDown(false);
    addTabButton.setShowRollOver(false);
    addTabButton.setWidth(25);
    addTabButton.setTooltip("add new tab");
View Full Code Here

        rollOverCanvas.setWidth(22);
        rollOverCanvas.setHeight100();
        rollOverCanvas.setSnapTo("TR");
        rollOverCanvas.setAlign(VerticalAlignment.CENTER);
       
        ImgButton delImg = new ImgButton();
        delImg.setShowDown(false);
        delImg.setShowRollOver(false);
        delImg.setLayoutAlign(Alignment.CENTER);
        delImg.setSrc(Imgs.CROSS.get());
        delImg.setPrompt("Remove completions");
        delImg.setHeight(16);
        delImg.setWidth(16);
        rollOverCanvas.addMember(delImg);
      }
      //now, rollOverCanvas always exists, and always has 1 member. Get the member and change the onclick handler.
      //This way we can use the same canvas for every cell, and still change the click handler
      if (rollOverCanvasClickHandler != null) rollOverCanvasClickHandler.removeHandler();
View Full Code Here

        rollOverCanvas = new HLayout();
        rollOverCanvas.setSnapTo("TR");
        rollOverCanvas.setWidth(22);
        rollOverCanvas.setHeight100();
        rollOverCanvas.setAlign(VerticalAlignment.CENTER);
        ImgButton openExtLink = new ImgButton();
        openExtLink.setShowDown(false);
        openExtLink.setShowRollOver(false);
        openExtLink.setLayoutAlign(Alignment.CENTER);
        if (view.getSettings().useUrlAsSnorql()) {
          openExtLink.setSrc(Imgs.EXTERNAL_LINK.get());
          openExtLink.setPrompt("Open resource information in new window");
        } else {
          openExtLink.setSrc(Imgs.INTERNAL_LINK.get());
          openExtLink.setPrompt("Show resource information in YASGUI");
        }
       
        openExtLink.setHeight(16);
        openExtLink.setWidth(16);
        rollOverCanvas.addMember(openExtLink);
      }
     
      //now, rollOverCanvas always exists, and always has 1 member. Get the member and change the onclick handler.
      //This way we can use the same canvas for every URI, and still change the click handler
View Full Code Here

    }
  }
 
 
  private ImgButton getQueryIcon(String icon, ClickHandler clickHandler) {
    final ImgButton imgButton = new ImgButton();
    imgButton.setHeight(QUERY_BUTTON_HEIGHT);
    imgButton.setWidth(QUERY_BUTTON_WIDTH);
    imgButton.setSrc(icon);
    imgButton.setShowRollOver(false);
    imgButton.setShowDown(false);
    imgButton.setShowOverCanvas(false);
    imgButton.addClickHandler(clickHandler);
    imgButton.getElement().getStyle().setPosition(Position.ABSOLUTE);
    imgButton.getElement().getStyle().setTop(QUERY_BUTTON_POS_TOP, Unit.PX);
    imgButton.getElement().getStyle().setRight(QUERY_BUTTON_POS_RIGHT, Unit.PX);
    imgButton.setCursor(com.smartgwt.client.types.Cursor.POINTER);
    Scheduler.get().scheduleDeferred(new Command() {
      public void execute() {
        //tricky: we need a z-index larger than the tabset (otherwise button is not clickable),
        //and we need one smaller than the config menu (otherwise the overlay is wrong)
        //therefore set dynamically. we use a scheduled method, as at the time of drawing the
        //query button, the tabs arent drawn yet
        imgButton.getElement().getStyle().setZIndex(view.getTabs().getZIndex()+1);
      }
    });
    return imgButton;
  }
View Full Code Here

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

                    rollOverCanvas = new HLayout(3);
                    rollOverCanvas.setSnapTo("TR");
                    rollOverCanvas.setWidth(50);
                    rollOverCanvas.setHeight(22);

                    ImgButton editImg = new ImgButton();
                    editImg.setShowDown(false);
                    editImg.setShowRollOver(false);
                    editImg.setLayoutAlign(Alignment.CENTER);
                    editImg.setSrc("silk/comment_edit.png");
                    editImg.setPrompt("Edit Comments");
                    editImg.setHeight(16);
                    editImg.setWidth(16);
                    editImg.addClickHandler(new ClickHandler() {
                        public void onClick(ClickEvent event) {
                            SC.say("Edit Comment Icon Clicked for country : " + rollOverRecord.getAttribute("countryName"));
                        }
                    });

                    ImgButton chartImg = new ImgButton();
                    chartImg.setShowDown(false);
                    chartImg.setShowRollOver(false);
                    chartImg.setLayoutAlign(Alignment.CENTER);
                    chartImg.setSrc("silk/chart_bar.png");
                    chartImg.setPrompt("View Chart");
                    chartImg.setHeight(16);
                    chartImg.setWidth(16);
                    chartImg.addClickHandler(new ClickHandler() {
                        public void onClick(ClickEvent event) {
                            SC.say("Chart Icon Clicked for country : " + rollOverRecord.getAttribute("countryName"));
                        }
                    });
View Full Code Here

        cssButton.setShowRollOver(true);
        cssButton.setShowDisabled(true);
        cssButton.setShowDown(true);
        cssButton.setIcon("silk/printer.png");

        final ImgButton imgButton = new ImgButton();
        imgButton.setWidth(18);
        imgButton.setHeight(18);
        imgButton.setShowRollOver(true);
        imgButton.setShowDown(true);
        imgButton.setSrc("[SKIN]/ImgButton/button.png");

        HLayout hLayout = new HLayout();
        hLayout.setMembersMargin(20);
        hLayout.addMember(stretchButton);
        hLayout.addMember(cssButton);
View Full Code Here

TOP

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

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.