Example usage for com.google.gwt.user.client.ui Label addMouseMoveHandler

List of usage examples for com.google.gwt.user.client.ui Label addMouseMoveHandler

Introduction

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

Prototype

public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) 

Source Link

Usage

From source file:com.github.a2g.core.objectmodel.VerbsPanel.java

License:Apache License

@Override
public void setVerbs(Verbs verbs) {
    int rows = verbs.getNumberOfRows();
    int columns = verbs.getNumberOfColumns();
    this.resize(rows, columns);
    for (int i = 0; i < (rows * columns); i++) {
        int row = i / columns;
        if (i >= verbs.items().size())
            continue;
        int column = i % columns;

        Verb verb = verbs.items().get(i);
        String textualId = verb.gettextualId();
        String displayText = verb.getdisplayText();
        int code = verb.getCode();
        Label widget = new Label(textualId);

        this.setWidget(row, column, widget);
        widget.addMouseMoveHandler(new VerbMouseOverHandler(mouseToPresenter, displayText, textualId, code));
        widget.addClickHandler(new VerbMouseClickHandler(mouseToPresenter, displayText, textualId, code));
    }/* www. j ava 2s.c o m*/
}

From source file:io.apiman.manager.ui.client.local.pages.common.PolicyList.java

License:Apache License

/**
 * Creates a single policy row.//w w  w .  j a va 2  s.c  o  m
 * @param bean
 */
private Widget createPolicyRow(final PolicyBean bean) {
    PolicyRow container = new PolicyRow(bean);

    final FlowPanel row = new FlowPanel();
    row.getElement().setClassName("row"); //$NON-NLS-1$

    // Grabber
    Label grabber = new Label();
    grabber.getElement().setDraggable(Element.DRAGGABLE_TRUE);
    grabber.getElement().setClassName("grabber"); //$NON-NLS-1$
    grabber.getElement().getStyle().setHeight(48, Unit.PX);
    row.add(grabber);

    createIconColumn(bean, row);
    createSummaryColumn(bean, row);
    createActionColumn(bean, row);
    container.add(new HTMLPanel("<hr/>")); //$NON-NLS-1$

    container.add(row);

    PolicyDragHandler handler = new PolicyDragHandler(grabber, container);
    grabber.addMouseDownHandler(handler);
    grabber.addMouseUpHandler(handler);
    grabber.addMouseMoveHandler(handler);

    return container;
}