Register a createMode.
If no Mode is registered yet it will be used as the default mode

@param $modeName
@param CreateMode $createMode
185608
public function register( $modeName, CreateMode $createMode ) {
		if( empty($this->defaultMode) )
			$this->defaultMode = $modeName;

		$this->container[$modeName] = function() use ($createMode) {
			return $createMode;
		};
	}
92426
public void setMode(String mode) {
        checkNotNull(mode, "mode should not be null");
        if (MODE_ASYNC.equals(mode) || MODE_SYNC.equals(mode)) {
            this.mode = mode;
        } else {
            throw new IllegalArgumentException("illegal mode: " + mode);
        }
    }
1007684
function createModal(config) {

    var id = MODAL_JS_ID;
    var modalClassName = config.modalPrefixClass + MODAL_CLASS_SUFFIX;
    var modalClassWrapper = config.modalPrefixClass + MODAL_WRAPPER_CLASS_SUFFIX;
    var buttonCloseClassName = config.modalPrefixClass + MODAL_BUTTON_CLASS_SUFFIX;
    var buttonCloseInner = config.modalCloseImgPath ? '<img src="' + config.modalCloseImgPath + '" alt="' + config.modalCloseText + '" class="' + config.modalPrefixClass + MODAL_CLOSE_IMG_CLASS_SUFFIX + '" />' : '<span class="' + config.modalPrefixClass + MODAL_CLOSE_TEXT_CLASS_SUFFIX + '">\n                                          ' + config.modalCloseText + '\n                                         </span>';
    var contentClassName = config.modalPrefixClass + MODAL_CONTENT_CLASS_SUFFIX;
    var titleClassName = config.modalPrefixClass + MODAL_TITLE_CLASS_SUFFIX;
    var title = config.modalTitle !== '' ? '<h1 id="' + MODAL_TITLE_ID + '" class="' + titleClassName + '">\n                                          ' + config.modalTitle + '\n                                         </h1>' : '';
    var button_close = '<button type="button" class="' + MODAL_BUTTON_JS_CLASS + ' ' + buttonCloseClassName + '" id="' + MODAL_BUTTON_JS_ID + '" title="' + config.modalCloseTitle + '" ' + MODAL_BUTTON_CONTENT_BACK_ID + '="' + config.modalContentId + '" ' + MODAL_BUTTON_FOCUS_BACK_ID + '="' + config.modalFocusBackId + '">\n                               ' + buttonCloseInner + '\n                              </button>';
    var content = config.modalText;
    var describedById = config.modalDescribedById !== '' ? ATTR_DESCRIBEDBY + '="' + config.modalDescribedById + '"' : '';

    // If there is no content but an id we try to fetch content id
    if (content === '' && config.modalContentId) {
      var contentFromId = findById(config.modalContentId);
      if (contentFromId) {
        content = '<div id="' + MODAL_CONTENT_JS_ID + '">\n                              ' + contentFromId.innerHTML + '\n                             </div';
        // we remove content from its source to avoid id duplicates, etc.
        contentFromId.innerHTML = '';
      }
    }

    return '<dialog id="' + id + '" class="' + modalClassName + '" ' + ATTR_ROLE + '="' + MODAL_ROLE + '" ' + describedById + ' ' + ATTR_OPEN + ' ' + ATTR_LABELLEDBY + '="' + MODAL_TITLE_ID + '">\n                    <div role="document" class="' + modalClassWrapper + '">\n                      ' + button_close + '\n                      <div class="' + contentClassName + '">\n                        ' + title + '\n                        ' + content + '\n                      </div>\n                    </div>\n                  </dialog>';
  }
643640
public function create($mode = 0777) {

		if(false === ('-' . intval($mode) == '-' . $mode)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($mode)), E_USER_ERROR);
		}

		$paths = preg_split('#[\\/]#', $this -> directory -> getPath());
		$build = '';

		foreach($paths as $path) {

			$build .= $path . DIRECTORY_SEPARATOR;

			if(false === @is_dir($build)) {
				@mkdir($build, $mode);
			}
		}

		$this -> refresh();

		return $this;
	}
1241260
public static function create($path = false, $mode = 0777) {

        if($path && !self::isFolder(dirname($path)) && self::isWritable(dirname($path))) {

            mkdir($path, $mode);

            if(Folder::isFolder($path)) {

                return true;
            }
        } 

        return false;
    }
289209
public void setSelectMode(final SelectMode selectMode) {
		getOrCreateComponentModel().selectMode = selectMode == null ? SelectMode.NONE : selectMode;
	}
468231
private function create($mode, $url, $lastMod = null):void
    {
        $lastMod = $lastMod ?: $this->lastMod;
        $raw = str_replace([':url', ':lastmod'], [$url, $lastMod], $this->raw);
        if ($mode === 'create') {
            $fileH = new SitemapWriter($this->file, 'writeOnly');
            $fileH->write(self::START.PHP_EOL);
            $fileH->write($raw);
            $fileH->write(PHP_EOL.self::END);
        } elseif ($mode === 'append') {
            $fileH = new SitemapWriter($this->file, 'readOnly');
            $sitemapData = $fileH->read();
            $fileH = new SitemapWriter($this->file, 'writeOverride');
            $sitemapData = str_replace('</sitemapindex>', '', $sitemapData);
            $sitemapData = $sitemapData.$raw;
            $fileH->write($sitemapData);
            $fileH->write(PHP_EOL.self::END);
        }
        $fileH->close();
    }
1368417
public void addChangePlayModeCommand(PlayMode playMode) {
        StringBuilder buf = new StringBuilder();
        buf.append("(change_mode ");
        buf.append(playMode);
        buf.append(')');
        fifo.add(fifo.size(), buf.toString());
    }
1141342
public static function setNewSymbolicLinkMode(string $mode = '740'): void
    {
        static::init();
        static::$newSymlinkMode = \preg_match('/^[0-7]{3}$/', $mode) ? \intval($mode, 8) : 0740;
    }
520719
private Config lazyCreateConfig(Mode newMode) {
    if (newMode == this.mode) {
      return this;
    }

    // this is here so that we don't keep cascading deeper into object creation so:
    // localConfig == toLocalMode(toClusterMode(localConfig))
    Config newRawConfig = this.rawConfig;
    Config newLocalConfig = this.localConfig;
    Config newClusterConfig = this.clusterConfig;
    switch (this.mode) {
      case RAW:
        newRawConfig = this;
        break;
      case LOCAL:
        newLocalConfig = this;
        break;
      case CLUSTER:
        newClusterConfig = this;
        break;
      default:
        throw new IllegalArgumentException(
            "Unrecognized mode found in config: " + this.mode);
    }

    switch (newMode) {
      case LOCAL:
        if (this.localConfig == null) {
          Config tempConfig = Config.expand(Config.newBuilder().putAll(rawConfig.cfgMap).build());
          this.localConfig = new Config(Mode.LOCAL, newRawConfig, tempConfig, newClusterConfig);
        }
        return this.localConfig;
      case CLUSTER:
        if (this.clusterConfig == null) {
          Config.Builder bc = Config.newBuilder()
              .putAll(rawConfig.cfgMap)
              .put(Key.HERON_HOME, get(Key.HERON_CLUSTER_HOME))
              .put(Key.HERON_CONF, get(Key.HERON_CLUSTER_CONF));
          Config tempConfig = Config.expand(bc.build());
          this.clusterConfig = new Config(Mode.CLUSTER, newRawConfig, newLocalConfig, tempConfig);
        }
        return this.clusterConfig;
      case RAW:
      default:
        throw new IllegalArgumentException(
            "Unrecognized mode passed to lazyCreateConfig: " + newMode);
    }
  }
66137
protected function setAdminModeCheckout($mode)
    {
        $this->admin = null;

        if ($this->access('order_add')) {

            if ($mode === 'add') {
                $this->admin = 'add';
            }

            if ($mode === 'clone' && $this->access('order_edit')) {
                $this->admin = 'clone';
            }
        }
    }
425827
function(newMode) {
    if (newMode == 'SPLIT') {
      this.outputConnection.setCheck('Array');
      this.getInput('INPUT').setCheck('String');
    } else {
      this.outputConnection.setCheck('String');
      this.getInput('INPUT').setCheck('Array');
    }
  }
248547
public function setMode($mode)
    {
        if (in_array($mode, $this->availableModes)) {
            $this->mode = $mode;
        }

        throw new \Exception("$mode is not a available mode for this API.");
    }
262037
public static function createByConfiguration($modeName, array $configuration)
    {
        $mode = new static();
        $mode->setName($modeName);
        $mode->setPreview($configuration['isPreviewMode']);
        $mode->setEdit($configuration['isEditingMode']);
        $mode->setTitle($configuration['title']);

        if (isset($configuration['fusionRenderingPath'])) {
            $mode->setFusionPath($configuration['fusionRenderingPath']);
        } else {
            $mode->setFusionPath('');
        }

        if (isset($configuration['options']) && is_array($configuration['options'])) {
            $mode->setOptions($configuration['options']);
        }

        return $mode;
    }
762782
public static function create($path = null, $mode = self::DEFAULT_UNIX_CHMOD_DIRECTORIES, $recursive = true)
    {
        if (is_null($path)) {
            return null;
        }
        return mkdir($path, Filesystem::getOctal($mode), $recursive);
    }
648053
public void setMode(EditorMode mode) {

        switch (mode) {
            case galleries:
                m_newGalleryMenuButton.getElement().getStyle().clearDisplay();
                m_newMenuButton.getElement().getStyle().setDisplay(Display.NONE);
                break;
            case modelpages:
            case categories:
                m_newGalleryMenuButton.getElement().getStyle().setDisplay(Display.NONE);
                m_newMenuButton.getElement().getStyle().clearDisplay();
                break;
            default:
                m_newMenuButton.getElement().getStyle().clearDisplay();
                m_newGalleryMenuButton.getElement().getStyle().setDisplay(Display.NONE);
                break;
        }
    }
802615
public void setExpandMode(final ExpandMode expandMode) {
		getOrCreateComponentModel().expandMode = ExpandMode.SERVER.equals(expandMode) ? ExpandMode.DYNAMIC
				: expandMode;
	}