When the last event of a line is selected the "Next Event" menu item is still enabled. It should be grayed. Same for "Previous Event" when the first event of a lines selected.
Am attaching a patch which will fix this bug. I have done the following changes:
The NextAction & PreviousAction classes will observe the ZoomModel class. When a user creates a baseline that will be notified to these classes through zoom model. Then these two classes will update the status of the Next/Previous action menu option(i.e. enable/disable the menu obtion based on the base line time).
File Added: bug- 1654076v3.diff
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Am attaching a patch which will fix this bug. I have done the following changes:
The NextAction & PreviousAction classes will observe the ZoomModel class. When a user creates a baseline that will be notified to these classes through zoom model. Then these two classes will update the status of the Next/Previous action menu option(i.e. enable/disable the menu obtion based on the base line time).
File Added: bug- 1654076v3.diff
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) in NextAction.updateModel() please call super.updateModel(...) instead of explicitly setting the tracemodel/zoommodel attributes again. Same for PreviousAction.
2) NextAction/PreviousAction are created once in TraceEditorActionBars() and then shared by all editors. Thus I don't understand why you need a static field to store this unique instance. Removing this static field and calling setEnabled(...) directly should work ...
3) you always add observers on the zoommodel, but never remove them. To do that you probably need to remember the previous zoomModel, remove the observer on this one and add the new observer on the new zoommodel. As I don't think it is the responsability of those actions to store such a state, I think you may consider moving the code that handle the enablement (updateActionState()) in TraceEditorActionBars.setActiveEditor(). Here you can add a local observer to the zoommodel that will enable/disable the action according to the new state and you also have the dispose() method available to remove the observer from the last active model.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1596868
Originator: NO
Am attaching a patch which will fix this bug. I have done the following changes:
The NextAction & PreviousAction classes will observe the ZoomModel class. When a user creates a baseline that will be notified to these classes through zoom model. Then these two classes will update the status of the Next/Previous action menu option(i.e. enable/disable the menu obtion based on the base line time).
File Added: bug- 1654076v3.diff
Logged In: YES
user_id=1596868
Originator: NO
Am attaching a patch which will fix this bug. I have done the following changes:
The NextAction & PreviousAction classes will observe the ZoomModel class. When a user creates a baseline that will be notified to these classes through zoom model. Then these two classes will update the status of the Next/Previous action menu option(i.e. enable/disable the menu obtion based on the base line time).
File Added: bug- 1654076v3.diff
Logged In: YES
user_id=1706683
Originator: YES
Hi Karthik,
some remarks about the patch:
1) in NextAction.updateModel() please call super.updateModel(...) instead of explicitly setting the tracemodel/zoommodel attributes again. Same for PreviousAction.
2) NextAction/PreviousAction are created once in TraceEditorActionBars() and then shared by all editors. Thus I don't understand why you need a static field to store this unique instance. Removing this static field and calling setEnabled(...) directly should work ...
3) you always add observers on the zoommodel, but never remove them. To do that you probably need to remember the previous zoomModel, remove the observer on this one and add the new observer on the new zoommodel. As I don't think it is the responsability of those actions to store such a state, I think you may consider moving the code that handle the enablement (updateActionState()) in TraceEditorActionBars.setActiveEditor(). Here you can add a local observer to the zoommodel that will enable/disable the action according to the new state and you also have the dispose() method available to remove the observer from the last active model.
Logged In: YES
user_id=1596868
Originator: NO
I am submitting a new patch for this bug which incorporates Mr. Philippe Coucaud's comments.
File Added: bug- 1654076v4.diff
Logged In: YES
user_id=1577725
Originator: NO
I have verified the patch and it fixes the problem as well as the review comments.
The code is updated in CVS.