Skip to content
Snippets Groups Projects
Commit 3b1c3581 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Added TutorialUIUtils class to ease tutorial implementations.

refs 2567
parent 6e85bd17
No related branches found
No related tags found
No related merge requests found
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2016 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.util;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.IContributionItem;
import org.fortiss.tooling.kernel.extension.data.Prototype;
import org.fortiss.tooling.kernel.ui.service.IActionService;
/**
* Utility class providing common methods used when implementing UI parts of tutorials.
*
* @author hoelzl
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating RED Hash:
*/
public class TutorialUIServiceUtils {
/** Returns whether the given contribution is a new menu prototype instance of the given class. */
public static boolean isNewMenuContributionPrototype(IContributionItem contribution,
Class<? extends EObject> clazz) {
Prototype proto = IActionService.INSTANCE.getNewMenuContributionPrototype(contribution);
return proto != null && clazz.isInstance(proto.getPrototype());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment