1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 12:03:16 +02:00

Further fix to 36837

* src/org/eclipse/cdt/internal/ui/util/ResourceToItemsMapper.java
Fix for 82516
	* src/org/eclipse/cdt/internal/ui/viewsupport/CElementLabels.java
This commit is contained in:
David Inglis 2005-01-11 15:17:45 +00:00
parent c796aad342
commit 70a3403e0b
3 changed files with 21 additions and 5 deletions

View file

@ -1,3 +1,15 @@
2005-01-11 David Inglis
Further fix to 36837
* src/org/eclipse/cdt/internal/ui/util/ResourceToItemsMapper.java
2005-01-11 David Inglis
Fix for 82516
* src/org/eclipse/cdt/internal/ui/viewsupport/CElementLabels.java
2005-01-07 Alain Magloire 2005-01-07 Alain Magloire
Part of Fix 82323. Part of Fix 82323.
The "New" action was not shown when workspace was empty The "New" action was not shown when workspace was empty

View file

@ -184,7 +184,7 @@ public class ResourceToItemsMapper {
private static IResource getCorrespondingResource(Object element) { private static IResource getCorrespondingResource(Object element) {
if (element instanceof ICElement) { if (element instanceof ICElement) {
ICElement elem= (ICElement) element; ICElement elem= (ICElement) element;
if (elem.exists() && !elem.isReadOnly()) { // only modifieable elements can get error ticks if (elem.exists()) {
IResource res= elem.getResource(); IResource res= elem.getResource();
if (res == null) { if (res == null) {
ITranslationUnit cu= (ITranslationUnit) elem.getAncestor(ICElement.C_UNIT); ITranslationUnit cu= (ITranslationUnit) elem.getAncestor(ICElement.C_UNIT);

View file

@ -14,6 +14,7 @@
package org.eclipse.cdt.internal.ui.viewsupport; package org.eclipse.cdt.internal.ui.viewsupport;
import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.core.model.ICContainer; import org.eclipse.cdt.core.model.ICContainer;
import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IMethod; import org.eclipse.cdt.core.model.IMethod;
@ -314,6 +315,12 @@ public class CElementLabels {
buf.append(CONCAT_STRING); buf.append(CONCAT_STRING);
getSourceRootLabel(root, ROOT_QUALIFIED, buf); getSourceRootLabel(root, ROOT_QUALIFIED, buf);
} }
if (element instanceof IBinary) {
IBinary bin = (IBinary)element;
buf.append(" - [" + bin.getCPU() + (bin.isLittleEndian() ? "le" : "be") + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
} }
public static void getMethodLabel( IMethod method, int flags, StringBuffer buf ) { public static void getMethodLabel( IMethod method, int flags, StringBuffer buf ) {
@ -419,10 +426,7 @@ public class CElementLabels {
if (rootQualified) { if (rootQualified) {
buf.append(container.getPath().makeRelative().toString()); buf.append(container.getPath().makeRelative().toString());
} else { } else {
// if (resource != null) buf.append(container.getElementName());
// buf.append(resource.getProjectRelativePath().toString());
// else
buf.append(container.getElementName());
if (referencedQualified) { if (referencedQualified) {
buf.append(CONCAT_STRING); buf.append(CONCAT_STRING);
buf.append(resource.getProject().getName()); buf.append(resource.getProject().getName());