この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

Newer Version Available

This content describes an older version of this product. View Latest

DescribeColorResult クラス

タブの色メタデータ情報が含まれます。

名前空間

Schema

使用方法

Schema.DescribeTabResult クラスの getColors メソッドは、タブに使用する色を示す Schema.DescribeColorResult オブジェクトのリストを返します。

Schema.DescribeColorResult クラスのメソッドは、対応するプロパティを使用してコールできます。get で始まる各メソッドでは、get プレフィックスと末尾の括弧 () を省略して対応するプロパティをコールできます。たとえば、colorResultObj.colorcolorResultObj.getColor() と同じです。

このサンプルでは、Sales アプリケーションの最初のタブの最初の色の情報を取得する方法を示します。

1// Get tab set describes for each app
2List<Schema.DescribeTabSetResult> tabSetDesc = Schema.DescribeTabs();
3
4// Iterate through each tab set describe for each app and display the info
5for(Schema.DescribeTabSetResult tsr : tabSetDesc) {            
6    // Display tab info for the Sales app
7    if (tsr.getLabel() == 'Sales') {
8        // Get color information for the first tab
9        List<Schema.DescribeColorResult> colorDesc = tsr.getTabs()[0].getColors();
10        // Display the icon color, theme, and context of the first color returned
11        System.debug('Color: ' + colorDesc[0].getColor());
12        System.debug('Theme: ' + colorDesc[0].getTheme());
13        System.debug('Context: ' + colorDesc[0].getContext());
14    }            
15}
16
17// Example debug statement output
18// DEBUG|Color: 1797C0
19// DEBUG|Theme: theme4
20// DEBUG|Context: primary

DescribeColorResult メソッド

DescribeColorResult のメソッドは次のとおりです。すべてインスタンスメソッドです。

getColor()

00FF00 などの Web RGB 色コードを返します。

署名

public String getColor()

戻り値

型: String

getContext()

色のコンテキストを返します。コンテキストにより、その色がそのタブのメインの色であるか否かが判別されます。

署名

public String getContext()

戻り値

型: String

getTheme()

カラーテーマを返します。

署名

public String getTheme()

戻り値

型: String

テーマに使用できる値には、theme3theme4、および custom があります。
  • theme3 は Spring '10 で導入された、Salesforce テーマです。
  • theme4 は、Salesforce のモバイルタッチスクリーンバージョン向けの Winter '14 で導入された、Salesforce テーマです。
  • custom はカスタムアイコンに関連付けられたテーマの名前です。