use of com.google.gwt.user.client.ui.Focusable in project rstudio by rstudio.
the class FocusTransitionManager method register.
private void register(final Widget widget) {
if (registration_.contains(widget))
return;
registration_.add(widget);
widget.addDomHandler(new KeyDownHandler() {
@Override
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_TAB) {
boolean forward = !event.isShiftKeyDown();
Widget target = get(widget, forward);
if (target == null)
return;
if (target instanceof CanFocus) {
event.stopPropagation();
event.preventDefault();
focus((CanFocus) target);
} else if (target instanceof Focusable) {
event.stopPropagation();
event.preventDefault();
focus((Focusable) target);
}
}
}
}, KeyDownEvent.getType());
}
use of com.google.gwt.user.client.ui.Focusable in project blogwt by billy1380.
the class PropertiesPage method ready.
private void ready() {
btnUpdate.getElement().setInnerSafeHtml(WizardDialog.WizardDialogTemplates.INSTANCE.nextButton("Update"));
// enable properties
btnUpdate.setEnabled(true);
if (propertyWidgets != null) {
for (Widget widget : propertyWidgets) {
if (widget instanceof Focusable) {
((Focusable) widget).setFocus(true);
break;
}
}
}
}
use of com.google.gwt.user.client.ui.Focusable in project che by eclipse.
the class ProcessesPanelViewImpl method focusGained.
@Override
public void focusGained(SubPanel subPanel, IsWidget widget) {
focusedSubPanel = subPanel;
final ProcessTreeNode processTreeNode = widget2TreeNodes.get(widget);
if (processTreeNode != null) {
selectNode(processTreeNode);
}
if (lastFosuced != null && !lastFosuced.equals(widget)) {
lastFosuced.setFocus(false);
}
if (widget instanceof Focusable) {
((Focusable) widget).setFocus(true);
lastFosuced = (Focusable) widget;
}
}
Aggregations