Difference between revisions of "JA/Documentation/BASIC Guide/Templates"

From Apache OpenOffice Wiki
Jump to: navigation, search
(New page: {{DISPLAYTITLE:テンプレート}} {{JA/Documentation/BASICGuideTOC/v2 |ShowPrevNext=block |ShowPrevPage=block |PrevPage=Documentation/BASIC Guide/StarDesktop |NextPage=Documentation/BASI...)
 
Line 69: Line 69:
 
各テンプレートには、独自の書式設定属性が存在します。以下に、主要な書式設定属性とその説明箇所を示します。
 
各テンプレートには、独自の書式設定属性が存在します。以下に、主要な書式設定属性とその説明箇所を示します。
  
* [[Documentation/BASIC Guide/Structure of Text Documents#Character Properties|文字属性]]、<idl>com.sun.star.style.CharacterProperties</idl> サービス
+
* [[JA/Documentation/BASIC Guide/Structure of Text Documents#Character Properties|文字属性]]、<idl>com.sun.star.style.CharacterProperties</idl> サービス
* [[Documentation/BASIC Guide/Structure of Text Documents#Paragraph Properties|段落属性]]、<idl>com.sun.star.text.Paragraph</idl> サービス
+
* [[JA/Documentation/BASIC Guide/Structure of Text Documents#Paragraph Properties|段落属性]]、<idl>com.sun.star.text.Paragraph</idl> サービス
* [[Documentation/BASIC Guide/Formatting Spreadsheet Documents#Cell Properties|セル属性]]、<idl>com.sun.star.table.CellProperties</idl> サービス
+
* [[JA/Documentation/BASIC Guide/Formatting Spreadsheet Documents#Cell Properties|セル属性]]、<idl>com.sun.star.table.CellProperties</idl> サービス
* [[Documentation/BASIC Guide/Formatting Spreadsheet Documents#Page Properties|ページ属性]]、<idl>com.sun.star.style.PageProperties</idl> サービス
+
* [[JA/Documentation/BASIC Guide/Formatting Spreadsheet Documents#Page Properties|ページ属性]]、<idl>com.sun.star.style.PageProperties</idl> サービス
* [[Documentation/BASIC Guide/Formatting Spreadsheet Documents|文字要素属性]]、さまざまなサービス
+
* [[JA/Documentation/BASIC Guide/Formatting Spreadsheet Documents|文字要素属性]]、さまざまなサービス
  
書式設定属性は、ここでの説明に用いたアプリケーションにのみ限定されるわけでなく、より広範に利用されます。たとえば、[[Documentation/BASIC Guide/Spreadsheets|「スプレッドシート」]]で説明するページ属性の大部分は、{{OOo}} Calc だけでなく {{OOo}} Writer でも使用できます。
+
書式設定属性は、ここでの説明に用いたアプリケーションにのみ限定されるわけでなく、より広範に利用されます。たとえば、[[JA/Documentation/BASIC Guide/Spreadsheets|「スプレッドシート」]]で説明するページ属性の大部分は、{{OOo}} Calc だけでなく {{OOo}} Writer でも使用できます。
  
テンプレートの使用法に関する詳細情報については、[[Documentation/BASIC Guide/Text Documents|「文書ドキュメント」]]の'''「文字と段落属性のデフォルト値」'''を参照してください。
+
テンプレートの使用法に関する詳細情報については、[[JA/Documentation/BASIC Guide/Text Documents|「文書ドキュメント」]]の'''「文字と段落属性のデフォルト値」'''を参照してください。
  
 
{{PDL1}}
 
{{PDL1}}
 
{{InterWiki_Languages_BasicGuide|articletitle=Documentation/BASIC Guide/Templates}}
 
{{InterWiki_Languages_BasicGuide|articletitle=Documentation/BASIC Guide/Templates}}

Revision as of 16:24, 13 November 2008

doc OOo
Book.png

テンプレートとは、さまざまな書式設定情報を 1 つにまとめて、名前を付けたものです。Template:アプリケーションでは、各種のテンプレートを利用して、書式設定の操作を簡略化します。OOoテンプレートの登録情報が変更されると、Template:ドキュメントの該当セクションも自動的に更新されます。OOoこのような機\'94\'5cを利用すると、たとえばテンプレートを変更して、すべてのレベル 1 ヘッダの\'95\'5c示フォントを一括変更する、などの操作が行えます。Template:OOo では、ドキュメントの種類ごとに該当するテンプレートが自動判別されます。

Apache OpenOffice Writer は以下のテンプレートをサポートしています。

  • 文字テンプレート
  • 段落テンプレート
  • フレームテンプレート
  • ページテンプレート
  • 番号付けテンプレート

Apache OpenOffice Calc は以下のテンプレートをサポートしています。

  • セルテンプレート
  • ページテンプレート

Apache OpenOffice Impress は以下のテンプレートをサポートしています。

  • 文字要素テンプレート
  • プレゼンテーションテンプレート

Apache OpenOffice で利用する各種のテンプレートは、com.sun.star.style.StyleFamily サービスに基づいて、StyleFamilies として管理されています。StyleFamilies にはドキュメントオブジェクトを通じてアクセスします。

Dim Doc As Object
Dim Sheet As Object 
Dim StyleFamilies As Object 
Dim CellStyles As Object
 
Doc = StarDesktop.CurrentComponent
StyleFamilies = Doc.StyleFamilies
CellStyles = StyleFamilies.getByName("CellStyles")

このサンプルコードでは、表計算ドキュメントの StyleFamilies 属性を用いて、使用可能なすべてのセルテンプレートの一覧を取得します。

個々のテンプレートには、インデックスを使って直接アクセスできます。

Dim Doc As Object
Dim Sheet As Object
Dim StyleFamilies As Object 
Dim CellStyles As Object
Dim CellStyle As Object
Dim I As Integer
 
Doc = StarDesktop.CurrentComponent
StyleFamilies = Doc.StyleFamilies
CellStyles = StyleFamilies.getByName("CellStyles")
 
For I = 0 To CellStyles.Count - 1
  CellStyle = CellStyles(I)
  MsgBox CellStyle.Name
Next I

1 つ前のサンプルコードでは、すべてのセルテンプレートをメッセージ\'83\'7bックスに一括\'95\'5c示しましたが、ここではループを使って個別に\'95\'5c示します。

書式設定オプションの詳細

各テンプレートには、独自の書式設定属性が存在します。以下に、主要な書式設定属性とその説明箇所を示します。

書式設定属性は、ここでの説明に用いたアプリケーションにのみ限定されるわけでなく、より広範に利用されます。たとえば、「スプレッドシート」で説明するページ属性の大部分は、Apache OpenOffice Calc だけでなく Apache OpenOffice Writer でも使用できます。

テンプレートの使用法に関する詳細情報については、「文書ドキュメント」「文字と段落属性のデフォルト値」を参照してください。

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools