DescribeColorResult クラス
名前空間
使用方法
Schema.DescribeTabResult クラスの getColors メソッドは、タブに使用する色を示す Schema.DescribeColorResult オブジェクトのリストを返します。
Schema.DescribeColorResult クラスのメソッドは、対応するプロパティを使用してコールできます。get で始まる各メソッドでは、get プレフィックスと末尾の括弧 () を省略して対応するプロパティをコールできます。たとえば、colorResultObj.color は colorResultObj.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: primaryDescribeColorResult のメソッド
DescribeColorResult のメソッドは次のとおりです。すべてインスタンスメソッドです。
getTheme()
カラーテーマを返します。
署名
public String getTheme()
戻り値
型: String
テーマに使用できる値には、theme3、theme4、および custom があります。
- theme3 は Spring '10 で導入された、Salesforce テーマです。
- theme4 は、Salesforce のモバイルタッチスクリーンバージョン向けの Winter '14 で導��された、Salesforce テーマです。
- custom はカスタムアイコンに関連付けられたテーマの名前です。