3 abstract class PhabricatorSyntaxStyle
extends Phobject
{
5 abstract public function getStyleName();
6 abstract public function getStyleMap();
8 final public function getStyleOrder() {
9 return (string)id(new PhutilSortVector())
10 ->addInt($this->isDefaultStyle() ?
0 : 1)
11 ->addString($this->getStyleName());
14 final public function getSyntaxStyleKey() {
15 return $this->getPhobjectClassConstant('STYLEKEY');
18 final public function isDefaultStyle() {
19 return ($this->getSyntaxStyleKey() == 'default');
22 public static function getAllStyles() {
23 return id(new PhutilClassMapQuery())
24 ->setAncestorClass(__CLASS__
)
25 ->setUniqueMethod('getSyntaxStyleKey')
26 ->setSortMethod('getStyleName')
30 final public function getRemarkupStyleMap() {
32 'rbw_r' => 'color: red',
33 'rbw_o' => 'color: orange',
34 'rbw_y' => 'color: yellow',
35 'rbw_g' => 'color: green',
36 'rbw_b' => 'color: blue',
37 'rbw_i' => 'color: indigo',
38 'rbw_v' => 'color: violet',
41 return $map +
$this->getStyleMap();