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
*/
public class SystemCollapseAction extends SystemBaseAction {
// see defect 41203
/**
* Constructor
* @param parent the parent shell for this action

View file

@ -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,23 +28,16 @@ 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
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);
@ -58,8 +51,7 @@ public class SystemCollapseAllAction extends SystemBaseAction
/**
* @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
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));
}
}

View file

@ -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,23 +30,17 @@ 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);
public SystemExpandAction(Shell parent) {
super(SystemResources.ACTION_EXPAND_SELECTED_LABEL, SystemResources.ACTION_EXPAND_SELECTED_TOOLTIP, parent);
allowOnMultipleSelection(true);
setContextMenuGroup(ISystemContextMenuConstants.GROUP_EXPAND);
setAccelerator('+');
@ -60,23 +54,18 @@ public class SystemExpandAction extends SystemBaseAction
*
* @see SystemBaseAction#updateSelection(IStructuredSelection)
*/
public boolean updateSelection(IStructuredSelection selection)
{
public boolean updateSelection(IStructuredSelection selection) {
boolean enable = false;
if ((viewer != null) && (viewer instanceof ISystemTree))
{
if ((viewer != null) && (viewer instanceof ISystemTree)) {
return ((ISystemTree) viewer).areAnySelectedItemsExpandable();
}
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
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));
}
}