Package org.eclipse.ui
Class OpenAndLinkWithEditorHelper
java.lang.Object
org.eclipse.ui.OpenAndLinkWithEditorHelper
Helper for opening editors on the viewer's selection and link the selection
 with the editor.
- Since:
- 3.5
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new helper for the given viewer.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidactivate(ISelection selection) Tells to activate the editor that is open on the given selection.voiddispose()Disposes this helper.protected voidlinkToEditor(ISelection selection) Tells to link the given selection to the editor that is open on the given selection but does nothing if no matching editor can be found.protected abstract voidopen(ISelection selection, boolean activate) Tells to open an editor for the given selection.voidsetLinkWithEditor(boolean enabled) Sets whether editor that corresponds to the viewer's selection should be brought to front.
- 
Constructor Details- 
OpenAndLinkWithEditorHelperCreates a new helper for the given viewer.- Parameters:
- viewer- the viewer
 
 
- 
- 
Method Details- 
setLinkWithEditorpublic void setLinkWithEditor(boolean enabled) Sets whether editor that corresponds to the viewer's selection should be brought to front.- Parameters:
- enabled-- trueto enable,- falseto disable
 
- 
disposepublic void dispose()Disposes this helper.Clients only need to call this method if their viewer has a longer life-cycle than this helper. 
- 
activateTells to activate the editor that is open on the given selection.Note: The implementation must not open a new editor. - Parameters:
- selection- the viewer's selection
- Since:
- 3.5
 
- 
openTells to open an editor for the given selection.- Parameters:
- selection- the viewer's selection
- activate-- trueif the editor should be activated,- falseotherwise
- Since:
- 3.5
 
- 
linkToEditorTells to link the given selection to the editor that is open on the given selection but does nothing if no matching editor can be found.The common implementation brings that editor to front but more advanced implementations may also select the given selection inside the editor. Note: The implementation must not open a new editor. The default implementation does nothing i.e. does not implement linking. - Parameters:
- selection- the viewer's selection
- Since:
- 3.5, non-abstract since 4.3
 
 
-