Search in sources :

Example 1 with Point

use of com.sencha.gxt.core.client.util.Point in project activityinfo by bedatadriven.

the class LogicalTabPanel method onRightClick.

@Override
protected void onRightClick(Event event) {
    Element target = event.getEventTarget().cast();
    if (appearance.getBar(getElement()).isOrHasChild(target)) {
        Element item = findItem(event.getEventTarget().<Element>cast());
        if (item != null) {
            int idx = itemIndex(item);
            if (idx != -1) {
                event.preventDefault();
                event.stopPropagation();
                Point point = event.<XEvent>cast().getXY();
                final M w = getModel(idx);
                final int x = point.getX();
                final int y = point.getY();
                Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                    @Override
                    public void execute() {
                        onItemContextMenu(w, x, y);
                    }
                });
            }
        }
    } else {
        super.onRightClick(event);
    }
}
Also used : ScheduledCommand(com.google.gwt.core.client.Scheduler.ScheduledCommand) XElement(com.sencha.gxt.core.client.dom.XElement) Element(com.google.gwt.dom.client.Element) FxElement(com.sencha.gxt.fx.client.FxElement) Point(com.sencha.gxt.core.client.util.Point) XDOM(com.sencha.gxt.core.client.dom.XDOM) Point(com.sencha.gxt.core.client.util.Point)

Aggregations

ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)1 Element (com.google.gwt.dom.client.Element)1 XDOM (com.sencha.gxt.core.client.dom.XDOM)1 XElement (com.sencha.gxt.core.client.dom.XElement)1 Point (com.sencha.gxt.core.client.util.Point)1 FxElement (com.sencha.gxt.fx.client.FxElement)1