| /******************************************************************************* |
| * 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.RPROConstraint; |
| import org.eclipse.apogy.common.topology.addons.dynamics.ui.composites.RPROConstraintComposite; |
| import org.eclipse.swt.SWT; |
| import org.eclipse.swt.layout.FillLayout; |
| import org.eclipse.swt.widgets.Composite; |
| |
| public class RPROConstraintView extends AbstractPinableView<RPROConstraint> { |
| private RPROConstraint rPROConstraint; |
| public static final String ID = "org.eclipse.apogy.common.topology.addons.dynamics.ui.views.RPROConstraintView"; //$NON-NLS-1$ |
| |
| private RPROConstraintComposite rPROConstraintCompositeComposite = null; |
| |
| public RPROConstraintView() { |
| } |
| |
| /** |
| * 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.rPROConstraintCompositeComposite = new RPROConstraintComposite(container, SWT.None); |
| |
| createActions(); |
| getSite().getPage().addSelectionListener(this); |
| } |
| |
| public RPROConstraint getRPROConstraint() { |
| return this.rPROConstraint; |
| } |
| |
| public void setRPROConstraint(RPROConstraint rPROConstraint) { |
| this.rPROConstraint = rPROConstraint; |
| if (this.rPROConstraintCompositeComposite != null) |
| this.rPROConstraintCompositeComposite.setRPROConstraint(this.rPROConstraint); |
| } |
| |
| @Override |
| public void setFocus() { |
| // Set the focus |
| } |
| |
| @Override |
| public Class<RPROConstraint> getObjectClass() { |
| return RPROConstraint.class; |
| } |
| |
| @Override |
| public void setObject(RPROConstraint object) { |
| |
| this.rPROConstraintCompositeComposite.setRPROConstraint(object); |
| super.setObject(object); |
| } |
| } |