Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 110525 Details for
Bug 219312
SQL Editor white on black: Impossible reed text.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated patch
patch_219312.txt (text/plain), 14.50 KB, created by
Ren Junyan
on 2008-08-21 01:28:30 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Ren Junyan
Created:
2008-08-21 01:28:30 EDT
Size:
14.50 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.datatools.sqltools.sqleditor >Index: src/org/eclipse/datatools/sqltools/sqleditor/preferences/SyntaxColoringPage.java >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.sqltools/plugins/org.eclipse.datatools.sqltools.sqleditor/src/org/eclipse/datatools/sqltools/sqleditor/preferences/SyntaxColoringPage.java,v >retrieving revision 1.3 >diff -u -r1.3 SyntaxColoringPage.java >--- src/org/eclipse/datatools/sqltools/sqleditor/preferences/SyntaxColoringPage.java 22 Jul 2008 08:13:06 -0000 1.3 >+++ src/org/eclipse/datatools/sqltools/sqleditor/preferences/SyntaxColoringPage.java 21 Aug 2008 05:10:39 -0000 >@@ -41,18 +41,21 @@ > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.graphics.Color; > import org.eclipse.swt.graphics.RGB; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Label; > import org.eclipse.swt.widgets.List; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.IWorkbenchPreferencePage; > import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.texteditor.AbstractTextEditor; > > /** > * The preference page for configurating color and style of syntax. >@@ -66,6 +69,7 @@ > private Button _italicFont = null; > private Button _strikethroughFont = null; > private Button _underlineFont = null; >+ private Button _systemDefault = null; > private ColorSelector _colorSelector; > private SQLSourceViewer _sourceViewer; > >@@ -82,14 +86,14 @@ > } > > private void initialPage() { >- _defaultSyntaxItems.put(SQLColorProvider.SQL_COMMENT, new SyntaxItem(false, false, false, false, new RGB(64, 128, 128))); >- _defaultSyntaxItems.put(SQLColorProvider.SQL_MULTILINE_COMMENT, new SyntaxItem(false, false, false, false, new RGB(64, 128, 128))); >- _defaultSyntaxItems.put(SQLColorProvider.SQL_QUOTED_LITERAL, new SyntaxItem(false, false, false, false, new RGB(0, 0, 255))); >- _defaultSyntaxItems.put(SQLColorProvider.SQL_DELIMITED_IDENTIFIER, new SyntaxItem(false, false, false, false, new RGB(0, 128, 0))); >- _defaultSyntaxItems.put(SQLColorProvider.SQL_KEYWORD, new SyntaxItem(true, false, false, false, new RGB(127, 0, 85))); >- _defaultSyntaxItems.put(SQLColorProvider.SQL_TYPE, new SyntaxItem(true, false, false, false, new RGB(64, 0, 200))); >- _defaultSyntaxItems.put(SQLColorProvider.SQL_IDENTIFIER, new SyntaxItem(false, false, false, false, new RGB(0, 0, 128))); >- _defaultSyntaxItems.put(SQLColorProvider.SQL_DEFAULT, new SyntaxItem(false, false, false, false, new RGB(0, 0, 0))); >+ _defaultSyntaxItems.put(SQLColorProvider.SQL_COMMENT, new SyntaxItem(false, false, false, false, false, new RGB(64, 128, 128))); >+ _defaultSyntaxItems.put(SQLColorProvider.SQL_MULTILINE_COMMENT, new SyntaxItem(false, false, false, false, false, new RGB(64, 128, 128))); >+ _defaultSyntaxItems.put(SQLColorProvider.SQL_QUOTED_LITERAL, new SyntaxItem(false, false, false, false, false, new RGB(0, 0, 255))); >+ _defaultSyntaxItems.put(SQLColorProvider.SQL_DELIMITED_IDENTIFIER, new SyntaxItem(false, false, false, false, false, new RGB(0, 128, 0))); >+ _defaultSyntaxItems.put(SQLColorProvider.SQL_KEYWORD, new SyntaxItem(true, false, false, false, false, new RGB(127, 0, 85))); >+ _defaultSyntaxItems.put(SQLColorProvider.SQL_TYPE, new SyntaxItem(true, false, false, false, false, new RGB(64, 0, 200))); >+ _defaultSyntaxItems.put(SQLColorProvider.SQL_IDENTIFIER, new SyntaxItem(false, false, false, false, false, new RGB(0, 0, 128))); >+ _defaultSyntaxItems.put(SQLColorProvider.SQL_DEFAULT, new SyntaxItem(false, false, false, false, true, getForeGroundColor())); > } > > /* >@@ -155,6 +159,13 @@ > > public void widgetSelected(SelectionEvent e) { > if (_syntaxList.getSelection()[0] != null) { >+ if (_syntaxList.getSelection()[0].equals(SQLColorProvider.SQL_DEFAULT)) { >+ _systemDefault.setVisible(true); >+ } else { >+ _systemDefault.setVisible(false); >+ _systemDefault.setSelection(false); >+ _colorSelector.setEnabled(true); >+ } > refreshStyleComposite(((SyntaxItem) _syntaxList.getData(_syntaxList.getSelection()[0]))); > } > } >@@ -170,7 +181,7 @@ > comp.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); > > Composite compColorControl = new Composite(comp, SWT.NULL); >- GridLayout colorLayout = new GridLayout(2, false); >+ GridLayout colorLayout = new GridLayout(3, false); > colorLayout.marginHeight = 0; > colorLayout.marginWidth = 0; > compColorControl.setLayout(colorLayout); >@@ -185,6 +196,11 @@ > } > }); > >+ _systemDefault = new Button(compColorControl, SWT.CHECK); >+ _systemDefault.setText(PreferenceMessages.SyntaxColoringPage_default_foreground_color); >+ _systemDefault.addSelectionListener(new stylesListener()); >+ _systemDefault.setVisible(false); >+ > _boldFont = new Button(comp, SWT.CHECK); > _boldFont.setText(PreferenceMessages.SyntaxColoringPage_bold); > _boldFont.addSelectionListener(new stylesListener()); >@@ -226,6 +242,7 @@ > extension3.setDocumentPartitioner(SQLPartitionScanner.SQL_PARTITIONING, partitioner); > } > _sourceViewer.setDocument(document); >+ _sourceViewer.getTextWidget().setBackground(new Color(Display.getCurrent(), getBackGroundColor())); > } > > /* >@@ -243,7 +260,7 @@ > > if (getPreferenceStore().getString(syntaxItemName) == null || getPreferenceStore().getString(syntaxItemName).equals("")) { > // use default values >- _syntaxList.setData(syntaxItemName, _defaultSyntaxItems.get(syntaxItemName)); >+ _syntaxList.setData(syntaxItemName, new SyntaxItem(_defaultSyntaxItems.get(syntaxItemName).toString())); > } else { > // use values saved before > _syntaxList.setData(syntaxItemName, new SyntaxItem(getPreferenceStore().getString(syntaxItemName))); >@@ -262,7 +279,7 @@ > */ > private void getInitialValue() { > if (_syntaxList.getSelection()[0] != null) { >- _syntaxList.setData(_syntaxList.getSelection()[0], _defaultSyntaxItems.get(_syntaxList.getSelection()[0])); >+ _syntaxList.setData(_syntaxList.getSelection()[0], new SyntaxItem(_defaultSyntaxItems.get(_syntaxList.getSelection()[0]).toString())); > refreshStyleComposite((SyntaxItem) _defaultSyntaxItems.get(_syntaxList.getSelection()[0])); > } > } >@@ -323,6 +340,8 @@ > _italicFont.setSelection(syntax.isItalic()); > _strikethroughFont.setSelection(syntax.isStrikethrough()); > _underlineFont.setSelection(syntax.isUnderline()); >+ _systemDefault.setSelection(syntax.isSystemDefault()); >+ _systemDefault.notifyListeners(SWT.Selection, new Event()); > } > > /** >@@ -337,6 +356,46 @@ > } > > /** >+ * Get foreground color >+ * @return foreground color >+ */ >+ private RGB getForeGroundColor() >+ { >+ String rgb[] = new String[]{"0","0","0"}; >+ try { >+ if (!org.eclipse.ui.internal.editors.text.EditorsPlugin.getDefault().getPreferenceStore().getString(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT).equalsIgnoreCase("true")) { >+ String foreGroundColor = org.eclipse.ui.internal.editors.text.EditorsPlugin.getDefault().getPreferenceStore().getString(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND); >+ if (foreGroundColor != null && !foreGroundColor.equals("")) { >+ rgb = foreGroundColor.split(","); >+ } >+ } >+ } catch (Throwable ex) { >+ // do nothing, keep using default value >+ } >+ return new RGB(Integer.parseInt(rgb[0]),Integer.parseInt(rgb[1]),Integer.parseInt(rgb[2])); >+ } >+ >+ /** >+ * Get background color >+ * @return background color >+ */ >+ private RGB getBackGroundColor() >+ { >+ String rgb[] = new String[] { "255", "255", "255" }; >+ try { >+ if (!org.eclipse.ui.internal.editors.text.EditorsPlugin.getDefault().getPreferenceStore().getString(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT).equalsIgnoreCase("true")) { >+ String backGroundColor = org.eclipse.ui.internal.editors.text.EditorsPlugin.getDefault().getPreferenceStore().getString(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND); >+ if (backGroundColor != null && !backGroundColor.equals("")) { >+ rgb = backGroundColor.split(","); >+ } >+ } >+ } catch (Throwable ex) { >+ // do nothing, keep using default value >+ } >+ return new RGB(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2])); >+ } >+ >+ /** > * Handle selection event of all check boxes > */ > class stylesListener implements SelectionListener { >@@ -348,6 +407,13 @@ > ((SyntaxItem) _syntaxList.getData(_syntaxList.getSelection()[0])).setItalicKey(_italicFont.getSelection()); > ((SyntaxItem) _syntaxList.getData(_syntaxList.getSelection()[0])).setStrikethroughKey(_strikethroughFont.getSelection()); > ((SyntaxItem) _syntaxList.getData(_syntaxList.getSelection()[0])).setUnderlineKey(_underlineFont.getSelection()); >+ ((SyntaxItem) _syntaxList.getData(_syntaxList.getSelection()[0])).setSystemDefault(_systemDefault.getSelection()); >+ if (_systemDefault.isVisible() && _systemDefault.getSelection()) { >+ ((SyntaxItem) _syntaxList.getData(_syntaxList.getSelection()[0])).setColor(((SyntaxItem)_defaultSyntaxItems.get(SQLColorProvider.SQL_DEFAULT)).getColor()); >+ } else { >+ ((SyntaxItem) _syntaxList.getData(_syntaxList.getSelection()[0])).setColor(_colorSelector.getColorValue()); >+ } >+ _colorSelector.setEnabled(!_systemDefault.getSelection()); > updatePreviewer(); > } > } >Index: src/org/eclipse/datatools/sqltools/sqleditor/preferences/PreferenceMessages.properties >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.sqltools/plugins/org.eclipse.datatools.sqltools.sqleditor/src/org/eclipse/datatools/sqltools/sqleditor/preferences/PreferenceMessages.properties,v >retrieving revision 1.6 >diff -u -r1.6 PreferenceMessages.properties >--- src/org/eclipse/datatools/sqltools/sqleditor/preferences/PreferenceMessages.properties 22 Mar 2008 13:04:01 -0000 1.6 >+++ src/org/eclipse/datatools/sqltools/sqleditor/preferences/PreferenceMessages.properties 21 Aug 2008 05:10:38 -0000 >@@ -82,3 +82,4 @@ > SyntaxColoringPage_underline=&Underline > SyntaxColoringPage_preview=Previe&w: > SyntaxColoringPage_syntax_items=S&yntax items: >+SyntaxColoringPage_default_foreground_color=Default &foreground color >Index: src/org/eclipse/datatools/sqltools/sqleditor/preferences/PreferenceMessages.java >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.sqltools/plugins/org.eclipse.datatools.sqltools.sqleditor/src/org/eclipse/datatools/sqltools/sqleditor/preferences/PreferenceMessages.java,v >retrieving revision 1.4 >diff -u -r1.4 PreferenceMessages.java >--- src/org/eclipse/datatools/sqltools/sqleditor/preferences/PreferenceMessages.java 22 Mar 2008 13:04:01 -0000 1.4 >+++ src/org/eclipse/datatools/sqltools/sqleditor/preferences/PreferenceMessages.java 21 Aug 2008 05:10:38 -0000 >@@ -83,6 +83,7 @@ > public static String SyntaxColoringPage_underline; > public static String SyntaxColoringPage_preview; > public static String SyntaxColoringPage_syntax_items; >+ public static String SyntaxColoringPage_default_foreground_color; > > static > { >Index: src/org/eclipse/datatools/sqltools/sqleditor/preferences/SyntaxItem.java >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.sqltools/plugins/org.eclipse.datatools.sqltools.sqleditor/src/org/eclipse/datatools/sqltools/sqleditor/preferences/SyntaxItem.java,v >retrieving revision 1.2 >diff -u -r1.2 SyntaxItem.java >--- src/org/eclipse/datatools/sqltools/sqleditor/preferences/SyntaxItem.java 21 Apr 2008 15:21:24 -0000 1.2 >+++ src/org/eclipse/datatools/sqltools/sqleditor/preferences/SyntaxItem.java 21 Aug 2008 05:10:40 -0000 >@@ -21,12 +21,13 @@ > * @author renj > */ > public class SyntaxItem { >- private Pattern pattern = Pattern.compile("(\\d)\\,(\\d)\\,(\\d)\\,(\\d)\\,(\\d{1,3})\\,(\\d{1,3})\\,(\\d{1,3})"); >+ private Pattern pattern = Pattern.compile("(\\d)\\,(\\d)\\,(\\d)\\,(\\d)\\,(\\d)\\,(\\d{1,3})\\,(\\d{1,3})\\,(\\d{1,3})"); > > private Boolean _boldKey = Boolean.FALSE; > private Boolean _italicKey = Boolean.FALSE; > private Boolean _strikethroughKey = Boolean.FALSE; > private Boolean _underlineKey = Boolean.FALSE; >+ private Boolean _systemDefault = Boolean.FALSE; > private RGB _color = new RGB(0, 0, 0); > > public SyntaxItem(String preferenceCodes) { >@@ -37,16 +38,18 @@ > _italicKey = Boolean.valueOf(m.group(2).equals("1") ? true : false); > _strikethroughKey = Boolean.valueOf(m.group(3).equals("1") ? true : false); > _underlineKey = Boolean.valueOf(m.group(4).equals("1") ? true : false); >- _color = new RGB(Integer.parseInt(m.group(5)), Integer.parseInt(m.group(6)), Integer.parseInt(m.group(7))); >+ _systemDefault = Boolean.valueOf(m.group(5).equals("1") ? true : false); >+ _color = new RGB(Integer.parseInt(m.group(6)), Integer.parseInt(m.group(7)), Integer.parseInt(m.group(8))); > } > } > } > >- public SyntaxItem(boolean bk, boolean ik, boolean sk, boolean uk, RGB rgb) { >+ public SyntaxItem(boolean bk, boolean ik, boolean sk, boolean uk, boolean sys, RGB rgb) { > _boldKey = Boolean.valueOf(bk); > _italicKey = Boolean.valueOf(ik); > _strikethroughKey = Boolean.valueOf(sk); > _underlineKey = Boolean.valueOf(uk); >+ _systemDefault = Boolean.valueOf(sys); > _color = rgb; > } > >@@ -66,6 +69,10 @@ > _underlineKey = Boolean.valueOf(uk); > } > >+ public void setSystemDefault(boolean sys) { >+ _systemDefault = Boolean.valueOf(sys); >+ } >+ > public void setColor(RGB rgb) { > _color = rgb; > } >@@ -86,13 +93,17 @@ > return _underlineKey.booleanValue(); > } > >+ public boolean isSystemDefault() { >+ return _systemDefault.booleanValue(); >+ } >+ > public RGB getColor() { > return _color; > } > > public String toString() { > String preferenceCodes = (_boldKey.booleanValue() ? "1" : "0") + "," + (_italicKey.booleanValue() ? "1" : "0") + "," + (_strikethroughKey.booleanValue() ? "1" : "0") + "," >- + (_underlineKey.booleanValue() ? "1" : "0") + "," + _color.red + "," + _color.green + "," + _color.blue; >+ + (_underlineKey.booleanValue() ? "1" : "0") + "," + (_systemDefault.booleanValue() ? "1" : "0") + "," + _color.red + "," + _color.green + "," + _color.blue; > return preferenceCodes; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 219312
:
110082
| 110525