Creo™ Schematics 4.0 Help Center > Customizing Creo Schematics Using Java APIs > Example: Validating a Change to a PropertySet
  
Example: Validating a Change to a PropertySet
public class ValidateProperties extends Object implements rsdesigner.uiextension.ValidateProperties
{
// Constructor must be public
public ValidateProperties() {}
public boolean canSet(Properties properties) throws RSDException
{
boolean res = true;
PropertySet pset = properties.getPropertySet();
// Get the Creo Schematics Class string
System.out.println("*** Validating " + properties.size() + "properties for " + pset.getClassString());
// Print a list of the properties
for (int i = 0; i < properties.size(); i++) {
String pname = properties.getName(i);
String type = properties.getType(pname);
Object value = properties.getValue(pname);
if (value == null)
value = "UNSET";
System.out.println("Property name = " + pname + " ; type = " + type + " ; value = " + value.toString());
}
// Send a message
properties.setMessage("Cannot apply these properties!");
return false;
}
}