Method: initializeViewerColors(ISourceViewer)

1: /*
2: * #%~
3: * org.overture.ide.ui
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.ide.ui.editor.core;
23:
24: import org.eclipse.jface.text.source.ISourceViewer;
25: import org.eclipse.swt.custom.StyledText;
26: import org.eclipse.swt.graphics.Color;
27: import org.eclipse.swt.graphics.RGB;
28:
29: public abstract class VdmExternalEditor extends VdmEditor
30: {
31:
32:         public VdmExternalEditor()
33:         {
34:                 super();
35:                 setDocumentProvider(new VdmExternalDocumentProvider());
36:         }
37:
38:         @Override
39:         public boolean isEditable()
40:         {
41:                 return false;
42:         }
43:         
44:         @Override
45:         protected void initializeViewerColors(ISourceViewer viewer)
46:         {
47:                 super.initializeViewerColors(viewer);
48:                 StyledText styledText= viewer.getTextWidget();
49:                 Color color= new Color(styledText.getDisplay(), new RGB(245, 245, 245));
50:                 styledText.setBackground(color);
51:         }
52:         
53:         //FIXME
54: //        @Override
55: //        public SourceReferenceManager getSourceReferenceManager()
56: //        {
57: //                if(this.sourceReferenceManager == null)
58: //                {
59: //                        IVdmElement inputElement = getInputVdmElement();
60: //                        if (inputElement instanceof IVdmSourceUnit) {
61: //                                this.sourceReferenceManager = new ExternalSourceReferenceManager(
62: //                                (IVdmSourceUnit) inputElement);
63: //                        }
64: //                }
65: //                return this.sourceReferenceManager;
66: //        }
67: }