Search in sources :

Example 6 with XElement

use of com.sencha.gxt.core.client.dom.XElement in project activityinfo by bedatadriven.

the class LogicalTabPanel method scrollTo.

private void scrollTo(int pos, boolean animate) {
    XElement stripWrap = getStripWrap();
    if (animate) {
        Fx fx = new Fx();
        fx.addAfterAnimateHandler(new AfterAnimateHandler() {

            @Override
            public void onAfterAnimate(AfterAnimateEvent event) {
                appearance.updateScrollButtons(getElement());
            }
        });
        stripWrap.<FxElement>cast().scrollTo(ScrollDirection.LEFT, pos, true, fx);
    } else {
        stripWrap.setScrollLeft(pos);
        appearance.updateScrollButtons(getElement());
    }
}
Also used : Fx(com.sencha.gxt.fx.client.animation.Fx) XElement(com.sencha.gxt.core.client.dom.XElement) AfterAnimateEvent(com.sencha.gxt.fx.client.animation.AfterAnimateEvent) AfterAnimateHandler(com.sencha.gxt.fx.client.animation.AfterAnimateEvent.AfterAnimateHandler)

Example 7 with XElement

use of com.sencha.gxt.core.client.dom.XElement in project activityinfo by bedatadriven.

the class LogicalTabPanel method onTap.

protected void onTap(Event event) {
    XElement target = event.getEventTarget().cast();
    Element item = findItem(target);
    if (item != null) {
        int index = itemIndex(item);
        if (index < 0) {
            return;
        }
        TabItemConfig config = getConfig(getModel(index));
        if (config != null && !config.isEnabled()) {
            return;
        }
    }
    onClick(event);
}
Also used : XElement(com.sencha.gxt.core.client.dom.XElement) XElement(com.sencha.gxt.core.client.dom.XElement) Element(com.google.gwt.dom.client.Element) FxElement(com.sencha.gxt.fx.client.FxElement) TabItemConfig(com.sencha.gxt.widget.core.client.TabItemConfig) Point(com.sencha.gxt.core.client.util.Point)

Example 8 with XElement

use of com.sencha.gxt.core.client.dom.XElement in project activityinfo by bedatadriven.

the class LogicalTabPanel method onBrowserEvent.

@Override
public void onBrowserEvent(Event event) {
    XElement target = event.getEventTarget().cast();
    if (target == null) {
        return;
    }
    boolean isbar = appearance.getBar(getElement()).isOrHasChild(target);
    boolean orig = disableContextMenu;
    // allow right clicks in tab panel body
    if (!isbar && disableContextMenu) {
        disableContextMenu = false;
    }
    super.onBrowserEvent(event);
    if (!isbar) {
        disableContextMenu = orig;
        return;
    }
    Element item = findItem(target);
    if (item != null) {
        int index = itemIndex(item);
        if (index < 0) {
            // tab may have already closed
            return;
        }
        TabItemConfig config = getConfig(getModel(index));
        if (config != null && !config.isEnabled()) {
            return;
        }
    }
    switch(event.getTypeInt()) {
        case Event.ONCLICK:
            onClick(event);
            break;
        case Event.ONMOUSEOVER:
            appearance.onMouseOver(getElement(), event.getEventTarget().<XElement>cast());
            break;
        case Event.ONMOUSEOUT:
            appearance.onMouseOut(getElement(), event.getEventTarget().<XElement>cast());
            break;
    }
}
Also used : XElement(com.sencha.gxt.core.client.dom.XElement) XElement(com.sencha.gxt.core.client.dom.XElement) Element(com.google.gwt.dom.client.Element) FxElement(com.sencha.gxt.fx.client.FxElement) TabItemConfig(com.sencha.gxt.widget.core.client.TabItemConfig) Point(com.sencha.gxt.core.client.util.Point)

Aggregations

XElement (com.sencha.gxt.core.client.dom.XElement)8 Point (com.sencha.gxt.core.client.util.Point)5 Element (com.google.gwt.dom.client.Element)3 FxElement (com.sencha.gxt.fx.client.FxElement)3 TabItemConfig (com.sencha.gxt.widget.core.client.TabItemConfig)2 XDOM (com.sencha.gxt.core.client.dom.XDOM)1 AfterAnimateEvent (com.sencha.gxt.fx.client.animation.AfterAnimateEvent)1 AfterAnimateHandler (com.sencha.gxt.fx.client.animation.AfterAnimateEvent.AfterAnimateHandler)1 Fx (com.sencha.gxt.fx.client.animation.Fx)1