diff options
Diffstat (limited to 'bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPluginAction.java')
-rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPluginAction.java | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPluginAction.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPluginAction.java index fdfd6d88aa8..6895ab5486c 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPluginAction.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPluginAction.java @@ -19,43 +19,40 @@ import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchPartSite; /** - * This class adds to the PluginAction support by - * setting itself up for work within a WorkbenchPart. - * The main difference is that it is capable of + * This class adds to the PluginAction support by setting itself up for work + * within a WorkbenchPart. The main difference is that it is capable of * processing local selection changes within a part. */ public class PartPluginAction extends PluginAction { - /** - * PartPluginAction constructor. - */ - public PartPluginAction(IConfigurationElement actionElement, String id, - int style) { - super(actionElement, id, style); - } + /** + * PartPluginAction constructor. + */ + public PartPluginAction(IConfigurationElement actionElement, String id, int style) { + super(actionElement, id, style); + } - /** - * Registers this action as a listener of the workbench part. - */ - protected void registerSelectionListener(IWorkbenchPart aPart) { - ISelectionProvider selectionProvider = aPart.getSite() - .getSelectionProvider(); - if (selectionProvider != null) { - selectionProvider.addSelectionChangedListener(this); - selectionChanged(selectionProvider.getSelection()); - } - } + /** + * Registers this action as a listener of the workbench part. + */ + protected void registerSelectionListener(IWorkbenchPart aPart) { + ISelectionProvider selectionProvider = aPart.getSite().getSelectionProvider(); + if (selectionProvider != null) { + selectionProvider.addSelectionChangedListener(this); + selectionChanged(selectionProvider.getSelection()); + } + } - /** - * Unregisters this action as a listener of the workbench part. - */ - protected void unregisterSelectionListener(IWorkbenchPart aPart) { - IWorkbenchPartSite site = aPart.getSite(); + /** + * Unregisters this action as a listener of the workbench part. + */ + protected void unregisterSelectionListener(IWorkbenchPart aPart) { + IWorkbenchPartSite site = aPart.getSite(); if (site == null) { return; } ISelectionProvider selectionProvider = site.getSelectionProvider(); - if (selectionProvider != null) { - selectionProvider.removeSelectionChangedListener(this); - } - } + if (selectionProvider != null) { + selectionProvider.removeSelectionChangedListener(this); + } + } } |