Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java1
-rw-r--r--core/org.eclipse.cdt.ui/icons/ovr16/read.gifbin0 -> 834 bytes
-rw-r--r--core/org.eclipse.cdt.ui/icons/ovr16/readwrite.gifbin0 -> 839 bytes
-rw-r--r--core/org.eclipse.cdt.ui/icons/ovr16/write.gifbin0 -> 831 bytes
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java10
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java19
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java28
9 files changed, 64 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java
index c0c79fa3b4f..2a33c402919 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java
@@ -88,6 +88,7 @@ public class IndexUpdateTests extends IndexTestBase {
if (fCProject == null) {
fCProject= CProjectHelper.createCProject("indexUpdateTestsC", null, IPDOMManager.ID_FAST_INDEXER);
}
+ CCorePlugin.getIndexManager().joinIndexer(INDEXER_WAIT_TIME, NPM);
fIndex= CCorePlugin.getIndexManager().getIndex(new ICProject[] {fCProject, fCppProject});
}
diff --git a/core/org.eclipse.cdt.ui/icons/ovr16/read.gif b/core/org.eclipse.cdt.ui/icons/ovr16/read.gif
new file mode 100644
index 00000000000..5a4e725e3a8
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/icons/ovr16/read.gif
Binary files differ
diff --git a/core/org.eclipse.cdt.ui/icons/ovr16/readwrite.gif b/core/org.eclipse.cdt.ui/icons/ovr16/readwrite.gif
new file mode 100644
index 00000000000..1a563ebafbf
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/icons/ovr16/readwrite.gif
Binary files differ
diff --git a/core/org.eclipse.cdt.ui/icons/ovr16/write.gif b/core/org.eclipse.cdt.ui/icons/ovr16/write.gif
new file mode 100644
index 00000000000..56cfe9975b8
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/icons/ovr16/write.gif
Binary files differ
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java
index da3ab14252d..c41ce010512 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java
@@ -16,12 +16,13 @@ package org.eclipse.cdt.internal.ui;
import java.net.MalformedURLException;
import java.net.URL;
-import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.cdt.ui.CUIPlugin;
+
/**
* Bundle of all images used by the C plugin.
*/
@@ -264,6 +265,9 @@ public class CPluginImages {
public static final ImageDescriptor DESC_OVR_SYSTEM_INCLUDE= create(T_OVR, "systeminclude_co.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OVR_DEFINES= create(T_OVR, "defines_co.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OVR_INACTIVE= create(T_OVR, "inactive_co.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor DESC_OVR_READ_ACCESS= create(T_OVR, "read.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor DESC_OVR_READ_WRITE_ACCESS= create(T_OVR, "readwrite.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor DESC_OVR_WRITE_ACCESS= create(T_OVR, "write.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OVR_WARNING= create(T_OVR, "warning_co.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OVR_ERROR= create(T_OVR, "error_co.gif"); //$NON-NLS-1$
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java
index 20252d33f1b..33a7b14deec 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java
@@ -197,10 +197,15 @@ public class CHContentProvider extends AsyncTreeContentProvider {
if (element instanceof IVariable || element instanceof IEnumerator) {
node.setInitializer(true);
}
+ boolean readAccess= false;
+ boolean writeAccess= false;
for (int i = 0; i < refs.length; i++) {
IIndexName reference = refs[i];
node.addReference(new CHReferenceInfo(reference.getNodeOffset(), reference.getNodeLength()));
+ readAccess= (readAccess || reference.isReadAccess());
+ writeAccess= (writeAccess || reference.isWriteAccess());
}
+ node.setRWAccess(readAccess, writeAccess);
node.sortReferencesByOffset();
return node;
}
@@ -236,11 +241,16 @@ public class CHContentProvider extends AsyncTreeContentProvider {
node= new CHMultiDefNode(parent, tu, timestamp, elements);
}
+ boolean readAccess= false;
+ boolean writeAccess= false;
for (int i = 0; i < references.length; i++) {
IIndexName reference = references[i];
node.addReference(new CHReferenceInfo(reference.getNodeOffset(), reference.getNodeLength()));
+ readAccess= (readAccess || reference.isReadAccess());
+ writeAccess= (writeAccess || reference.isWriteAccess());
}
node.sortReferencesByOffset();
+ node.setRWAccess(readAccess, writeAccess);
return node;
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java
index cd62b7f47bf..95975db6c97 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHLabelProvider.java
@@ -142,6 +142,12 @@ public class CHLabelProvider extends LabelProvider implements IColorProvider {
}
}
}
+ if (node.isReadAccess()) {
+ flags |= CElementImageDescriptor.READ_ACCESS;
+ }
+ if (node.isWriteAccess()) {
+ flags |= CElementImageDescriptor.WRITE_ACCESS;
+ }
String key= image.toString()+String.valueOf(flags);
Image result= (Image) fCachedImages.get(key);
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java
index abffc892749..c85532172fa 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHNode.java
@@ -28,16 +28,18 @@ import org.eclipse.cdt.internal.ui.util.CoreUtility;
/**
* Represents a node in the include browser
*/
-public class CHNode implements IAdaptable {
+public class CHNode implements IAdaptable {
private CHNode fParent;
private ICElement fRepresentedDecl;
private ITranslationUnit fFileOfReferences;
private List fReferences;
private int fHashCode;
- private boolean fIsRecursive;
private long fTimestamp;
+ private boolean fIsRecursive;
private boolean fIsInitializer;
+ private boolean fIsReadAccess;
+ private boolean fIsWriteAccess;
/**
* Creates a new node for the include browser
@@ -175,4 +177,17 @@ public class CHNode implements IAdaptable {
Collections.sort(fReferences, CHReferenceInfo.COMPARE_OFFSET);
}
}
+
+ public void setRWAccess(boolean readAccess, boolean writeAccess) {
+ fIsReadAccess= readAccess;
+ fIsWriteAccess= writeAccess;
+ }
+
+ public boolean isReadAccess() {
+ return fIsReadAccess;
+ }
+
+ public boolean isWriteAccess() {
+ return fIsWriteAccess;
+ }
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java
index 4180f298107..a9906412995 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementImageDescriptor.java
@@ -12,13 +12,13 @@
*******************************************************************************/
package org.eclipse.cdt.ui;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.resource.CompositeImageDescriptor;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
import org.eclipse.cdt.internal.ui.CPluginImages;
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.core.runtime.Assert;
/**
@@ -91,6 +91,12 @@ public class CElementImageDescriptor extends CompositeImageDescriptor {
/** Flag to render the 'inactive' adornment for include directives */
public final static int INACTIVE= 0x8000;
+ /** Flag to render the 'read access' adornment for references to variables or fields */
+ public static final int READ_ACCESS = 0x10000;
+
+ /** Flag to render the 'read access' adornment for references to variables or fields */
+ public static final int WRITE_ACCESS = 0x20000;
+
private ImageDescriptor fBaseImage;
private int fFlags;
private Point fSize;
@@ -270,6 +276,22 @@ public class CElementImageDescriptor extends CompositeImageDescriptor {
data= CPluginImages.DESC_OVR_INACTIVE.getImageData();
drawImage(data, 0, 0);
}
+
+ final boolean isReadAccess= (fFlags & READ_ACCESS) != 0;
+ final boolean isWriteAccess= (fFlags & WRITE_ACCESS) != 0;
+ if (isReadAccess) {
+ if (isWriteAccess) {
+ data= CPluginImages.DESC_OVR_READ_WRITE_ACCESS.getImageData();
+ }
+ else {
+ data= CPluginImages.DESC_OVR_READ_ACCESS.getImageData();
+ }
+ drawImage(data, 0, 0);
+ }
+ else if (isWriteAccess) {
+ data= CPluginImages.DESC_OVR_WRITE_ACCESS.getImageData();
+ drawImage(data, 0, 0);
+ }
}
private void drawBottomLeft() {

Back to the top