blob: a52df5db2c2d7e3b60fc074b1139aabae0fe4402 [file] [log] [blame]
/*******************************************************************************
* 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.ui.SelectionBasedTimeSource;
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.SelectionBasedTimeSourceComposite;
import org.eclipse.swt.widgets.Composite;
public class SelectionBasedTimeSourceTimeSourceCompositeProvider
implements TimeSourceCompositeProvider<SelectionBasedTimeSource> {
@Override
public boolean isAdapterFor(SelectionBasedTimeSource obj) {
return obj instanceof SelectionBasedTimeSource;
}
@Override
public AbstractTimeSourceComposite getComposite(Composite parent, int style, SelectionBasedTimeSource obj) {
if (isAdapterFor(obj)) {
return new SelectionBasedTimeSourceComposite(parent, style, obj);
} else {
return null;
}
}
@Override
public Class<?> getAdaptedClass() {
return SelectionBasedTimeSource.class;
}
}