Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fixed formatting
Contents

Table of Contents
maxLevel5
minLevel2

Related Topics

Children Display
depth6

Wiki Markup
{html}
<style type="text/css">
table.confluenceTable { width:100% }
th.confluenceTh:first-child { font-weight:bold;width:30% }
td.confluenceTd:first-child { font-weight:bold;width:30% }
</style>
{html}

Studio 3 uses a new "theming" system to define the coloring of the IDE across the various editors and views. We tried to follow the convention of token names used by TextMate in our coloring so that porting existing themes over would be relatively easy.

...

Scopes are similar to CSS selectors in that they describe a pattern which is matched against the current location of the cursor in the document. Multiple scopes may apply simultaneously at different levels of specificity. As an example, if we take the following piece of CSS:

Code Block
html
languagehtmlcss
body {
    background: #000000;
}

...

There is a longer discussion about creating scopes here: http://manual.macromates.com/en/scope_selectors.html

Token

...

names

A good starting point for token naming conventions is the TextMate documentation on the subject: http://manual.macromates.com/en/language_grammars#naming_conventions
Generally speaking tokens follow a convention of category.sub-category.language-extension, i.e. "comment.line.js"

...

Rubles may contribute themes. Simply use a hash from token name to a string containing the fg, bg(optional) and font styles (optional). Place the theme addition in a file that will get loaded when the ruble does (i.e. bundle.rb). The overall theme color keys of foreground, background, selection, caret, and lineHighlight are expected to be present as keys; as is the "name" key for the theme name. The rest of the keys are interpreted as token names (if using symbols, "_" will be changed to "." under the hood for you). Here's an example:

Code Block
linenumberstrue
languageruby
require 'ruble/theme'

Ruble::Theme.add({
  :name => 'example',
  :foreground => '#ffffff',
  :background =>  '#000000',
  :selection => '#999999',
  :caret => '#cccccc',
  :lineHighlight => '#cccccc',
  :string_quoted_single => ['#ff0000', '#00ff00', 'bold', 'italic']
})

...

In our Java code we contribute themes via properties files. The key used is the token name and the values are a list of colors and font styles with order being significant. The first color in hex is the fg, the second (optional) is background. We also then take optional font style names such as bold, italic or underline. A few examples:

Code Block
languagejava
comment.line=#ffff00,#333333,italic
string=#00ff00
invalid.illegal=#521c93,#fffb00,bold

Related topics

Children Display
depth6