getNewWindow()

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2012-10-27

@return HubWindow
327069
public function getNewWindow()
    {
        switch ($this->getDeliveryType())
        {
            case HubWindow::DELIVERY_TYPE_PICKUP:

              $window = new HubPickupWindow();

              break;

            case HubWindow::DELIVERY_TYPE_DELIVERY:

              $window = new HubDeliveryWindow();

              break;
        }

        $this->getHub()->addHubWindow($window);

        return $window;
    }
973797
public function build(): SetWindowBoundsRequest
	{
		$instance = new SetWindowBoundsRequest();
		if ($this->windowId === null) {
			throw new BuilderException('Property [windowId] is required.');
		}
		$instance->windowId = $this->windowId;
		if ($this->bounds === null) {
			throw new BuilderException('Property [bounds] is required.');
		}
		$instance->bounds = $this->bounds;
		return $instance;
	}
1257364
public function addHubWindow(\HarvestCloud\CoreBundle\Entity\HubWindow $window)
    {
        $this->windows[] = $window;

        $window->setWindowMaker($this);
    }
1216469
public static String getHub() throws InvalidHubException {
        String hub = getProgramProperty(HUB);
        if (hub == null || "".equals(hub)) {
            throw new InvalidHubException("Hub isn't set");
        }
        return hub;
    }
1215320
public function getNewestInThread()
    {
        $newest = $this;
        $next_reply = function ($message) use (&$next_reply, &$newest)
        {
            if ($message->getReplies()) {
                foreach ($message->getReplies() as $r) {
                    $next_reply($r);
                }
            }
            if ($message->getCreatedAt() > $newest->getCreatedAt()) {
                $newest = $message;
            }
        };

        $next_reply($this);
        return $newest;
    }
543436
public function getGateway() {
        if (is_null($this->gateway)) {
            $this->gateway = $this->getZendServiceManager()->get(self::SERVICE_SEARCH_ID)
                ->setServiceLocator($this->getZendServiceManager())
                ->init();
        }
        return $this->gateway;
    }
934080
public function getContent()
    {

        $this->checkContainerVisibility();


        $this->href = $this->url;

        $this->loadHyperlink();

        /*if ($this->openNewWindow) {
            $this->target = HyperlinkTarget::BLANK;
        }*/

        return parent::getContent();

    }
1279038
public function getNext()
    {
        $cursor = $this;
        $next = $this->retry(function() use ($cursor) {
            return $cursor->getRiakCursor()->getNext();
        }, false);
        if ($next instanceof \RiakGridFSFile) {
            $document = $next->file;
            $document['file'] = new GridFSFile($next);
            $next = $document;
        }
        return $next;
    }
847585
public Window getWindow ()
    {
        Component parent = getParent();
        while (!(parent instanceof Window) && parent != null) {
            parent = parent.getParent();
        }
        return (Window)parent;
    }
275589
public function newUpload()
    {
        if (null === $this->getFile()) {
            return null;
        }

        $this->moveFile();

        return $this->getUploadRootDir() . $this->path;
    }
864018
protected function getNewKeys() {
        if (!$this->_newKeys) {
            $this->_newKeys = new NewKeyList($this->version, $this->solution['sid']);
        }

        return $this->_newKeys;
    }
1371076
private function getClient()
    {
        if ($this->client === null) {
            $this->client = new $this->clientClassName($this->config->hostname, [
                'credentials' => \Grpc\ChannelCredentials::createInsecure(),
            ]);
        }

        return $this->client;
    }
621272
public function getStubNodePeerBuilder()
    {
        if (!isset($this->stubNodePeerBuilder)) {
            $this->stubNodePeerBuilder = $this->getGeneratorConfig()->getConfiguredBuilder($this->getTable(), 'nodepeerstub');
        }

        return $this->stubNodePeerBuilder;
    }
1185195
public Window getParentWindow() {
		if (parentWindow == null) {
			if ((parentComponent == null) && (getApplicationConfig().windowManager().getActiveWindow() != null)) {
				parentWindow = getApplicationConfig().windowManager().getActiveWindow().getControl();
			}
			else {
				parentWindow = getWindowForComponent(parentComponent);
			}
		}
		return parentWindow;
	}
234630
protected function getNewInstance()
    {
        $className = $this->objectMetadata->getName();

        if (class_exists($className) === false) {
            throw new \RuntimeException('Unable to create new instance of ' . $className);
        }

        return new $className;
    }
122276
protected function getNewWindow($sessionHandleList)
    {
        $newSessionHandleList = $this->getSessionWindowHandles();
        $sessionHandleCount = count($sessionHandleList);
        $newSessionHandleCount = count($newSessionHandleList);
        $newWindowHandleList = array_diff($newSessionHandleList, $sessionHandleList);
        if ($newSessionHandleCount - $sessionHandleCount == 1 && count($newWindowHandleList) == 1) {
            /**
             * If amount of current session handles increments exactly by 1 and new handle only 1 -
             * this is new window handle.
             */
            return array_shift($newWindowHandleList);
        } elseif ($newSessionHandleCount == $sessionHandleCount && count($newWindowHandleList) == 0) {
            return;
        } else {
            throw new WebDriver_Exception(
                "Unexpected behaviour while waiting for new window: \n" .
                "Handles before wait started: " . var_export($sessionHandleList, true) . "\n" .
                "Handles current: " . var_export($newSessionHandleList, true)
            );
        }
    }
391135
public function current()
    {
        if ($this->_curval == null) {
            return $this->next();
        }
        return new $this->_cls($this->_curval);
    }