26.11.2012 Views

Wirtschaftsuniversität Wien Magisterarbeit - SemanticLab

Wirtschaftsuniversität Wien Magisterarbeit - SemanticLab

Wirtschaftsuniversität Wien Magisterarbeit - SemanticLab

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• components directory: this directory can hold XPCOM Components. These are<br />

JavaScript or C++ libraries which provide Interfaces which are registered with<br />

Firefox and can then be used by the extension. [MDC09d] describes this in more<br />

detail.<br />

• defaults directory: all JavaScript files which are stored in this directory are going<br />

to be executed when the extension is installed. Therefore, it can be used to<br />

define preferences using the Mozilla Preferences API which extensions can then<br />

use. Another interface for the preferences is the (probably well known) technique<br />

of typing “about:config” into the Firefox URL-bar [MDC09f].<br />

• chrome.manifest: by using the chrome.manifest-file, developers can change the<br />

Firefox GUI. They can, for example, add entries in menu bars or toolbars by<br />

“overlaying” customized XUL-files. This is done by “registering” XUL-files with<br />

Chrome as described in more detail in [MDC09g].<br />

• chrome/content: this is the directory where the actual JavaScript-, XUL-files,<br />

etc. are stored. There can also be directories for skins and localization if your<br />

extension has the need for it - see the Mozilla Developer Center at [MDC09h] for<br />

more information on these topics.<br />

6.1.4. Flexible graphical user-interfaces (GUIs)<br />

XUL offers the option of defining windows which are flexible, that is they “flex” to the<br />

resolution and space on the screen which is available. Obviously it is highly recommended<br />

not to design GUIs with a fixed sized, that is by defining height and width as the chances<br />

are very high that the GUI will not always be displayed properly. Although every XUL<br />

element can be designed by using Cascading Style Sheets (CSS), this works only if a<br />

“flex” attribute with a value greater than zero has been defined for each XUL container<br />

which is affected. By using this flexible system, one can define how empty space in a<br />

container (such as a window) should be occupied by the existing elements and (relatively<br />

to the other elements) how much of this empty space each element should occupy -<br />

depending on the flex value. The result of using the “flex-system” is, that elements of a<br />

GUI resize automatically if the resolution or window-size is changed.<br />

6.1.5. XUL templates<br />

By using XUL templates, developers are able to dynamically create XUL elements. As<br />

already mentioned, there are currently three types of data sources available: RDF-files<br />

and XML-files and SQLite databases. However, the principle is the same: developers<br />

can query a data source and dynamically create XUL elements such as items in a menu<br />

drop down list. See [MDC09i] for more details.<br />

56

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!