Styling > Customizing Object States > Customizing the SNMP State System > Creating a New SNMP Primary State

Each primary state in the SNMP state dictionary is associated with a different base style. To create a new primary state you need to execute the following steps.

How to Create an SNMP Primary State
  1. Create a new SNMP state using the method IltSNMP.NewState.
  2. This method takes two arguments: a name and a description. The name is used to identify the state in the application. The description is used to provide information about the semantics of the state.
IltSNMP.State state = IltSNMP.NewState ("Pending", "Indicates if the object is waiting for validation");
The state defined above can be used in XML in the following way:
<state>Pending</state>
  1. Create a CSS file that configures the representation of the objects according to this new state. For more information on CSS, see section Introducing Cascading Style Sheets in this documentation. For more information on how to customize the object representation based on states, see Customizing the Object Representation Based on States.
object."ilog.tgo.model.IltObject"["objectState.SNMP.State"=Pending] {
  foreground: red;
  background: yellow;
  pattern: '@|pattern("SkewGrid", 8, 2)';
  lineStyle: "1.000001, 7.000001";
}
  1. Create a selector that resets the values defined by the state selector, so that the normal configuration is still applied to the objects when the state changes.
object."ilog.tgo.model.IltObject" {
  foreground: '';
  background: '';
  pattern: '';
  lineStyle: '';
}