| /******************************************************************************* |
| * Copyright (c) 2015 Boeing. |
| * 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: |
| * Boeing - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.osee.ats.search; |
| |
| import org.eclipse.jface.action.Action; |
| import org.eclipse.jface.resource.ImageDescriptor; |
| import org.eclipse.osee.ats.api.query.AtsSearchData; |
| import org.eclipse.osee.ats.api.workdef.StateType; |
| import org.eclipse.osee.ats.internal.AtsClientService; |
| import org.eclipse.osee.framework.ui.skynet.FrameworkImage; |
| import org.eclipse.osee.framework.ui.swt.ImageManager; |
| |
| /** |
| * @author Donald G. Dunne |
| */ |
| public final class ClearSearchAction extends Action { |
| |
| private final AtsSearchWorkflowSearchItem searchItem; |
| |
| public ClearSearchAction(AtsSearchWorkflowSearchItem searchItem) { |
| this.searchItem = searchItem; |
| } |
| |
| @Override |
| public String getText() { |
| return "Clear Search Options"; |
| } |
| |
| @Override |
| public void run() { |
| AtsSearchData searchData = AtsClientService.get().getQueryService().createSearchData(searchItem.getNamespace(), |
| searchItem.getSearchName()); |
| searchData.getStateTypes().add(StateType.Working); |
| searchItem.loadWidgets(searchData); |
| } |
| |
| @Override |
| public ImageDescriptor getImageDescriptor() { |
| return ImageManager.getImageDescriptor(FrameworkImage.CLEAR_CO); |
| } |
| } |