mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Bug 341545 - [Accessibility] Traditional memory rendering uses colour to
convey information Change-Id: I8127a026a3d6abb0291e35f606c622b1fa92ac2f Reviewed-on: https://git.eclipse.org/r/11133 IP-Clean: Chris Recoskie <recoskie@ca.ibm.com> Reviewed-by: Jesse Weinstein <Jesse.Weinstein@clinicomp.com> Reviewed-by: Chris Recoskie <recoskie@ca.ibm.com> Tested-by: Chris Recoskie <recoskie@ca.ibm.com>
This commit is contained in:
parent
07fcd9213c
commit
d11a8c4902
9 changed files with 341 additions and 95 deletions
|
@ -837,4 +837,35 @@ public abstract class AbstractPane extends Canvas
|
||||||
}
|
}
|
||||||
return fTextHeight;
|
return fTextHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean shouldDrawBox(TraditionalMemoryByte bytes[], int col)
|
||||||
|
{
|
||||||
|
TraditionalRendering ren = fRendering.getTraditionalRendering();
|
||||||
|
if (ren.getBoxEdit())
|
||||||
|
{
|
||||||
|
for (TraditionalMemoryByte tmb : bytes)
|
||||||
|
{
|
||||||
|
if (tmb.isEdited())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ren.getBoxChanged())
|
||||||
|
{
|
||||||
|
for (int i = 0; i < fRendering.getHistoryDepth(); i++)
|
||||||
|
{
|
||||||
|
for (TraditionalMemoryByte tmb : bytes)
|
||||||
|
{
|
||||||
|
if (tmb.isChanged(i))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2013 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
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* IBM - Initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.ui.memory.traditional;
|
||||||
|
|
||||||
|
import org.eclipse.jface.preference.ColorSelector;
|
||||||
|
import org.eclipse.jface.preference.FieldEditor;
|
||||||
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
import org.eclipse.jface.preference.PreferenceConverter;
|
||||||
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.layout.GridData;
|
||||||
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
|
public class ColorAndEffectFieldEditor extends FieldEditor {
|
||||||
|
|
||||||
|
private final String nameBold;
|
||||||
|
private final String nameItalic;
|
||||||
|
private final String nameBox;
|
||||||
|
|
||||||
|
private ColorSelector colorSelector;
|
||||||
|
private Button checkBold;
|
||||||
|
private Button checkItalic;
|
||||||
|
private Button checkBox; // :)
|
||||||
|
|
||||||
|
public ColorAndEffectFieldEditor(String name, String nameBold, String nameItalic, String nameBox, String labelText, Composite parent) {
|
||||||
|
super(name, labelText, parent);
|
||||||
|
this.nameBold = nameBold;
|
||||||
|
this.nameItalic = nameItalic;
|
||||||
|
this.nameBox = nameBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void adjustForNumColumns(int numColumns) {
|
||||||
|
((GridData) checkItalic.getLayoutData()).horizontalSpan = numColumns - 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doFillIntoGrid(Composite parent, int numColumns) {
|
||||||
|
Control control = getLabelControl(parent);
|
||||||
|
control.setLayoutData(new GridData());
|
||||||
|
|
||||||
|
colorSelector = new ColorSelector(parent);
|
||||||
|
colorSelector.getButton().setLayoutData(new GridData());
|
||||||
|
|
||||||
|
checkBold = new Button(parent, SWT.CHECK);
|
||||||
|
checkBold.setText(TraditionalRenderingMessages.getString("ColorAndEffectFieldEditor.bold"));
|
||||||
|
checkBold.setLayoutData(new GridData());
|
||||||
|
|
||||||
|
checkItalic = new Button(parent, SWT.CHECK);
|
||||||
|
checkItalic.setText(TraditionalRenderingMessages.getString("ColorAndEffectFieldEditor.italic"));
|
||||||
|
checkItalic.setLayoutData(new GridData());
|
||||||
|
|
||||||
|
checkBox = new Button(parent, SWT.CHECK);
|
||||||
|
checkBox.setText(TraditionalRenderingMessages.getString("ColorAndEffectFieldEditor.box"));
|
||||||
|
checkBox.setLayoutData(new GridData());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doLoad() {
|
||||||
|
IPreferenceStore store = getPreferenceStore();
|
||||||
|
colorSelector.setColorValue(PreferenceConverter.getColor(store, getPreferenceName()));
|
||||||
|
checkBold.setSelection(store.getBoolean(nameBold));
|
||||||
|
checkItalic.setSelection(store.getBoolean(nameItalic));
|
||||||
|
checkBox.setSelection(store.getBoolean(nameBox));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doLoadDefault() {
|
||||||
|
IPreferenceStore store = getPreferenceStore();
|
||||||
|
colorSelector.setColorValue(PreferenceConverter.getDefaultColor(store, getPreferenceName()));
|
||||||
|
checkBold.setSelection(store.getDefaultBoolean(nameBold));
|
||||||
|
checkItalic.setSelection(store.getDefaultBoolean(nameItalic));
|
||||||
|
checkBox.setSelection(store.getDefaultBoolean(nameBox));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doStore() {
|
||||||
|
IPreferenceStore store = getPreferenceStore();
|
||||||
|
PreferenceConverter.setValue(store, getPreferenceName(), colorSelector.getColorValue());
|
||||||
|
store.setValue(nameBold, checkBold.getSelection());
|
||||||
|
store.setValue(nameItalic, checkItalic.getSelection());
|
||||||
|
store.setValue(nameBox, checkBox.getSelection());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getNumberOfControls() {
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -256,7 +256,6 @@ public class DataPane extends AbstractPane
|
||||||
protected void doPaintData(PaintEvent pe)
|
protected void doPaintData(PaintEvent pe)
|
||||||
{
|
{
|
||||||
GC gc = pe.gc;
|
GC gc = pe.gc;
|
||||||
gc.setFont(fRendering.getFont());
|
|
||||||
|
|
||||||
int cellHeight = getCellHeight();
|
int cellHeight = getCellHeight();
|
||||||
int cellWidth = getCellWidth();
|
int cellWidth = getCellWidth();
|
||||||
|
@ -271,6 +270,8 @@ public class DataPane extends AbstractPane
|
||||||
{
|
{
|
||||||
for(int col = 0; col < columns; col++)
|
for(int col = 0; col < columns; col++)
|
||||||
{
|
{
|
||||||
|
gc.setFont(fRendering.getFont());
|
||||||
|
|
||||||
if (isOdd(col))
|
if (isOdd(col))
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorText());
|
gc.setForeground(fRendering.getTraditionalRendering().getColorText());
|
||||||
else
|
else
|
||||||
|
@ -283,6 +284,8 @@ public class DataPane extends AbstractPane
|
||||||
TraditionalMemoryByte bytes[] = fRendering.getBytes(cellAddress,
|
TraditionalMemoryByte bytes[] = fRendering.getBytes(cellAddress,
|
||||||
fRendering.getBytesPerColumn());
|
fRendering.getBytesPerColumn());
|
||||||
|
|
||||||
|
boolean drawBox = false;
|
||||||
|
|
||||||
if(fRendering.getSelection().isSelected(cellAddress))
|
if(fRendering.getSelection().isSelected(cellAddress))
|
||||||
{
|
{
|
||||||
gc.setBackground(fRendering.getTraditionalRendering().getColorSelection());
|
gc.setBackground(fRendering.getTraditionalRendering().getColorSelection());
|
||||||
|
@ -301,12 +304,19 @@ public class DataPane extends AbstractPane
|
||||||
|
|
||||||
// Allow subclasses to override this method to do their own coloring
|
// Allow subclasses to override this method to do their own coloring
|
||||||
applyCustomColor(gc, bytes, col);
|
applyCustomColor(gc, bytes, col);
|
||||||
|
drawBox = shouldDrawBox(bytes, col);
|
||||||
}
|
}
|
||||||
|
|
||||||
gc.drawText(getCellText(bytes), cellWidth * col
|
gc.drawText(getCellText(bytes), cellWidth * col
|
||||||
+ fRendering.getCellPadding(), cellHeight * i
|
+ fRendering.getCellPadding(), cellHeight * i
|
||||||
+ fRendering.getCellPadding());
|
+ fRendering.getCellPadding());
|
||||||
|
|
||||||
|
if(drawBox)
|
||||||
|
{
|
||||||
|
gc.setForeground(fRendering.getTraditionalRendering().getColorTextAlternate());
|
||||||
|
gc.drawRectangle(cellWidth * col, cellHeight * i, cellWidth, cellHeight-1);
|
||||||
|
}
|
||||||
|
|
||||||
BigInteger cellEndAddress = cellAddress.add(BigInteger
|
BigInteger cellEndAddress = cellAddress.add(BigInteger
|
||||||
.valueOf(fRendering.getAddressesPerColumn()));
|
.valueOf(fRendering.getAddressesPerColumn()));
|
||||||
cellEndAddress = cellEndAddress.subtract(BigInteger
|
cellEndAddress = cellEndAddress.subtract(BigInteger
|
||||||
|
@ -353,15 +363,18 @@ public class DataPane extends AbstractPane
|
||||||
if (bytes[n].isEdited())
|
if (bytes[n].isEdited())
|
||||||
anyByteEditing = true;
|
anyByteEditing = true;
|
||||||
|
|
||||||
|
TraditionalRendering ren = fRendering.getTraditionalRendering();
|
||||||
|
|
||||||
if (isOdd(col))
|
if (isOdd(col))
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorText());
|
gc.setForeground(ren.getColorText());
|
||||||
else
|
else
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorTextAlternate());
|
gc.setForeground(ren.getColorTextAlternate());
|
||||||
gc.setBackground(fRendering.getTraditionalRendering().getColorBackground());
|
gc.setBackground(ren.getColorBackground());
|
||||||
|
|
||||||
if (anyByteEditing)
|
if (anyByteEditing)
|
||||||
{
|
{
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorEdit());
|
gc.setForeground(ren.getColorEdit());
|
||||||
|
gc.setFont(ren.getFontEdit(gc.getFont()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -374,16 +387,18 @@ public class DataPane extends AbstractPane
|
||||||
if (bytes[n].isChanged(i))
|
if (bytes[n].isChanged(i))
|
||||||
{
|
{
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorsChanged()[i]);
|
gc.setForeground(ren.getColorsChanged()[i]);
|
||||||
else
|
else
|
||||||
gc.setBackground(fRendering.getTraditionalRendering().getColorsChanged()[i]);
|
gc.setBackground(ren.getColorsChanged()[i]);
|
||||||
|
|
||||||
|
gc.setFont(ren.getFontChanged(gc.getFont()));
|
||||||
|
|
||||||
isColored = true;
|
isColored = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,6 +242,8 @@ public class TextPane extends AbstractPane
|
||||||
{
|
{
|
||||||
for(int col = 0; col < columns; col++)
|
for(int col = 0; col < columns; col++)
|
||||||
{
|
{
|
||||||
|
gc.setFont(fRendering.getFont());
|
||||||
|
|
||||||
if (isOdd(col))
|
if (isOdd(col))
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorText());
|
gc.setForeground(fRendering.getTraditionalRendering().getColorText());
|
||||||
else
|
else
|
||||||
|
@ -254,6 +256,8 @@ public class TextPane extends AbstractPane
|
||||||
TraditionalMemoryByte bytes[] = fRendering.getBytes(cellAddress,
|
TraditionalMemoryByte bytes[] = fRendering.getBytes(cellAddress,
|
||||||
fRendering.getBytesPerColumn());
|
fRendering.getBytesPerColumn());
|
||||||
|
|
||||||
|
boolean drawBox = false;
|
||||||
|
|
||||||
if(fRendering.getSelection().isSelected(cellAddress))
|
if(fRendering.getSelection().isSelected(cellAddress))
|
||||||
{
|
{
|
||||||
gc.setBackground(fRendering.getTraditionalRendering().getColorSelection());
|
gc.setBackground(fRendering.getTraditionalRendering().getColorSelection());
|
||||||
|
@ -269,12 +273,19 @@ public class TextPane extends AbstractPane
|
||||||
cellWidth, cellHeight);
|
cellWidth, cellHeight);
|
||||||
|
|
||||||
applyCustomColor(gc, bytes, col);
|
applyCustomColor(gc, bytes, col);
|
||||||
|
drawBox = shouldDrawBox(bytes, col);
|
||||||
}
|
}
|
||||||
|
|
||||||
gc.drawText(fRendering.formatText(bytes,
|
gc.drawText(fRendering.formatText(bytes,
|
||||||
isLittleEndian, fRendering.getTextMode()), cellWidth * col, cellHeight * i
|
isLittleEndian, fRendering.getTextMode()), cellWidth * col, cellHeight * i
|
||||||
+ fRendering.getCellPadding());
|
+ fRendering.getCellPadding());
|
||||||
|
|
||||||
|
if(drawBox)
|
||||||
|
{
|
||||||
|
gc.setForeground(fRendering.getTraditionalRendering().getColorTextAlternate());
|
||||||
|
gc.drawRectangle(cellWidth * col - (col == 0 ? 0 : 1), cellHeight * i, cellWidth - (col == 0 ? 1 : 0), cellHeight-1);
|
||||||
|
}
|
||||||
|
|
||||||
if(fRendering.isDebug())
|
if(fRendering.isDebug())
|
||||||
gc.drawRectangle(cellWidth * col, cellHeight * i
|
gc.drawRectangle(cellWidth * col, cellHeight * i
|
||||||
+ fRendering.getCellPadding(), cellWidth,
|
+ fRendering.getCellPadding(), cellWidth,
|
||||||
|
@ -300,15 +311,18 @@ public class TextPane extends AbstractPane
|
||||||
if (bytes[n].isEdited())
|
if (bytes[n].isEdited())
|
||||||
anyByteEditing = true;
|
anyByteEditing = true;
|
||||||
|
|
||||||
|
TraditionalRendering ren = fRendering.getTraditionalRendering();
|
||||||
|
|
||||||
if (isOdd(col))
|
if (isOdd(col))
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorText());
|
gc.setForeground(ren.getColorText());
|
||||||
else
|
else
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorTextAlternate());
|
gc.setForeground(ren.getColorTextAlternate());
|
||||||
gc.setBackground(fRendering.getTraditionalRendering().getColorBackground());
|
gc.setBackground(ren.getColorBackground());
|
||||||
|
|
||||||
if (anyByteEditing)
|
if (anyByteEditing)
|
||||||
{
|
{
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorEdit());
|
gc.setForeground(ren.getColorEdit());
|
||||||
|
gc.setFont(ren.getFontEdit(gc.getFont()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -321,15 +335,18 @@ public class TextPane extends AbstractPane
|
||||||
if (bytes[n].isChanged(i))
|
if (bytes[n].isChanged(i))
|
||||||
{
|
{
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
gc.setForeground(fRendering.getTraditionalRendering().getColorsChanged()[i]);
|
gc.setForeground(ren.getColorsChanged()[i]);
|
||||||
else
|
else
|
||||||
gc.setBackground(fRendering.getTraditionalRendering().getColorsChanged()[i]);
|
gc.setBackground(ren.getColorsChanged()[i]);
|
||||||
|
|
||||||
|
gc.setFont(ren.getFontChanged(gc.getFont()));
|
||||||
|
|
||||||
isColored = true;
|
isColored = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ package org.eclipse.cdt.debug.ui.memory.traditional;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.provisional.IMemoryRenderingViewportProvider;
|
import org.eclipse.cdt.debug.core.model.provisional.IMemoryRenderingViewportProvider;
|
||||||
import org.eclipse.core.commands.AbstractHandler;
|
import org.eclipse.core.commands.AbstractHandler;
|
||||||
|
@ -65,6 +67,8 @@ import org.eclipse.swt.dnd.DND;
|
||||||
import org.eclipse.swt.dnd.TextTransfer;
|
import org.eclipse.swt.dnd.TextTransfer;
|
||||||
import org.eclipse.swt.dnd.Transfer;
|
import org.eclipse.swt.dnd.Transfer;
|
||||||
import org.eclipse.swt.graphics.Color;
|
import org.eclipse.swt.graphics.Color;
|
||||||
|
import org.eclipse.swt.graphics.Font;
|
||||||
|
import org.eclipse.swt.graphics.FontData;
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
@ -240,6 +244,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
||||||
if(this.fRendering != null)
|
if(this.fRendering != null)
|
||||||
this.fRendering.dispose();
|
this.fRendering.dispose();
|
||||||
disposeColors();
|
disposeColors();
|
||||||
|
disposeFonts();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -494,6 +499,8 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
||||||
private Color colorText;
|
private Color colorText;
|
||||||
private Color colorTextAlternate;
|
private Color colorTextAlternate;
|
||||||
|
|
||||||
|
private Map<Integer,Font> fonts = new HashMap<Integer,Font>(3);
|
||||||
|
|
||||||
public void allocateColors()
|
public void allocateColors()
|
||||||
{
|
{
|
||||||
IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore();
|
IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore();
|
||||||
|
@ -558,6 +565,12 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
||||||
disposeChangedColors();
|
disposeChangedColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void disposeFonts()
|
||||||
|
{
|
||||||
|
for (Font font : fonts.values())
|
||||||
|
font.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
public void applyPreferences()
|
public void applyPreferences()
|
||||||
{
|
{
|
||||||
if(fRendering != null && !fRendering.isDisposed())
|
if(fRendering != null && !fRendering.isDisposed())
|
||||||
|
@ -578,6 +591,53 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Font makeFont(Font font, String boldKey, String italicKey)
|
||||||
|
{
|
||||||
|
IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore();
|
||||||
|
int style = SWT.NONE;
|
||||||
|
if (store.getBoolean(boldKey))
|
||||||
|
style |= SWT.BOLD;
|
||||||
|
if (store.getBoolean(italicKey))
|
||||||
|
style |= SWT.ITALIC;
|
||||||
|
|
||||||
|
if (style == SWT.NONE)
|
||||||
|
return font;
|
||||||
|
|
||||||
|
Font modified = fonts.get(style);
|
||||||
|
if (modified == null)
|
||||||
|
{
|
||||||
|
FontData fontData = font.getFontData()[0];
|
||||||
|
modified = new Font(font.getDevice(), fontData.getName(), fontData.getHeight(), fontData.getStyle() | style);
|
||||||
|
fonts.put(style, modified);
|
||||||
|
}
|
||||||
|
return modified;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Font getFontChanged(Font font)
|
||||||
|
{
|
||||||
|
return makeFont(font, TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOLD,
|
||||||
|
TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_ITALIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Font getFontEdit(Font font)
|
||||||
|
{
|
||||||
|
return makeFont(font, TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOLD,
|
||||||
|
TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_ITALIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getBoxChanged()
|
||||||
|
{
|
||||||
|
IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore();
|
||||||
|
return store.getBoolean(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOX);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getBoxEdit()
|
||||||
|
{
|
||||||
|
IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore();
|
||||||
|
return store.getBoolean(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOX);
|
||||||
|
}
|
||||||
|
|
||||||
public Color getColorBackground()
|
public Color getColorBackground()
|
||||||
{
|
{
|
||||||
IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore();
|
IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore();
|
||||||
|
|
|
@ -17,13 +17,20 @@ package org.eclipse.cdt.debug.ui.memory.traditional;
|
||||||
public class TraditionalRenderingPreferenceConstants {
|
public class TraditionalRenderingPreferenceConstants {
|
||||||
|
|
||||||
public static final String MEM_COLOR_CHANGED = "memoryColorChanged";
|
public static final String MEM_COLOR_CHANGED = "memoryColorChanged";
|
||||||
|
public static final String MEM_COLOR_CHANGED_ITALIC = "memoryColorChanged.italic";
|
||||||
|
public static final String MEM_COLOR_CHANGED_BOLD = "memoryColorChanged.bold";
|
||||||
|
public static final String MEM_COLOR_CHANGED_BOX = "memoryColorChanged.box";
|
||||||
|
|
||||||
|
public static final String MEM_COLOR_EDIT = "memoryColorEdit";
|
||||||
|
public static final String MEM_COLOR_EDIT_ITALIC = "memoryColorEdit.italic";
|
||||||
|
public static final String MEM_COLOR_EDIT_BOLD = "memoryColorEdit.bold";
|
||||||
|
public static final String MEM_COLOR_EDIT_BOX = "memoryColorEdit.box";
|
||||||
|
|
||||||
|
|
||||||
public static final String MEM_USE_GLOBAL_BACKGROUND = "memUseGlobalBackground";
|
public static final String MEM_USE_GLOBAL_BACKGROUND = "memUseGlobalBackground";
|
||||||
|
|
||||||
public static final String MEM_COLOR_BACKGROUND = "memoryColorBackground";
|
public static final String MEM_COLOR_BACKGROUND = "memoryColorBackground";
|
||||||
|
|
||||||
public static final String MEM_COLOR_EDIT = "memoryColorEdit";
|
|
||||||
|
|
||||||
public static final String MEM_COLOR_TEXT = "memoryColorText";
|
public static final String MEM_COLOR_TEXT = "memoryColorText";
|
||||||
|
|
||||||
public static final String MEM_USE_GLOBAL_SELECTION = "memUseGlobalSelection";
|
public static final String MEM_USE_GLOBAL_SELECTION = "memUseGlobalSelection";
|
||||||
|
|
|
@ -38,6 +38,14 @@ public class TraditionalRenderingPreferenceInitializer extends AbstractPreferenc
|
||||||
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_USE_GLOBAL_SELECTION, true);
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_USE_GLOBAL_SELECTION, true);
|
||||||
|
|
||||||
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED, "255,0,0");
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED, "255,0,0");
|
||||||
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_ITALIC, false);
|
||||||
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOLD, false);
|
||||||
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOX, true);
|
||||||
|
|
||||||
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT, "0,255,0");
|
||||||
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_ITALIC, true);
|
||||||
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOLD, false);
|
||||||
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOX, true);
|
||||||
|
|
||||||
Color systemSelection = Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION);
|
Color systemSelection = Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION);
|
||||||
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_SELECTION, systemSelection.getRed()
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_SELECTION, systemSelection.getRed()
|
||||||
|
@ -45,8 +53,6 @@ public class TraditionalRenderingPreferenceInitializer extends AbstractPreferenc
|
||||||
|
|
||||||
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_LIGHTEN_DARKEN_ALTERNATE_CELLS, "5");
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_LIGHTEN_DARKEN_ALTERNATE_CELLS, "5");
|
||||||
|
|
||||||
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT, "0,255,0");
|
|
||||||
|
|
||||||
Color systemText = Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
|
Color systemText = Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
|
||||||
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_TEXT, systemText.getRed()
|
store.setDefault(TraditionalRenderingPreferenceConstants.MEM_COLOR_TEXT, systemText.getRed()
|
||||||
+ "," + systemText.getGreen() + "," + systemText.getBlue());
|
+ "," + systemText.getGreen() + "," + systemText.getBlue());
|
||||||
|
|
|
@ -77,11 +77,19 @@ public class TraditionalRenderingPreferencePage
|
||||||
addField(new ColorFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_BACKGROUND,
|
addField(new ColorFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_BACKGROUND,
|
||||||
TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_BackgroundColor"), getFieldEditorParent())); //$NON-NLS-1$
|
TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_BackgroundColor"), getFieldEditorParent())); //$NON-NLS-1$
|
||||||
|
|
||||||
addField(new ColorFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED,
|
addField(new ColorAndEffectFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED,
|
||||||
TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_ChangedColor"), getFieldEditorParent())); //$NON-NLS-1$
|
TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOLD,
|
||||||
|
TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_ITALIC,
|
||||||
|
TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOX,
|
||||||
|
TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_ChangedColor"), //$NON-NLS-1$
|
||||||
|
getFieldEditorParent()));
|
||||||
|
|
||||||
addField(new ColorFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT,
|
addField(new ColorAndEffectFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT,
|
||||||
TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_EditColor"), getFieldEditorParent())); //$NON-NLS-1$
|
TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOLD,
|
||||||
|
TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_ITALIC,
|
||||||
|
TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOX,
|
||||||
|
TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_EditColor"), //$NON-NLS-1$
|
||||||
|
getFieldEditorParent()));
|
||||||
|
|
||||||
addField(new BooleanFieldEditor(TraditionalRenderingPreferenceConstants.MEM_USE_GLOBAL_SELECTION,
|
addField(new BooleanFieldEditor(TraditionalRenderingPreferenceConstants.MEM_USE_GLOBAL_SELECTION,
|
||||||
TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_UseGlobalSelectionColor"), getFieldEditorParent())); //$NON-NLS-1$
|
TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_UseGlobalSelectionColor"), getFieldEditorParent())); //$NON-NLS-1$
|
||||||
|
|
|
@ -83,3 +83,6 @@ TraditionalRenderingPreferencePage_TextColor=&Text Color:
|
||||||
TraditionalRenderingPreferencePage_UseGlobalBackgroundColor=Use Global B&ackground Color
|
TraditionalRenderingPreferencePage_UseGlobalBackgroundColor=Use Global B&ackground Color
|
||||||
TraditionalRenderingPreferencePage_UseGlobalSelectionColor=Use Global Se&lection Color
|
TraditionalRenderingPreferencePage_UseGlobalSelectionColor=Use Global Se&lection Color
|
||||||
TraditionalRenderingPreferencePage_UseGlobalTextColor=Use Global Te&xt Color
|
TraditionalRenderingPreferencePage_UseGlobalTextColor=Use Global Te&xt Color
|
||||||
|
ColorAndEffectFieldEditor.bold=Bold
|
||||||
|
ColorAndEffectFieldEditor.italic=Italic
|
||||||
|
ColorAndEffectFieldEditor.box=Box
|
||||||
|
|
Loading…
Add table
Reference in a new issue