1 11 package org.eclipse.team.internal.ui.synchronize.actions; 12 13 import org.eclipse.compare.ICompareNavigator; 14 import org.eclipse.jface.action.Action; 15 import org.eclipse.team.internal.ui.Utils; 16 import org.eclipse.team.internal.ui.synchronize.SynchronizePageConfiguration; 17 import org.eclipse.team.ui.synchronize.*; 18 import org.eclipse.ui.IActionBars; 19 import org.eclipse.ui.actions.ActionFactory; 20 21 28 public class NavigateAction extends Action { 29 private final boolean next; 30 private ISynchronizePageConfiguration configuration; 31 32 public NavigateAction(ISynchronizePageConfiguration configuration, boolean next) { 33 this.configuration = configuration; 34 this.next = next; 35 IActionBars bars = configuration.getSite().getActionBars(); 36 if (next) { 37 Utils.initAction(this, "action.navigateNext."); if (bars != null) 39 bars.setGlobalActionHandler(ActionFactory.NEXT.getId(), this); 40 } else { 41 Utils.initAction(this, "action.navigatePrevious."); if (bars != null) 43 bars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), this); 44 } 45 } 46 47 51 public void run() { 52 ICompareNavigator nav = (ICompareNavigator)configuration.getProperty(SynchronizePageConfiguration.P_NAVIGATOR); 53 nav.selectChange(next); 54 } 55 } 56 | Popular Tags |