|
|
|
|
|
|
Re: Gen. Editor: Change Font Color [message #695376 is a reply to message #695196] |
Mon, 11 July 2011 15:51 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Sylvain,
No, I don't believe a tree widget supports that nor do the Eclipse APIs
provide such control.
On 11/07/2011 1:55 AM, S wrote:
> Thank you Ed,
> Thank you Sylvain,
>
> The missing ColerProvider caused the Problem.
> But for now, the hole String is colored. Is there a way to use
> multiple colors?
> In case of "System Component Aircraft", the name of the element
> "System Component" should has an other color as the value "Aircraft".
>
> Ed Merks wrote on Fri, 08 July 2011 12:23
>> The registration is important for registered lookup, but if the right
>> one is explicitly created (as in the generated editor) you won't
>> notice the registration missing. It is important to use
>> AdapterFactoryLabelProvider.ColorProvider for colors to be supported
>> so that's likely the cause of the problem.
>>
>> On 08/07/2011 6:16 AM, Sylvain EVEILLARD wrote:
>> > You have to change your plugin.xml to add the IItemColorProvider in
>> > the supported interfaces.
>> > It is only generated once and not changed afterwards.
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Gen. Editor: Change Font Color [message #893042 is a reply to message #694459] |
Mon, 02 July 2012 12:17 |
Markus G Messages: 23 Registered: June 2012 |
Junior Member |
|
|
Hi,
sorry I am reopening this thread, but I wanted to do the same thing and I'm having some trouble doing so, so I will just write in here.
I also want to use different fonts and followed the steps in here. The colors appear fine in the outline view, but not in my editors. I don't exactly understand what you, Ed, meant by "using AdapterFactoryLabelProvider.ColorProvider for colors".
That means I need a ColorProvider in my editor class, correct?
What I tried is creating a ColorProvider in the editor class and calling setForeground on it in the getContentOutlinePage() of my editor on the current viewer. That is also being called fine, but the colors again only appear in the outline.
I think that my problem is only that I don't understand how I am supposed to use the ColorProvider correctly. Maybe you could just quickly tell me how that works?
Thanks a lot!
Markus
[Updated on: Mon, 02 July 2012 12:18] Report message to a moderator
|
|
|
|
|
|
Re: Gen. Editor: Change Font Color [message #893529 is a reply to message #893518] |
Wed, 04 July 2012 13:05 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Markus,<br>
<br>
I see this in the Javadoc for AbstractListViewer so I'd say no, it
doesn't support that.<br>
<br>
<style type="text/css" charset="ISO-8859-1">/* Font definitions */
html { font-family: 'Segoe UI',sans-serif; font-size: 9pt; font-style: normal; font-weight: normal; }
body, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt { font-size: 1em; }
pre { font-family: monospace; }
h1 { font-size: 1.8em; }
h2 { font-size: 1.2em; }
h3 { font-size: 1.1em; }
/* Margins */
body { overflow: auto; margin-top: 5px; margin-bottom: 4px; margin-left: 8px; margin-right: 4px; }
h1 { margin-top: 0.3em; margin-bottom: 0.04em; }
h2 { margin-top: 2em; margin-bottom: 0.25em; }
h3 { margin-top: 1.7em; margin-bottom: 0.25em; }
h4 { margin-top: 2em; margin-bottom: 0.3em; }
h5 { margin-top: 0px; margin-bottom: 0px; }
p { margin-top: 1em; margin-bottom: 1em; }
pre { margin-left: 0.6em; }
ul { margin-top: 0px; margin-bottom: 1em; margin-left: 1em; padding-left: 1em; }
li { margin-top: 0px; margin-bottom: 0px; }
li p { margin-top: 0px; margin-bottom: 0px; }
ol { margin-top: 0px; margin-bottom: 1em; margin-left: 1em; padding-left: 1em; }
dl { margin-top: 0px; margin-bottom: 1em; }
dt { margin-top: 0px; margin-bottom: 0px; font-weight: bold; }
dd { margin-top: 0px; margin-bottom: 0px; }
/* Styles and colors */
a:link { color: #0000FF; }
a:hover { color: #000080; }
a:visited { text-decoration: underline; }
a.header:link { text-decoration: none; color: #000000 }
a.header:visited { text-decoration: none; color: #000000 }
a.header:hover { text-decoration: underline; color: #000080; }
h4 { font-style: italic; }
strong { font-weight: bold; }
em { font-style: italic; }
var { font-style: italic; }
th { font-weight: bold; }
</style><br>
<p>The list viewer implementation of this <code>Viewer</code>
framework method ensures that the given label provider is an
instance of <code>ILabelProvider</code>. <b>The optional
interfaces <code><a
href="eclipse-javadoc:%E2%98%82=org.eclipse.emf.cheatsheets/D:%5C/sandbox%5C/4.2RC1%5C/eclipse%5C/plugins%5C/org.eclipse.jface_3.8.0.v20120429-1603.jar%3Corg.eclipse.jface.viewers%28AbstractListViewer.class%E2%98%83AbstractListViewer%7EsetLabelProvider%7ELorg.eclipse.jface.viewers.IBaseLabelProvider;%E2%98%82IColorProvider">IColorProvider</a></code>
and <code><a
href="eclipse-javadoc:%E2%98%82=org.eclipse.emf.cheatsheets/D:%5C/sandbox%5C/4.2RC1%5C/eclipse%5C/plugins%5C/org.eclipse.jface_3.8.0.v20120429-1603.jar%3Corg.eclipse.jface.viewers%28AbstractListViewer.class%E2%98%83AbstractListViewer%7EsetLabelProvider%7ELorg.eclipse.jface.viewers.IBaseLabelProvider;%E2%98%82IFontProvider">IFontProvider</a></code>
have no effect for this type of viewer</b>
</p>
<div><b>Overrides:</b> <a
href="eclipse-javadoc:%E2%98%82=org.eclipse.emf.cheatsheets/D:%5C/sandbox%5C/4.2RC1%5C/eclipse%5C/plugins%5C/org.eclipse.jface_3.8.0.v20120429-1603.jar%3Corg.eclipse.jface.viewers%28StructuredViewer.class%E2%98%83StructuredViewer%7EsetLabelProvider%7ELorg.eclipse.jface.viewers.IBaseLabelProvider;">setLabelProvider(...)</a>
in <a
href="eclipse-javadoc:%E2%98%82=org.eclipse.emf.cheatsheets/D:%5C/sandbox%5C/4.2RC1%5C/eclipse%5C/plugins%5C/org.eclipse.jface_3.8.0.v20120429-1603.jar%3Corg.eclipse.jface.viewers%28StructuredViewer.class%E2%98%83StructuredViewer">StructuredViewer</a></div>
<dl>
<dt>Parameters:
</dt>
<dd><b>labelProvider</b> the label provider, or <code>null</code>
if none</dd>
<dt><br>
</dt>
</dl>
<base
href="http://127.0.0.1:57694/help/nftopic/jar:file:/D:/sandbox/4.2RC1/eclipse/plugins/org.eclipse.platform.doc.isv_4.2.0.v20120518-2015.jar%21/reference/api/org/eclipse/jface/viewers/AbstractListViewer.html">You
could try a table with a single column and to table header.<br>
<br>
<br>
<div class="moz-cite-prefix">On 04/07/2012 2:32 PM, Markus G wrote:<br>
</div>
<blockquote cite="mid:jt1d40$h2r$1@xxxxxxxxe.org" type="cite">One
more thing: is that not possible for a ListViewer for some reason?
It works fine in the tree and the table viewer for me, but the
ListViewer does not show the same behaviour...
<br>
</blockquote>
<br>
<br>
</body>
</html>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02316 seconds