tableFormat、columnFormatおよびrowFormatsの使用

注意: この手順では、このトピックの最後に記述されているインライン・データがUIXファイルに挿入されているものとして説明しています。demoTableDataというインライン・データでは、行と列のデータが提供されます。

表、列および行に書式を追加するには、次のようにします。

  1. 表全体に書式設定情報を追加するには、設計構造ウィンドウで表ノードを選択し、次のステップに従ってtableFormat複合属性を設定します。
    1. プロパティ・インスペクタで、tableFormat属性の横にある列のEllipsis buttonアイコンをクリックして表の書式プロパティの値を入力するか、バインド先のデータソースを指定します。EL構文のデータ・バインディングの式を使用するか「データにバインド」ダイアログを使用して、データソースを選択することもできます。サポートされている表の書式の値は、次のとおりです。
      • bandingInterval: 各バンド・グループの行数または列数を入力します。
      • tableBanding: 表でのバンドの使用方法を選択します。次の3つの値を指定できます。
        • noBanding: デフォルトです。表では、バンドは使用されません。
        • columnBanding: 列に交互にバンドが付けられます。各バンド・グループの列数はbandingIntervalにより決定されます。
        • rowBanding: 行に交互にバンドが付けられます。各バンド・グループの行数はbandingIntervalにより決定されます。
  2. 列に書式設定情報を追加するには、設計構造ウィンドウで列を選択し、次のステップに従ってcolumnFormat複合属性を設定します。
  3. 表の各行に書式設定情報を追加するには、設計構造ウィンドウで表ノードを選択した後、次のステップに従ってrowFormats複合属性を設定します。

注意: データ・バインディングの使用は、「コンポーネント属性のデータ・バインディング」を参照してください。

例(UIX XML)


...
<provider>
  <data name="demoTableData">
    <inline>
      <!-- data for 4 rows -->
      <demoRowData firstColumnText="First row"
                   secondColumnText="First Button"
                   thirdColumnText="First col"
                   fourthColumnText="111"
                   isSelected="false"
                   isDisabled="true" />
      <demoRowData firstColumnText="Second row"
                   secondColumnText="Second Button"
                   thirdColumnText="Second col"
                   fourthColumnText="222"
                   isSelected="true" />
      <demoRowData firstColumnText="Third row"
                   secondColumnText="Third Button"
                   thirdColumnText="Third col"
                   fourthColumnText="333"
                   isSelected="false" />
      <demoRowData firstColumnText="4th row"
                   secondColumnText="4th Button"
                   thirdColumnText="4th row col"
                   fourthColumnText="444"
                   isSelected="false" />
      <!-- data for the row headers -->
      <demoRowHeaderData headerText="1"/>
      <demoRowHeaderData headerText="2"/>
      <demoRowHeaderData headerText="3"/>
      <demoRowHeaderData headerText="4"/>
      <!-- data for the 4 column headers -->
      <demoColHeaderData textKey="H1"/>
      <demoColHeaderData textKey="H2"/>
      <demoColHeaderData textKey="H3"/>
      <demoColHeaderData textKey="H4"/>
      <!-- formatting information for the rows -->
      <demoRowFormats/>
      <demoRowFormats displayGrid="false"/>
      <demoRowFormats/>
      <demoRowFormats/>
    </inline>
  </data>
</provider>
...
<contents>
  ...
  <table alternateText="No Items Found."
         blockSize="25"
         tableData="${uix.data.demoTableData.demoRowData}"
         rowFormats="${demoTableData.demoRowFormats}
         columnHeaderData="${uix.data.demoTableData.demoColHeaderData}"
         rowHeaderData="${uix.data.demoTableData.demoRowHeaderData}">
    <tableFormat bandingInterval="1" tableBanding="rowBanding"/>
    <contents>
      <!-- table's indexed children are the columns -->
      <column>
        <!-- first column stamp -->
        <contents>
          <styledText text="${uix.current.firstColumnText}"/>
        </contents>
      </column>

      <column>
        <!-- second column stamp -->
        <contents>
          <styledText text="${uix.current.secondColumnText}"/>
        </contents>
        <!-- second column header -->
      </column>

      <column>
        <!-- third column stamp -->
        <contents>
          <styledText text="${uix.current.thirdColumnText}"/>
        </contents>
      </column>

      <column>
        <!-- column formatting -->
        <columnFormat columnDataFormat="numberFormat"
                      width="45%"/>
        <!-- fourth column stamp -->
        <contents>
          <styledText text="${uix.current.fourthColumnText}"/>
        </contents>
      </column>
    </contents>
  </table>
</contents>
...    

columnとその名前付きの子について

columnHeaderの挿入
columnGroupの使用
表の作成
tableコンポーネントの使用

 

Copyright © 1997, 2004, Oracle. All rights reserved.