Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » how to change editor font size
how to change editor font size [message #330589] Mon, 04 August 2008 15:48 Go to next message
Eclipse UserFriend
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
Eclipse UserFriend
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"));
Previous Topic:RE: Access file in developed plugin
Next Topic:Some very very strange thing about the open action in the CNF?
Goto Forum:
  


Current Time: Sat Jul 13 22:35:53 GMT 2024

Powered by FUDForum. Page generated in 0.03128 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top