1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.utils.ui.action;
14 import org.eclipse.jface.action.IAction;
17 * @author Tuukka Lehtonen
19 public class PriorityActionAdapter extends PriorityAction {
21 private IAction handler;
25 * @throws NullPointerException for null handlers
27 public PriorityActionAdapter(IAction handler) {
28 this(IPriorityAction.NORMAL, handler);
34 * @throws NullPointerException for null handlers
36 public PriorityActionAdapter(int priority, IAction handler) {
37 super(priority, handler.getText(), handler.getStyle());
38 this.handler = handler;
40 setText(handler.getText());
41 setImageDescriptor(handler.getImageDescriptor());
46 if (handler != null) {