Class ecStyleCheck

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.

Known SubClasses

simpleStyleCheck

Properties

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$  

Methods

FUNCTION actionPerformed(inActionEventID)  

This method will be called when the action is triggered from the contributed tools menu.

ParameterDescription
inActionEventID This is a reference to [Java Class:eventmanager/ExtCommand]
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.

ParameterDescription
inActionEventID This is a reference to [Java Class:eventmanager/ExtCommand]
FUNCTION getStyleCheckName$()  

Get the name for the style check class

Returns The name of the class
FUNCTION hasConfigAction()  

This method is used to check whether a configuration action has been implemented.

Returns True (1) if 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.

ParameterDescription
state A reference to an object of class PvxState
FUNCTION LOCAL loadRules(theRuleFile$)  

Load the style rules from the developer properies file.

ParameterDescription
theRuleFile$ The name of the properties file ti be loaded
FUNCTION LOCAL writeRuleFile(aRuleFile$, theRules$, isSecondaryFile)  

save rules back to the rule file(s)

ParameterDescription
theRuleFile$ The name of the properties file to write
theRules$ The modified rules to write to the rule file
isSecondaryFile A simple boolean (0=False, 1=True) to indicate a secondary rule file

Properties inherited from: AbstractActionListener

theDescription$, theNotificationFlag

Properties inherited from: EventManagerObserver

theDescription$, theNotificationFlag

Methods inherited from: AbstractActionListener

actionPerformed(), configPerformed(), getDescription$(), getEventNotificationFlag(), hasConfigAction(), init()

Methods inherited from: EventManagerObserver

getDescription$(), getEventNotificationFlag(), init(), update(), createAlternateSourceFile(), getAlternateSourceFile$()