This is a special-purpose utility class that can used by developers to enable a style checker to be implemented as part of their development processes. This class does most of the work but is designed to be inherited by a developer-written class to allow developers to decide if this feature is useful and to also allow the developer to override the standard functionality to add hard-coded rules to the style check logic. This allows developers to implement style check logic that cannot be easily defined using the rules file information. A sample developer class has been included in the examples folder. This utility class is written to be both a "contributed tool" and a "Build Post-Process" listener. When the class is triggered from the "Contributed Tools" menu, it will scan the resource that is selected in the navigation view. When triggered as part of the build process, it will scan the program that is getting processed for the build. In both cases, the source code of the program is checked against a pre-set list of style rules and any discrepancies are reported in the "Problem View". When accessed as part of the build process, it will only report issues to the problem view. When accessed from the "Contributed Tool" menu, it can also automatically correct some of the issues that are discovered based on the information contained within the style rules. |
LOCAL theDescription$="ProvideX Style Check" |
Description for this observer/contributed tool |
LOCAL styleCheckName$="ecStyleCheck" |
Short name for this observer/contributed tool |
LOCAL theNotificationFlag=_pvxConstants'_idePrePostProcess |
Register the events for this tool |
LOCAL lbSepChar$=$09$ |
FUNCTION actionPerformed(inActionEventID) | ||||||||
This method will be called when the action is triggered from the contributed tools menu. | ||||||||
| ||||||||
FUNCTION configPerformed(inActionEventID) | ||||||||
This method will be called when the 'Configure' action is triggered from the contributed tools menu. The code required to implement the configuration action is normally implemented as one or more NOMADS panels that this method will execute. | ||||||||
| ||||||||
FUNCTION getStyleCheckName$() | ||||||||
Get the name for the style check class | ||||||||
| ||||||||
FUNCTION hasConfigAction() | ||||||||
This method is used to check whether a configuration action has been implemented. | ||||||||
| ||||||||
FUNCTION init() | ||||||||
Register this class as an event listener and add it to the list of contributed tools under the ProvideX menu. | ||||||||
FUNCTION update(state) | ||||||||
The logic to be executed when the observer is triggered during the normal event process in the ProvideX event manager. This logic will check the major and minor codes to determine the current event and then decide what action is to be performed. | ||||||||
| ||||||||
FUNCTION LOCAL loadRules(theRuleFile$) | ||||||||
Load the style rules from the developer properies file. | ||||||||
| ||||||||
FUNCTION LOCAL writeRuleFile(aRuleFile$, theRules$, isSecondaryFile) | ||||||||
save rules back to the rule file(s) | ||||||||
|
theDescription$, theNotificationFlag |
theDescription$, theNotificationFlag |
actionPerformed(), configPerformed(), getDescription$(), getEventNotificationFlag(), hasConfigAction(), init() |
getDescription$(), getEventNotificationFlag(), init(), update(), createAlternateSourceFile(), getAlternateSourceFile$() |