mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 11:55:40 +02:00
Fix warnings.
This commit is contained in:
parent
d5ad391d97
commit
b4636c8a3c
11 changed files with 68 additions and 77 deletions
|
@ -19,6 +19,18 @@ import java.util.Set;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
import org.eclipse.core.runtime.Assert;
|
||||||
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||||
|
import org.eclipse.jface.viewers.ArrayContentProvider;
|
||||||
|
import org.eclipse.jface.viewers.CheckStateChangedEvent;
|
||||||
|
import org.eclipse.jface.viewers.CheckboxTableViewer;
|
||||||
|
import org.eclipse.jface.viewers.ICheckStateListener;
|
||||||
|
import org.eclipse.jface.viewers.ILabelProvider;
|
||||||
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
|
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||||
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
|
import org.eclipse.jface.viewers.LabelProvider;
|
||||||
|
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
|
@ -32,24 +44,11 @@ import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
import org.eclipse.ui.dialogs.SelectionDialog;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||||
import org.eclipse.cdt.internal.ui.util.SWTUtil;
|
import org.eclipse.cdt.internal.ui.util.SWTUtil;
|
||||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
|
||||||
import org.eclipse.core.runtime.Assert;
|
|
||||||
import org.eclipse.jface.viewers.ArrayContentProvider;
|
|
||||||
import org.eclipse.jface.viewers.CheckStateChangedEvent;
|
|
||||||
import org.eclipse.jface.viewers.CheckboxTableViewer;
|
|
||||||
import org.eclipse.jface.viewers.ICheckStateListener;
|
|
||||||
import org.eclipse.jface.viewers.ILabelProvider;
|
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
|
||||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
|
||||||
import org.eclipse.jface.viewers.LabelProvider;
|
|
||||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
|
||||||
|
|
||||||
import org.eclipse.ui.PlatformUI;
|
|
||||||
import org.eclipse.ui.dialogs.SelectionDialog;
|
|
||||||
|
|
||||||
public class CustomFiltersDialog extends SelectionDialog {
|
public class CustomFiltersDialog extends SelectionDialog {
|
||||||
|
|
||||||
|
@ -66,7 +65,7 @@ public class CustomFiltersDialog extends SelectionDialog {
|
||||||
Button fEnableUserDefinedPatterns;
|
Button fEnableUserDefinedPatterns;
|
||||||
Text fUserDefinedPatterns;
|
Text fUserDefinedPatterns;
|
||||||
|
|
||||||
Stack fFilterDescriptorChangeHistory;
|
Stack<Object> fFilterDescriptorChangeHistory;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,7 +91,7 @@ public class CustomFiltersDialog extends SelectionDialog {
|
||||||
fEnabledFilterIds= enabledFilterIds;
|
fEnabledFilterIds= enabledFilterIds;
|
||||||
|
|
||||||
fBuiltInFilters= FilterDescriptor.getFilterDescriptors(fViewId);
|
fBuiltInFilters= FilterDescriptor.getFilterDescriptors(fViewId);
|
||||||
fFilterDescriptorChangeHistory= new Stack();
|
fFilterDescriptorChangeHistory= new Stack<Object>();
|
||||||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +180,7 @@ public class CustomFiltersDialog extends SelectionDialog {
|
||||||
fCheckBoxList.setInput(fBuiltInFilters);
|
fCheckBoxList.setInput(fBuiltInFilters);
|
||||||
setInitialSelections(getEnabledFilterDescriptors());
|
setInitialSelections(getEnabledFilterDescriptors());
|
||||||
|
|
||||||
List initialSelection= getInitialElementSelections();
|
List<?> initialSelection= getInitialElementSelections();
|
||||||
if (initialSelection != null && !initialSelection.isEmpty())
|
if (initialSelection != null && !initialSelection.isEmpty())
|
||||||
checkInitialSelections();
|
checkInitialSelections();
|
||||||
|
|
||||||
|
@ -262,7 +261,7 @@ public class CustomFiltersDialog extends SelectionDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkInitialSelections() {
|
private void checkInitialSelections() {
|
||||||
Iterator itemsToCheck= getInitialElementSelections().iterator();
|
Iterator<?> itemsToCheck= getInitialElementSelections().iterator();
|
||||||
while (itemsToCheck.hasNext())
|
while (itemsToCheck.hasNext())
|
||||||
fCheckBoxList.setChecked(itemsToCheck.next(),true);
|
fCheckBoxList.setChecked(itemsToCheck.next(),true);
|
||||||
}
|
}
|
||||||
|
@ -270,7 +269,7 @@ public class CustomFiltersDialog extends SelectionDialog {
|
||||||
@Override
|
@Override
|
||||||
protected void okPressed() {
|
protected void okPressed() {
|
||||||
if (fBuiltInFilters != null) {
|
if (fBuiltInFilters != null) {
|
||||||
ArrayList result= new ArrayList();
|
ArrayList<FilterDescriptor> result= new ArrayList<FilterDescriptor>();
|
||||||
for (int i= 0; i < fBuiltInFilters.length; ++i) {
|
for (int i= 0; i < fBuiltInFilters.length; ++i) {
|
||||||
if (fCheckBoxList.getChecked(fBuiltInFilters[i]))
|
if (fCheckBoxList.getChecked(fBuiltInFilters[i]))
|
||||||
result.add(fBuiltInFilters[i]);
|
result.add(fBuiltInFilters[i]);
|
||||||
|
@ -291,14 +290,14 @@ public class CustomFiltersDialog extends SelectionDialog {
|
||||||
public String getText(Object element) {
|
public String getText(Object element) {
|
||||||
if (element instanceof FilterDescriptor)
|
if (element instanceof FilterDescriptor)
|
||||||
return ((FilterDescriptor)element).getName();
|
return ((FilterDescriptor)element).getName();
|
||||||
else
|
return null;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------- result handling ----------
|
// ---------- result handling ----------
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
protected void setResult(List newResult) {
|
protected void setResult(List newResult) {
|
||||||
super.setResult(newResult);
|
super.setResult(newResult);
|
||||||
|
@ -324,10 +323,10 @@ public class CustomFiltersDialog extends SelectionDialog {
|
||||||
*/
|
*/
|
||||||
public String[] getEnabledFilterIds() {
|
public String[] getEnabledFilterIds() {
|
||||||
Object[] result= getResult();
|
Object[] result= getResult();
|
||||||
Set enabledIds= new HashSet(result.length);
|
Set<String> enabledIds= new HashSet<String>(result.length);
|
||||||
for (int i= 0; i < result.length; i++)
|
for (int i= 0; i < result.length; i++)
|
||||||
enabledIds.add(((FilterDescriptor)result[i]).getId());
|
enabledIds.add(((FilterDescriptor)result[i]).getId());
|
||||||
return (String[]) enabledIds.toArray(new String[enabledIds.size()]);
|
return enabledIds.toArray(new String[enabledIds.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -341,20 +340,20 @@ public class CustomFiltersDialog extends SelectionDialog {
|
||||||
* @return a stack with the filter descriptor check history
|
* @return a stack with the filter descriptor check history
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public Stack getFilterDescriptorChangeHistory() {
|
public Stack<Object> getFilterDescriptorChangeHistory() {
|
||||||
return fFilterDescriptorChangeHistory;
|
return fFilterDescriptorChangeHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
private FilterDescriptor[] getEnabledFilterDescriptors() {
|
private FilterDescriptor[] getEnabledFilterDescriptors() {
|
||||||
FilterDescriptor[] filterDescs= fBuiltInFilters;
|
FilterDescriptor[] filterDescs= fBuiltInFilters;
|
||||||
List result= new ArrayList(filterDescs.length);
|
List<FilterDescriptor> result= new ArrayList<FilterDescriptor>(filterDescs.length);
|
||||||
List enabledFilterIds= Arrays.asList(fEnabledFilterIds);
|
List<String> enabledFilterIds= Arrays.asList(fEnabledFilterIds);
|
||||||
for (int i= 0; i < filterDescs.length; i++) {
|
for (int i= 0; i < filterDescs.length; i++) {
|
||||||
String id= filterDescs[i].getId();
|
String id= filterDescs[i].getId();
|
||||||
if (enabledFilterIds.contains(id))
|
if (enabledFilterIds.contains(id))
|
||||||
result.add(filterDescs[i]);
|
result.add(filterDescs[i]);
|
||||||
}
|
}
|
||||||
return (FilterDescriptor[])result.toArray(new FilterDescriptor[result.size()]);
|
return result.toArray(new FilterDescriptor[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,15 +17,16 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
import org.eclipse.core.runtime.Assert;
|
||||||
import org.eclipse.core.runtime.IConfigurationElement;
|
import org.eclipse.core.runtime.IConfigurationElement;
|
||||||
import org.eclipse.core.runtime.IExtensionRegistry;
|
import org.eclipse.core.runtime.IExtensionRegistry;
|
||||||
import org.eclipse.core.runtime.ISafeRunnable;
|
import org.eclipse.core.runtime.ISafeRunnable;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.Assert;
|
|
||||||
import org.eclipse.jface.util.SafeRunnable;
|
import org.eclipse.jface.util.SafeRunnable;
|
||||||
import org.eclipse.jface.viewers.ViewerFilter;
|
import org.eclipse.jface.viewers.ViewerFilter;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a custom filter which is provided by the
|
* Represents a custom filter which is provided by the
|
||||||
|
@ -33,7 +34,7 @@ import org.eclipse.jface.viewers.ViewerFilter;
|
||||||
*
|
*
|
||||||
* since 2.0
|
* since 2.0
|
||||||
*/
|
*/
|
||||||
public class FilterDescriptor implements Comparable {
|
public class FilterDescriptor implements Comparable<FilterDescriptor> {
|
||||||
|
|
||||||
private static String PATTERN_FILTER_ID_PREFIX= "_patternFilterId_"; //$NON-NLS-1$
|
private static String PATTERN_FILTER_ID_PREFIX= "_patternFilterId_"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -82,13 +83,13 @@ public class FilterDescriptor implements Comparable {
|
||||||
*/
|
*/
|
||||||
public static FilterDescriptor[] getFilterDescriptors(String targetId) {
|
public static FilterDescriptor[] getFilterDescriptors(String targetId) {
|
||||||
FilterDescriptor[] filterDescs= FilterDescriptor.getFilterDescriptors();
|
FilterDescriptor[] filterDescs= FilterDescriptor.getFilterDescriptors();
|
||||||
List result= new ArrayList(filterDescs.length);
|
List<FilterDescriptor> result= new ArrayList<FilterDescriptor>(filterDescs.length);
|
||||||
for (int i= 0; i < filterDescs.length; i++) {
|
for (int i= 0; i < filterDescs.length; i++) {
|
||||||
String tid= filterDescs[i].getTargetId();
|
String tid= filterDescs[i].getTargetId();
|
||||||
if (tid == null || tid.equals(targetId))
|
if (tid == null || tid.equals(targetId))
|
||||||
result.add(filterDescs[i]);
|
result.add(filterDescs[i]);
|
||||||
}
|
}
|
||||||
return (FilterDescriptor[])result.toArray(new FilterDescriptor[result.size()]);
|
return result.toArray(new FilterDescriptor[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -140,10 +141,9 @@ public class FilterDescriptor implements Comparable {
|
||||||
String targetId= getTargetId();
|
String targetId= getTargetId();
|
||||||
if (targetId == null)
|
if (targetId == null)
|
||||||
return PATTERN_FILTER_ID_PREFIX + getPattern();
|
return PATTERN_FILTER_ID_PREFIX + getPattern();
|
||||||
else
|
return targetId + PATTERN_FILTER_ID_PREFIX + getPattern();
|
||||||
return targetId + PATTERN_FILTER_ID_PREFIX + getPattern();
|
}
|
||||||
} else
|
return fElement.getAttribute(ID_ATTRIBUTE);
|
||||||
return fElement.getAttribute(ID_ATTRIBUTE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -229,11 +229,8 @@ public class FilterDescriptor implements Comparable {
|
||||||
/*
|
/*
|
||||||
* Implements a method from IComparable
|
* Implements a method from IComparable
|
||||||
*/
|
*/
|
||||||
public int compareTo(Object o) {
|
public int compareTo(FilterDescriptor o) {
|
||||||
if (o instanceof FilterDescriptor)
|
return Collator.getInstance().compare(getName(), (o).getName());
|
||||||
return Collator.getInstance().compare(getName(), ((FilterDescriptor)o).getName());
|
|
||||||
else
|
|
||||||
return Integer.MIN_VALUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---- initialization ---------------------------------------------------
|
//---- initialization ---------------------------------------------------
|
||||||
|
@ -242,8 +239,8 @@ public class FilterDescriptor implements Comparable {
|
||||||
* Creates the filter descriptors.
|
* Creates the filter descriptors.
|
||||||
*/
|
*/
|
||||||
private static FilterDescriptor[] createFilterDescriptors(IConfigurationElement[] elements) {
|
private static FilterDescriptor[] createFilterDescriptors(IConfigurationElement[] elements) {
|
||||||
List result= new ArrayList(5);
|
List<FilterDescriptor> result= new ArrayList<FilterDescriptor>(5);
|
||||||
Set descIds= new HashSet(5);
|
Set<String> descIds= new HashSet<String>(5);
|
||||||
for (int i= 0; i < elements.length; i++) {
|
for (int i= 0; i < elements.length; i++) {
|
||||||
final IConfigurationElement element= elements[i];
|
final IConfigurationElement element= elements[i];
|
||||||
if (FILTER_TAG.equals(element.getName())) {
|
if (FILTER_TAG.equals(element.getName())) {
|
||||||
|
@ -262,6 +259,6 @@ public class FilterDescriptor implements Comparable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Collections.sort(result);
|
Collections.sort(result);
|
||||||
return (FilterDescriptor[])result.toArray(new FilterDescriptor[result.size()]);
|
return result.toArray(new FilterDescriptor[result.size()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,8 +109,7 @@ public class CFunctionSummary implements IFunctionSummary {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
if (std)
|
if (std)
|
||||||
return "#include <" + iname + ">"; //$NON-NLS-1$ //$NON-NLS-2$
|
return "#include <" + iname + ">"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
else
|
return "#include \"" + iname + "\""; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
return "#include \"" + iname + "\""; //$NON-NLS-1$ //$NON-NLS-2$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -118,8 +118,8 @@ public class CHelpBook implements ICHelpBook {
|
||||||
if (++b > bs[i]) { // no overflow
|
if (++b > bs[i]) { // no overflow
|
||||||
bs[i] = b;
|
bs[i] = b;
|
||||||
break;
|
break;
|
||||||
} else
|
}
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
SortedMap<String, CHelpEntry> sm = (i>-1) ?
|
SortedMap<String, CHelpEntry> sm = (i>-1) ?
|
||||||
entries.subMap(pr1, new String(bs)) :
|
entries.subMap(pr1, new String(bs)) :
|
||||||
|
@ -133,8 +133,8 @@ public class CHelpBook implements ICHelpBook {
|
||||||
for (IFunctionSummary fs : he.getFunctionSummary())
|
for (IFunctionSummary fs : he.getFunctionSummary())
|
||||||
out.add(fs);
|
out.add(fs);
|
||||||
return out;
|
return out;
|
||||||
} else
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICHelpResourceDescriptor getHelpResources(
|
public ICHelpResourceDescriptor getHelpResources(
|
||||||
|
|
|
@ -87,8 +87,7 @@ public class CHelpProvider implements ICHelpProvider {
|
||||||
}
|
}
|
||||||
if (lst.size() > 0)
|
if (lst.size() > 0)
|
||||||
return lst.toArray(new ICHelpResourceDescriptor[lst.size()]);
|
return lst.toArray(new ICHelpResourceDescriptor[lst.size()]);
|
||||||
else
|
return null;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IFunctionSummary[] getMatchingFunctions(
|
public IFunctionSummary[] getMatchingFunctions(
|
||||||
|
@ -104,8 +103,7 @@ public class CHelpProvider implements ICHelpProvider {
|
||||||
}
|
}
|
||||||
if (lst.size() > 0)
|
if (lst.size() > 0)
|
||||||
return lst.toArray(new IFunctionSummary[lst.size()]);
|
return lst.toArray(new IFunctionSummary[lst.size()]);
|
||||||
else
|
return null;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -171,22 +169,20 @@ public class CHelpProvider implements ICHelpProvider {
|
||||||
InputSource src = new InputSource(reader);
|
InputSource src = new InputSource(reader);
|
||||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||||
doc = builder.parse(src);
|
doc = builder.parse(src);
|
||||||
|
Element e = doc.getDocumentElement();
|
||||||
|
if(NODE_HEAD.equals(e.getNodeName())){
|
||||||
|
NodeList list = e.getChildNodes();
|
||||||
|
for(int j = 0; j < list.getLength(); j++){
|
||||||
|
Node node = list.item(j);
|
||||||
|
if(node.getNodeType() != Node.ELEMENT_NODE) continue;
|
||||||
|
if(NODE_BOOK.equals(node.getNodeName())){
|
||||||
|
chbl.add(new CHelpBook((Element)node));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (ParserConfigurationException e) {
|
} catch (ParserConfigurationException e) {
|
||||||
} catch (SAXException e) {
|
} catch (SAXException e) {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Element e = doc.getDocumentElement();
|
|
||||||
if(NODE_HEAD.equals(e.getNodeName())){
|
|
||||||
NodeList list = e.getChildNodes();
|
|
||||||
for(int j = 0; j < list.getLength(); j++){
|
|
||||||
Node node = list.item(j);
|
|
||||||
if(node.getNodeType() != Node.ELEMENT_NODE) continue;
|
|
||||||
if(NODE_BOOK.equals(node.getNodeName())){
|
|
||||||
chbl.add(new CHelpBook((Element)node));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class IBConversions {
|
||||||
public static IBNode selectionToNode(ISelection sel) {
|
public static IBNode selectionToNode(ISelection sel) {
|
||||||
if (sel instanceof IStructuredSelection) {
|
if (sel instanceof IStructuredSelection) {
|
||||||
IStructuredSelection ssel= (IStructuredSelection) sel;
|
IStructuredSelection ssel= (IStructuredSelection) sel;
|
||||||
for (Iterator iter = ssel.iterator(); iter.hasNext();) {
|
for (Iterator<?> iter = ssel.iterator(); iter.hasNext();) {
|
||||||
Object o= iter.next();
|
Object o= iter.next();
|
||||||
if (o instanceof IBNode) {
|
if (o instanceof IBNode) {
|
||||||
IBNode node = (IBNode) o;
|
IBNode node = (IBNode) o;
|
||||||
|
@ -45,7 +45,7 @@ public class IBConversions {
|
||||||
public static ITranslationUnit selectionToTU(ISelection sel) {
|
public static ITranslationUnit selectionToTU(ISelection sel) {
|
||||||
if (sel instanceof IStructuredSelection) {
|
if (sel instanceof IStructuredSelection) {
|
||||||
IStructuredSelection ssel= (IStructuredSelection) sel;
|
IStructuredSelection ssel= (IStructuredSelection) sel;
|
||||||
for (Iterator iter = ssel.iterator(); iter.hasNext();) {
|
for (Iterator<?> iter = ssel.iterator(); iter.hasNext();) {
|
||||||
ITranslationUnit tu= objectToTU(iter.next());
|
ITranslationUnit tu= objectToTU(iter.next());
|
||||||
if (tu != null) {
|
if (tu != null) {
|
||||||
return tu;
|
return tu;
|
||||||
|
@ -59,7 +59,7 @@ public class IBConversions {
|
||||||
if (sel instanceof IStructuredSelection) {
|
if (sel instanceof IStructuredSelection) {
|
||||||
IStructuredSelection ssel= (IStructuredSelection) sel;
|
IStructuredSelection ssel= (IStructuredSelection) sel;
|
||||||
ArrayList<ITranslationUnit> tus= new ArrayList<ITranslationUnit>();
|
ArrayList<ITranslationUnit> tus= new ArrayList<ITranslationUnit>();
|
||||||
for (Iterator iter = ssel.iterator(); iter.hasNext();) {
|
for (Iterator<?> iter = ssel.iterator(); iter.hasNext();) {
|
||||||
Object obj= iter.next();
|
Object obj= iter.next();
|
||||||
if (obj instanceof IBNode) {
|
if (obj instanceof IBNode) {
|
||||||
ITranslationUnit tu= ((IBNode) obj).getRepresentedTranslationUnit();
|
ITranslationUnit tu= ((IBNode) obj).getRepresentedTranslationUnit();
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class IBDragSourceListener implements DragSourceListener {
|
||||||
fSelectedNodes.clear();
|
fSelectedNodes.clear();
|
||||||
if (event.doit) {
|
if (event.doit) {
|
||||||
IStructuredSelection sel= (IStructuredSelection) fTreeViewer.getSelection();
|
IStructuredSelection sel= (IStructuredSelection) fTreeViewer.getSelection();
|
||||||
for (Iterator iter = sel.iterator(); iter.hasNext();) {
|
for (Iterator<?> iter = sel.iterator(); iter.hasNext();) {
|
||||||
Object element = iter.next();
|
Object element = iter.next();
|
||||||
if (element instanceof IBNode) {
|
if (element instanceof IBNode) {
|
||||||
fSelectedNodes.add((IBNode) element);
|
fSelectedNodes.add((IBNode) element);
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class IBDropTargetListener implements DropTargetListener {
|
||||||
private ITranslationUnit checkLocalSelection() {
|
private ITranslationUnit checkLocalSelection() {
|
||||||
ISelection sel= LocalSelectionTransfer.getTransfer().getSelection();
|
ISelection sel= LocalSelectionTransfer.getTransfer().getSelection();
|
||||||
if (sel instanceof IStructuredSelection) {
|
if (sel instanceof IStructuredSelection) {
|
||||||
for (Iterator iter = ((IStructuredSelection)sel).iterator(); iter.hasNext();) {
|
for (Iterator<?> iter = ((IStructuredSelection)sel).iterator(); iter.hasNext();) {
|
||||||
Object element = iter.next();
|
Object element = iter.next();
|
||||||
if (element instanceof ITranslationUnit) {
|
if (element instanceof ITranslationUnit) {
|
||||||
return (ITranslationUnit) element;
|
return (ITranslationUnit) element;
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class IBHistoryListAction extends Action {
|
||||||
|
|
||||||
private void doSelectionChanged() {
|
private void doSelectionChanged() {
|
||||||
StatusInfo status= new StatusInfo();
|
StatusInfo status= new StatusInfo();
|
||||||
List selected= fHistoryList.getSelectedElements();
|
List<?> selected= fHistoryList.getSelectedElements();
|
||||||
if (selected.size() != 1) {
|
if (selected.size() != 1) {
|
||||||
status.setError(""); //$NON-NLS-1$
|
status.setError(""); //$NON-NLS-1$
|
||||||
fResult= null;
|
fResult= null;
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class OpenIncludeBrowserAction extends SelectionDispatchAction {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private Object getAdapter(Object object, Class desiredClass) {
|
private Object getAdapter(Object object, Class desiredClass) {
|
||||||
if (desiredClass.isInstance(object)) {
|
if (desiredClass.isInstance(object)) {
|
||||||
return object;
|
return object;
|
||||||
|
|
|
@ -118,8 +118,7 @@ public class IndexView extends ViewPart implements PDOM.IListener, IElementChang
|
||||||
IndexNode node= (IndexNode)element;
|
IndexNode node= (IndexNode)element;
|
||||||
return node.fHasDeclarationInProject;
|
return node.fHasDeclarationInProject;
|
||||||
}
|
}
|
||||||
else
|
return true;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
public static boolean hasDeclarationInProject(IPDOMNode element) {
|
public static boolean hasDeclarationInProject(IPDOMNode element) {
|
||||||
if (element instanceof PDOMBinding) {
|
if (element instanceof PDOMBinding) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue