テーマファイルの形式

テーマは、特定のタグを使用して XML ファイルで定義されます。

テーマファイルの形式

テーマ XML ファイルの形式の概要を以下に示します。 <theme> ルートタグは、オプションで特定のアプリケーション向けにグローバルテーマを拡張できます。 オプションのヘッダーでは、テーマを記述します。 resource タグでは、テーマに含める必要がある CSS スタイルシートなどの追加のフォーマットリソースをリストします。 property タグでは、デフォルトのプロパティに対する変更を定義し、control タグでは、基本コントロール要素に対する変更を定義します。 control タグで override="true" を設定すると、指定された定義のみがその要素に対して使用され、override="false" を設定すると、指定された定義がデフォルトのプロパティにマージされます。 これらの設定の使用方法の例としては、デフォルトのカラースキームとは異なるカラースキームを指定するボタンコントロールに対して override="true" を使用したり、デフォルトのボタン定義には指定されていない新規のカーソルアイコンのスタイルを指定するボタンに override="false" を使用します。

<?xml version="1.0" encoding="UTF-8"?><!-- 
	Theme root tag.
		extends: defines the theme this theme is inheriting from. Optional.
-->
<theme extends="theme" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="theme.xsd">	<!-- 
		Theme header.
		<description>: describe this theme. Optional.
	-->
	<description>[Theme runtimeDescription]</description>	<!-- 
		Define the list of resources that are automatically inserted in the XPage.
		<resource>: defines a resource that should be inserted into each XPage
			target: attribute that define the target technology. Optional.
			<href>: URI pointing to the resource
			<content-type>: MIME content type of the resource. 
					    Used to generate the correct HTML tag. Optional (uses the
                           file extension if not provided)
			<description>: Description of the resource. Optional.
	-->
	<resource target="xsp">
		<description>[Resource Description]</description>
		<content-type>[Mime Type]</content-type>
		<href>[Url Reference]</href>
	</resource>	<!-- 
		Define some properties that will be available at runtime to XPages. These
       properties are available through the ApplicationEx object, as soon as the Theme
       is loaded. For example, it can define how dojo controls are rendered for this 
       theme.
		<property>: defines a new property entry
			target: attribute that define the target technology. Optional.
			<name>: name of the property to set
			<value>: value of the property
			<description>: Description of the resource. Optional.
	-->
	<property target="xsp">
		<description>[Property Description]</description>
		<name>[Property Name]</name>
		<href>[Property Value]</href>
	</property>	<!-- 
		One entry per control. 
		<control>: defines an entry for a control
			target: attribute that define the target technology. Optional.
			override: attribute used to ignore the properties defined in the parent 
             theme. Optional.
			<name>: name of the control
			<label>: label displayed by Designer. Optional.
			<description>: description displayed by Designer. Optional.
			<property>: definition of a property content - As many nodes as necessary
				target: attribute that define the target technology. Optional.
				type: attribute that define the property type. Optional, default to
                  'string'.
				<name>: name of the property to set
				<value>: value of the property
				<description>: description displayed by Designer. Optional.
	-->
	<control target="runtime" override="true">
		<description>[Control Description]</description>
		<name>[Control Name]</name>
		<property target="xsp" type="string">
			<description>[Property Description]</description>
			<name>[Property Name]</name>
			<value>[Property Value]</value>
		</property>
	</control>
</theme>