Skip to content

Commit 94dd5fe

Browse files
kysmith-csgiloveeclipse
authored andcommitted
Allow JavaVariableLabelProvider's presentation to be overridden
1 parent 4748918 commit 94dd5fe

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/variables/JavaVariableLabelProvider.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.util.HashMap;
1717
import java.util.Map;
1818

19+
import org.eclipse.core.runtime.Assert;
1920
import org.eclipse.core.runtime.CoreException;
2021
import org.eclipse.core.runtime.Platform;
2122
import org.eclipse.core.runtime.jobs.ISchedulingRule;
@@ -55,7 +56,7 @@
5556
*/
5657
public class JavaVariableLabelProvider extends VariableLabelProvider implements IPreferenceChangeListener {
5758

58-
private final static JDIModelPresentation fLabelProvider = new JDIModelPresentation();
59+
private static JDIModelPresentation fLabelProvider = new JDIModelPresentation();
5960

6061
/**
6162
* Map of view id to qualified name setting
@@ -290,4 +291,22 @@ public void preferenceChange(PreferenceChangeEvent event) {
290291
determineSerializationMode((String) event.getNewValue());
291292
}
292293
}
294+
295+
/**
296+
* @return the model presentation used to display Java elements, never {@code null}
297+
*/
298+
protected static JDIModelPresentation getModelPresentation() {
299+
return fLabelProvider;
300+
}
301+
302+
/**
303+
* Sets the model presentation used by this label provider to the specified object.
304+
*
305+
* @param presentation
306+
* the new presentation, may not be {@code null}
307+
*/
308+
protected static void setModelPresentation(final JDIModelPresentation presentation) {
309+
Assert.isNotNull(presentation);
310+
fLabelProvider = presentation;
311+
}
293312
}

0 commit comments

Comments
 (0)