@Override
public void updateLineNumberRuler(boolean showLineNumber)
{
- if (fSrcViewers[mode] !=null) {
+ if ((fSrcViewers[mode] !=null) && modeWithLineNumberRuler(mode)) {
if (lineNumberColumnOn != showLineNumber) {
if(!showLineNumber){
if(fLineNumberColumns[mode] != null){
for (int i=0; i < NUMBER_OF_MODES; i++) {
- if (fSrcViewers[i] !=null) {
+ if ((fSrcViewers[i] !=null) && modeWithLineNumberRuler(i)) {
fVerticalRulers[i].removeDecorator(fLineNumberColumns[i]);
}
}
} else {
if(fLineNumberColumns[mode] == null){
for (int i=0; i < NUMBER_OF_MODES; i++) {
- if (fSrcViewers[i] !=null) {
+ if ((fSrcViewers[i] !=null) && modeWithLineNumberRuler(i)) {
fLineNumberColumns[i] = new LineNumberRulerColumn();
}
}
updateLineNumberColumnPresentation(false);
}
for (int i=0; i < NUMBER_OF_MODES; i++) {
- if (fSrcViewers[i] !=null) {
+ if ((fSrcViewers[i] !=null) && modeWithLineNumberRuler(i)) {
fVerticalRulers[i].addDecorator(0, fLineNumberColumns[i]);
}
}
}
}
+ private boolean modeWithLineNumberRuler(int mode) {
+ boolean returnValue = false;
+ switch (mode) {
+ case MODE_JS_DECLARATION_HTML:
+ returnValue = true;
+ break;
+ case MODE_CSS_DECLARATION:
+ returnValue = false;
+ break;
+ case MODE_IMAGE_VIEW:
+ returnValue = false;
+ break;
+ case MODE_JS_FILE_VIEW:
+ returnValue = true;
+ break;
+ case MODE_CSS_FILE_VIEW:
+ returnValue = true;
+ break;
+ case MODE_HTML_FILE_VIEW:
+ returnValue = true;
+ break;
+ case MODE_INVALID_CASE:
+ returnValue = false;
+ break;
+ default:
+ break;
+ }
+ return returnValue;
+ }
private void updateLineNumberColumnPresentation(boolean refresh) {
if (fLineNumberColumns[mode] == null) {
return;
ISharedTextColors sharedColors= getSharedColors();
for (int i=0; i < NUMBER_OF_MODES; i++) {
- if (fSrcViewers[i] !=null) {
+ if ((fSrcViewers[i] !=null) && (fLineNumberColumns[i] != null)) {
fLineNumberColumns[i].setForeground(sharedColors.getColor(rgb));
if (refresh) {
fLineNumberColumns[i].redraw();