mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Implement local notification.
The default behavior is to only notify remote changes, but for some applications (e.g. GUI's) it's advantageous to know about local changes as well. This is (slightly) optimized in that local changes only result in additional resources being consumed if (any) local listeners have been created.
This commit is contained in:
@@ -310,6 +310,16 @@ public interface ITable {
|
||||
*/
|
||||
public void addTableListener(ITableListener listener,
|
||||
boolean immediateNotify);
|
||||
/**
|
||||
* Add a listener for changes to the table
|
||||
* @param listener the listener to add
|
||||
* @param immediateNotify if true then this listener will be notified of all
|
||||
* current entries (marked as new)
|
||||
* @param localNotify if true then this listener will be notified of all
|
||||
* local changes in addition to all remote changes
|
||||
*/
|
||||
public void addTableListener(ITableListener listener, boolean immediateNotify,
|
||||
boolean localNotify);
|
||||
|
||||
/**
|
||||
* Add a listener for changes to a specific key the table
|
||||
@@ -320,11 +330,30 @@ public interface ITable {
|
||||
*/
|
||||
public void addTableListener(String key, ITableListener listener,
|
||||
boolean immediateNotify);
|
||||
/**
|
||||
* Add a listener for changes to a specific key the table
|
||||
* @param key the key to listen for
|
||||
* @param listener the listener to add
|
||||
* @param immediateNotify if true then this listener will be notified of all
|
||||
* current entries (marked as new)
|
||||
* @param localNotify if true then this listener will be notified of all
|
||||
* local changes in addition to all remote changes
|
||||
*/
|
||||
public void addTableListener(String key, ITableListener listener,
|
||||
boolean immediateNotify, boolean localNotify);
|
||||
/**
|
||||
* This will immediately notify the listener of all current sub tables
|
||||
* @param listener
|
||||
*/
|
||||
public void addSubTableListener(final ITableListener listener);
|
||||
/**
|
||||
* This will immediately notify the listener of all current sub tables
|
||||
* @param listener
|
||||
* @param localNotify if true then this listener will be notified of all
|
||||
* local changes in addition to all remote changes
|
||||
*/
|
||||
public void addSubTableListener(final ITableListener listener,
|
||||
boolean localNotify);
|
||||
/**
|
||||
* Remove a listener from receiving table events
|
||||
* @param listener the listener to be removed
|
||||
|
||||
Reference in New Issue
Block a user