| /******************************************************************************* |
| * Copyright (c) 2007 IBM Corporation and Others |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Kentarou FUKUDA - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.actf.model.ui.editor.actions; |
| |
| import org.eclipse.actf.model.ui.IModelService; |
| import org.eclipse.actf.model.ui.editor.browser.IWebBrowserACTF; |
| import org.eclipse.actf.model.ui.util.ModelServiceUtils; |
| import org.eclipse.jface.action.Action; |
| import org.eclipse.ui.IWorkbenchWindow; |
| |
| |
| |
| public class TextSizeAction extends Action { |
| |
| public static final String ID = TextSizeAction.class.getName(); |
| |
| private int _fontSize = 2; |
| |
| public TextSizeAction(IWorkbenchWindow window) { |
| super(ID, Action.AS_RADIO_BUTTON); |
| } |
| |
| public void run() { |
| IModelService modelService = ModelServiceUtils.getActiveModelService(); |
| if(modelService!=null && modelService instanceof IWebBrowserACTF){ |
| ((IWebBrowserACTF)modelService).setFontSize(this._fontSize); |
| } |
| } |
| |
| public void setFontSize(int fontSize) { |
| this._fontSize = fontSize; |
| } |
| |
| public int getFontSize() { |
| return this._fontSize; |
| } |
| } |