Example usage for com.google.gwt.user.client.ui Image addClickListener

List of usage examples for com.google.gwt.user.client.ui Image addClickListener

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Image addClickListener.

Prototype

@Deprecated
public void addClickListener(ClickListener listener) 

Source Link

Usage

From source file:com.anzsoft.client.utils.emotions.EmoticonPalettePanel.java

License:Open Source License

private Image createEmoticon(final AbstractImagePrototype imageProto, final String emoticonText,
        final EmoticonPaletteListener listener) {
    final Image img = new Image();
    imageProto.applyTo(img);//www  . jav  a 2s  . c  om
    img.addClickListener(new ClickListener() {

        public void onClick(final Widget arg0) {
            listener.onEmoticonSelected(emoticonText);
        }
    });
    img.setTitle(emoticonText);
    return img;
}

From source file:com.audata.client.AuDoc.java

License:Open Source License

/**
 * Called when a user logs in/*from ww w  .j  ava  2s  .co m*/
 */
public void onLogin() {

    SecLoader.cacheCaveats();
    SecLoader.cacheSecLevels();

    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(2);
    panel.setWidth("150px");
    panel.add(new Image("images/16x16/users.gif"));
    Label name = new Label(AuDoc.state.getItem("surname") + ", " + AuDoc.state.getItem("forename"));
    name.setWidth("116px");
    name.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
    name.addStyleName("audoc-userNote");
    panel.add(name);
    Image logout = new Image("images/16x16/logout.gif");
    logout.addStyleName("audoc-logoutButton");
    logout.addClickListener(new LogoutListener(this));
    panel.add(logout);
    RootPanel.get("user").add(panel);

    if (AuDoc.state.getItem("isAdmin") == "true") {
        this.adminButton.setVisible(true);
    }

    this.classBrowser.onUpdate();
    this.trayPanel.onUpdate();
    this.checkoutsPanel.onUpdate();
    this.savedSearchPanel.onUpdate();
}

From source file:com.audata.client.checkout.CheckoutPanel.java

License:Open Source License

public void addRecord(String uuid, String title, String recordType, String cot) {
    HorizontalPanel hp = new HorizontalPanel();
    hp.setWidth("100%");
    hp.setSpacing(3);/*from   ww  w  .j a  v  a  2  s  .  c  o m*/
    //CaptionButton button = new CaptionButton("images/16x16/treerec.gif",title, CaptionButton.CAPTION_EAST);
    CaptionButton button = new CaptionButton();
    button.setImageUrl("images/16x16/treerec.gif");
    button.setCaptionText(title);

    button.addClickListener(new CheckoutClickListener(this, uuid, recordType, cot));

    Image cButton = new Image("images/16x16/checkouts.gif");
    cButton.addClickListener(new CheckinClickListener(uuid, title));
    cButton.setTitle(LANG.check_in_Text() + " " + title);
    cButton.addStyleName("hand");

    hp.add(button);
    hp.add(cButton);
    hp.setCellVerticalAlignment(cButton, HasAlignment.ALIGN_MIDDLE);
    this.records.add(hp);
}

From source file:com.audata.client.search.SavedSearchPanel.java

License:Open Source License

public void addSavedSearch(String uuid, String name, String desc) {
    HorizontalPanel sp = new HorizontalPanel();
    sp.setSpacing(2);/*from  w ww  . j  a  v a2  s  .c o  m*/
    sp.setWidth("100%");
    //CaptionButton cp = new CaptionButton("images/16x16/tray.gif", name, CaptionButton.CAPTION_EAST);
    CaptionButton cp = new CaptionButton();
    cp.setImageUrl("images/16x16/tray.gif");
    cp.setCaptionText(name);
    cp.setTitle(desc);
    cp.setCaptionStyleName("tree-text");
    cp.addClickListener(new SavedSearchClickListener(this.parent, uuid));

    Image dButton = new Image("images/16x16/logout.gif");
    dButton.setTitle(LANG.delete_Text() + " " + name);
    dButton.addClickListener(new ItemDeleteClickListener(AuDoc.STACK_SAVEDSEARCHES, uuid));
    dButton.addStyleName("hand");
    sp.add(cp);
    sp.add(dButton);
    this.searches.add(sp);
}

From source file:com.audata.client.trays.TrayPanel.java

License:Open Source License

public void addTray(String uuid, String name, String description) {
    HorizontalPanel tp = new HorizontalPanel();
    tp.setSpacing(2);//from w  w  w  .  java2  s .c o  m
    tp.setWidth("100%");
    //CaptionButton cp = new CaptionButton("images/16x16/tray.gif", name, CaptionButton.CAPTION_EAST);
    CaptionButton cp = new CaptionButton();
    cp.setImageUrl("images/16x16/tray.gif");
    cp.setCaptionText(name);
    cp.setCaptionStyleName("audoc-trayLabel");
    cp.setTitle(description);
    cp.addClickListener(new TrayClickListener(this.parent, name, uuid));
    Image dButton = new Image("images/16x16/logout.gif");
    dButton.setTitle("delete " + name);
    dButton.addClickListener(new ItemDeleteClickListener(AuDoc.STACK_TRAYS, uuid));
    dButton.addStyleName("hand");

    tp.add(cp);
    tp.add(dButton);
    tp.setCellVerticalAlignment(dButton, HasAlignment.ALIGN_MIDDLE);
    this.trays.add(tp);
    this.show();
}

From source file:com.dimdim.conference.ui.common.client.list.DefaultListBrowseControl.java

License:Open Source License

protected Image setImage(HorizontalPanel panel, Image newImage, Image image) {
    panel.remove(image);/*w  ww  .j  a  v  a  2  s .  co  m*/

    Image image2 = newImage;
    image2.addClickListener(this);
    image2.setStyleName("list-browse-control-image");
    panel.add(image2);
    panel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);

    return image2;
}

From source file:com.dimdim.conference.ui.common.client.list.ListEntryPanel.java

License:Open Source License

protected Image setImage(DockPanel imagePanel, Image image, Image imageUrl, ClickListener clickListener,
        HorizontalPanel subPanel, String tooltip, boolean rightAlign) {
    Image image2 = image;
    if (image != null) {
        //Window.alert("prev image = is not null");
        if (subPanel != null) {
            //Window.alert("subpanel = is not null so removing..");
            subPanel.remove(image);//from  ww w.  ja  v a  2s.  c  o  m
            image2 = null;
        } else if (imagePanel != null) {
            imagePanel.remove(image);
            image2 = null;
        }

    }
    if (imageUrl != null) {
        /*
        if (imageUrl.endsWith("xxx"))
        {
           Image image = new Image(imageUrl);
           image.addStyleName("list-entry-panel-image");
           imagePanel.add(image,DockPanel.WEST);
           imagePanel.setCellHorizontalAlignment(image,HorizontalPanel.ALIGN_CENTER);
           imagePanel.setCellVerticalAlignment(image,VerticalPanel.ALIGN_MIDDLE);
           if (clickListener != null)
           {
              image.addClickListener(clickListener);
           }
        }
        else
        */
        //         else
        {
            image2 = imageUrl;
            image2.addStyleName("list-entry-panel-image");
            if (subPanel != null) {
                subPanel.add(image2);
                subPanel.setCellHorizontalAlignment(image2, HorizontalPanel.ALIGN_CENTER);
                subPanel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);
            } else {
                if (rightAlign) {
                    imagePanel.add(image2, DockPanel.EAST);
                    imagePanel.setCellHorizontalAlignment(image2, HorizontalPanel.ALIGN_RIGHT);
                    imagePanel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);
                } else {
                    imagePanel.add(image2, DockPanel.WEST);
                    imagePanel.setCellHorizontalAlignment(image2, HorizontalPanel.ALIGN_CENTER);
                    imagePanel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);
                }
            }
            if (clickListener != null) {
                image2.addClickListener(clickListener);
                //image2.addStyleName("anchor-cursor");
            }
            if (tooltip != null) {
                image2.setTitle(tooltip);
            }
        }
    }
    return image2;
}

From source file:com.dimdim.conference.ui.resources.client.ResourceTypeListEntryPanel.java

License:Open Source License

protected Image setImage(DockPanel imagePanel, Image currentImage, Image newImage, ClickListener clickListener,
        HorizontalPanel subPanel, String tooltip, boolean rightAlign) {
    Image image2 = currentImage;
    if (currentImage != null) {
        if (subPanel != null) {
            //Window.alert("subpanel = is not null so removing..");
            subPanel.remove(currentImage);
            image2 = null;/*  w w w  .j a  va  2  s  .com*/
        } else if (imagePanel != null) {
            imagePanel.remove(currentImage);
            image2 = null;
        }
    }
    if (newImage != null) {
        {
            image2 = newImage;
            image2.addStyleName("list-entry-panel-image");
            if (subPanel != null) {
                subPanel.add(image2);
                subPanel.setCellHorizontalAlignment(image2, HorizontalPanel.ALIGN_CENTER);
                subPanel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);
            } else {
                if (rightAlign) {
                    imagePanel.add(image2, DockPanel.EAST);
                    imagePanel.setCellHorizontalAlignment(image2, HorizontalPanel.ALIGN_RIGHT);
                    imagePanel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);
                } else {
                    imagePanel.add(image2, DockPanel.WEST);
                    imagePanel.setCellHorizontalAlignment(image2, HorizontalPanel.ALIGN_CENTER);
                    imagePanel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);
                }
            }
            if (clickListener != null) {
                image2.addClickListener(clickListener);
                //image2.addStyleName("anchor-cursor");
            }
            if (tooltip != null) {
                image2.setTitle(tooltip);
            }
        }
    }
    return image2;
}

From source file:com.dimdim.conference.ui.user.client.ActivePresenterAVWindow.java

License:Open Source License

/**
 * Same chat panel is used for global as well as personal chats. Global
 * chat is simply identified by using 'other' argument as null.
 *//*from   ww w .j  av a2s.  com*/
public ActivePresenterAVWindow(UIRosterEntry me, String captionText, String movieUrl, int movieWidth,
        int movieHeight, String suffix, String sizeFactor, ClickListener presenterSizeControl) {
    super(false);
    //      Window.alert("ActivePresenterAVWindow::ActivePresenterAVWindow");

    this.me = me;
    this.movieUrl = movieUrl;
    this.movieWidth = movieWidth;
    this.movieHeight = movieHeight;
    this.suffix = suffix;
    this.sizeFactor = sizeFactor;
    //   Add header.

    caption.setStyleName("common-float-panel-header");
    caption.addStyleName("common-text");

    this.caption.setText(captionText);

    ScrollPanel s1 = new ScrollPanel();
    headerPanel.setSize(movieWidth + "px", "14px");
    s1.setSize(movieWidth + "px", "14px");
    s1.add(headerPanel);

    if (presenterSizeControl != null) {
        //   This is a broadcaster on presenter console. Add the size
        //   change image in the header.
        header.add(caption);
        header.setCellWidth(caption, "100%");
        header.setCellHorizontalAlignment(caption, HorizontalPanel.ALIGN_LEFT);

        Image image = this.getHeaderImageUrl();
        header.add(image);
        image.addStyleName("anchor-cursor");
        header.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_RIGHT);
        image.addClickListener(presenterSizeControl);
        headerPanel.add(header);

        header.setWidth(movieWidth + "px");
        //         outer.setCellWidth(header, "100%");
    } else {
        //         caption.setWidth(movieWidth+"px");
        headerPanel.add(caption);
        header.setCellWidth(caption, "100%");
    }
    outer.add(s1);

    avWindow = new AVWindow("AVPlayer" + suffix, "AV" + suffix, movieUrl, movieWidth, movieHeight);
    this.panelHeight = movieHeight + 24;
    this.setHeight((movieHeight + 24) + "px");
    this.panelWidth = movieWidth + 8;
    this.setWidth((movieWidth + 8) + "px");

    this.scrollPanel = new ScrollPanel();
    this.scrollPanel.setSize(movieWidth + "px", movieHeight + "px");
    this.scrollPanel.add(avWindow);
    outer.setStyleName("common-float-panel-content");
    outer.add(scrollPanel);
    outer.setCellHorizontalAlignment(avWindow, HorizontalPanel.ALIGN_CENTER);
    outer.setCellVerticalAlignment(avWindow, VerticalPanel.ALIGN_MIDDLE);
    this.avRoundedPanel = new RoundedPanel(this.outer);
    add(this.avRoundedPanel);

    //      Window.addWindowResizeListener(this);
    DimdimPopupsLayoutManager.getManager(me).dimdimPopupOpened(this);

    addPopupListener(this);
}

From source file:com.italianasoftware.echoes.client.Echoes.java

License:Open Source License

private void createAboutDialog() {
    aboutDialog = new DialogBox();
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    aboutDialog.add(vPanel);//  w w w  .  j a v a 2s . co m
    vPanel.add(new HTML("<strong>Echoes</strong>"));
    VerticalPanel cPanel = new VerticalPanel();
    vPanel.add(cPanel);
    cPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    cPanel.addStyleName("margintop-2em");
    cPanel.add(new HTML("(C) 2008, <a href=\"mailto:fmontesi@italianasoftware.com\">Fabrizio Montesi</a>"));
    HTML oxygenTeam = new HTML(
            "Echoes logo by <a href=\"http://www.oxygen-icons.org/\" target=\"_new\">the Oxygen team</a>");
    oxygenTeam.addStyleName("margintop-1em");
    cPanel.add(oxygenTeam);

    HTML license = new HTML(
            "License: <a href=\"http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\" target=\"_new\">GPLv2</a>");
    license.addStyleName("margintop-1em");
    cPanel.add(license);

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    hPanel.addStyleName("margintop-1em");
    HTML poweredBy = new HTML("Powered by: ");
    hPanel.add(poweredBy);
    Image jolieImage = new Image("images/jolie.png");
    jolieImage.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            Window.open("http://jolie.sourceforge.net/", "_blank", "");
        }
    });
    hPanel.add(jolieImage);
    cPanel.add(hPanel);

    Button closeButton = new NativeButton("Close");
    closeButton.addStyleName("margintop-1em");
    closeButton.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            aboutDialog.hide();
        }
    });
    vPanel.add(closeButton);
}