X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.utils.ui%2Fsrc%2Forg%2Fsimantics%2Futils%2Fui%2Faction%2FPriorityActionAdapter.java;h=ad430dadd485eaaf33e03d70496b51edc424796c;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=05f0c7d56a530ab2c77aa96dd645e3dc850b8869;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/action/PriorityActionAdapter.java b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/action/PriorityActionAdapter.java index 05f0c7d56..ad430dadd 100644 --- a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/action/PriorityActionAdapter.java +++ b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/action/PriorityActionAdapter.java @@ -1,50 +1,50 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.utils.ui.action; - -import org.eclipse.jface.action.IAction; - -/** - * @author Tuukka Lehtonen - */ -public class PriorityActionAdapter extends PriorityAction { - - private IAction handler; - - /** - * @param handler - * @throws NullPointerException for null handlers - */ - public PriorityActionAdapter(IAction handler) { - this(IPriorityAction.NORMAL, handler); - } - - /** - * @param priority - * @param handler - * @throws NullPointerException for null handlers - */ - public PriorityActionAdapter(int priority, IAction handler) { - super(priority, handler.getText(), handler.getStyle()); - this.handler = handler; - - setText(handler.getText()); - setImageDescriptor(handler.getImageDescriptor()); - } - - @Override - public void run() { - if (handler != null) { - handler.run(); - } - } -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.utils.ui.action; + +import org.eclipse.jface.action.IAction; + +/** + * @author Tuukka Lehtonen + */ +public class PriorityActionAdapter extends PriorityAction { + + private IAction handler; + + /** + * @param handler + * @throws NullPointerException for null handlers + */ + public PriorityActionAdapter(IAction handler) { + this(IPriorityAction.NORMAL, handler); + } + + /** + * @param priority + * @param handler + * @throws NullPointerException for null handlers + */ + public PriorityActionAdapter(int priority, IAction handler) { + super(priority, handler.getText(), handler.getStyle()); + this.handler = handler; + + setText(handler.getText()); + setImageDescriptor(handler.getImageDescriptor()); + } + + @Override + public void run() { + if (handler != null) { + handler.run(); + } + } +}