1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00

[cleanup] format and javadoc

This commit is contained in:
David Dykstal 2006-09-15 20:05:08 +00:00
parent 3c00fb249e
commit daa1d12771
3 changed files with 40 additions and 72 deletions

View file

@ -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 * The action allows users to collapse the selected nodes in the Remote Systems Explorer tree view
*/ */
public class SystemCollapseAction extends SystemBaseAction { public class SystemCollapseAction extends SystemBaseAction {
// see defect 41203
/** /**
* Constructor * Constructor
* @param parent the parent shell for this action * @param parent the parent shell for this action

View file

@ -15,8 +15,8 @@
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.actions; package org.eclipse.rse.ui.actions;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.model.ISystemResourceChangeEvents;
import org.eclipse.rse.model.ISystemResourceChangeListener; import org.eclipse.rse.model.ISystemResourceChangeListener;
import org.eclipse.rse.model.SystemRegistry; 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.SWT;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
/** /**
* The action allows users to collapse the entire Remote Systems Explorer tree view. * The action allows users to collapse the entire Remote Systems Explorer tree view.
*/ */
public class SystemCollapseAllAction extends SystemBaseAction public class SystemCollapseAllAction extends SystemBaseAction {
//
{
// See defect 41203
/** /**
* Constructor * Constructor
* @param parent the shell that is employing this action
*/ */
public SystemCollapseAllAction(Shell 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
super(SystemResources.ACTION_COLLAPSE_ALL_LABEL, SystemResources.ACTION_COLLAPSE_ALL_TOOLTIP,
RSEUIPlugin.getDefault().getImageDescriptorFromIDE(ISystemIconConstants.ICON_IDE_COLLAPSEALL_ID), // D54577
parent); parent);
setHoverImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptorFromIDE("elcl16/collapseall.gif")); //$NON-NLS-1$ setHoverImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptorFromIDE("elcl16/collapseall.gif")); //$NON-NLS-1$
allowOnMultipleSelection(true); allowOnMultipleSelection(true);
setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND); // should never be used setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND); // should never be used
setSelectionSensitive(false); setSelectionSensitive(false);
setHelp(RSEUIPlugin.HELPPREFIX+"actn0023"); setHelp(RSEUIPlugin.HELPPREFIX + "actn0023");
setAccelerator(SWT.CTRL | '-'); setAccelerator(SWT.CTRL | '-');
} }
/** /**
* @see SystemBaseAction#updateSelection(IStructuredSelection) * @see SystemBaseAction#updateSelection(IStructuredSelection)
*/ */
public boolean updateSelection(IStructuredSelection selection) public boolean updateSelection(IStructuredSelection selection) {
{
return true; return true;
} }
@ -67,16 +59,11 @@ public class SystemCollapseAllAction extends SystemBaseAction
* This is the method called when the user selects this action. * This is the method called when the user selects this action.
* @see org.eclipse.jface.action.Action#run() * @see org.eclipse.jface.action.Action#run()
*/ */
public void run() public void run() {
{
SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) {
{ sr.fireEvent((ISystemResourceChangeListener) viewer, new SystemResourceChangeEvent("false", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null));
sr.fireEvent((ISystemResourceChangeListener)viewer, } else
new SystemResourceChangeEvent("false",
ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null));
}
else
sr.fireEvent(new SystemResourceChangeEvent("false", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null)); sr.fireEvent(new SystemResourceChangeEvent("false", ISystemResourceChangeEvents.EVENT_COLLAPSE_ALL, null));
} }
} }

View file

@ -15,10 +15,10 @@
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.actions; package org.eclipse.rse.ui.actions;
import java.util.Iterator; import java.util.Iterator;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.model.ISystemResourceChangeEvents; import org.eclipse.rse.model.ISystemResourceChangeEvents;
import org.eclipse.rse.model.ISystemResourceChangeListener; import org.eclipse.rse.model.ISystemResourceChangeListener;
import org.eclipse.rse.model.SystemRegistry; import org.eclipse.rse.model.SystemRegistry;
@ -30,29 +30,23 @@ import org.eclipse.rse.ui.view.ISystemTree;
import org.eclipse.rse.ui.view.ISystemViewElementAdapter; import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
/** /**
* The action allows users to expand the selected nodes in the Remote Systems Explorer tree view * The action allows users to expand the selected nodes in the Remote Systems Explorer tree view
*/ */
public class SystemExpandAction extends SystemBaseAction public class SystemExpandAction extends SystemBaseAction {
{
// see defect 41203
/** /**
* Constructor * Constructor
* @param parent the shell that employs this action
*/ */
public SystemExpandAction(Shell parent) public SystemExpandAction(Shell parent) {
{ super(SystemResources.ACTION_EXPAND_SELECTED_LABEL, SystemResources.ACTION_EXPAND_SELECTED_TOOLTIP, parent);
super(SystemResources.ACTION_EXPAND_SELECTED_LABEL,SystemResources.ACTION_EXPAND_SELECTED_TOOLTIP,
parent);
allowOnMultipleSelection(true); allowOnMultipleSelection(true);
setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND); setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND);
setAccelerator('+'); setAccelerator('+');
setHelp(RSEUIPlugin.HELPPREFIX+"actn0025"); setHelp(RSEUIPlugin.HELPPREFIX + "actn0025");
setAvailableOffline(true); setAvailableOffline(true);
} }
/** /**
* <p> * <p>
@ -60,23 +54,18 @@ public class SystemExpandAction extends SystemBaseAction
* *
* @see SystemBaseAction#updateSelection(IStructuredSelection) * @see SystemBaseAction#updateSelection(IStructuredSelection)
*/ */
public boolean updateSelection(IStructuredSelection selection) public boolean updateSelection(IStructuredSelection selection) {
{
boolean enable = false; boolean enable = false;
if ((viewer != null) && (viewer instanceof ISystemTree)) if ((viewer != null) && (viewer instanceof ISystemTree)) {
{ return ((ISystemTree) viewer).areAnySelectedItemsExpandable();
return ((ISystemTree)viewer).areAnySelectedItemsExpandable();
} }
Iterator e = selection.iterator(); Iterator e = selection.iterator();
ISystemViewElementAdapter adapter = null; ISystemViewElementAdapter adapter = null;
while (!enable && e.hasNext()) while (!enable && e.hasNext()) {
{
Object selectedObject = e.next(); Object selectedObject = e.next();
adapter = getAdapter(selectedObject); adapter = getAdapter(selectedObject);
if (adapter != null) if (adapter != null) {
{ if (adapter.hasChildren(selectedObject)) enable = true;
if (adapter.hasChildren(selectedObject))
enable = true;
} }
} }
return enable; return enable;
@ -86,17 +75,12 @@ public class SystemExpandAction extends SystemBaseAction
* This is the method called when the user selects this action. * This is the method called when the user selects this action.
* @see org.eclipse.jface.action.Action#run() * @see org.eclipse.jface.action.Action#run()
*/ */
public void run() public void run() {
{
//System.out.println("Inside run of SystemRefreshAction"); //System.out.println("Inside run of SystemRefreshAction");
SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); SystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) if ((viewer != null) && (viewer instanceof ISystemResourceChangeListener)) {
{ sr.fireEvent((ISystemResourceChangeListener) viewer, new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null));
sr.fireEvent((ISystemResourceChangeListener)viewer, } else
new SystemResourceChangeEvent("dummy",
ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null));
}
else
sr.fireEvent(new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null)); sr.fireEvent(new SystemResourceChangeEvent("dummy", ISystemResourceChangeEvents.EVENT_EXPAND_SELECTED, null));
} }
} }