Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSergey Prigogin2011-06-29 23:24:16 -0400
committerSergey Prigogin2011-06-29 23:25:30 -0400
commit5854ece2d45bb9698b75071c78f0a1fe55c628ca (patch)
treeffeea801b4468eaeb07dcc2c104f4206ae960fae /core
parent4946010ddd798de8c2f899c0e2d1f197d2689105 (diff)
downloadorg.eclipse.cdt-5854ece2d45bb9698b75071c78f0a1fe55c628ca.tar.gz
org.eclipse.cdt-5854ece2d45bb9698b75071c78f0a1fe55c628ca.tar.xz
org.eclipse.cdt-5854ece2d45bb9698b75071c78f0a1fe55c628ca.zip
Cosmetics.
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHDropTargetListener.java13
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java27
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java4
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenElementInCallHierarchyAction.java10
5 files changed, 24 insertions, 36 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHDropTargetListener.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHDropTargetListener.java
index 7e5eab7e01..652484b268 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHDropTargetListener.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHDropTargetListener.java
@@ -6,9 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.internal.ui.callhierarchy;
import java.util.Iterator;
@@ -24,9 +23,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.cdt.core.model.ICElement;
-
public class CHDropTargetListener implements DropTargetListener {
-
private CHViewPart fCallHierarchy;
private ICElement fInput;
private boolean fEnabled= true;
@@ -56,7 +53,7 @@ public class CHDropTargetListener implements DropTargetListener {
private ICElement checkLocalSelection() {
ISelection sel= LocalSelectionTransfer.getTransfer().getSelection();
if (sel instanceof IStructuredSelection) {
- for (Iterator<?> iter = ((IStructuredSelection)sel).iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = ((IStructuredSelection) sel).iterator(); iter.hasNext();) {
Object element = iter.next();
if (element instanceof ICElement) {
return (ICElement) element;
@@ -85,8 +82,7 @@ public class CHDropTargetListener implements DropTargetListener {
public void drop(DropTargetEvent event) {
if (fInput == null) {
Display.getCurrent().beep();
- }
- else {
+ } else {
fCallHierarchy.setInput(fInput);
}
}
@@ -97,8 +93,7 @@ public class CHDropTargetListener implements DropTargetListener {
private void checkOperation(DropTargetEvent event) {
if (fEnabled && (event.operations & DND.DROP_COPY) != 0) {
event.detail= DND.DROP_COPY;
- }
- else {
+ } else {
event.detail= DND.DROP_NONE;
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java
index d456591826..a58bd7afec 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHQueries.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.ui.callhierarchy;
@@ -101,8 +101,8 @@ public class CHQueries {
}
- private static void findCalledBy2(IIndex index, IBinding callee, boolean includeOrdinaryCalls, ICProject project, CalledByResult result)
- throws CoreException {
+ private static void findCalledBy2(IIndex index, IBinding callee, boolean includeOrdinaryCalls,
+ ICProject project, CalledByResult result) throws CoreException {
IIndexName[] names= index.findNames(callee, IIndex.FIND_REFERENCES | IIndex.SEARCH_ACROSS_LANGUAGE_BOUNDARIES);
for (IIndexName rname : names) {
if (includeOrdinaryCalls || rname.couldBePolymorphicMethodCall()) {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java
index 59e228e1c2..643cbe5125 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CallHierarchyUI.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.ui.callhierarchy;
@@ -136,8 +136,7 @@ public class CallHierarchyUI {
CHMessages.CallHierarchyUI_openFailureMessage);
}
return Status.OK_STATUS;
- }
- catch (CoreException e) {
+ } catch (CoreException e) {
return e.getStatus();
}
}
@@ -151,7 +150,8 @@ public class CallHierarchyUI {
private static ICElement[] findDefinitions(ICProject project, IEditorInput editorInput, ITextSelection sel)
throws CoreException {
try {
- IIndex index= CCorePlugin.getIndexManager().getIndex(project, IIndexManager.ADD_DEPENDENCIES | IIndexManager.ADD_DEPENDENT);
+ IIndex index= CCorePlugin.getIndexManager().getIndex(project,
+ IIndexManager.ADD_DEPENDENCIES | IIndexManager.ADD_DEPENDENT);
index.acquireReadLock();
try {
@@ -190,8 +190,7 @@ public class CallHierarchyUI {
return NO_ELEMENTS;
}
}
- }
- finally {
+ } finally {
index.releaseReadLock();
}
} catch (CoreException e) {
@@ -226,7 +225,8 @@ public class CallHierarchyUI {
final ITranslationUnit tu= CModelUtil.getTranslationUnit(input);
if (tu != null) {
final ICProject project= tu.getCProject();
- final IIndex index= CCorePlugin.getIndexManager().getIndex(project, IIndexManager.ADD_DEPENDENCIES | IIndexManager.ADD_DEPENDENT);
+ final IIndex index= CCorePlugin.getIndexManager().getIndex(project,
+ IIndexManager.ADD_DEPENDENCIES | IIndexManager.ADD_DEPENDENT);
index.acquireReadLock();
try {
@@ -242,21 +242,18 @@ public class CallHierarchyUI {
IIndexName name= IndexUI.elementToName(index, input);
if (name != null) {
ICElementHandle handle= IndexUI.getCElementForName(tu, index, name);
- return new ICElement[] {handle};
+ return new ICElement[] { handle };
}
- }
- finally {
+ } finally {
index.releaseReadLock();
}
}
- }
- catch (CoreException e) {
+ } catch (CoreException e) {
CUIPlugin.log(e);
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
- return new ICElement[] {input};
+ return new ICElement[] { input };
}
private static boolean needToFindDefinition(ICElement elem) {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java
index b6f5bec8c5..acfe484905 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenCallHierarchyAction.java
@@ -27,7 +27,6 @@ import org.eclipse.cdt.ui.actions.SelectionDispatchAction;
public class OpenCallHierarchyAction extends SelectionDispatchAction {
-
private ITextEditor fEditor;
public OpenCallHierarchyAction(IWorkbenchSite site) {
@@ -73,8 +72,7 @@ public class OpenCallHierarchyAction extends SelectionDispatchAction {
ICElement elem= (ICElement) getAdapter(selectedObject, ICElement.class);
if (elem != null) {
setEnabled(isValidElement(elem));
- }
- else {
+ } else {
setEnabled(false);
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenElementInCallHierarchyAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenElementInCallHierarchyAction.java
index 5fa962e003..5fc584ed15 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenElementInCallHierarchyAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/OpenElementInCallHierarchyAction.java
@@ -6,9 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Markus Schorn - initial API and implementation
+ * Markus Schorn - initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.internal.ui.callhierarchy;
import org.eclipse.jface.action.IAction;
@@ -31,7 +30,6 @@ import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.internal.ui.browser.opentype.ElementSelectionDialog;
public class OpenElementInCallHierarchyAction implements IWorkbenchWindowActionDelegate {
-
private static final int[] VISIBLE_TYPES = {
ICElement.C_FUNCTION, ICElement.C_METHOD, ICElement.C_VARIABLE, ICElement.C_ENUMERATOR,
ICElement.C_FUNCTION_DECLARATION, ICElement.C_METHOD_DECLARATION, ICElement.C_VARIABLE_DECLARATION };
@@ -59,10 +57,10 @@ public class OpenElementInCallHierarchyAction implements IWorkbenchWindowActionD
}
if (elements == null || elements.length == 0) {
String title = CHMessages.OpenElementInCallHierarchyAction_errorDlgTitle;
- String message = NLS.bind(CHMessages.OpenElementInCallHierarchyAction_errorNoDefinition, info.getQualifiedTypeName().toString());
+ String message = NLS.bind(CHMessages.OpenElementInCallHierarchyAction_errorNoDefinition,
+ info.getQualifiedTypeName().toString());
MessageDialog.openError(getShell(), title, message);
- }
- else {
+ } else {
CallHierarchyUI.open(fWorkbenchWindow, elements[0]);
}
}

Back to the top