| /******************************************************************************* |
| * 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: |
| <<<<<<< HEAD |
| * Pierre Allard - initial API and implementation |
| * Regent L'Archeveque |
| * |
| ======= |
| * Pierre Allard, |
| * Regent L'Archeveque - initial API and implementation |
| * |
| >>>>>>> refs/heads/eclipse_pa |
| * SPDX-License-Identifier: EPL-1.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.apogy.common.io.jinput.ui.composites; |
| |
| import org.eclipse.apogy.common.io.jinput.EController; |
| import org.eclipse.swt.SWT; |
| import org.eclipse.swt.widgets.Button; |
| import org.eclipse.swt.widgets.Composite; |
| import org.eclipse.swt.widgets.Event; |
| import org.eclipse.swt.widgets.Listener; |
| |
| public class PollCommandComposite extends Composite { |
| |
| private EController controller; |
| |
| public PollCommandComposite(Composite parent, int style) { |
| super(parent, style); |
| |
| Button btnPoll = new Button(this, SWT.NONE); |
| btnPoll.setBounds(0, 0, 88, 29); |
| btnPoll.setText("Poll"); |
| btnPoll.addListener(SWT.Selection, new Listener() { |
| @Override |
| public void handleEvent(Event event) { |
| if (getController() != null) |
| getController().poll(); |
| } |
| }); |
| |
| } |
| |
| public void setController(EController c) { |
| this.controller = c; |
| } |
| |
| public EController getController() { |
| return this.controller; |
| } |
| } |