Hands back the View that this Presenter works with
A match is made if the ViewProvider finds a VaadinView annotated View whose name matches Presenter's viewName
@return an implementor of {@link View}
174031
@SuppressWarnings("unchecked")
    public V getView() {
        V result = null;
        if (viewName != null) {
            result = (V) viewProvider.getView(viewName);
        }
        return result;
    }
725769
@CheckResult
    @NonNull
    public static PowerAdapter asAdapter(@NonNull ViewFactory... views) {
        checkNotNull(views, "views");
        if (views.length == 0) {
            return EMPTY;
        }
        return new ItemAdapter(ItemAdapter.toItems(asList(views)));
    }
424185
public static Object callGetter(View view, String methodName) {
        try {
            Method method = view.getClass().getMethod(methodName);
            return method.invoke(view);
        } catch (SecurityException ex) {
            throw new AttributeAccessException(ex);
        } catch (NoSuchMethodException ex) {
            throw new AttributeAccessException("No such attribute", ex);
        } catch (IllegalAccessException ex) {
            throw new AttributeAccessException(ex);
        } catch (InvocationTargetException ex) {
            throw new AttributeAccessException(ex);
        }
    }
1186756
public Addon getAddonForView(final AddonView view, final AddonId id)
   {
      return lock.performLocked(LockMode.READ, new Callable<Addon>()
      {
         @Override
         public Addon call() throws Exception
         {
            for (AddonVertex vertex : getCurrentGraph().getGraph().vertexSet())
            {
               if (vertex.getAddonId().equals(id) && vertex.getViews().contains(view))
               {
                  return vertex.getAddon();
               }
            }
            return null;
         }
      });
   }
377717
public static ProgressLayout wrap(final View targetView){
        if(targetView==null){
            throw new IllegalArgumentException();
        }

        final ProgressLayout progressLayout = new ProgressLayout(targetView.getContext());
        progressLayout.attachTo(targetView);
        return progressLayout;
    }
160656
View createPresetsView() {
    View contentView = View.inflate(getActivity(), R.layout.cpv_dialog_presets, null);
    shadesLayout = (LinearLayout) contentView.findViewById(R.id.shades_layout);
    transparencySeekBar = (SeekBar) contentView.findViewById(R.id.transparency_seekbar);
    transparencyPercText = (TextView) contentView.findViewById(R.id.transparency_text);
    GridView gridView = (GridView) contentView.findViewById(R.id.gridView);

    loadPresets();

    if (showColorShades) {
      createColorShades(color);
    } else {
      shadesLayout.setVisibility(View.GONE);
      contentView.findViewById(R.id.shades_divider).setVisibility(View.GONE);
    }

    adapter = new ColorPaletteAdapter(new ColorPaletteAdapter.OnColorSelectedListener() {
      @Override public void onColorSelected(int newColor) {
        if (color == newColor) {
          // Double tab selects the color
          ColorPickerDialog.this.onColorSelected(color);
          dismiss();
          return;
        }
        color = newColor;
        if (showColorShades) {
          createColorShades(color);
        }
      }
    }, presets, getSelectedItemPosition(), colorShape);

    gridView.setAdapter(adapter);

    if (showAlphaSlider) {
      setupTransparency();
    } else {
      contentView.findViewById(R.id.transparency_layout).setVisibility(View.GONE);
      contentView.findViewById(R.id.transparency_title).setVisibility(View.GONE);
    }

    return contentView;
  }
1367126
@SuppressWarnings("unchecked")
  public static <T extends View> T findViewById(View containerView, int viewId) {
    View foundView = containerView.findViewById(viewId);
    return (T) foundView;
  }
309197
private int compareView(ViewRef<?> viewA, 
                          ViewRef<?> viewB,
                          Class<?> type)
  {
    int cmp = viewB.priority() - viewA.priority();
    
    if (cmp != 0) {
      return cmp;
    }
    
    cmp = typeDepth(viewA.type(), type) - typeDepth(viewB.type(), type);

    if (cmp != 0) {
      return cmp;
    }
    
    // equivalent views are sorted by name to ensure consistency
    
    String nameA = viewA.resolver().getClass().getName();
    String nameB = viewB.resolver().getClass().getName();
    
    return nameA.compareTo(nameB); 
  }
503624
private boolean findListView(@NonNull final View view) {
        if (view instanceof AbsListView) {
            this.listView = (AbsListView) view;
            this.listView.setOnScrollListener(createListViewScrollListener());
            return true;
        } else if (view instanceof ViewGroup) {
            ViewGroup viewGroup = (ViewGroup) view;

            for (int i = 0; i < viewGroup.getChildCount(); i++) {
                if (findListView(viewGroup.getChildAt(i))) {
                    return true;
                }
            }
        }

        return false;
    }
648049
private void validateAttributesToCreateANewRendererViewHolder() {
    if (viewType == null) {
      throw new NullContentException(
          "RendererBuilder needs a view type to create a RendererViewHolder");
    }
    if (layoutInflater == null) {
      throw new NullLayoutInflaterException(
          "RendererBuilder needs a LayoutInflater to create a RendererViewHolder");
    }
    if (parent == null) {
      throw new NullParentException(
          "RendererBuilder needs a parent to create a RendererViewHolder");
    }
  }
1098155
protected View getView(String viewName) {
        for (View view: solo.getCurrentViews()) {
            if (view.toString().contains(viewName)) {
                return view;
            }
        }

        return null;
    }
1135332
public void putPresenter(@NonNull String viewId,
      @NonNull MvpPresenter<? extends MvpView> presenter) {

    if (viewId == null) {
      throw new NullPointerException("ViewId is null");
    }

    if (presenter == null) {
      throw new NullPointerException("Presenter is null");
    }

    PresenterHolder presenterHolder = presenterMap.get(viewId);
    if (presenterHolder == null) {
      presenterHolder = new PresenterHolder();
      presenterHolder.presenter = presenter;
      presenterMap.put(viewId, presenterHolder);
    } else {
      presenterHolder.presenter = presenter;
    }
  }
702034
@SuppressWarnings("unused") // expose utility check method to subclasses
    protected FormValidation checkDisplayName(@Nonnull View view, @CheckForNull String value) {
        if (StringUtils.isBlank(value)) {
            // no custom name, no need to check
            return FormValidation.ok();
        }
        for (View v: view.owner.getViews()) {
            if (v.getViewName().equals(view.getViewName())) {
                continue;
            }
            if (StringUtils.equals(v.getDisplayName(), value)) {
                return FormValidation.warning(Messages.View_DisplayNameNotUniqueWarning(value));
            }
        }
        return FormValidation.ok();
    }
65929
public ViewFactory getViewFactory()
    {
        if (m_viewFactory != null)
            return m_viewFactory;
        m_viewFactory = super.getViewFactory();
        if (m_viewFactory != null)
            return m_viewFactory;
        String viewType = this.getProperty(ScreenModel.VIEW_TYPE);
        if (viewType == null)
            viewType = ScreenModel.SWING_TYPE;
        char viewPrefix = Character.toUpperCase(viewType.charAt(0));
        if (ScreenModel.SWING_TYPE.equalsIgnoreCase(viewType))
            viewPrefix = 'V';   // Special, swing starts with 'V'
        return m_viewFactory = ViewFactory.getViewFactory(viewType, viewPrefix);
    }
378614
public <T extends View> boolean waitForView(View view){
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "waitForView("+view+")");
		}
		
		return waiter.waitForView(view);
	}
1272040
public static View resolveView(HttpServletRequest request, UrlMappingInfo info, String viewName, ViewResolver viewResolver) throws Exception {
        String controllerName = info.getControllerName();
        return WebUtils.resolveView(request, viewName, controllerName, viewResolver);
    }
988772
View getViewWithKey(String key) {
        if (key == null) {
            throw new IllegalArgumentException("A key must be specified.");
        }

        Set<View> views = new HashSet<>();
        views.addAll(systemLandscapeViews);
        views.addAll(systemContextViews);
        views.addAll(containerViews);
        views.addAll(componentViews);
        views.addAll(dynamicViews);
        views.addAll(deploymentViews);

        return views.stream().filter(v -> key.equals(v.getKey())).findFirst().orElse(null);
    }