mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Cosmetics.
This commit is contained in:
parent
dfd0794ed6
commit
6aa836780c
8 changed files with 58 additions and 161 deletions
|
@ -87,8 +87,8 @@ public class CModel extends Openable implements ICModel {
|
|||
}
|
||||
|
||||
/**
|
||||
* Finds the given project in the list of the java model's children.
|
||||
* Returns null if not found.
|
||||
* Finds the given project in the list of the C model's children.
|
||||
* Returns {@code null} if not found.
|
||||
*/
|
||||
public ICProject findCProject(IProject project) {
|
||||
try {
|
||||
|
@ -112,7 +112,7 @@ public class CModel extends Openable implements ICModel {
|
|||
@Override
|
||||
public void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings,
|
||||
String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException {
|
||||
if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT ) {
|
||||
if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT) {
|
||||
runOperation(new CopyResourceElementsOperation(elements, containers, replace), elements,
|
||||
siblings, renamings, monitor);
|
||||
} else {
|
||||
|
@ -184,8 +184,7 @@ public class CModel extends Openable implements ICModel {
|
|||
|
||||
/**
|
||||
* Workaround for bug 15168 circular errors not reported
|
||||
* Returns the list of java projects before resource delta processing
|
||||
* has started.
|
||||
* Returns the list of C projects before resource delta processing has started.
|
||||
*/
|
||||
public ICProject[] getOldCProjectsList() throws CModelException {
|
||||
CModelManager manager = CModelManager.getDefault();
|
||||
|
@ -194,9 +193,6 @@ public class CModel extends Openable implements ICModel {
|
|||
manager.cProjectsCache;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see Openable#buildStructure(OpenableInfo, IProgressMonitor, Map, IResource)
|
||||
*/
|
||||
@Override
|
||||
protected boolean buildStructure(OpenableInfo info, IProgressMonitor pm, Map<ICElement,
|
||||
CElementInfo> newElements, IResource underlyingResource) throws CModelException {
|
||||
|
@ -214,9 +210,6 @@ public class CModel extends Openable implements ICModel {
|
|||
return validInfo;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICModel#getNonCResources()
|
||||
*/
|
||||
@Override
|
||||
public Object[] getNonCResources() throws CModelException {
|
||||
return ((CModelInfo) getElementInfo()).getNonCResources();
|
||||
|
|
|
@ -166,10 +166,11 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
|
|||
/**
|
||||
* Map of the binary parser for each project.
|
||||
*/
|
||||
private final Map<IProject, BinaryParserConfig[]> binaryParsersMap = Collections.synchronizedMap(new HashMap<IProject, BinaryParserConfig[]>());
|
||||
private final Map<IProject, BinaryParserConfig[]> binaryParsersMap =
|
||||
Collections.synchronizedMap(new HashMap<IProject, BinaryParserConfig[]>());
|
||||
|
||||
/**
|
||||
* The lis of the SourceMappers on projects.
|
||||
* The list of the SourceMappers on projects.
|
||||
*/
|
||||
private HashMap<ICProject, SourceMapper> sourceMappers = new HashMap<ICProject, SourceMapper>();
|
||||
|
||||
|
@ -626,8 +627,8 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
|
|||
if (parsers == null) {
|
||||
try {
|
||||
BinaryParserConfig config = new BinaryParserConfig(CCorePlugin.getDefault().getDefaultBinaryParser(), CCorePlugin.DEFAULT_BINARY_PARSER_UNIQ_ID);
|
||||
parsers = new BinaryParserConfig[]{config};
|
||||
} catch (CoreException e1) {
|
||||
parsers = new BinaryParserConfig[] { config };
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -785,15 +786,16 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
|
|||
runner = binaryRunners.get(project);
|
||||
}
|
||||
if (runner == null) {
|
||||
// Creation of BinaryRunner must occur outside the synchronized block
|
||||
// Creation of BinaryRunner must occur outside the synchronized block.
|
||||
runner = new BinaryRunner(project);
|
||||
synchronized (binaryRunners) {
|
||||
if (binaryRunners.get(project) == null) {
|
||||
BinaryRunner existing = binaryRunners.get(project);
|
||||
if (existing == null) {
|
||||
binaryRunners.put(project, runner);
|
||||
runner.start();
|
||||
} else {
|
||||
// Another thread was faster
|
||||
runner = binaryRunners.get(project);
|
||||
// Another thread was faster.
|
||||
runner = existing;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1001,14 +1003,16 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
|
|||
// If inside CProjectDescriptionManager.setProjectDescription() just send notifications
|
||||
fire(delta, ElementChangedEvent.POST_CHANGE);
|
||||
} else {
|
||||
// If not inside CProjectDescriptionManager.setProjectDescription() recalculate cached settings
|
||||
// If not inside CProjectDescriptionManager.setProjectDescription() recalculate cached
|
||||
// settings
|
||||
try {
|
||||
CoreModel.getDefault().updateProjectDescriptions(new IProject[] {project}, null);
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
}
|
||||
// Fire notifications in a job with workspace rule to ensure running after the updateProjectDescriptions(...)
|
||||
// which is run in separate thread with workspace rule
|
||||
// Fire notifications in a job with workspace rule to ensure running after
|
||||
// the updateProjectDescriptions(...), which is run in separate thread with workspace
|
||||
// rule.
|
||||
ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
|
||||
Job job = new Job(CoreModelMessages.getFormattedString("CModelManager.LanguageSettingsChangeEventNotifications")) { //$NON-NLS-1$
|
||||
@Override
|
||||
|
@ -1148,7 +1152,8 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
|
|||
System.out.print("Listener #" + (i + 1) + "=" + listener.toString());//$NON-NLS-1$//$NON-NLS-2$
|
||||
start = System.currentTimeMillis();
|
||||
}
|
||||
// Wrap callbacks with Safe runnable for subsequent listeners to be called when some are causing grief
|
||||
// Wrap callbacks with Safe runnable for subsequent listeners to be called when some
|
||||
// are causing grief.
|
||||
SafeRunner.run(new ISafeRunnable() {
|
||||
@Override
|
||||
public void handleException(Throwable exception) {
|
||||
|
@ -1284,9 +1289,9 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
|
|||
// remove children
|
||||
Object existingInfo = this.cache.peekAtInfo(openedElement);
|
||||
if (openedElement instanceof IParent && existingInfo instanceof CElementInfo) {
|
||||
ICElement[] children = ((CElementInfo)existingInfo).getChildren();
|
||||
ICElement[] children = ((CElementInfo) existingInfo).getChildren();
|
||||
for (int i = 0, size = children.length; i < size; ++i) {
|
||||
CElement child = (CElement)children[i];
|
||||
CElement child = (CElement) children[i];
|
||||
try {
|
||||
child.close();
|
||||
} catch (CModelException e) {
|
||||
|
@ -1303,7 +1308,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
|
|||
this.cache.removeInfo(element);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns the temporary cache for newly opened elements for the current thread.
|
||||
* Creates it if not already created.
|
||||
*/
|
||||
|
@ -1316,14 +1321,14 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
|
|||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returns whether there is a temporary cache for the current thread.
|
||||
*/
|
||||
public boolean hasTemporaryCache() {
|
||||
return this.temporaryCache.get() != null;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Resets the temporary cache for newly created elements to null.
|
||||
*/
|
||||
public void resetTemporaryCache() {
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.model;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -138,7 +137,6 @@ public class CProject extends Openable implements ICProject {
|
|||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
if (this == o)
|
||||
return true;
|
||||
|
||||
|
@ -255,7 +253,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return PathEntryManager.getDefault().projectPrerequisites(entries);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.core.model.ICProject#getOption(String, boolean)
|
||||
*/
|
||||
|
@ -302,9 +299,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.core.model.ICProject#setOption(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setOption(String optionName, String optionValue) {
|
||||
if (!CModelManager.OptionNames.contains(optionName))
|
||||
|
@ -326,9 +320,6 @@ public class CProject extends Openable implements ICProject {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.core.model.ICProject#setOptions(Map)
|
||||
*/
|
||||
@Override
|
||||
public void setOptions(Map<String, String> newOptions) {
|
||||
Preferences preferences = new Preferences();
|
||||
|
@ -395,8 +386,8 @@ public class CProject extends Openable implements ICProject {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set cached preferences, no preferences are saved, only info is updated
|
||||
/**
|
||||
* Sets cached preferences, no preferences are saved, only info is updated
|
||||
*/
|
||||
private void setPreferences(Preferences preferences) {
|
||||
if (!isCProject()) {
|
||||
|
@ -405,33 +396,21 @@ public class CProject extends Openable implements ICProject {
|
|||
// Do nothing
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICProject#getResolvedCPathEntries()
|
||||
*/
|
||||
@Override
|
||||
public IPathEntry[] getResolvedPathEntries() throws CModelException {
|
||||
return CoreModel.getResolvedPathEntries(this);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICProject#getRawCPathEntries()
|
||||
*/
|
||||
@Override
|
||||
public IPathEntry[] getRawPathEntries() throws CModelException {
|
||||
return CoreModel.getRawPathEntries(this);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICProject#setRawCPathEntries(org.eclipse.cdt.core.model.IPathEntry[], org.eclipse.core.runtime.IProgressMonitor)
|
||||
*/
|
||||
@Override
|
||||
public void setRawPathEntries(IPathEntry[] newEntries, IProgressMonitor monitor) throws CModelException {
|
||||
CoreModel.setRawPathEntries(this, newEntries, monitor);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICProject#getSourceRoot(org.eclipse.cdt.core.model.ISourceEntry)
|
||||
*/
|
||||
@Override
|
||||
public ISourceRoot getSourceRoot(ISourceEntry entry) throws CModelException {
|
||||
return getSourceRoot(new CSourceEntry(entry.getPath(), entry.getExclusionPatterns(), 0));
|
||||
|
@ -456,9 +435,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICProject#findSourceRoot()
|
||||
*/
|
||||
@Override
|
||||
public ISourceRoot findSourceRoot(IResource res) {
|
||||
try {
|
||||
|
@ -473,9 +449,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICProject#findSourceRoot()
|
||||
*/
|
||||
@Override
|
||||
public ISourceRoot findSourceRoot(IPath path) {
|
||||
try {
|
||||
|
@ -490,9 +463,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICProject#getSourceRoots()
|
||||
*/
|
||||
@Override
|
||||
public ISourceRoot[] getSourceRoots() throws CModelException {
|
||||
Object[] children = getChildren();
|
||||
|
@ -506,7 +476,7 @@ public class CProject extends Openable implements ICProject {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get all source roots.
|
||||
* Returns all source roots.
|
||||
*
|
||||
* @return all source roots
|
||||
* @throws CModelException
|
||||
|
@ -547,9 +517,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return outs;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public IOutputEntry[] getOutputEntries(IPathEntry[] entries) throws CModelException {
|
||||
ArrayList<IPathEntry> list = new ArrayList<IPathEntry>(entries.length);
|
||||
for (IPathEntry entrie : entries) {
|
||||
|
@ -562,9 +529,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return outputs;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public boolean isOnOutputEntry(IResource resource) {
|
||||
IPath path = resource.getFullPath();
|
||||
|
@ -595,9 +559,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.model.Openable#buildStructure(org.eclipse.cdt.internal.core.model.OpenableInfo, org.eclipse.core.runtime.IProgressMonitor, java.util.Map, org.eclipse.core.resources.IResource)
|
||||
*/
|
||||
@Override
|
||||
protected boolean buildStructure(OpenableInfo info, IProgressMonitor pm,
|
||||
Map<ICElement, CElementInfo> newElements, IResource underlyingResource)
|
||||
|
@ -647,11 +608,12 @@ public class CProject extends Openable implements ICProject {
|
|||
children.addAll(sourceRoots);
|
||||
|
||||
boolean projectIsSourceRoot = false;
|
||||
for (ISourceRoot sourceRoot : sourceRoots)
|
||||
for (ISourceRoot sourceRoot : sourceRoots) {
|
||||
if (sourceRoot.getResource().equals(getProject())) {
|
||||
projectIsSourceRoot = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Now look for output folders
|
||||
try {
|
||||
|
@ -686,9 +648,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see ICProject
|
||||
*/
|
||||
@Override
|
||||
public boolean isOnSourceRoot(ICElement element) {
|
||||
try {
|
||||
|
@ -704,9 +663,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see ICProject
|
||||
*/
|
||||
@Override
|
||||
public boolean isOnSourceRoot(IResource resource) {
|
||||
try {
|
||||
|
@ -722,9 +678,6 @@ public class CProject extends Openable implements ICProject {
|
|||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICElement#exists()
|
||||
*/
|
||||
@Override
|
||||
public boolean exists() {
|
||||
if (!isCProject()) {
|
||||
|
@ -733,17 +686,11 @@ public class CProject extends Openable implements ICProject {
|
|||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.model.ICProject#getNonCResources()
|
||||
*/
|
||||
@Override
|
||||
public Object[] getNonCResources() throws CModelException {
|
||||
return ((CProjectInfo) getElementInfo()).getNonCResources(getResource());
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.model.CElement#closing(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void closing(Object info) throws CModelException {
|
||||
if (info instanceof CProjectInfo) {
|
||||
|
@ -760,7 +707,7 @@ public class CProject extends Openable implements ICProject {
|
|||
super.closing(info);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Resets this project's caches
|
||||
*/
|
||||
public void resetCaches() {
|
||||
|
@ -808,7 +755,7 @@ public class CProject extends Openable implements ICProject {
|
|||
if (project != null) {
|
||||
IResource resource= project.findMember(path);
|
||||
if (resource != null && resource.getType() == IResource.FILE) {
|
||||
final IFile file= (IFile)resource;
|
||||
final IFile file= (IFile) resource;
|
||||
tu= (CElement) CModelManager.getDefault().create(file, this);
|
||||
if (tu == null) {
|
||||
String contentTypeId= CoreModel.getRegistedContentTypeId(project, file.getName());
|
||||
|
@ -833,5 +780,4 @@ public class CProject extends Openable implements ICProject {
|
|||
protected char getHandleMementoDelimiter() {
|
||||
return CEM_CPROJECT;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,10 +6,9 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.core.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -36,11 +35,11 @@ import org.eclipse.core.runtime.IPath;
|
|||
import org.eclipse.core.runtime.content.IContentType;
|
||||
import org.eclipse.core.runtime.content.IContentTypeManager.ContentTypeChangeEvent;
|
||||
import org.eclipse.core.runtime.preferences.IScopeContext;
|
||||
|
||||
/**
|
||||
* ContentType processor
|
||||
*/
|
||||
public class ContentTypeProcessor extends CModelOperation {
|
||||
|
||||
CModelManager fManager;
|
||||
CElementDelta fCurrentDelta;
|
||||
ContentTypeChangeEvent[] fEvents;
|
||||
|
@ -53,9 +52,6 @@ public class ContentTypeProcessor extends CModelOperation {
|
|||
fCurrentDelta = new CElementDelta(root);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.model.CModelOperation#isReadOnly()
|
||||
*/
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return true;
|
||||
|
@ -76,8 +72,6 @@ public class ContentTypeProcessor extends CModelOperation {
|
|||
addDelta(fCurrentDelta);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static public void processContentTypeChanges(ContentTypeChangeEvent[] events) {
|
||||
try {
|
||||
|
@ -213,8 +207,7 @@ public class ContentTypeProcessor extends CModelOperation {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add the resource delta to the right CElementDelta tree.
|
||||
* @param parent
|
||||
|
@ -252,7 +245,6 @@ public class ContentTypeProcessor extends CModelOperation {
|
|||
}
|
||||
|
||||
private void elementAdded(ICElement celement, ICElement parent) throws CModelException {
|
||||
|
||||
if (celement instanceof Openable) {
|
||||
addToParentInfo((Openable)celement);
|
||||
}
|
||||
|
@ -296,13 +288,13 @@ public class ContentTypeProcessor extends CModelOperation {
|
|||
}
|
||||
fCurrentDelta.changed(element, ICElementDelta.F_CONTENT |ICElementDelta.F_CONTENT_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the given element from its parents cache of children. If the
|
||||
* element does not have a parent, or the parent is not currently open,
|
||||
* this has no effect.
|
||||
*/
|
||||
private void removeFromParentInfo(ICElement child) throws CModelException {
|
||||
|
||||
// Remove the child from the parent list.
|
||||
ICElement parent = child.getParent();
|
||||
if (parent != null && parent instanceof Parent && fManager.peekAtInfo(parent) != null) {
|
||||
|
@ -338,5 +330,4 @@ public class ContentTypeProcessor extends CModelOperation {
|
|||
}
|
||||
return new ICProject[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.core.pdom.indexer;
|
||||
|
||||
|
@ -37,17 +37,18 @@ public final class FileExistsCache {
|
|||
private static class Content {
|
||||
public Content(String[] names) {
|
||||
fNames= names;
|
||||
fIsFile= new BitSet(names.length*2);
|
||||
fIsFile= new BitSet(names.length * 2);
|
||||
}
|
||||
public String[] fNames;
|
||||
public BitSet fIsFile;
|
||||
}
|
||||
private Reference<Map<String,Content>> fCache= null;
|
||||
|
||||
private Reference<Map<String, Content>> fCache;
|
||||
private final boolean fCaseInSensitive;
|
||||
|
||||
public FileExistsCache(boolean caseInsensitive) {
|
||||
fCaseInSensitive= caseInsensitive;
|
||||
fCache= new SoftReference<Map<String,Content>>(new HashMap<String, Content>()); // before running out of memory the entire map will be thrown away.
|
||||
fCache= new SoftReference<Map<String, Content>>(new HashMap<String, Content>()); // before running out of memory the entire map will be thrown away.
|
||||
}
|
||||
|
||||
public boolean isFile(String path) {
|
||||
|
@ -92,14 +93,13 @@ public final class FileExistsCache {
|
|||
if (avail == null) {
|
||||
String[] files = null;
|
||||
try {
|
||||
files = (parentStore == null) ? new File(parent).list() : parentStore.childNames(EFS.NONE, null);
|
||||
files = parentStore == null ? new File(parent).list() : parentStore.childNames(EFS.NONE, null);
|
||||
} catch (CoreException e) {
|
||||
// Ignore
|
||||
}
|
||||
if (files == null || files.length == 0) {
|
||||
avail= EMPTY_STRING_ARRAY;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (fCaseInSensitive) {
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
files[i]= files[i].toUpperCase();
|
||||
|
@ -118,14 +118,14 @@ public final class FileExistsCache {
|
|||
final BitSet isFileBitset = avail.fIsFile;
|
||||
if (isFileBitset.get(idx))
|
||||
return true;
|
||||
if (isFileBitset.get(idx+1))
|
||||
if (isFileBitset.get(idx + 1))
|
||||
return false;
|
||||
|
||||
if ((file != null && file.isFile()) || (fileStore != null && !fileStore.fetchInfo().isDirectory())) {
|
||||
isFileBitset.set(idx);
|
||||
return true;
|
||||
}
|
||||
isFileBitset.set(idx+1);
|
||||
isFileBitset.set(idx + 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1147,7 +1147,6 @@ public class CCorePlugin extends Plugin {
|
|||
private static final String PARSER_EXCEPTIONS = CCorePlugin.PLUGIN_ID + "/debug/parser/exceptions" ; //$NON-NLS-1$
|
||||
private static final String SCANNER = CCorePlugin.PLUGIN_ID + "/debug/scanner"; //$NON-NLS-1$
|
||||
private static final String DELTA = CCorePlugin.PLUGIN_ID + "/debug/deltaprocessor" ; //$NON-NLS-1$
|
||||
//private static final String CONTENTASSIST = CCorePlugin.PLUGIN_ID + "/debug/contentassist" ; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Configure the plug-in with respect to option settings defined in ".options" file
|
||||
|
|
|
@ -86,18 +86,16 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
private static final boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.cdt.ui/debug/ResultCollector")); //$NON-NLS-1$//$NON-NLS-2$
|
||||
|
||||
/**
|
||||
* Dialog settings key for the "all categories are disabled" warning dialog. See
|
||||
* {@link OptionalMessageDialog}.
|
||||
* Dialog settings key for the "all categories are disabled" warning dialog.
|
||||
* See {@link OptionalMessageDialog}.
|
||||
*/
|
||||
private static final String PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY= "EmptyDefaultAssistCategory"; //$NON-NLS-1$
|
||||
|
||||
private static final Comparator<CompletionProposalCategory> ORDER_COMPARATOR= new Comparator<CompletionProposalCategory>() {
|
||||
|
||||
@Override
|
||||
public int compare(CompletionProposalCategory d1, CompletionProposalCategory d2) {
|
||||
return d1.getSortOrder() - d2.getSortOrder();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private static final ICompletionProposal[] NO_PROPOSALS= {};
|
||||
|
@ -110,9 +108,9 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
|
||||
/* cycling stuff */
|
||||
private int fRepetition= -1;
|
||||
private List<List<CompletionProposalCategory>> fCategoryIteration= null;
|
||||
private String fIterationGesture= null;
|
||||
private int fNumberOfComputedResults= 0;
|
||||
private List<List<CompletionProposalCategory>> fCategoryIteration;
|
||||
private String fIterationGesture;
|
||||
private int fNumberOfComputedResults;
|
||||
private String fErrorMessage;
|
||||
private boolean fIsAutoActivated;
|
||||
|
||||
|
@ -123,10 +121,6 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
fCategories= CompletionProposalComputerRegistry.getDefault().getProposalCategories();
|
||||
fAssistant= assistant;
|
||||
fAssistant.addCompletionListener(new ICompletionListener() {
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.contentassist.ICompletionListener#assistSessionStarted(org.eclipse.jface.text.contentassist.ContentAssistEvent)
|
||||
*/
|
||||
@Override
|
||||
public void assistSessionStarted(ContentAssistEvent event) {
|
||||
if (event.processor != ContentAssistProcessor.this)
|
||||
|
@ -164,9 +158,6 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.contentassist.ICompletionListener#assistSessionEnded(org.eclipse.jface.text.contentassist.ContentAssistEvent)
|
||||
*/
|
||||
@Override
|
||||
public void assistSessionEnded(ContentAssistEvent event) {
|
||||
if (event.processor != ContentAssistProcessor.this)
|
||||
|
@ -192,18 +183,12 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.contentassist.ICompletionListener#selectionChanged(org.eclipse.jface.text.contentassist.ICompletionProposal, boolean)
|
||||
*/
|
||||
@Override
|
||||
public void selectionChanged(ICompletionProposal proposal, boolean smartToggle) {}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
|
||||
*/
|
||||
@Override
|
||||
public final ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
|
||||
long start= DEBUG ? System.currentTimeMillis() : 0;
|
||||
|
@ -250,7 +235,7 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Verify that auto activation is allowed.
|
||||
* Verifies that auto activation is allowed.
|
||||
* <p>
|
||||
* The default implementation always returns <code>true</code>.
|
||||
* </p>
|
||||
|
@ -296,9 +281,6 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
return proposals;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
|
||||
*/
|
||||
@Override
|
||||
public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
|
||||
clearState();
|
||||
|
@ -362,26 +344,16 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
fCompletionAutoActivationCharacters= activationSet;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
|
||||
*/
|
||||
@Override
|
||||
public char[] getCompletionProposalAutoActivationCharacters() {
|
||||
return fCompletionAutoActivationCharacters;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
|
||||
*/
|
||||
@Override
|
||||
public char[] getContextInformationAutoActivationCharacters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
|
||||
*/
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
if (fNumberOfComputedResults > 0)
|
||||
|
@ -391,9 +363,6 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
return ContentAssistMessages.ContentAssistProcessor_no_completions;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
|
||||
*/
|
||||
@Override
|
||||
public IContextInformationValidator getContextInformationValidator() {
|
||||
return null;
|
||||
|
@ -494,9 +463,6 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
final int restoreId= IDialogConstants.CLIENT_ID + 10;
|
||||
final int settingsId= IDialogConstants.CLIENT_ID + 11;
|
||||
final OptionalMessageDialog dialog= new OptionalMessageDialog(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY, shell, title, null /* default image */, message, MessageDialog.WARNING, new String[] { restoreButtonLabel, IDialogConstants.CLOSE_LABEL }, 1) {
|
||||
/*
|
||||
* @see org.eclipse.cdt.internal.ui.dialogs.OptionalMessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected Control createCustomArea(Composite composite) {
|
||||
// wrap link and checkbox in one composite without space
|
||||
|
@ -533,9 +499,6 @@ public class ContentAssistProcessor implements IContentAssistProcessor {
|
|||
return parent;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.dialogs.MessageDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
Button[] buttons= new Button[2];
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Rational Software - Initial API and implementation
|
||||
* IBM Rational Software - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.util;
|
||||
|
||||
|
@ -14,12 +14,13 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
|||
|
||||
public class Util implements IDebugLogConstants{
|
||||
public static boolean VERBOSE_CONTENTASSIST = false;
|
||||
|
||||
private Util() {
|
||||
}
|
||||
/*
|
||||
* Add a log entry
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adds a log entry
|
||||
*/
|
||||
public static void debugLog(String message, DebugLogConstant client) {
|
||||
if( CUIPlugin.getDefault() == null ) return;
|
||||
if ( CUIPlugin.getDefault().isDebugging() && isActive(client)) {
|
||||
|
@ -42,5 +43,4 @@ public class Util implements IDebugLogConstants{
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue