mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
compilation warnings
This commit is contained in:
parent
82f47ea669
commit
4fe00329b1
5 changed files with 36 additions and 39 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007, 2010 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
|
||||||
|
@ -57,10 +57,6 @@ public class MakefileMergeViewer extends TextMergeViewer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new merge viewer.
|
* Create a new merge viewer.
|
||||||
*
|
|
||||||
* @param parent
|
|
||||||
* @param style
|
|
||||||
* @param configuration
|
|
||||||
*/
|
*/
|
||||||
public MakefileMergeViewer(Composite parent, int style, CompareConfiguration configuration) {
|
public MakefileMergeViewer(Composite parent, int style, CompareConfiguration configuration) {
|
||||||
super(parent, style | SWT.LEFT_TO_RIGHT, configuration);
|
super(parent, style | SWT.LEFT_TO_RIGHT, configuration);
|
||||||
|
@ -90,6 +86,7 @@ public class MakefileMergeViewer extends TextMergeViewer {
|
||||||
return fPreferenceStore;
|
return fPreferenceStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void handleDispose(DisposeEvent event) {
|
protected void handleDispose(DisposeEvent event) {
|
||||||
if (fPreferenceChangeListener != null) {
|
if (fPreferenceChangeListener != null) {
|
||||||
fPreferenceStore.removePropertyChangeListener(fPreferenceChangeListener);
|
fPreferenceStore.removePropertyChangeListener(fPreferenceChangeListener);
|
||||||
|
@ -133,14 +130,17 @@ public class MakefileMergeViewer extends TextMergeViewer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getDocumentPartitioning() {
|
protected String getDocumentPartitioning() {
|
||||||
return MakefileDocumentSetupParticipant.MAKEFILE_PARTITIONING;
|
return MakefileDocumentSetupParticipant.MAKEFILE_PARTITIONING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected IDocumentPartitioner getDocumentPartitioner() {
|
protected IDocumentPartitioner getDocumentPartitioner() {
|
||||||
return new FastPartitioner(new MakefilePartitionScanner(), MakefilePartitionScanner.MAKE_PARTITIONS);
|
return new FastPartitioner(new MakefilePartitionScanner(), MakefilePartitionScanner.MAKE_PARTITIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void configureTextViewer(TextViewer textViewer) {
|
protected void configureTextViewer(TextViewer textViewer) {
|
||||||
if (textViewer instanceof SourceViewer) {
|
if (textViewer instanceof SourceViewer) {
|
||||||
((SourceViewer)textViewer).configure(getSourceViewerConfiguration());
|
((SourceViewer)textViewer).configure(getSourceViewerConfiguration());
|
||||||
|
@ -150,6 +150,7 @@ public class MakefileMergeViewer extends TextMergeViewer {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#getTitle()
|
* @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#getTitle()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return MakeUIPlugin.getResourceString("MakefileMergeViewer.title"); //$NON-NLS-1$
|
return MakeUIPlugin.getResourceString("MakefileMergeViewer.title"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
* Copyright (c) 2000, 2010 QNX Software Systems 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
|
||||||
|
@ -31,16 +31,10 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
|
||||||
IMakefile fMakefile;
|
IMakefile fMakefile;
|
||||||
|
|
||||||
protected class MakefileAnnotationModel extends ResourceMarkerAnnotationModel /*implements IProblemRequestor */{
|
protected class MakefileAnnotationModel extends ResourceMarkerAnnotationModel /*implements IProblemRequestor */{
|
||||||
/**
|
|
||||||
* @param resource
|
|
||||||
*/
|
|
||||||
public MakefileAnnotationModel(IResource resource) {
|
public MakefileAnnotationModel(IResource resource) {
|
||||||
super(resource);
|
super(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param makefile
|
|
||||||
*/
|
|
||||||
public void setMakefile(IMakefile makefile) {
|
public void setMakefile(IMakefile makefile) {
|
||||||
fMakefile = makefile;
|
fMakefile = makefile;
|
||||||
}
|
}
|
||||||
|
@ -71,13 +65,15 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createAnnotationModel(org.eclipse.core.resources.IFile)
|
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createAnnotationModel(org.eclipse.core.resources.IFile)
|
||||||
*/
|
*/
|
||||||
protected IAnnotationModel createAnnotationModel(IFile file) {
|
@Override
|
||||||
|
protected IAnnotationModel createAnnotationModel(IFile file) {
|
||||||
return new MakefileAnnotationModel(file);
|
return new MakefileAnnotationModel(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createFileInfo(java.lang.Object)
|
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createFileInfo(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected FileInfo createFileInfo(Object element) throws CoreException {
|
protected FileInfo createFileInfo(Object element) throws CoreException {
|
||||||
if (!(element instanceof IFileEditorInput))
|
if (!(element instanceof IFileEditorInput))
|
||||||
return null;
|
return null;
|
||||||
|
@ -107,7 +103,8 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#disposeFileInfo(java.lang.Object, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo)
|
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#disposeFileInfo(java.lang.Object, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo)
|
||||||
*/
|
*/
|
||||||
protected void disposeFileInfo(Object element, FileInfo info) {
|
@Override
|
||||||
|
protected void disposeFileInfo(Object element, FileInfo info) {
|
||||||
if (info instanceof MakefileFileInfo) {
|
if (info instanceof MakefileFileInfo) {
|
||||||
MakefileFileInfo makefileInfo= (MakefileFileInfo) info;
|
MakefileFileInfo makefileInfo= (MakefileFileInfo) info;
|
||||||
if (makefileInfo.fCopy != null) {
|
if (makefileInfo.fCopy != null) {
|
||||||
|
@ -120,6 +117,7 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createEmptyFileInfo()
|
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createEmptyFileInfo()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected FileInfo createEmptyFileInfo() {
|
protected FileInfo createEmptyFileInfo() {
|
||||||
return new MakefileFileInfo();
|
return new MakefileFileInfo();
|
||||||
}
|
}
|
||||||
|
@ -140,7 +138,7 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
|
||||||
* @see org.eclipse.cdt.make.internal.ui.IMakefileDocumentProvider#shutdown()
|
* @see org.eclipse.cdt.make.internal.ui.IMakefileDocumentProvider#shutdown()
|
||||||
*/
|
*/
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
Iterator e= getConnectedElementsIterator();
|
Iterator<?> e= getConnectedElementsIterator();
|
||||||
while (e.hasNext())
|
while (e.hasNext())
|
||||||
disconnect(e.next());
|
disconnect(e.next());
|
||||||
}
|
}
|
||||||
|
@ -148,6 +146,7 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createSaveOperation(java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
|
* @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createSaveOperation(java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected DocumentProviderOperation createSaveOperation(Object element, IDocument document, boolean overwrite)
|
protected DocumentProviderOperation createSaveOperation(Object element, IDocument document, boolean overwrite)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if (!(element instanceof IFileEditorInput)) {
|
if (!(element instanceof IFileEditorInput)) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2008 QNX Software Systems and others.
|
* Copyright (c) 2002, 2010 QNX Software Systems 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
|
||||||
|
@ -14,9 +14,10 @@
|
||||||
package org.eclipse.cdt.make.internal.ui.preferences;
|
package org.eclipse.cdt.make.internal.ui.preferences;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Map;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
|
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
|
||||||
|
import org.eclipse.cdt.make.internal.ui.preferences.OverlayPreferenceStore.OverlayKey;
|
||||||
import org.eclipse.cdt.make.internal.ui.text.ColorManager;
|
import org.eclipse.cdt.make.internal.ui.text.ColorManager;
|
||||||
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
|
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
|
||||||
import org.eclipse.cdt.ui.PreferenceConstants;
|
import org.eclipse.cdt.ui.PreferenceConstants;
|
||||||
|
@ -58,7 +59,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
private String[][] fSyntaxColorListModel;
|
private String[][] fSyntaxColorListModel;
|
||||||
|
|
||||||
private TableViewer fHighlightingColorListViewer;
|
private TableViewer fHighlightingColorListViewer;
|
||||||
private final java.util.List fHighlightingColorList= new ArrayList(5);
|
private final List<HighlightingColorListItem> fHighlightingColorList= new ArrayList<HighlightingColorListItem>(5);
|
||||||
|
|
||||||
Button fAppearanceColorDefault;
|
Button fAppearanceColorDefault;
|
||||||
ColorSelector fSyntaxForegroundColorEditor;
|
ColorSelector fSyntaxForegroundColorEditor;
|
||||||
|
@ -68,10 +69,6 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
// folding
|
// folding
|
||||||
protected Button fFoldingCheckbox;
|
protected Button fFoldingCheckbox;
|
||||||
|
|
||||||
protected Map fWorkingValues;
|
|
||||||
protected ArrayList fComboBoxes;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Item in the highlighting color list.
|
* Item in the highlighting color list.
|
||||||
*
|
*
|
||||||
|
@ -152,6 +149,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
|
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getText(Object element) {
|
public String getText(Object element) {
|
||||||
return ((HighlightingColorListItem)element).getDisplayName();
|
return ((HighlightingColorListItem)element).getDisplayName();
|
||||||
}
|
}
|
||||||
|
@ -182,7 +180,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
|
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public Object[] getElements(Object inputElement) {
|
public Object[] getElements(Object inputElement) {
|
||||||
return ((java.util.List)inputElement).toArray();
|
return ((List<?>)inputElement).toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -207,6 +205,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected OverlayPreferenceStore createOverlayStore() {
|
protected OverlayPreferenceStore createOverlayStore() {
|
||||||
fSyntaxColorListModel= new String[][] {
|
fSyntaxColorListModel= new String[][] {
|
||||||
{MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_comment"), ColorManager.MAKE_COMMENT_COLOR, null}, //$NON-NLS-1$
|
{MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_comment"), ColorManager.MAKE_COMMENT_COLOR, null}, //$NON-NLS-1$
|
||||||
|
@ -216,7 +215,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
{MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_keyword"), ColorManager.MAKE_KEYWORD_COLOR, null}, //$NON-NLS-1$
|
{MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_keyword"), ColorManager.MAKE_KEYWORD_COLOR, null}, //$NON-NLS-1$
|
||||||
{MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_default"), ColorManager.MAKE_DEFAULT_COLOR, null}, //$NON-NLS-1$
|
{MakefilePreferencesMessages.getString("MakefileEditorPreferencePage.makefile_editor_default"), ColorManager.MAKE_DEFAULT_COLOR, null}, //$NON-NLS-1$
|
||||||
};
|
};
|
||||||
ArrayList overlayKeys= new ArrayList();
|
ArrayList<OverlayKey> overlayKeys= new ArrayList<OverlayKey>();
|
||||||
|
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, MakefileEditorPreferenceConstants.EDITOR_FOLDING_ENABLED));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, MakefileEditorPreferenceConstants.EDITOR_FOLDING_ENABLED));
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, MakefileEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, MakefileEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL));
|
||||||
|
@ -233,7 +232,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
return new OverlayPreferenceStore(getPreferenceStore(), keys);
|
return new OverlayPreferenceStore(getPreferenceStore(), keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addTextKeyToCover(ArrayList overlayKeys, String mainKey) {
|
private void addTextKeyToCover(ArrayList<OverlayKey> overlayKeys, String mainKey) {
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey));
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + MakefileEditorPreferenceConstants.EDITOR_BOLD_SUFFIX));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + MakefileEditorPreferenceConstants.EDITOR_BOLD_SUFFIX));
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + MakefileEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + MakefileEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX));
|
||||||
|
@ -242,6 +241,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
|
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected Control createContents(Composite parent) {
|
protected Control createContents(Composite parent) {
|
||||||
MakeUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), IMakeHelpContextIds.MAKE_EDITOR_PREFERENCE_PAGE);
|
MakeUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), IMakeHelpContextIds.MAKE_EDITOR_PREFERENCE_PAGE);
|
||||||
getOverlayStore().load();
|
getOverlayStore().load();
|
||||||
|
@ -294,6 +294,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ant.internal.ui.preferences.AbstractMakefileEditorPreferencePage#handleDefaults()
|
* @see org.eclipse.ant.internal.ui.preferences.AbstractMakefileEditorPreferencePage#handleDefaults()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void handleDefaults() {
|
protected void handleDefaults() {
|
||||||
handleSyntaxColorListSelection();
|
handleSyntaxColorListSelection();
|
||||||
initializeDefaultFolding();
|
initializeDefaultFolding();
|
||||||
|
@ -451,13 +452,11 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
|
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean performOk() {
|
public boolean performOk() {
|
||||||
return super.performOk();
|
return super.performOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param preferenceStore
|
|
||||||
*/
|
|
||||||
public static void initDefaults(IPreferenceStore prefs) {
|
public static void initDefaults(IPreferenceStore prefs) {
|
||||||
// Makefile Editor color preferences
|
// Makefile Editor color preferences
|
||||||
PreferenceConverter.setDefault(prefs, ColorManager.MAKE_COMMENT_COLOR, ColorManager.MAKE_COMMENT_RGB);
|
PreferenceConverter.setDefault(prefs, ColorManager.MAKE_COMMENT_COLOR, ColorManager.MAKE_COMMENT_RGB);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2010 QNX Software Systems 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
|
||||||
|
@ -15,7 +15,7 @@ import java.util.Comparator;
|
||||||
|
|
||||||
import org.eclipse.jface.text.contentassist.ICompletionProposal;
|
import org.eclipse.jface.text.contentassist.ICompletionProposal;
|
||||||
|
|
||||||
public class CompletionProposalComparator implements Comparator {
|
public class CompletionProposalComparator implements Comparator<ICompletionProposal> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for CompletionProposalComparator.
|
* Constructor for CompletionProposalComparator.
|
||||||
|
@ -26,9 +26,7 @@ public class CompletionProposalComparator implements Comparator {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see Comparator#compare(Object, Object)
|
* @see Comparator#compare(Object, Object)
|
||||||
*/
|
*/
|
||||||
public int compare(Object o1, Object o2) {
|
public int compare(ICompletionProposal c1, ICompletionProposal c2) {
|
||||||
ICompletionProposal c1= (ICompletionProposal) o1;
|
|
||||||
ICompletionProposal c2= (ICompletionProposal) o2;
|
|
||||||
return c1.getDisplayString().compareToIgnoreCase(c2.getDisplayString());
|
return c1.getDisplayString().compareToIgnoreCase(c2.getDisplayString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2010 QNX Software Systems 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
|
||||||
|
@ -70,7 +70,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DirectiveComparator implements Comparator {
|
public class DirectiveComparator implements Comparator<Object> {
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
|
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
|
||||||
|
@ -131,7 +131,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
|
||||||
statements = makefile.getTargetRules();
|
statements = makefile.getTargetRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList proposalList = new ArrayList(statements.length);
|
ArrayList<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>(statements.length);
|
||||||
|
|
||||||
// iterate over all the different categories
|
// iterate over all the different categories
|
||||||
for (int i = 0; i < statements.length; i++) {
|
for (int i = 0; i < statements.length; i++) {
|
||||||
|
@ -163,7 +163,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
|
||||||
proposalList.add(result);
|
proposalList.add(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ICompletionProposal[] proposals = (ICompletionProposal[]) proposalList.toArray(new ICompletionProposal[0]);
|
ICompletionProposal[] proposals = proposalList.toArray(new ICompletionProposal[0]);
|
||||||
Arrays.sort(proposals, comparator);
|
Arrays.sort(proposals, comparator);
|
||||||
return proposals;
|
return proposals;
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
|
||||||
WordPartDetector wordPart = new WordPartDetector(viewer, documentOffset);
|
WordPartDetector wordPart = new WordPartDetector(viewer, documentOffset);
|
||||||
boolean macro = WordPartDetector.inMacro(viewer, documentOffset);
|
boolean macro = WordPartDetector.inMacro(viewer, documentOffset);
|
||||||
IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
|
IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
|
||||||
ArrayList contextList = new ArrayList();
|
ArrayList<String> contextList = new ArrayList<String>();
|
||||||
if (macro) {
|
if (macro) {
|
||||||
IDirective[] statements = makefile.getMacroDefinitions();
|
IDirective[] statements = makefile.getMacroDefinitions();
|
||||||
for (int i = 0; i < statements.length; i++) {
|
for (int i = 0; i < statements.length; i++) {
|
||||||
|
@ -205,7 +205,7 @@ public class MakefileCompletionProcessor implements IContentAssistProcessor {
|
||||||
|
|
||||||
IContextInformation[] result = new IContextInformation[contextList.size()];
|
IContextInformation[] result = new IContextInformation[contextList.size()];
|
||||||
for (int i = 0; i < result.length; i++) {
|
for (int i = 0; i < result.length; i++) {
|
||||||
String context = (String)contextList.get(i);
|
String context = contextList.get(i);
|
||||||
result[i] = new ContextInformation(imageMacro, wordPart.toString(), context);
|
result[i] = new ContextInformation(imageMacro, wordPart.toString(), context);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue