1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 01:35:39 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2014-10-09 10:32:13 -07:00
parent 856b684824
commit 3ac977929a
3 changed files with 11 additions and 13 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2013 Wind River Systems, Inc. and others. * Copyright (c) 2007, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -41,7 +41,7 @@ public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate
@Override @Override
public void run(IAction action) { public void run(IAction action) {
if(!(fSelection instanceof IStructuredSelection) && !(fSelection instanceof ITextSelection)) { if (!(fSelection instanceof IStructuredSelection) && !(fSelection instanceof ITextSelection)) {
return; return;
} }
ICElement[] elements = getSelectedCElements(); ICElement[] elements = getSelectedCElements();
@ -57,7 +57,7 @@ public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate
} }
/** /**
* Return the options to update the translation. * Returns the options to update the translation.
* @see IIndexManager#update(ICElement[], int) * @see IIndexManager#update(ICElement[], int)
* @since 4.0 * @since 4.0
*/ */
@ -76,22 +76,22 @@ public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate
protected ICElement[] getSelectedCElements() { protected ICElement[] getSelectedCElements() {
ArrayList<ICElement> tuSelection= new ArrayList<ICElement>(); ArrayList<ICElement> tuSelection= new ArrayList<ICElement>();
if(fSelection instanceof IStructuredSelection) { if (fSelection instanceof IStructuredSelection) {
IStructuredSelection resources = SelectionConverter.convertSelectionToResources(fSelection); IStructuredSelection resources = SelectionConverter.convertSelectionToResources(fSelection);
for (Iterator<?> i= resources.iterator(); i.hasNext();) { for (Iterator<?> i= resources.iterator(); i.hasNext();) {
Object o= i.next(); Object o= i.next();
if(o instanceof IResource) { if (o instanceof IResource) {
ICElement celement= CCorePlugin.getDefault().getCoreModel().create((IResource)o); ICElement celement= CCorePlugin.getDefault().getCoreModel().create((IResource) o);
if(celement != null) { if (celement != null) {
tuSelection.add(celement); tuSelection.add(celement);
} }
} }
} }
} else if(fSelection == null || fSelection instanceof ITextSelection) { } else if (fSelection == null || fSelection instanceof ITextSelection) {
IProject project = EditorUtility.getProjectForActiveEditor(); IProject project = EditorUtility.getProjectForActiveEditor();
if(project != null) { if (project != null) {
ICProject cproject= CCorePlugin.getDefault().getCoreModel().create(project); ICProject cproject= CCorePlugin.getDefault().getCoreModel().create(project);
if(cproject != null) { if (cproject != null) {
tuSelection.add(cproject); tuSelection.add(cproject);
} }
} }

View file

@ -10,7 +10,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.actions; package org.eclipse.cdt.internal.ui.actions;
/** /**
* Handler for {@link org.eclipse.cdt.internal.ui.actions.RebuildIndexAction} * Handler for {@link org.eclipse.cdt.internal.ui.actions.RebuildIndexAction}
* *
@ -18,7 +17,6 @@ package org.eclipse.cdt.internal.ui.actions;
* @noinstantiate This class is not intended to be instantiated by clients. * @noinstantiate This class is not intended to be instantiated by clients.
*/ */
public class RebuildIndexHandler extends AbstractUpdateIndexHandler { public class RebuildIndexHandler extends AbstractUpdateIndexHandler {
private final RebuildIndexAction rebuildIndexAction = new RebuildIndexAction(); private final RebuildIndexAction rebuildIndexAction = new RebuildIndexAction();
@Override @Override

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2008, 2013 Wind River Systems, Inc. and others. * Copyright (c) 2008, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at