Example 3: Style Check

The Class

The simpleStyleCheck class shows the minimal amount of code required to enable a user-defined source code validation capability that is based on the built-in ecStyleCheck group of classes.

API Documentation

User class
Click HERE to view the API documentation for this class.
Plug-in Class: ecStyleCheck
Click HERE to view the API documentation for this class.
Plug-in Class: ecStyleCheckEditUI
Click HERE to view the API documentation for the user interface class for the configuration action of the style check.
Plug-in Class: ecStyleCheckUI
Click HERE to view the API documentation for the user interface class for to set the run-time options for the style check.
Plug-in Class: ecStyleCheckRun
Click HERE to view the API documentation for the user interface class for the run-time progress log for the style check.

Source Code

Click Formatted HTML or Simple Text to view the source code for the class.

Do the Work

The constructor for this contributed tool loads the style rules. The remainder of the logic for the source code validation is inherited from ecStyleCheck.

def class "simpleStyleCheck" create required
	like "ecStyleCheck"

	! ** specify the name of the file that contains the style rules
	! ** default value: %PvxCode(mid(pgn,1,pos(dlm=pgn,-1))+_obj'_Class$+"_rules.txt")%
	local styleRulesFile$=mid(pgn,1,pos(dlm=pgn,-1))+_obj'_Class$+"_rules.txt"
	! ** Override Description
	local theDescription$="Simple rule-based Style Check"

end def

on_create:
	! Use the method from the parent class to load the rules
	_obj'loadRules(from "ecStyleCheck",styleRulesFile$)
return 

end