| /******************************************************************************* |
| * Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency |
| * 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: |
| * Pierre Allard, |
| * Regent L'Archeveque, |
| <<<<<<< HEAD |
| * Olivier L. Larouche |
| * |
| ======= |
| * Olivier L. Larouche - initial API and implementation |
| >>>>>>> refs/heads/eclipse_pa |
| * SPDX-License-Identifier: EPL-1.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.apogy.common.emf.ui.adapters; |
| |
| import org.eclipse.apogy.common.emf.FixedTimeSource; |
| import org.eclipse.apogy.common.emf.ui.TimeSourceCompositeProvider; |
| import org.eclipse.apogy.common.emf.ui.composites.AbstractTimeSourceComposite; |
| import org.eclipse.apogy.common.emf.ui.composites.FixedTimeSourceComposite; |
| import org.eclipse.swt.widgets.Composite; |
| |
| public class FixedTimeSourceTimeSourceCompositeProvider implements TimeSourceCompositeProvider<FixedTimeSource> { |
| @Override |
| public boolean isAdapterFor(FixedTimeSource obj) { |
| return obj instanceof FixedTimeSource; |
| } |
| |
| @Override |
| public AbstractTimeSourceComposite getComposite(Composite parent, int style, FixedTimeSource obj) { |
| if (isAdapterFor(obj)) { |
| return new FixedTimeSourceComposite(parent, style, obj); |
| } else { |
| return null; |
| } |
| } |
| |
| @Override |
| public Class<?> getAdaptedClass() { |
| return FixedTimeSource.class; |
| } |
| } |