The TimeZoneTableView
and the TimeZoneTreeView
can propagate their selection to the Properties view. Responding to selection changes gives a unified feel despite the fact that the views are independent entities.
They can be further linked so that when a TimeZone
is selected in either of these views, it automatically reveals in the other. To do this, a selection listener will need to be registered, and if the selected object is a type of TimeZone
, display it in the view (with the reveal()
and setSelection()
methods).
Create a class
TimeZoneSelectionListener
(in thecom.packtpub.e4.clock.ui.internal
package), which implements theISelectionListener
interface. This will take a viewer, and an associated part, to implement theselectionChanged()
method.public class TimeZoneSelectionListener implements ISelectionListener { private Viewer viewer; private IWorkbenchPart part; public TimeZoneSelectionListener(Viewer v, IWorkbenchPart p) { this.viewer...