Search in sources :

Example 1 with PullAction

use of org.eclipse.egit.ui.internal.synchronize.action.PullAction in project egit by eclipse.

the class GitActionContributor method initialize.

@Override
public void initialize(ISynchronizePageConfiguration configuration) {
    super.initialize(configuration);
    ExpandAllModelAction expandAllAction = new ExpandAllModelAction(GitActionContributor_ExpandAll, configuration);
    expandAllAction.setImageDescriptor(EXPAND_ALL);
    appendToGroup(P_TOOLBAR_MENU, NAVIGATE_GROUP, expandAllAction);
    PullAction pullAction = new PullAction(UIText.GitActionContributor_Pull, configuration);
    pullAction.setImageDescriptor(PULL);
    appendToGroup(P_TOOLBAR_MENU, SYNCHRONIZE_GROUP, pullAction);
    PushAction pushAction = new PushAction(UIText.GitActionContributor_Push, configuration);
    pushAction.setImageDescriptor(PUSH);
    appendToGroup(P_TOOLBAR_MENU, SYNCHRONIZE_GROUP, pushAction);
    ISynchronizePageSite site = configuration.getSite();
    IWorkbenchSite ws = site.getWorkbenchSite();
    openWorkingFileAction = new OpenWorkingFileAction(ws.getWorkbenchWindow().getActivePage());
    site.getSelectionProvider().addSelectionChangedListener(openWorkingFileAction);
    if (ws instanceof IViewSite) {
        Object oldAction = configuration.getProperty(P_OPEN_ACTION);
        if (!(oldAction instanceof Action))
            return;
        final GitOpenInCompareAction openInCompareAction = new GitOpenInCompareAction(configuration, (Action) oldAction);
        configuration.setProperty(P_OPEN_ACTION, openInCompareAction);
    }
}
Also used : IWorkbenchSite(org.eclipse.ui.IWorkbenchSite) IViewSite(org.eclipse.ui.IViewSite) ExpandAllModelAction(org.eclipse.egit.ui.internal.synchronize.action.ExpandAllModelAction) GitOpenInCompareAction(org.eclipse.egit.ui.internal.synchronize.action.GitOpenInCompareAction) OpenWorkingFileAction(org.eclipse.egit.ui.internal.synchronize.action.OpenWorkingFileAction) PushAction(org.eclipse.egit.ui.internal.synchronize.action.PushAction) PullAction(org.eclipse.egit.ui.internal.synchronize.action.PullAction) Action(org.eclipse.jface.action.Action) PullAction(org.eclipse.egit.ui.internal.synchronize.action.PullAction) ISynchronizePageSite(org.eclipse.team.ui.synchronize.ISynchronizePageSite) OpenWorkingFileAction(org.eclipse.egit.ui.internal.synchronize.action.OpenWorkingFileAction) ExpandAllModelAction(org.eclipse.egit.ui.internal.synchronize.action.ExpandAllModelAction) GitModelObject(org.eclipse.egit.ui.internal.synchronize.model.GitModelObject) GitOpenInCompareAction(org.eclipse.egit.ui.internal.synchronize.action.GitOpenInCompareAction) PushAction(org.eclipse.egit.ui.internal.synchronize.action.PushAction)

Aggregations

ExpandAllModelAction (org.eclipse.egit.ui.internal.synchronize.action.ExpandAllModelAction)1 GitOpenInCompareAction (org.eclipse.egit.ui.internal.synchronize.action.GitOpenInCompareAction)1 OpenWorkingFileAction (org.eclipse.egit.ui.internal.synchronize.action.OpenWorkingFileAction)1 PullAction (org.eclipse.egit.ui.internal.synchronize.action.PullAction)1 PushAction (org.eclipse.egit.ui.internal.synchronize.action.PushAction)1 GitModelObject (org.eclipse.egit.ui.internal.synchronize.model.GitModelObject)1 Action (org.eclipse.jface.action.Action)1 ISynchronizePageSite (org.eclipse.team.ui.synchronize.ISynchronizePageSite)1 IViewSite (org.eclipse.ui.IViewSite)1 IWorkbenchSite (org.eclipse.ui.IWorkbenchSite)1