use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.
the class CubaTabSheetWidget method handleBadDD.
protected void handleBadDD(NativeEvent event) {
Element target = WidgetUtil.getElementUnderMouse(event);
if (target == null) {
VDragAndDropManager.get().interruptDrag();
return;
}
Node targetParent = DOM.asOld(target).getParentNode();
if (!getElement().isOrHasChild(targetParent)) {
VDragAndDropManager.get().interruptDrag();
}
}
use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.
the class CubaTreeTableConnector method init.
@Override
protected void init() {
super.init();
getWidget()._delegate.cellClickListener = new TableCellClickListener() {
@Override
public void onClick(String columnKey, int rowKey) {
getRpcProxy(CubaTableServerRpc.class).onClick(columnKey, String.valueOf(rowKey));
}
};
tooltipHandlerRegistration = Event.addNativePreviewHandler(new Event.NativePreviewHandler() {
@Override
public void onPreviewNativeEvent(Event.NativePreviewEvent event) {
if (event.getTypeInt() != Event.ONMOUSEMOVE || !Element.is(event.getNativeEvent().getEventTarget())) {
return;
}
Element element = Element.as(event.getNativeEvent().getEventTarget());
if ("div".equalsIgnoreCase(element.getTagName())) {
String className = element.getClassName();
if (className != null && (className.contains("v-table-caption-container") || className.contains("v-table-footer-container"))) {
DomEvent.fireNativeEvent(event.getNativeEvent(), getWidget());
}
}
}
});
}
use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.
the class CubaTreeTableConnector method getTooltipInfo.
@Override
public TooltipInfo getTooltipInfo(Element element) {
if (getState().columnDescriptions != null) {
Element targetHeaderElement = findCurrentOrParentTd(element);
if (targetHeaderElement != null) {
// if column has description
int childIndex = DOM.getChildIndex(targetHeaderElement.getParentElement(), targetHeaderElement);
String columnKey = getWidget().tHead.getHeaderCell(childIndex).getColKey();
if (columnKey != null) {
String columnDescription = getState().columnDescriptions.get(columnKey);
if (columnDescription != null && !columnDescription.isEmpty()) {
return new TooltipInfo(columnDescription);
}
}
}
}
if (getState().aggregationDescriptions != null) {
Element targetAggregatedElement = findCurrentOrParentTd(element);
if (targetAggregatedElement != null && (targetAggregatedElement.hasClassName("v-table-aggregation-cell") || targetAggregatedElement.hasClassName("v-table-footer-container"))) {
int childIndex = DOM.getChildIndex(targetAggregatedElement.getParentElement(), targetAggregatedElement);
String columnKey = getWidget().tHead.getHeaderCell(childIndex).getColKey();
if (columnKey != null) {
String columnTooltip = getState().aggregationDescriptions.get(columnKey);
if (columnTooltip != null && !columnTooltip.isEmpty()) {
return new TooltipInfo(columnTooltip);
}
}
}
}
if (element != getWidget().getElement()) {
Object node = WidgetUtil.findWidget(element, CubaTreeTableWidget.CubaTreeTableBody.CubaTreeTableRow.class);
if (node != null) {
CubaTreeTableWidget.CubaTreeTableBody.CubaTreeTableRow row = (CubaTreeTableWidget.CubaTreeTableBody.CubaTreeTableRow) node;
return row.getTooltip(element);
}
}
return super.getTooltipInfo(element);
}
use of com.google.gwt.dom.client.Element in project pentaho-platform by pentaho.
the class SolutionBrowserPanel method adjustHeight.
private void adjustHeight() {
Element pucHeader = DOM.getElementById("pucHeader");
if (pucHeader != null) {
final boolean isIE = RootPanel.getBodyElement().getClassName().contains("IE8") || RootPanel.getBodyElement().getClassName().contains("IE9") || RootPanel.getBodyElement().getClassName().contains("IE10");
final int offset = pucHeader.getOffsetHeight();
setElementHeightOffset(navigatorAndContentSplit.getElement(), -1 * offset);
setElementHeightOffset(contentTabPanel.getElement(), isIE ? -1 * (offset + 36) : -1 * offset);
Timer t = new Timer() {
public void run() {
setElementHeightOffset(navigatorAndContentSplit.getElement(), -1 * offset);
setElementHeightOffset(contentTabPanel.getElement(), isIE ? -1 * (offset + 36) : -1 * offset);
}
};
t.schedule(100);
}
}
use of com.google.gwt.dom.client.Element in project activityinfo by bedatadriven.
the class OfflineMenu method updatePendingCountIcon.
private void updatePendingCountIcon(int count) {
Element countElement = Document.get().getElementById("pending-count");
countElement.setInnerText(Integer.toString(count));
pendingChangesItem.setText(I18N.MESSAGES.pendingChanges(count));
}
Aggregations