use of com.google.gwt.dom.client.Element in project drools-wb by kiegroup.
the class RadarMenuViewImpl method setup.
@PostConstruct
public void setup() {
radarCanvas.add(radarLayer);
radarMenuDropdown.setTitle(translationService.getTranslation(GuidedDecisionTableErraiConstants.RowContextMenuViewImpl_Title));
visibleBounds.setDraggable(true);
visibleBounds.addNodeDragMoveHandler(new NodeDragMoveHandler() {
@Override
public void onNodeDragMove(final NodeDragMoveEvent event) {
presenter.onDragVisibleBounds(visibleBounds.getX(), visibleBounds.getY());
}
});
visibleBounds.setFillColor(ColorName.GRAY);
visibleBounds.setAlpha(0.25);
visibleBounds.setLocation(new Point2D((RADAR_WIDTH - visibleBounds.getWidth()) / 2, (RADAR_HEIGHT - visibleBounds.getHeight()) / 2));
radarLayer.add(visibleBounds);
radarCanvas.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (eventTargetsPopup(event.getNativeEvent(), radarMenu)) {
event.stopPropagation();
event.preventDefault();
}
}
private boolean eventTargetsPopup(final NativeEvent event, final Element element) {
final EventTarget target = event.getEventTarget();
if (Element.is(target)) {
return element.isOrHasChild(Element.as(target));
}
return false;
}
});
}
use of com.google.gwt.dom.client.Element in project kie-wb-common by kiegroup.
the class ShowcaseEntryPoint method hideLoadingPopup.
// Fade out the "Loading application" pop-up
private void hideLoadingPopup() {
final Element e = RootPanel.get("loading").getElement();
new Animation() {
@Override
protected void onUpdate(double progress) {
e.getStyle().setOpacity(1.0 - progress);
}
@Override
protected void onComplete() {
e.getStyle().setVisibility(Style.Visibility.HIDDEN);
}
}.run(500);
}
use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.
the class CubaLinkWidget method setRel.
public void setRel(String rel) {
Element element = getElement().getFirstChildElement();
element.setAttribute("rel", rel);
}
use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.
the class EnterKeyDownHandler method onKeyDown.
@Override
public void onKeyDown(GridKeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
if (isCellContainingComponent(event.getFocusedCell())) {
// if the ENTER key-event's propagation is not stopped it would
// be propagated to the newly focused component, which e.g. in the
// case of a button leads to an immediate button press
event.preventDefault();
event.stopPropagation();
Element componentElement = extractComponentElement(event.getFocusedCell());
WidgetUtil.focus(componentElement);
focusInputField(componentElement);
}
}
}
use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.
the class CubaSourceCodeEditorWidget method setEnabled.
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
super.setReadOnly(!enabled || readOnly);
if (editor != null) {
Element textAreaElement = getTextAreaElement();
if (enabled) {
textAreaElement.removeAttribute("disabled");
} else {
textAreaElement.setAttribute("disabled", "disabled");
}
updateTabIndex();
}
}
Aggregations