use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.
the class CubaFieldGroupLayoutComponentSlot method onBrowserEvent.
@Override
public void onBrowserEvent(Event event) {
if (DOM.eventGetType(event) == Event.ONCLICK) {
Element target = Element.as(event.getEventTarget());
ComponentConnector componentConnector = Util.findConnectorFor(getWidget());
if (target == contextHelpIndicatorElement && componentConnector instanceof HasContextHelpConnector) {
HasContextHelpConnector connector = (HasContextHelpConnector) componentConnector;
if (hasContextHelpIconListeners(componentConnector.getState())) {
connector.contextHelpIconClick(event);
}
}
}
}
use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.
the class CubaFieldGroupLayoutComponentSlot method createRightCaption.
protected Element createRightCaption() {
Element rightCaption = DOM.createDiv();
getLayoutManager().registerDependency((ManagedLayout) getChild().getParent(), rightCaption);
rightCaption.setClassName(VCaption.CLASSNAME);
rightCaption.addClassName(INDICATORS_CLASSNAME);
rightCaption.getStyle().setDisplay(Style.Display.INLINE_BLOCK);
rightCaption.getStyle().setPosition(Style.Position.ABSOLUTE);
return rightCaption;
}
use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.
the class CubaFileUploadProgressWindow method fixIE8FocusCaptureIssue.
private void fixIE8FocusCaptureIssue() {
Element e = DOM.createInputText();
Style elemStyle = e.getStyle();
elemStyle.setPosition(Style.Position.ABSOLUTE);
elemStyle.setTop(-10, Style.Unit.PX);
elemStyle.setWidth(0, Style.Unit.PX);
elemStyle.setHeight(0, Style.Unit.PX);
contentPanel.getElement().appendChild(e);
e.focus();
contentPanel.getElement().removeChild(e);
}
use of com.google.gwt.dom.client.Element in project openremote by openremote.
the class AssetBrowserImpl method showAndSelectNode.
@Override
public void showAndSelectNode(String[] path, BrowserTreeNode treeNode, boolean scrollIntoView) {
List<BrowserTreeNode> selectedPath = new AssetTree.AssetIdSearch().resolvePath(Arrays.asList(path), assetTree.getRootTreeNode());
if (selectedPath.size() > 0) {
BrowserTreeNode selectedNode = selectedPath.get(selectedPath.size() - 1);
assetTree.getTreeViewModel().getSelectionModel().setSelected(selectedNode, true);
if (!scrollIntoView)
return;
// We place the selected asset in the middle of the tree container
elemental.dom.Element treeElement = (elemental.dom.Element) assetTree.getElement();
elemental.dom.Element assetElement = treeElement.querySelector(AssetTreeCell.CELL_ID_SELECTOR(treeNode));
int offsetTop = 0;
if (assetElement != null && assetElement.getOffsetParent() != null) {
elemental.dom.Element el = assetElement.getOffsetParent();
do {
offsetTop += el.getOffsetTop();
} while ((el = el.getOffsetParent()) != null);
Element treeContainerElement = assetTreeContainer.getElement();
treeContainerElement.setAttribute("tabindex", "1");
int middleOffset = offsetTop - treeContainerElement.getClientHeight() / 2 - treeContainerElement.getOffsetTop();
treeContainerElement.setScrollTop(middleOffset);
}
}
}
use of com.google.gwt.dom.client.Element in project opennms by OpenNMS.
the class MapQuestMapPanel method initializeMap.
/**
* <p>initializeMap</p>
*/
private void initializeMap() {
m_map = MQATileMap.newInstance(m_mapHolder.getElement());
m_map.addControl(MQALargeZoomControl.newInstance());
m_map.setZoomLevel(1);
m_map.setCenter(MQALatLng.newInstance("0,0"));
m_map.addMoveEndHandler(new MoveEndHandler() {
@Override
public void onMoveEnd(final MoveEndEvent event) {
m_eventBus.fireEvent(new MapPanelBoundsChangedEvent(getBounds()));
}
});
m_map.addClickHandler(new com.googlecode.gwtmapquest.transaction.event.ClickHandler() {
@Override
public void onClicked(final com.googlecode.gwtmapquest.transaction.event.ClickEvent event) {
m_clickCounter.incrementCounter(event.getLL());
}
});
m_map.addDblClickHandler(new DblClickHandler() {
@Override
public void onDblClicked(DblClickEvent event) {
m_clickCounter.incrementCounter(event.getLL());
}
});
m_map.addZoomEndHandler(new ZoomEndHandler() {
@Override
public void onZoomEnd(ZoomEndEvent event) {
m_eventBus.fireEvent(new MapPanelBoundsChangedEvent(getBounds()));
}
});
m_map.addShapeAddedHandler(new ShapeAddedHandler() {
@Override
public void onShapeAdded(ShapeAddedEvent event) {
Element mqPoiDiv = DOM.getElementById("mqpoidiv");
Element markerElement = Element.as(mqPoiDiv.getLastChild());
updatePOILayer(markerElement);
}
});
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
syncMapSizeWithParent();
}
});
}
Aggregations