Returns the name a given Style is set as within the Collection.

@param   interfaces\Style    $style  The Style to search for.
@return  string                      The name of the Style or null if it couldn't be found.
198092
public function name(interfaces\Style $style) : ?string
    {
        foreach ($this->items as $key => $value) {
            if ($value === $style) {
                return $key;
            }
        }

        return null;
    }
212414
public function show($style)
    {
        switch ($style) {
            case 1:
                // 最简单的上一页 下一些
                return $this->f1();
                break;
            case 2:
                // 一次翻翻N页的 Link
                return $this->f2();
                break;
            case 3:
                // 滑动滚动
                return $this->f3();
                break;
            case 4:
                // wap2.0
                return $this->f4();
                break;
            case 5:
                // wap1.2
                return $this->f5();
                break;
            default:
                $this->f1();
        }
    }
1010089
public function delStyle($style) {
        if ( ! empty($style)) {
            if ( ! is_array($style)) {
                $style = [$style];
            }
            if ( ! isset($this->obsolete['style'])) {
                $this->obsolete['style'] = [];
            }
            $this->obsolete['style'] = array_merge($this->obsolete['style'], $style);
        }
    }
553876
public function setStyle($style)
    {
        if ($style == null) {
            $this->style = new IdenticonStyle();
        } elseif ($style instanceof IdenticonStyle) {
            $this->style = $style;
        } elseif (is_array($style)) {
            $this->style = new IdenticonStyle($style);
        } else {
            throw new \InvalidArgumentException(
                "Invalid indenticon style was specified. ".
                "Allowed values are IdenticonStyle instances and associative ".
                "arrays containing IdenticonStyle options.");
        }
        
        return $this;
    }
578006
def _style_name(self, el):
        """"""
        if el.attributes is None:
            return None
        style_field = ('urn:oasis:names:tc:opendocument:xmlns:text:1.0',
                       'style-name')
        name = el.attributes.get(style_field, None)
        if not name:
            return None
        return self._get_style_name(name)
1118948
public function setStyle(string $style): void
    {
        $style = strtolower($style);
        switch ($style) {
            case 'nested':
            case 'compact':
            case 'compressed':
            case 'expanded':
            case 'crunched':
                $this->flags = str_replace(" --style $this->style", '', $this->flags);
                $this->style = $style;
                $this->flags .= " --style $style";
                break;
            default:
                $this->log("Style $style ignored", Project::MSG_INFO);
        }
    }
700010
public static <T extends Widget> T setStyleNames (T widget, String... styles)
    {
        int idx = 0;
        for (String style : styles) {
            if (style == null) {
                continue;
            }
            if (idx++ == 0) {
                widget.setStyleName(style);
            } else {
                widget.addStyleName(style);
            }
        }
        return widget;
    }
823592
public function contains(interfaces\Style $style) : bool
    {
        return empty($this->items) ? false : (null !== $this->name($style));
    }
1279195
public int getCount(T style)
    {
        Integer cnt = styles.get(style);
        return cnt == null ? 0 : cnt;
    }
360614
public static String decode(Style style) {
		if (style != null) {
			if (style instanceof ShapeStyle) {
				return decode((ShapeStyle) style);
			} else if (style instanceof FontStyle) {
				return decode((FontStyle) style);
			} else if (style instanceof PictureStyle) {
				return decode((PictureStyle) style);
			}
		}
		return "";
	}
330629
public static function style($string, $style)
    {
        $escapeSequence = ($style instanceof Style) ? $style->getEscapeSequence() : self::getEscapeSequence($style);
        $resetSequence = ($style instanceof Style) ? Style::getResetSequence() : self::getResetSequence($style);

        return $escapeSequence . $string . $resetSequence;
    }
360142
protected function getStyleTemplateName($identifier, $isInline)
    {
        if (!empty($this->customStylesConfiguration[$identifier]['template'])) {
            return $this->customStylesConfiguration[$identifier]['template'];
        }

        $this->logger->warning(
            "Template style '{$identifier}' configuration was not found"
        );

        if ($isInline) {
            $configurationReference = $this->styleConfigurationNamespace . '.default_inline';
        } else {
            $configurationReference = $this->styleConfigurationNamespace . '.default';
        }

        if ($this->configResolver->hasParameter($configurationReference)) {
            $configuration = $this->configResolver->getParameter($configurationReference);

            return $configuration['template'];
        }

        $this->logger->warning(
            "Template style '{$identifier}' default configuration was not found"
        );

        return null;
    }
640955
public function bootstrapStyle($style)
    {
        $styles = ['default', 'primary', 'info', 'warning', 'danger'];
        foreach ($styles as $sty) {
            $this->removeClass('btn-' . $sty);
        }

        return $this->class(['btn', 'btn-' . $style]);
    }
549937
public function style($style)
    {
        if (is_array($style)) {
            $style = implode('; ', array_map(function ($value, $attribute) {
                return "{$attribute}: {$value}";
            }, $style, array_keys($style)));
        }

        return $this->attribute('style', $style);
    }
328837
public function setStyle($style)
    {
        $dir = ForumEnv::get('WEB_ROOT').'themes/'.$style.'/';
        if (!is_dir($dir)) {
            throw new RunBBException('The style '.$style.' doesn\'t exist');
        }

        if (is_file($dir . 'bootstrap.php')) {
            $vars = include_once $dir . 'bootstrap.php';
            // file exist but return nothing
            if (!is_array($vars)) {
                $vars = [];
            }
            foreach ($vars as $key => $assets) {
                if ($key === 'jsraw' || !in_array($key, ['js', 'jshead', 'css'])) {
                    continue;
                }
                foreach ($assets as $asset) {
                    $params = ($key === 'css') ? ['type' => 'text/css', 'rel' => 'stylesheet'] : (
                    ($key === 'js' || $key === 'jshead') ? ['type' => 'text/javascript'] : []
                    );
                    $this->addAsset($key, $asset, $params);
                }
            }
            $this->set('jsraw', isset($vars['jsraw']) ? $vars['jsraw'] : '');
        }

        if (isset($vars['themeTemplates']) && $vars['themeTemplates'] == true) {
            $templatesDir = ForumEnv::get('WEB_ROOT').'themes/'.$style.'/view';
        } else {
            $templatesDir = ForumEnv::get('FORUM_ROOT') . 'View/';
        }

        $this->set('style', (string) $style);

        $this->addTemplatesDirectory($templatesDir);
    }
219847
public static boolean containsStyle(final String styleNames,
                                        final String style) {
        if (styleNames == null || style == null) {
            return false;
        }

        final String[] styles = styleNames.split("\\s");

        for (final String s : styles) {
            if (style.equals(s)) {
                return true;
            }
        }

        return false;
    }
91273
public static function getTypeName($type)
    {
        return isset(self::$names[$type])
            ? self::$names[$type]
            : null;
    }