diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAction.java index 922014ca748..a906da125de 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAction.java @@ -34,9 +34,6 @@ import org.eclipse.swt.widgets.Shell; * The action allows users to collapse the selected nodes in the Remote Systems Explorer tree view */ public class SystemCollapseAction extends SystemBaseAction { - - // see defect 41203 - /** * Constructor * @param parent the parent shell for this action diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAllAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAllAction.java index 3752a16af97..4d21937cb1b 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAllAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemCollapseAllAction.java @@ -15,8 +15,8 @@ ********************************************************************************/ package org.eclipse.rse.ui.actions; + import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.model.ISystemResourceChangeListener; import org.eclipse.rse.model.SystemRegistry; @@ -28,38 +28,30 @@ import org.eclipse.rse.ui.SystemResources; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Shell; - /** * The action allows users to collapse the entire Remote Systems Explorer tree view. */ -public class SystemCollapseAllAction extends SystemBaseAction - // -{ - - // See defect 41203 - +public class SystemCollapseAllAction extends SystemBaseAction { /** * Constructor + * @param parent the shell that is employing this action */ - public SystemCollapseAllAction(Shell parent) - { - super(SystemResources.ACTION_COLLAPSE_ALL_LABEL, SystemResources.ACTION_COLLAPSE_ALL_TOOLTIP, - RSEUIPlugin.getDefault().getImageDescriptorFromIDE(ISystemIconConstants.ICON_IDE_COLLAPSEALL_ID), // D54577 - parent); + public SystemCollapseAllAction(Shell parent) { + super(SystemResources.ACTION_COLLAPSE_ALL_LABEL, SystemResources.ACTION_COLLAPSE_ALL_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptorFromIDE(ISystemIconConstants.ICON_IDE_COLLAPSEALL_ID), // D54577 + parent); setHoverImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptorFromIDE("elcl16/collapseall.gif")); //$NON-NLS-1$ - allowOnMultipleSelection(true); + allowOnMultipleSelection(true); setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND); // should never be used - setSelectionSensitive(false); - - setHelp(RSEUIPlugin.HELPPREFIX+"actn0023"); + setSelectionSensitive(false); + + setHelp(RSEUIPlugin.HELPPREFIX + "actn0023"); setAccelerator(SWT.CTRL | '-'); } /** * @see SystemBaseAction#updateSelection(IStructuredSelection) */ - public boolean updateSelection(IStructuredSelection selection) - { + public boolean updateSelection(IStructuredSelection selection) { return true; } @@ -67,16 +59,11 @@ public class SystemCollapseAllAction extends SystemBaseAction * This is the method called when the user selects this action. * @see org.eclipse.jface.action.Action#run() */ - public void run() - { + public void run() { SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); - if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) - { - sr.fireEvent((ISystemResourceChangeListener)viewer, - new SystemResourceChangeEvent("false", - ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null)); - } - else - sr.fireEvent(new SystemResourceChangeEvent("false", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null)); - } + if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) { + sr.fireEvent((ISystemResourceChangeListener) viewer, new SystemResourceChangeEvent("false", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null)); + } else + sr.fireEvent(new SystemResourceChangeEvent("false", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null)); + } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemExpandAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemExpandAction.java index c3609ae77cd..bcd08dbf13d 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemExpandAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemExpandAction.java @@ -15,10 +15,10 @@ ********************************************************************************/ package org.eclipse.rse.ui.actions; + import java.util.Iterator; import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.model.ISystemResourceChangeListener; import org.eclipse.rse.model.SystemRegistry; @@ -30,53 +30,42 @@ import org.eclipse.rse.ui.view.ISystemTree; import org.eclipse.rse.ui.view.ISystemViewElementAdapter; import org.eclipse.swt.widgets.Shell; - /** * The action allows users to expand the selected nodes in the Remote Systems Explorer tree view */ -public class SystemExpandAction extends SystemBaseAction - -{ - - // see defect 41203 - +public class SystemExpandAction extends SystemBaseAction { + /** * Constructor + * @param parent the shell that employs this action */ - public SystemExpandAction(Shell parent) - { - super(SystemResources.ACTION_EXPAND_SELECTED_LABEL,SystemResources.ACTION_EXPAND_SELECTED_TOOLTIP, - parent); - allowOnMultipleSelection(true); + public SystemExpandAction(Shell parent) { + super(SystemResources.ACTION_EXPAND_SELECTED_LABEL, SystemResources.ACTION_EXPAND_SELECTED_TOOLTIP, parent); + allowOnMultipleSelection(true); setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND); setAccelerator('+'); - setHelp(RSEUIPlugin.HELPPREFIX+"actn0025"); + setHelp(RSEUIPlugin.HELPPREFIX + "actn0025"); setAvailableOffline(true); -} + } /** *

* We intercept to ensure at least one selected item is expandable - * + * * @see SystemBaseAction#updateSelection(IStructuredSelection) */ - public boolean updateSelection(IStructuredSelection selection) - { + public boolean updateSelection(IStructuredSelection selection) { boolean enable = false; - if ((viewer != null) && (viewer instanceof ISystemTree)) - { - return ((ISystemTree)viewer).areAnySelectedItemsExpandable(); + if ((viewer != null) && (viewer instanceof ISystemTree)) { + return ((ISystemTree) viewer).areAnySelectedItemsExpandable(); } - Iterator e = selection.iterator(); + Iterator e = selection.iterator(); ISystemViewElementAdapter adapter = null; - while (!enable && e.hasNext()) - { + while (!enable && e.hasNext()) { Object selectedObject = e.next(); adapter = getAdapter(selectedObject); - if (adapter != null) - { - if (adapter.hasChildren(selectedObject)) - enable = true; + if (adapter != null) { + if (adapter.hasChildren(selectedObject)) enable = true; } } return enable; @@ -86,17 +75,12 @@ public class SystemExpandAction extends SystemBaseAction * This is the method called when the user selects this action. * @see org.eclipse.jface.action.Action#run() */ - public void run() - { + public void run() { //System.out.println("Inside run of SystemRefreshAction"); SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); - if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) - { - sr.fireEvent((ISystemResourceChangeListener)viewer, - new SystemResourceChangeEvent("dummy", - ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null)); - } - else - sr.fireEvent(new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null)); - } + if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) { + sr.fireEvent((ISystemResourceChangeListener) viewer, new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null)); + } else + sr.fireEvent(new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null)); + } } \ No newline at end of file