1 11 package org.eclipse.pde.internal.ui.view; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.jface.window.Window; 15 import org.eclipse.pde.internal.core.PDECore; 16 import org.eclipse.pde.internal.ui.IHelpContextIds; 17 import org.eclipse.pde.internal.ui.PDEPlugin; 18 import org.eclipse.pde.internal.ui.PDEPluginImages; 19 import org.eclipse.pde.internal.ui.PDEUIMessages; 20 import org.eclipse.ui.PlatformUI; 21 22 public class HistoryListAction extends Action { 23 24 private DependenciesView fView; 25 26 public HistoryListAction(DependenciesView view) { 27 fView = view; 28 setText(PDEUIMessages.HistoryListAction_label); 29 setImageDescriptor(PDEPluginImages.DESC_HISTORY_LIST); 30 setDisabledImageDescriptor(PDEPluginImages.DESC_HISTORY_LIST_DISABLED); 31 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IHelpContextIds.HISTORY_LIST_ACTION); 32 } 33 34 37 public void run() { 38 String [] historyEntries = fView.getHistoryEntries(); 39 HistoryListDialog dialog = new HistoryListDialog(PDEPlugin 40 .getActiveWorkbenchShell(), historyEntries); 41 if (dialog.open() == Window.OK) { 42 fView.setHistoryEntries(dialog.getRemaining()); 43 String id = dialog.getResult(); 44 if (id == null) { 45 fView.openTo(null); 46 } else { 47 fView.openTo(PDECore.getDefault().getModelManager().findModel( 48 id)); 49 } 50 } 51 } 52 53 } 54 | Popular Tags |