Returns an instance of the viewer for the current page. If no instance yet exists and
forceCreate is true, one is created.

@param forceCreate If true, a viewer instance will be created if it does not exist.
@return The help viewer (may be null).
545168
public static IHelpViewer getViewer(boolean forceCreate) {
        Page page = getPage();
        IHelpViewer viewer = (IHelpViewer) page.getAttribute(VIEWER_ATTRIB);
        return viewer != null ? viewer : forceCreate ? createViewer(page) : null;
    }
94450
public function getViewer()
    {
        if (!isset($this->viewer)) {
            $this->viewer = $this->createPHPView(['path' => $this->getViewPath()]);
        }
        
        return $this->viewer;
    }
705096
public T build() {
        C clientObject = client;
        if (clientObject == null) {
            clientObject = createClient();
        }

        return factory.create(clientObject);
    }
113200
@Override
    protected void onCreate(Bundle savedInstanceState) {
        final RoboInjector injector = RoboGuice.getInjector(this);
        eventManager = injector.getInstance(EventManager.class);
        preferenceListener = injector.getInstance(PreferenceListener.class);
        injector.injectMembersWithoutViews(this);
        super.onCreate(savedInstanceState);
        eventManager.fire(new OnCreateEvent(savedInstanceState));
    }
817242
public ResourceFactory createChild() {
        ResourceFactory child = new ResourceFactory(this);
        this.chidren.add(new WeakReference<>(child));
        return child;
    }
302543
public function getCustomUI($createIfEmpty = true)
    {
        if (!$this->customUI && $createIfEmpty) {
            $this->setCustomUI(new CustomUI());
        }
        return $this->customUI;
    }
383415
@Override
    public Client getClientInstance()
    {
        // if threadsafe recycle the same single instance; if not create a new
        // instance

        if (isThreadSafe())
        {
            logger.info("Returning threadsafe used client instance for persistence unit : " + persistenceUnit);
            if (client == null)
            {
                client = instantiateClient(persistenceUnit);
            }
        }
        else
        {
            logger.debug("Returning fresh client instance for persistence unit : " + persistenceUnit);
            // no need to hold a client reference.
            return instantiateClient(persistenceUnit);
        }

        return client;
    }
308455
private static RequestCreator getCreator(RequestType pType) {
        RequestCreator creator = CREATOR_MAP.get(pType);
        if (creator == null) {
            throw new UnsupportedOperationException("Type " + pType + " is not supported (yet)");
        }
        return creator;
    }
558447
public synchronized static void init(boolean forceCreate) {
    if (!isInitialized) {
      if(processEngines == null) {
        // Create new map to store process-engines if current map is null
        processEngines = new HashMap<String, ProcessEngine>();
      }
      ClassLoader classLoader = ReflectUtil.getClassLoader();
      Enumeration<URL> resources = null;
      try {
        resources = classLoader.getResources("camunda.cfg.xml");
      } catch (IOException e) {
        try {
          resources = classLoader.getResources("activiti.cfg.xml");
        } catch(IOException ex) {
          if(forceCreate) {
            throw new ProcessEngineException("problem retrieving camunda.cfg.xml and activiti.cfg.xml resources on the classpath: "+System.getProperty("java.class.path"), ex);
          } else {
            return;
          }
        }
      }

      // Remove duplicated configuration URL's using set. Some classloaders may return identical URL's twice, causing duplicate startups
      Set<URL> configUrls = new HashSet<URL>();
      while (resources.hasMoreElements()) {
        configUrls.add( resources.nextElement() );
      }
      for (Iterator<URL> iterator = configUrls.iterator(); iterator.hasNext();) {
        URL resource = iterator.next();
        initProcessEngineFromResource(resource);
      }

      try {
        resources = classLoader.getResources("activiti-context.xml");
      } catch (IOException e) {
        if(forceCreate) {
          throw new ProcessEngineException("problem retrieving activiti-context.xml resources on the classpath: "+System.getProperty("java.class.path"), e);
        } else {
          return;
        }
      }
      while (resources.hasMoreElements()) {
        URL resource = resources.nextElement();
        initProcessEngineFromSpringResource(resource);
      }

      isInitialized = true;
    } else {
      LOG.processEngineAlreadyInitialized();
    }
  }
1065331
private WebChromeClient getCurrentWebChromeClient(){
		WebChromeClient currentWebChromeClient = null;

		Object currentWebView = viewFetcher.getFreshestView(viewFetcher.getCurrentViews(WebView.class, true));

		if (android.os.Build.VERSION.SDK_INT >= 16) {
			try{
				currentWebView = new Reflect(currentWebView).field("mProvider").out(Object.class);
			}catch(IllegalArgumentException ignored) {}
		}

		try{
			if (android.os.Build.VERSION.SDK_INT >= 19) {
				Object mClientAdapter = new Reflect(currentWebView).field("mContentsClientAdapter").out(Object.class);
				currentWebChromeClient = new Reflect(mClientAdapter).field("mWebChromeClient").out(WebChromeClient.class);
			}
			else {
				Object mCallbackProxy = new Reflect(currentWebView).field("mCallbackProxy").out(Object.class);
				currentWebChromeClient = new Reflect(mCallbackProxy).field("mWebChromeClient").out(WebChromeClient.class);
			}
		}catch(Exception ignored){}

		return currentWebChromeClient;
	}
814623
public function getView(): ?Factory
    {
        if (!$this->hasView()) {
            $this->setView($this->getDefaultView());
        }
        return $this->view;
    }
876702
@Override
    public Object createResource(final ResourceInfo resInfo) throws Exception {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "createResource", resInfo);

        Object connectionFactory;

        lock.readLock().lock();
        try {
            if (!isInitialized.get()) {
                // Switch to write lock for lazy initialization
                lock.readLock().unlock();
                lock.writeLock().lock();
                try {
                    if (!isInitialized.get())
                        initPrivileged();
                } finally {
                    // Downgrade to read lock for rest of method
                    lock.readLock().lock();
                    lock.writeLock().unlock();
                }
            }
            checkAccess();
            ConnectionManager conMgr = AccessController.doPrivileged(new PrivilegedExceptionAction<ConnectionManager>() {
                @Override
                public ConnectionManager run() throws Exception {
                    return conMgrSvc.getConnectionManager(resInfo, AbstractConnectionFactoryService.this);
                }
            });
            connectionFactory = getManagedConnectionFactory(null).createConnectionFactory(conMgr);
        } catch (Exception x) {
            if (trace && tc.isEntryEnabled())
                Tr.exit(this, tc, "createResource", x);
            throw x;
        } catch (Error x) {
            if (trace && tc.isEntryEnabled())
                Tr.exit(this, tc, "createResource", x);
            throw x;
        } finally {
            lock.readLock().unlock();
        }

        // Only connection factories defined in the server configuration are tracked for the app recycle coordinator.
        if (isServerDefined) {
            ComponentMetaData cData = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
            if (cData != null)
                appsToRecycle.add(cData.getJ2EEName().getApplication());
        }

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "createResource", connectionFactory);
        return connectionFactory;
    }
1226482
private <S> ConvertManagerTypeImpl<S> getOrCreate(Class<S> sourceType)
  {
    ConvertManagerTypeImpl<S> convertType
    = (ConvertManagerTypeImpl<S>) _convertMap.get(sourceType);
  
    if (convertType != null) {
      return convertType;
    }
    
    convertType = new ConvertManagerTypeImpl<>(sourceType);
    
    _convertMap.putIfAbsent(sourceType, convertType);

    return (ConvertManagerTypeImpl<S>) _convertMap.get(sourceType);
  }
600616
function ViewerSelector(defaultViewer) {
  // Try to load the selected key from local storage.
  try {
    this.selectedKey = localStorage.getItem(VIEWER_KEY);
  } catch (error) {
    console.error('Failed to load viewer profile: %s', error);
  }

  //If none exists, or if localstorage is unavailable, use the default key.
  if (!this.selectedKey) {
    this.selectedKey = defaultViewer || DEFAULT_VIEWER;
  }

  this.dialog = this.createDialog_(DeviceInfo.Viewers);
  this.root = null;
  this.onChangeCallbacks_ = [];
}
1113117
@Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        getSupportActionBar().setDisplayShowTitleEnabled(true);
        getSupportActionBar().setDisplayUseLogoEnabled(false);
        getSupportActionBar().setTitle("CustomMediaPlayer");
        setContentView(R.layout.activity_api_custom_mediaplayer);

        jzvdStd = findViewById(R.id.videoplayer);

        JZDataSource jzDataSource = null;
        try {
            jzDataSource = new JZDataSource(getAssets().openFd("local_video.mp4"));
            jzDataSource.title = "饺子快长大";
        } catch (IOException e) {
            e.printStackTrace();
        }
        jzvdStd.setUp(jzDataSource, JzvdStd.SCREEN_NORMAL, JZMediaSystemAssertFolder.class);


//        jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
//                , "饺子快长大", JzvdStd.SCREEN_NORMAL, new JZMediaIjk(jzvdStd));

        Glide.with(this)
                .load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png")
                .into(jzvdStd.thumbImageView);

    }
1174573
public Object getSearchView() {
        if (searchView != null) {
            return searchView;
        } else if (supportView != null) {
            return supportView;
        }
        throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
    }
680318
@Override
    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    protected View onCreateView(View parent, String name, AttributeSet attrs) throws ClassNotFoundException {
        return mCalligraphyFactory.onViewCreated(super.onCreateView(parent, name, attrs),
                getContext(), attrs);
    }