Newer Version Available
DescribeIconResult Class
Namespace
Usage
The getIcons method of the Schema.DescribeTabResult class returns a list of Schema.DescribeIconResult objects that describe colors used in a tab.
The methods in the Schema.DescribeIconResult class can be called using their property counterparts. For each method starting with get, you can omit the get prefix and the ending parentheses () to call the property counterpart. For example, iconResultObj.url is equivalent to iconResultObj.getUrl().
Example
This sample shows how to get the icon information in the Sales app for the first tab’s first icon.
1// Get tab set describes for each app
2List<Schema.DescribeTabSetResult> tabSetDesc = Schema.describeTabs();
3
4// Iterate through each tab set
5for(Schema.DescribeTabSetResult tsr : tabSetDesc) {
6 // Get tab info for the Sales app
7 if (tsr.getLabel() == 'Sales') {
8 // Get icon information for the first tab
9 List<Schema.DescribeIconResult> iconDesc = tsr.getTabs()[0].getIcons();
10 // Display the icon height and width of the first icon
11 System.debug('Height: ' + iconDesc[0].getHeight());
12 System.debug('Width: ' + iconDesc[0].getWidth());
13 }
14}
15
16// Example debug statement output
17// DEBUG|Height: 32
18// DEBUG|Width: 32DescribeIconResult Methods
The following are methods for DescribeIconResult. All are instance methods.
getContentType()
Signature
public String getContentType()
Return Value
Type: String
getHeight()
Signature
public Integer getHeight()
Return Value
Type: Integer
Usage
getTheme()
Signature
public String getTheme()
Return Value
Type: String
- theme3 is the Salesforce theme introduced during Spring ‘10.
- theme4 is the Salesforce theme introduced in Winter ‘14 for the mobile touchscreen version of Salesforce.
- custom is the theme name associated with a custom icon.
getUrl()
Signature
public String getUrl()
Return Value
Type: String
getWidth()
Signature
public Integer getWidth()
Return Value
Type: Integer