how to change editor font size [message #330589] |
Mon, 04 August 2008 15:48 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: chingyichan.tw.gmail.com
Hi,
I want to write a command that can change editor font size.
but I have no idea how to do it. someone can give some suggestion ?
|
|
|
Re: how to change editor font size [message #330703 is a reply to message #330589] |
Mon, 11 August 2008 00:57 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: chingyichan.tw.gmail.com
chingyichan 提到:
> Hi,
> I want to write a command that can change editor font size.
> but I have no idea how to do it. someone can give some suggestion ?
I get the Control instance of the current editor, and call set method to
change it.
============================== Code ============================
FontRegistry fontRegistry = new FontRegistry(Display.getCurrent());
fontRegistry.put("demo", new FontData[]{new FontData("Verdana", 14,
SWT.BOLD)} );
IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
Control control = (Control) editorPart.getAdapter(Control.class);
control.setFont(fontRegistry.get("demo"));
|
|
|
Powered by
FUDForum. Page generated in 0.03518 seconds