summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lindo2012-02-09 11:36:27 (EST)
committer Vivian Kong2012-02-09 11:36:27 (EST)
commit768ae51dda2b35ff86b0ef7495a9da79c9a4460c (patch)
tree5c2642e13d66d5e4de896fb2939450600d31b8ec
parent61d5be6ef6f0f8370f0ce31e0452f60aac4f0554 (diff)
downloadorg.eclipse.cdt-768ae51dda2b35ff86b0ef7495a9da79c9a4460c.zip
org.eclipse.cdt-768ae51dda2b35ff86b0ef7495a9da79c9a4460c.tar.gz
org.eclipse.cdt-768ae51dda2b35ff86b0ef7495a9da79c9a4460c.tar.bz2
Bug 370762 - Adding support for Remote Semantic Highlighting in the
Remote C/C++ Editor
-rw-r--r--core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF2
-rw-r--r--core/org.eclipse.cdt.ui/pom.xml2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java41
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java20
4 files changed, 34 insertions, 31 deletions
diff --git a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
index ddd2f70..83f621b 100644
--- a/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
+++ b/core/org.eclipse.cdt.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true
-Bundle-Version: 5.2.2.qualifier
+Bundle-Version: 5.2.3.qualifier
Bundle-Activator: org.eclipse.cdt.ui.CUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/core/org.eclipse.cdt.ui/pom.xml b/core/org.eclipse.cdt.ui/pom.xml
index 9c81cf9..51244ef 100644
--- a/core/org.eclipse.cdt.ui/pom.xml
+++ b/core/org.eclipse.cdt.ui/pom.xml
@@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>5.2.2-SNAPSHOT</version>
+ <version>5.2.3-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.ui</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java
index 6f4a8b5..700ffff 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -45,7 +45,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
/**
* Highlighting style.
*/
- static class HighlightingStyle {
+ public static class HighlightingStyle {
/** Text attribute */
private TextAttribute fTextAttribute;
@@ -94,7 +94,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
/**
* Highlighted Positions.
*/
- static class HighlightedPosition extends Position {
+ public static class HighlightedPosition extends Position {
/** Highlighting of the position */
private HighlightingStyle fStyle;
@@ -260,30 +260,30 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
/** Semantic highlighting presenter */
- private SemanticHighlightingPresenter fPresenter;
+ protected SemanticHighlightingPresenter fPresenter;
/** Semantic highlighting reconciler */
private SemanticHighlightingReconciler fReconciler;
/** Semantic highlightings */
- private SemanticHighlighting[] fSemanticHighlightings;
+ protected SemanticHighlighting[] fSemanticHighlightings;
/** Highlightings */
- private HighlightingStyle[] fHighlightings;
+ protected HighlightingStyle[] fHighlightings;
/** The editor */
private CEditor fEditor;
/** The source viewer */
- private CSourceViewer fSourceViewer;
+ protected CSourceViewer fSourceViewer;
/** The color manager */
- private IColorManager fColorManager;
+ protected IColorManager fColorManager;
/** The preference store */
- private IPreferenceStore fPreferenceStore;
+ protected IPreferenceStore fPreferenceStore;
/** The source viewer configuration */
- private CSourceViewerConfiguration fConfiguration;
+ protected CSourceViewerConfiguration fConfiguration;
/** The presentation reconciler */
- private CPresentationReconciler fPresentationReconciler;
+ protected CPresentationReconciler fPresentationReconciler;
/** The hard-coded ranges */
- private HighlightedRange[][] fHardcodedRanges;
+ protected HighlightedRange[][] fHardcodedRanges;
/**
* Install the semantic highlighting on the given editor infrastructure
@@ -347,7 +347,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
*
* @return the hard-coded positions
*/
- private HighlightedPosition[] createHardcodedPositions() {
+ protected HighlightedPosition[] createHardcodedPositions() {
List<HighlightedPosition> positions= new ArrayList<HighlightedPosition>();
for (int i= 0; i < fHardcodedRanges.length; i++) {
HighlightedRange range= null;
@@ -421,14 +421,14 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
/**
* @return <code>true</code> iff semantic highlighting is enabled in the preferences
*/
- private boolean isEnabled() {
+ protected boolean isEnabled() {
return SemanticHighlightings.isEnabled(fPreferenceStore);
}
/**
* Initialize semantic highlightings.
*/
- private void initializeHighlightings() {
+ protected void initializeHighlightings() {
fSemanticHighlightings= SemanticHighlightings.getSemanticHighlightings();
fHighlightings= new HighlightingStyle[fSemanticHighlightings.length];
@@ -461,7 +461,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
/**
* Dispose the semantic highlightings.
*/
- private void disposeHighlightings() {
+ protected void disposeHighlightings() {
for (int i= 0, n= fSemanticHighlightings.length; i < n; i++)
removeColor(SemanticHighlightings.getColorPreferenceKey(fSemanticHighlightings[i]));
@@ -480,10 +480,11 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
* Handle the given property change event
*
* @param event The event
+ * @return
*/
- private void handlePropertyChangeEvent(PropertyChangeEvent event) {
+ protected boolean handlePropertyChangeEvent(PropertyChangeEvent event) {
if (fPreferenceStore == null)
- return; // Uninstalled during event notification
+ return false; // Uninstalled during event notification
if (fConfiguration != null)
fConfiguration.handlePropertyChangeEvent(event);
@@ -496,7 +497,7 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
}
if (!isEnabled())
- return;
+ return false;
boolean refreshNeeded= false;
@@ -554,6 +555,8 @@ public class SemanticHighlightingManager implements IPropertyChangeListener {
if (refreshNeeded && fReconciler != null)
fReconciler.refresh();
+
+ return refreshNeeded;
}
private void adaptToEnablementChange(HighlightingStyle highlighting, PropertyChangeEvent event) {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java
index b3259d9..d08ba31 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightingReconciler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -287,18 +287,18 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
/** The C editor this semantic highlighting reconciler is installed on */
private CEditor fEditor;
/** The semantic highlighting presenter */
- private SemanticHighlightingPresenter fPresenter;
+ protected SemanticHighlightingPresenter fPresenter;
/** Semantic highlightings */
- private SemanticHighlighting[] fSemanticHighlightings;
+ protected SemanticHighlighting[] fSemanticHighlightings;
/** Highlightings */
private HighlightingStyle[] fHighlightings;
/** Background job's added highlighted positions */
- private List<HighlightedPosition> fAddedPositions= new ArrayList<HighlightedPosition>();
+ protected List<HighlightedPosition> fAddedPositions= new ArrayList<HighlightedPosition>();
/** Background job's removed highlighted positions */
- private List<HighlightedPosition> fRemovedPositions= new ArrayList<HighlightedPosition>();
+ protected List<HighlightedPosition> fRemovedPositions= new ArrayList<HighlightedPosition>();
/** Number of removed positions */
- private int fNOfRemovedPositions;
+ protected int fNOfRemovedPositions;
/** Background job */
private Job fJob;
@@ -313,9 +313,9 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
private boolean fIsReconciling= false;
/** The semantic highlighting presenter - cache for background thread, only valid during {@link #reconciled(IASTTranslationUnit, boolean, IProgressMonitor)} */
- private SemanticHighlightingPresenter fJobPresenter;
+ protected SemanticHighlightingPresenter fJobPresenter;
/** Semantic highlightings - cache for background thread, only valid during {@link #reconciled(IASTTranslationUnit, boolean, IProgressMonitor)} */
- private SemanticHighlighting[] fJobSemanticHighlightings;
+ protected SemanticHighlighting[] fJobSemanticHighlightings;
/** Highlightings - cache for background thread, only valid during {@link #reconciled(IASTTranslationUnit, boolean, IProgressMonitor)} */
private HighlightingStyle[] fJobHighlightings;
@@ -387,7 +387,7 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
/**
* Start reconciling positions.
*/
- private void startReconcilingPositions() {
+ protected void startReconcilingPositions() {
fJobPresenter.addAllPositions(fRemovedPositions);
fNOfRemovedPositions= fRemovedPositions.size();
}
@@ -449,7 +449,7 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
/**
* Stop reconciling positions.
*/
- private void stopReconcilingPositions() {
+ protected void stopReconcilingPositions() {
fRemovedPositions.clear();
fNOfRemovedPositions= 0;
fAddedPositions.clear();