use of javax.annotation.Nullable in project stetho by facebook.
the class DialogDescriptor method getViewAndBoundsForHighlighting.
@Nullable
@Override
public View getViewAndBoundsForHighlighting(Dialog element, Rect bounds) {
final Descriptor.Host host = getHost();
Window window = null;
HighlightableDescriptor descriptor = null;
if (host instanceof AndroidDescriptorHost) {
window = element.getWindow();
descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(window);
}
return descriptor == null ? null : descriptor.getViewAndBoundsForHighlighting(window, bounds);
}
use of javax.annotation.Nullable in project stetho by facebook.
the class DialogDescriptor method getElementToHighlightAtPosition.
@Nullable
@Override
public Object getElementToHighlightAtPosition(Dialog element, int x, int y, Rect bounds) {
final Descriptor.Host host = getHost();
Window window = null;
HighlightableDescriptor descriptor = null;
if (host instanceof AndroidDescriptorHost) {
window = element.getWindow();
descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(window);
}
return descriptor == null ? null : descriptor.getElementToHighlightAtPosition(window, x, y, bounds);
}
use of javax.annotation.Nullable in project stetho by facebook.
the class DialogFragmentDescriptor method getViewAndBoundsForHighlighting.
@Nullable
@Override
public View getViewAndBoundsForHighlighting(Object element, Rect bounds) {
final Descriptor.Host host = getHost();
Dialog dialog = null;
HighlightableDescriptor descriptor = null;
if (host instanceof AndroidDescriptorHost) {
dialog = mAccessor.getDialog(element);
descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(dialog);
}
return descriptor == null ? null : descriptor.getViewAndBoundsForHighlighting(dialog, bounds);
}
use of javax.annotation.Nullable in project stetho by facebook.
the class FragmentDescriptor method getElementToHighlightAtPosition.
@Nullable
@Override
public Object getElementToHighlightAtPosition(Object element, int x, int y, Rect bounds) {
final Descriptor.Host host = getHost();
View view = null;
HighlightableDescriptor descriptor = null;
if (host instanceof AndroidDescriptorHost) {
view = mAccessor.getView(element);
descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(view);
}
return descriptor == null ? null : descriptor.getElementToHighlightAtPosition(view, x, y, bounds);
}
use of javax.annotation.Nullable in project error-prone by google.
the class UTypeVarIdent method defaultAction.
@Override
protected Choice<Unifier> defaultAction(Tree target, Unifier unifier) {
JCExpression expr = (JCExpression) target;
Type targetType = expr.type;
if (targetType == null) {
return Choice.none();
}
@Nullable TypeWithExpression boundType = unifier.getBinding(key());
if (boundType == null) {
unifier.putBinding(key(), expr.accept(QUALIFIED_FROM_PACKAGE, null) ? TypeWithExpression.create(targetType) : /* use the ImportPolicy to refer to this type */
TypeWithExpression.create(targetType, expr));
return Choice.of(unifier);
} else if (unifier.types().isSameType(targetType, boundType.type())) {
return Choice.of(unifier);
}
return Choice.none();
}
Aggregations