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());
}
}
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);
}
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;
}
}
Aggregations