Example 2: Progress Log

The Class

This contributed tool (stripTrailing) is broken down into several separate pieces that work together to deliver the desired functionality to the user.

In this case, a NOMADS panel is used to display the output from the tool and to also allow the user to interact with the tool as it performs the work.

API Documentation

Listener
Click HERE to view the API documentation for the listener portion of this contributed tool.
User Interface
Click HERE to view the API documentation for the user interface portion of this contributed tool.
Plug-in Class: NOMADS Interface
Click HERE to view the API documentation for the standard NOMADS interface class that is part of the Plug-in.
Plug-in Class: ProgressLog
Click HERE to view the API documentation for the standard ProgressLog class that is part of the Plug-in.

Source Code

Listener
Click Formatted HTML or Simple Text to view the source code for the listener portion of this contributed tool.
User Interface
Click Formatted HTML or Simple Text to view the source code for the user interface portion of this contributed tool.

Do the Work

This contributed tool is broken down into several separate pieces that work together to deliver the desired functionality to the user. In this case, a NOMADS panel is used to display the output from the tool and to also allow the user to interact with the tool as it performs the work.

Listener

The do_ActionPerformed() method in the listener for this contributed tool simply starts the user interface class in a new process which will be responsible for completing the work.

do_ActionPerformed:
enter (IExtCommand)
	local oCommon
	oCommon=new("ecCommon")
	oCommon'processPanel(cUI$,cTitle$)
	drop object oCommon
return
User Interface

The user interface class inherits the standard Plug-in class com.pvx.util.progress which provides a simple progress log window that includes several buttons to allow user interaction as the work progresses. This class requires the child class to implement a do_work() method to perform the required work for the contributed tool and also manage the available features of the interface.

The child class interacts with the user interface using the following methods:

_obj'enable_cancel()
Use this method to enable the Cancel button.
_obj'checkCancel()
If Cancel has been enabled, the child class must use this method to determine if the user has attempted to cancel the task.
_obj'disable_cancel()
If Cancel has been enabled, the child class should use this method during any portion of work that cannot be aborted (such as an update).
_obj'writeLog(message$)
Use this method to write the value in the argument message$ to the progress log window.

The following image show an example if the user interface that will be presented to the user.

Example - Progress Log