| /******************************************************************************* |
| * 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, |
| * Sebastien Gemme - initial API and implementation |
| * SPDX-License-Identifier: EPL-1.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.apogy.common.topology.addons.dynamics.ui.views; |
| |
| import org.eclipse.apogy.common.topology.addons.dynamics.KinematicState; |
| import org.eclipse.apogy.common.topology.addons.dynamics.ui.composites.KinematicStateComposite; |
| import org.eclipse.swt.SWT; |
| import org.eclipse.swt.layout.FillLayout; |
| import org.eclipse.swt.widgets.Composite; |
| |
| public class KinematicsStateView extends AbstractPinableView<KinematicState> { |
| private KinematicState kinematicState; |
| public static final String ID = "org.eclipse.apogy.common.topology.addons.dynamics.ui.views.KinematicsStateView"; //$NON-NLS-1$ |
| |
| private KinematicStateComposite kinematicStateComposite = null; |
| |
| public KinematicsStateView() { |
| } |
| |
| /** |
| * Create contents of the view part. |
| * |
| * @param parent |
| */ |
| @Override |
| public void createPartControl(Composite parent) { |
| super.createPartControl(parent); |
| Composite container = new Composite(parent, SWT.NONE); |
| container.setLayout(new FillLayout(SWT.HORIZONTAL)); |
| this.kinematicStateComposite = new KinematicStateComposite(container, SWT.None); |
| |
| createActions(); |
| getSite().getPage().addSelectionListener(this); |
| } |
| |
| public KinematicState getKinematicState() { |
| return this.kinematicState; |
| } |
| |
| public void setKinematicState(KinematicState kinematicState) { |
| this.kinematicState = kinematicState; |
| if (this.kinematicStateComposite != null) |
| this.kinematicStateComposite.setKinematicState(this.kinematicState); |
| } |
| |
| @Override |
| public void setFocus() { |
| // Set the focus |
| } |
| |
| @Override |
| public Class<KinematicState> getObjectClass() { |
| return KinematicState.class; |
| } |
| |
| @Override |
| public void setObject(KinematicState object) { |
| |
| this.kinematicStateComposite.setKinematicState(object); |
| super.setObject(object); |
| } |
| } |