Newer Version Available
DescribeColorResult クラス
名前空間
使用方法
Schema.DescribeTabResult クラスの getColors メソッドは、タブに使用する色を示す Schema.DescribeColorResult オブジェクトのリストを返します。
Schema.DescribeColorResult クラスのメソッドは、対応するプロパティを使用してコールできます。get で始まる各メソッドでは、get プレフィックスと末尾の括弧 () を省略して対応するプロパティをコールできます。たとえば、colorResultObj.color は colorResultObj.getColor() と同じです。
例
このサンプルでは、Sales アプリケーションの最初のタブの最初の色の情報を取得する方法を示します。
1swfobject.registerObject("clippy.codeblock-0", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17// Get tab set describes for each app
18List<Schema.DescribeTabSetResult> tabSetDesc = Schema.DescribeTabs();
19
20// Iterate through each tab set describe for each app and display the info
21for(Schema.DescribeTabSetResult tsr : tabSetDesc) {
22 // Display tab info for the Sales app
23 if (tsr.getLabel() == 'Sales') {
24 // Get color information for the first tab
25 List<Schema.DescribeColorResult> colorDesc = tsr.getTabs()[0].getColors();
26 // Display the icon color, theme, and context of the first color returned
27 System.debug('Color: ' + colorDesc[0].getColor());
28 System.debug('Theme: ' + colorDesc[0].getTheme());
29 System.debug('Context: ' + colorDesc[0].getContext());
30 }
31}
32
33// Example debug statement output
34// DEBUG|Color: 1797C0
35// DEBUG|Theme: theme4
36// DEBUG|Context: primaryDescribeColorResult メソッド
DescribeColorResult のメソッドは次のとおりです。すべてインスタンスメソッドです。
getTheme()
カラーテーマを返します。
署名
public String getTheme()
戻り値
型: String
テーマに使用できる値には、theme3、theme4、および custom があります。
- theme3 は Spring '10 で導入された、Salesforce テーマです。
- theme4 は、Salesforce のモバイルタッチスクリーンバージョン向けの Winter '14 で導入された、Salesforce テーマです。
- custom はカスタムアイコンに関連付けられたテーマの名前です。