/******************************************************************************* * Copyright (c) 2010 Michal Antkiewicz. * 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: * Michal Antkiewicz - initial API and implementation ******************************************************************************/ package ca.uwaterloo.gsd.fsml.ui; import org.eclipse.jface.action.Action; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import ca.uwaterloo.gsd.fsml.sync.SyncItem; /** * @author Michal Antkiewicz <mantkiew@gsd.uwaterloo.ca> * */ public class ReconciliationDecisionAction extends Action implements ISelectionChangedListener { protected SyncItem item; public ReconciliationDecisionAction() { setEnabled(false); } public void selectionChanged(SelectionChangedEvent event) { if (event.getSelection() instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) event.getSelection(); Object object = structuredSelection.getFirstElement(); if (object instanceof SyncItem) item = (SyncItem) object; else item = null; } } }