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 77315 Details for
Bug 190851
Allow to customize fonts and colors for all messages views
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
initial patch
patch.txt (text/plain), 6.18 KB, created by
Jacek Pospychala
on 2007-08-29 18:05:47 EDT
(
hide
)
Description:
initial patch
Filename:
MIME Type:
Creator:
Jacek Pospychala
Created:
2007-08-29 18:05:47 EDT
Size:
6.18 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ecf.presence.ui >Index: src/org/eclipse/ecf/presence/ui/chatroom/MessageRenderer.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/MessageRenderer.java,v >retrieving revision 1.2 >diff -u -r1.2 MessageRenderer.java >--- src/org/eclipse/ecf/presence/ui/chatroom/MessageRenderer.java 30 Jul 2007 20:56:48 -0000 1.2 >+++ src/org/eclipse/ecf/presence/ui/chatroom/MessageRenderer.java 29 Aug 2007 22:05:35 -0000 >@@ -22,6 +22,8 @@ > import org.eclipse.swt.custom.StyleRange; > import org.eclipse.swt.graphics.Color; > import org.eclipse.swt.widgets.Display; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.themes.ITheme; > > /** > * Default implementation of {@link IMessageRenderer}. >@@ -38,16 +40,16 @@ > > private List styleRanges = new ArrayList(); > >- protected static final String DEFAULT_ME_COLOR = "0,255,0"; //$NON-NLS-1$ >- protected static final String DEFAULT_OTHER_COLOR = "0,0,0"; //$NON-NLS-1$ >- protected static final String DEFAULT_SYSTEM_COLOR = "0,0,255"; //$NON-NLS-1$ >+ protected static final String DEFAULT_ME_COLOR = "org.eclipse.ecf.presence.meColor"; //$NON-NLS-1$ >+ protected static final String DEFAULT_OTHER_COLOR = "org.eclipse.ecf.presence.otherColor"; //$NON-NLS-1$ >+ protected static final String DEFAULT_SYSTEM_COLOR = "org.eclipse.ecf.presence.systemColor"; //$NON-NLS-1$ > > /** > * The default color used to highlight the string of text when the user's > * name is referred to in the chatroom. The default color is red. > */ >- protected static final String DEFAULT_HIGHLIGHT_COLOR = "255,0,0"; //$NON-NLS-1$ >- protected static final String DEFAULT_DATE_COLOR = "0,0,0"; //$NON-NLS-1$ >+ protected static final String DEFAULT_HIGHLIGHT_COLOR = "org.eclipse.ecf.presence.highlightColor"; //$NON-NLS-1$ >+ protected static final String DEFAULT_DATE_COLOR = "org.eclipse.ecf.presence.dateColor"; //$NON-NLS-1$ > > protected static final String DEFAULT_TIME_FORMAT = Messages.MessageRenderer_DEFAULT_TIME_FORMAT; > >@@ -58,10 +60,10 @@ > protected String originator; > > public MessageRenderer() { >- otherColor = colorFromRGBString(DEFAULT_OTHER_COLOR); >- systemColor = colorFromRGBString(DEFAULT_SYSTEM_COLOR); >- highlightColor = colorFromRGBString(DEFAULT_HIGHLIGHT_COLOR); >- dateColor = colorFromRGBString(DEFAULT_DATE_COLOR); >+ otherColor = getColor(DEFAULT_OTHER_COLOR); >+ systemColor = getColor(DEFAULT_SYSTEM_COLOR); >+ highlightColor = getColor(DEFAULT_HIGHLIGHT_COLOR); >+ dateColor = getColor(DEFAULT_DATE_COLOR); > } > > public StyleRange[] getStyleRanges() { >@@ -145,19 +147,14 @@ > styleRanges.add(styleRange); > } > >- private Color colorFromRGBString(String rgb) { >- Color color = null; >- if (rgb == null || rgb.equals("")) { //$NON-NLS-1$ >- color = new Color(Display.getCurrent(), 0, 0, 0); >- return color; >- } >- if (color != null) { >- color.dispose(); >- } >- String[] vals = rgb.split(","); //$NON-NLS-1$ >- color = new Color(Display.getCurrent(), Integer >- .parseInt(vals[0]), Integer.parseInt(vals[1]), Integer >- .parseInt(vals[2])); >+ private Color getColor(String name) { >+ ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(); >+ Color color = theme.getColorRegistry().get(name); >+ >+ if (color == null) { >+ return Display.getCurrent().getSystemColor(SWT.COLOR_BLACK); >+ } >+ > return color; > } > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.ecf/plugins/org.eclipse.ecf.presence.ui/plugin.xml,v >retrieving revision 1.21 >diff -u -r1.21 plugin.xml >--- plugin.xml 28 Jul 2007 04:51:23 -0000 1.21 >+++ plugin.xml 29 Aug 2007 22:05:34 -0000 >@@ -180,5 +180,60 @@ > class="org.eclipse.ecf.internal.presence.ui.preferences.PreferenceInitializer"> > </initializer> > </extension> >+ <extension >+ point="org.eclipse.ui.themes"> >+ <colorDefinition >+ categoryId="org.eclipse.ecf.presence.ui.themeElementCategory" >+ id="org.eclipse.ecf.presence.dateColor" >+ label="Date color" >+ value="0,0,0"> >+ <description> >+ Color of the date stamp in message window. >+ </description> >+ </colorDefinition> >+ <themeElementCategory >+ id="org.eclipse.ecf.presence.ui.themeElementCategory" >+ label="Messages and Chats"> >+ <description> >+ Appearance details of ECF message and chat windows. >+ </description> >+ </themeElementCategory> >+ <colorDefinition >+ categoryId="org.eclipse.ecf.presence.ui.themeElementCategory" >+ id="org.eclipse.ecf.presence.highlightColor" >+ label="Highlight color" >+ value="255,0,0"> >+ <description> >+ The default color used to highlight the string of text when the user's name is referred to in the chatroom. The default color is red. >+ </description> >+ </colorDefinition> >+ <colorDefinition >+ categoryId="org.eclipse.ecf.presence.ui.themeElementCategory" >+ id="org.eclipse.ecf.presence.systemColor" >+ label="System color" >+ value="0,0,255"> >+ <description> >+ Color of messages sent by the system, eg. a server. >+ </description> >+ </colorDefinition> >+ <colorDefinition >+ categoryId="org.eclipse.ecf.presence.ui.themeElementCategory" >+ id="org.eclipse.ecf.presence.otherColor" >+ label="Other color" >+ value="0,0,0"> >+ <description> >+ Color used for other kinds of messages. >+ </description> >+ </colorDefinition> >+ <colorDefinition >+ categoryId="org.eclipse.ecf.presence.ui.themeElementCategory" >+ id="org.eclipse.ecf.presence.meColor" >+ label="Me color" >+ value="0,255,0"> >+ <description> >+ Color used for messages sent by local user. >+ </description> >+ </colorDefinition> >+ </extension> > > </plugin>
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 190851
:
77315
|
77478
|
77530