![]() |
![]() |
org.eclipse.team.ui_3.6.101.R37x_v20111109-0800e, 12); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.actions.SyncInfoSetStatusLineContributionGroup * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.actions; import org.eclipse.jface.action.Action; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.team.internal.ui.Utils; import org.eclipse.team.internal.ui.dialogs.PreferencePageContainerDialog; import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; import org.eclipse.team.ui.synchronize.ISynchronizePageSite; import org.eclipse.team.ui.synchronize.ISynchronizeParticipant; public class SyncViewerShowPreferencesAction extends Action { private final ISynchronizePageConfiguration configuration; public SyncViewerShowPreferencesAction(ISynchronizePageConfiguration configuration) { this.configuration = configuration; Utils.initAction(this, "action.syncViewPreferences."); } public void run() { PreferencePage[] pages = configuration.getParticipant().getPreferencePages(); PreferencePageContainerDialog dialog = new PreferencePageContainerDialog(configuration.getSite().getShell(), pages); dialog.setBlockOnOpen(true); dialog.open(); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.actions.SyncViewerShowPreferencesAction * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.actions; import org.eclipse.jface.action.Action; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.team.ui.synchronize.ISynchronizeParticipant; import org.eclipse.team.ui.synchronize.ISynchronizeView; import org.eclipse.ui.IWorkbenchPartSite; import org.eclipse.ui.actions.RefreshAction; public class SynchronizeAndRefreshAction extends Action { private ISynchronizeView fView; public SynchronizeAndRefreshAction(ISynchronizeView view) { fView = view; } public void run() { ISynchronizeParticipant current = fView.getParticipant(); if (current != null) { refreshLocal(); current.run(fView); } } private void refreshLocal() { ISelectionProvider selectionProvider = fView.getSite().getSelectionProvider(); if (selectionProvider == null) { return; } ISelection selection = selectionProvider.getSelection(); if (!(selection instanceof IStructuredSelection)) { return; } RefreshAction refreshAction = new RefreshAction(fView.getSite()); if (selection.isEmpty()) { refreshAction.refreshAll(); } else { refreshAction.selectionChanged((IStructuredSelection)selection); refreshAction.run(); } } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.actions.SynchronizeAndRefreshAction * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.actions; import org.eclipse.jface.action.Action; import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.team.internal.ui.wizards.GlobalSynchronizeWizard; import org.eclipse.team.ui.synchronize.ISynchronizeView; import org.eclipse.ui.IViewSite; class SynchronizePageDropDownAction$1 extends Action { final SynchronizePageDropDownAction this$0; SynchronizePageDropDownAction$1(SynchronizePageDropDownAction paramSynchronizePageDropDownAction, String $anonymous0) { super($anonymous0);this$0 = paramSynchronizePageDropDownAction; } public void run() { IWizard wizard = new GlobalSynchronizeWizard(); WizardDialog dialog = new WizardDialog(SynchronizePageDropDownAction.access$0(this$0).getViewSite().getShell(), wizard); dialog.open(); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.actions.SynchronizePageDropDownAction.1 * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.actions; import org.eclipse.jface.action.MenuManager; class SynchronizePageDropDownAction$2 implements Runnable { final SynchronizePageDropDownAction this$0; SynchronizePageDropDownAction$2(SynchronizePageDropDownAction paramSynchronizePageDropDownAction) { this$0 = paramSynchronizePageDropDownAction; } public void run() { if (SynchronizePageDropDownAction.access$1(this$0) != null) { SynchronizePageDropDownAction.access$1(this$0).dispose(); SynchronizePageDropDownAction.access$2(this$0, null); } this$0.update(); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.actions.SynchronizePageDropDownAction.2 * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.actions; import org.eclipse.jface.action.MenuManager; class SynchronizePageDropDownAction$3 implements Runnable { final SynchronizePageDropDownAction this$0; SynchronizePageDropDownAction$3(SynchronizePageDropDownAction paramSynchronizePageDropDownAction) { this$0 = paramSynchronizePageDropDownAction; } public void run() { if (SynchronizePageDropDownAction.access$1(this$0) != null) { SynchronizePageDropDownAction.access$1(this$0).dispose(); SynchronizePageDropDownAction.access$2(this$0, null); } this$0.update(); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.actions.SynchronizePageDropDownAction.3 * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.actions; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuCreator; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Menu; import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.ui.TeamUIMessages; import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.team.internal.ui.Utils; import org.eclipse.team.internal.ui.wizards.GlobalSynchronizeWizard; import org.eclipse.team.ui.TeamImages; import org.eclipse.team.ui.TeamUI; import org.eclipse.team.ui.synchronize.ISynchronizeManager; import org.eclipse.team.ui.synchronize.ISynchronizeParticipant; import org.eclipse.team.ui.synchronize.ISynchronizeParticipantListener; import org.eclipse.team.ui.synchronize.ISynchronizeParticipantReference; import org.eclipse.team.ui.synchronize.ISynchronizeView; import org.eclipse.ui.IKeyBindingService; import org.eclipse.ui.IViewSite; import org.eclipse.ui.IWorkbenchPartSite; public class SynchronizePageDropDownAction extends Action implements IMenuCreator, ISynchronizeParticipantListener { private ISynchronizeView fView; private Action synchronizeAction; private MenuManager menuManager; public SynchronizePageDropDownAction(ISynchronizeView view) { fView = view; Utils.initAction(this, "action.refreshSubscriber."); synchronizeAction = new Action(TeamUIMessages.GlobalRefreshAction_4) { public void run() { IWizard wizard = new GlobalSynchronizeWizard(); WizardDialog dialog = new WizardDialog(fView.getViewSite().getShell(), wizard); dialog.open(); } }; synchronizeAction.setImageDescriptor(TeamImages.getImageDescriptor("eview16/synch_synch.gif")); synchronizeAction.setActionDefinitionId("org.eclipse.team.ui.synchronizeAll"); setMenuCreator(this); TeamUI.getSynchronizeManager().addSynchronizeParticipantListener(this); update(); fView.getSite().getKeyBindingService().registerAction(synchronizeAction); setActionDefinitionId("org.eclipse.team.ui.synchronizeLast"); fView.getSite().getKeyBindingService().registerAction(this); } public void dispose() { if (menuManager != null) { menuManager.dispose(); menuManager = null; } TeamUI.getSynchronizeManager().removeSynchronizeParticipantListener(this); } public Menu getMenu(Menu parent) { return null; } public Menu getMenu(Control parent) { Menu fMenu = null; if (menuManager == null) { menuManager = new MenuManager(); fMenu = menuManager.createContextMenu(parent); ISynchronizeParticipantReference[] participants = TeamUI.getSynchronizeManager().getSynchronizeParticipants(); addParticipantsToMenu(participants); if (participants.length > 0) { menuManager.add(new Separator()); } menuManager.add(synchronizeAction); menuManager.update(true); } else { fMenu = menuManager.getMenu(); } return fMenu; } protected void addParticipantsToMenu(ISynchronizeParticipantReference[] refs) { ISynchronizeParticipant current = fView.getParticipant(); for (int i = 0; i < refs.length; i++) { ISynchronizeParticipantReference page = refs[i]; Action action = new ShowSynchronizeParticipantAction(fView, page); try { boolean isCurrent = page.getParticipant().equals(current); action.setChecked(isCurrent); } catch (TeamException localTeamException) { continue; } menuManager.add(action); } } public void run() { ISynchronizeParticipant current = fView.getParticipant(); if (current != null) { current.run(fView); } else { synchronizeAction.run(); } update(); } public void participantsAdded(ISynchronizeParticipant[] consoles) { Display display = TeamUIPlugin.getStandardDisplay(); display.asyncExec(new Runnable() { public void run() { if (menuManager != null) { menuManager.dispose(); menuManager = null; } update(); } }); } public void participantsRemoved(ISynchronizeParticipant[] consoles) { Display display = TeamUIPlugin.getStandardDisplay(); display.asyncExec(new Runnable() { public void run() { if (menuManager != null) { menuManager.dispose(); menuManager = null; } update(); } }); } public void update() { ISynchronizeParticipant current = fView.getParticipant(); ISynchronizeParticipantReference[] refs = TeamUI.getSynchronizeManager().getSynchronizeParticipants(); String text = null; if ((current != null) && (refs.length > 0)) { text = NLS.bind(TeamUIMessages.GlobalRefreshAction_5, new String[] { Utils.shortenText(100, current.getName()) }); setToolTipText(text); setText(text); } else { text = TeamUIMessages.GlobalRefreshAction_4; setToolTipText(text); setText(text); } } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.actions.SynchronizePageDropDownAction * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.actions; import org.eclipse.jface.action.Action; import org.eclipse.team.internal.ui.TeamUIMessages; import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.team.internal.ui.synchronize.SynchronizeView; public class ToggleLinkingAction extends Action { private SynchronizeView view; public ToggleLinkingAction(SynchronizeView view) { super(TeamUIMessages.SynchronizeView_linkWithEditor); setDescription(TeamUIMessages.SynchronizeView_linkWithEditorDescription); setToolTipText(TeamUIMessages.SynchronizeView_linkWithEditorTooltip); setImageDescriptor(TeamUIPlugin.getImageDescriptor("elcl16/synced.gif")); setDisabledImageDescriptor(TeamUIPlugin.getImageDescriptor("dlcl16/synced.gif")); setActionDefinitionId("org.eclipse.ui.navigate.linkWithEditor"); this.view = view; setChecked(view.isLinkingEnabled()); } public void run() { view.setLinkingEnabled(isChecked()); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.actions.ToggleLinkingAction * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import org.eclipse.compare.internal.patch.HunkDiffNode; import org.eclipse.compare.internal.patch.PatchFileDiffNode; import org.eclipse.compare.internal.patch.PatchProjectDiffNode; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.mapping.ResourceMapping; import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.team.ui.mapping.ISynchronizationCompareAdapter; import org.eclipse.ui.model.IWorkbenchAdapter; public class AdapterFactory implements IAdapterFactory { private IWorkbenchAdapter modelAdapter = new PatchWorkbenchAdapter(); private ISynchronizationCompareAdapter compareAdapter; public Object getAdapter(Object adaptableObject, Class adapterType) { if (adapterType == ResourceMapping.class) { if ((adaptableObject instanceof PatchProjectDiffNode)) { return new DiffProjectResourceMapping( ((PatchProjectDiffNode)adaptableObject) .getDiffProject()); } if ((adaptableObject instanceof PatchFileDiffNode)) { return new FilePatchResourceMapping( ((PatchFileDiffNode)adaptableObject).getDiffResult()); } if ((adaptableObject instanceof HunkDiffNode)) { return new HunkResourceMapping(((HunkDiffNode)adaptableObject) .getHunkResult()); } } if (adapterType == IWorkbenchAdapter.class) { return modelAdapter; } if ((adapterType == ISynchronizationCompareAdapter.class) && ((adaptableObject instanceof PatchModelProvider))) { if (compareAdapter == null) { compareAdapter = new PatchCompareAdapter(); } return compareAdapter; } if ((adapterType == IResource.class) && ((adaptableObject instanceof PatchFileDiffNode))) { return ((PatchFileDiffNode)adaptableObject).getResource(); } return null; } public Class[] getAdapterList() { return new Class[] { ResourceMapping.class, IWorkbenchAdapter.class, IResource.class }; } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.patch.AdapterFactory * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.jface.action.Action; import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.team.internal.ui.mapping.ResourceMarkAsMergedHandler; class ApplyPatchModelCompareEditorInput$1 extends Action { final ApplyPatchModelCompareEditorInput this$0; private final ResourceMarkAsMergedHandler val$markAsMergedHandler; ApplyPatchModelCompareEditorInput$1(ApplyPatchModelCompareEditorInput paramApplyPatchModelCompareEditorInput, String $anonymous0, ResourceMarkAsMergedHandler paramResourceMarkAsMergedHandler) { super($anonymous0);this$0 = paramApplyPatchModelCompareEditorInput;val$markAsMergedHandler = paramResourceMarkAsMergedHandler; } public void run() { try { val$markAsMergedHandler.execute(new ExecutionEvent()); } catch (ExecutionException e) { TeamUIPlugin.log(4, e.getMessage(), e); } } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.patch.ApplyPatchModelCompareEditorInput.1 * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.jface.action.Action; import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.team.internal.ui.mapping.ResourceMergeHandler; class ApplyPatchModelCompareEditorInput$2 extends Action { final ApplyPatchModelCompareEditorInput this$0; private final ResourceMergeHandler val$mergeHandler; ApplyPatchModelCompareEditorInput$2(ApplyPatchModelCompareEditorInput paramApplyPatchModelCompareEditorInput, String $anonymous0, ResourceMergeHandler paramResourceMergeHandler) { super($anonymous0);this$0 = paramApplyPatchModelCompareEditorInput;val$mergeHandler = paramResourceMergeHandler; } public void run() { try { val$mergeHandler.execute(new ExecutionEvent()); } catch (ExecutionException e) { TeamUIPlugin.log(4, e.getMessage(), e); } } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.patch.ApplyPatchModelCompareEditorInput.2 * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import org.eclipse.compare.internal.CompareEditorInputNavigator; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; class ApplyPatchModelCompareEditorInput$3 implements ISelectionChangedListener { final ApplyPatchModelCompareEditorInput this$0; private final CompareEditorInputNavigator val$cein; ApplyPatchModelCompareEditorInput$3(ApplyPatchModelCompareEditorInput paramApplyPatchModelCompareEditorInput, CompareEditorInputNavigator paramCompareEditorInputNavigator) { this$0 = paramApplyPatchModelCompareEditorInput;val$cein = paramCompareEditorInputNavigator; } public void selectionChanged(SelectionChangedEvent e) { ApplyPatchModelCompareEditorInput.access$0(this$0, val$cein); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.patch.ApplyPatchModelCompareEditorInput.3 * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import org.eclipse.compare.CompareViewerPane; import org.eclipse.compare.ICompareNavigator; import org.eclipse.compare.IResourceProvider; import org.eclipse.compare.internal.CompareEditorInputNavigator; import org.eclipse.compare.internal.patch.PatchFileDiffNode; import org.eclipse.compare.structuremergeviewer.ICompareInput; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.team.internal.ui.TeamUIMessages; import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.team.internal.ui.Utils; import org.eclipse.team.internal.ui.mapping.ModelCompareEditorInput; import org.eclipse.team.internal.ui.mapping.ResourceMarkAsMergedHandler; import org.eclipse.team.internal.ui.mapping.ResourceMergeHandler; import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; import org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant; import org.eclipse.ui.IWorkbenchPage; public class ApplyPatchModelCompareEditorInput extends ModelCompareEditorInput { public ApplyPatchModelCompareEditorInput(ModelSynchronizeParticipant participant, ICompareInput input, IWorkbenchPage page, ISynchronizePageConfiguration synchronizeConfiguration) { super(participant, input, page, synchronizeConfiguration); } protected void handleMenuAboutToShow(IMenuManager manager) { StructuredSelection selection = new StructuredSelection(((IResourceProvider)getCompareInput()).getResource()); ResourceMarkAsMergedHandler markAsMergedHandler = new ResourceMarkAsMergedHandler(getSynchronizeConfiguration()); markAsMergedHandler.updateEnablement(selection); Action markAsMergedAction = new Action(TeamUIMessages.ModelCompareEditorInput_0) { private final ResourceMarkAsMergedHandler val$markAsMergedHandler; public void run() { try { val$markAsMergedHandler.execute(new ExecutionEvent()); } catch (ExecutionException e) { TeamUIPlugin.log(4, e.getMessage(), e); } } }; Utils.initAction(markAsMergedAction, "action.markAsMerged."); markAsMergedAction.setEnabled(markAsMergedAction.isEnabled()); ResourceMergeHandler mergeHandler = new ResourceMergeHandler(getSynchronizeConfiguration(), false); mergeHandler.updateEnablement(selection); Action mergeAction = new Action(TeamUIMessages.ModelCompareEditorInput_1) { private final ResourceMergeHandler val$mergeHandler; public void run() { try { val$mergeHandler.execute(new ExecutionEvent()); } catch (ExecutionException e) { TeamUIPlugin.log(4, e.getMessage(), e); } } }; Utils.initAction(mergeAction, "action.merge."); mergeAction.setEnabled(mergeAction.isEnabled()); manager.insertAfter("additions", new Separator("merge")); manager.insertAfter("merge", markAsMergedAction); manager.insertAfter("merge", mergeAction); } protected void contentsCreated() { super.contentsCreated(); ICompareNavigator nav = getNavigator(); if ((nav instanceof CompareEditorInputNavigator)) { CompareEditorInputNavigator cein = (CompareEditorInputNavigator)nav; Object pane = cein.getPanes()[0]; if ((pane instanceof CompareViewerPane)) { CompareViewerPane cvp = (CompareViewerPane)pane; cvp.setSelection(StructuredSelection.EMPTY); cvp.addSelectionChangedListener(new ISelectionChangedListener() { private final CompareEditorInputNavigator val$cein; public void selectionChanged(SelectionChangedEvent e) { ApplyPatchModelCompareEditorInput.this.feed1(val$cein); } }); feed1(cein); } } } private void feed1(CompareEditorInputNavigator cein) { if ((getCompareInput() instanceof PatchFileDiffNode)) { Object pane = cein.getPanes()[1]; if ((pane instanceof CompareViewerPane)) { CompareViewerPane cvp = (CompareViewerPane)pane; cvp.setInput(getCompareInput()); } pane = cein.getPanes()[2]; if ((pane instanceof CompareViewerPane)) { CompareViewerPane cvp = (CompareViewerPane)pane; cvp.setInput(null); } } } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.patch.ApplyPatchModelCompareEditorInput * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.team.internal.ui.Utils; import org.eclipse.team.internal.ui.mapping.FuzzFactorAction; import org.eclipse.team.internal.ui.mapping.GererateRejFileAction; import org.eclipse.team.internal.ui.mapping.IgnoreLeadingPathSegmentsAction; import org.eclipse.team.internal.ui.mapping.ReversePatchAction; import org.eclipse.team.ui.synchronize.ModelSynchronizeParticipantActionGroup; import org.eclipse.ui.IActionBars; public class ApplyPatchModelSynchronizeParticipant$ApplyPatchModelSynchronizeParticipantActionGroup extends ModelSynchronizeParticipantActionGroup { final ApplyPatchModelSynchronizeParticipant this$0; public ApplyPatchModelSynchronizeParticipant$ApplyPatchModelSynchronizeParticipantActionGroup(ApplyPatchModelSynchronizeParticipant paramApplyPatchModelSynchronizeParticipant) { this$0 = paramApplyPatchModelSynchronizeParticipant; } protected void addToContextMenu(String mergeActionId, Action action, IMenuManager manager) { if (mergeActionId == "org.eclipse.team.ui.overwriteAction") { return; } super.addToContextMenu(mergeActionId, action, manager); } public void fillActionBars(IActionBars actionBars) { if (actionBars != null) { IMenuManager menu = actionBars.getMenuManager(); ReversePatchAction reversePatchAction = new ReversePatchAction( getConfiguration()); appendToGroup(menu, "preferences", reversePatchAction); Utils.initAction(reversePatchAction, "action.reversePatch."); FuzzFactorAction fuzzFactor = new FuzzFactorAction( getConfiguration()); appendToGroup(menu, "preferences", fuzzFactor); Utils.initAction(fuzzFactor, "action.fuzzFactor."); IgnoreLeadingPathSegmentsAction ignoreAction = new IgnoreLeadingPathSegmentsAction( getConfiguration()); appendToGroup(menu, "preferences", ignoreAction); Utils.initAction(ignoreAction, "action.ignoreLeadingPathSegments."); GererateRejFileAction generateAction = new GererateRejFileAction( getConfiguration()); appendToGroup(menu, "preferences", generateAction); Utils.initAction(generateAction, "action.generateRejFile."); appendToGroup(menu, "preferences", new Separator()); } super.fillActionBars(actionBars); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.patch.ApplyPatchModelSynchronizeParticipant.ApplyPatchModelSynchronizeParticipantActionGroup * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import org.eclipse.compare.structuremergeviewer.ICompareInput; import org.eclipse.core.resources.mapping.ModelProvider; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.team.core.mapping.provider.SynchronizationContext; import org.eclipse.team.internal.ui.Utils; import org.eclipse.team.internal.ui.mapping.FuzzFactorAction; import org.eclipse.team.internal.ui.mapping.GererateRejFileAction; import org.eclipse.team.internal.ui.mapping.IgnoreLeadingPathSegmentsAction; import org.eclipse.team.internal.ui.mapping.ReversePatchAction; import org.eclipse.team.internal.ui.synchronize.IRefreshable; import org.eclipse.team.ui.TeamUI; import org.eclipse.team.ui.mapping.ISynchronizationCompareAdapter; import org.eclipse.team.ui.synchronize.ISynchronizeManager; import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor; import org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant; import org.eclipse.team.ui.synchronize.ModelSynchronizeParticipantActionGroup; import org.eclipse.ui.IActionBars; public class ApplyPatchModelSynchronizeParticipant extends ModelSynchronizeParticipant { public static final String ID = "org.eclipse.team.ui.applyPatchModelParticipant"; public ApplyPatchModelSynchronizeParticipant(SynchronizationContext context) { super(context); init(); } private void init() { try { ISynchronizeParticipantDescriptor descriptor = TeamUI.getSynchronizeManager().getParticipantDescriptor("org.eclipse.team.ui.applyPatchModelParticipant"); setInitializationData(descriptor); setSecondaryId(Long.toString(System.currentTimeMillis())); } catch (CoreException localCoreException) {} } protected void initializeConfiguration(ISynchronizePageConfiguration configuration) { super.initializeConfiguration(configuration); configuration .setSupportedModes(9); configuration.setMode(1); } protected ModelSynchronizeParticipantActionGroup createMergeActionGroup() { return new ApplyPatchModelSynchronizeParticipantActionGroup(); } public class ApplyPatchModelSynchronizeParticipantActionGroup extends ModelSynchronizeParticipantActionGroup { public ApplyPatchModelSynchronizeParticipantActionGroup() {} protected void addToContextMenu(String mergeActionId, Action action, IMenuManager manager) { if (mergeActionId == "org.eclipse.team.ui.overwriteAction") { return; } super.addToContextMenu(mergeActionId, action, manager); } public void fillActionBars(IActionBars actionBars) { if (actionBars != null) { IMenuManager menu = actionBars.getMenuManager(); ReversePatchAction reversePatchAction = new ReversePatchAction( getConfiguration()); appendToGroup(menu, "preferences", reversePatchAction); Utils.initAction(reversePatchAction, "action.reversePatch."); FuzzFactorAction fuzzFactor = new FuzzFactorAction( getConfiguration()); appendToGroup(menu, "preferences", fuzzFactor); Utils.initAction(fuzzFactor, "action.fuzzFactor."); IgnoreLeadingPathSegmentsAction ignoreAction = new IgnoreLeadingPathSegmentsAction( getConfiguration()); appendToGroup(menu, "preferences", ignoreAction); Utils.initAction(ignoreAction, "action.ignoreLeadingPathSegments."); GererateRejFileAction generateAction = new GererateRejFileAction( getConfiguration()); appendToGroup(menu, "preferences", generateAction); Utils.initAction(generateAction, "action.generateRejFile."); appendToGroup(menu, "preferences", new Separator()); } super.fillActionBars(actionBars); } } public ModelProvider[] getEnabledModelProviders() { ModelProvider[] enabledProviders = super.getEnabledModelProviders(); for (int i = 0; i < enabledProviders.length; i++) { ModelProvider provider = enabledProviders[i]; if (provider.getId().equals("org.eclipse.team.ui.patchModelProvider")) { return enabledProviders; } } ModelProvider[] extended = new ModelProvider[enabledProviders.length + 1]; for (int i = 0; i < enabledProviders.length; i++) { extended[i] = enabledProviders[i]; } PatchModelProvider provider = PatchModelProvider.getProvider(); if (provider == null) { return enabledProviders; } extended[(extended.length - 1)] = provider; return extended; } public ICompareInput asCompareInput(Object object) { ISynchronizationCompareAdapter adapter = Utils.getCompareAdapter(object); if (adapter != null) { return adapter.asCompareInput(getContext(), object); } if ((object instanceof ICompareInput)) { return (ICompareInput)object; } return null; } public Object getAdapter(Class adapter) { if (adapter == IRefreshable.class) { return null; } return super.getAdapter(adapter); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.patch.ApplyPatchModelSynchronizeParticipant * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import org.eclipse.compare.internal.core.patch.FilePatch2; import org.eclipse.compare.internal.core.patch.PatchReader; import org.eclipse.compare.internal.patch.FilePatch; import org.eclipse.core.runtime.IPath; class ApplyPatchOperation$1 extends PatchReader { protected FilePatch2 createFileDiff(IPath oldPath, long oldDate, IPath newPath, long newDate) { return new FilePatch(oldPath, oldDate, newPath, newDate); } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.patch.ApplyPatchOperation.1 * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import java.io.BufferedReader; import java.io.IOException; import org.eclipse.compare.CompareConfiguration; import org.eclipse.compare.internal.ComparePreferencePage; import org.eclipse.compare.internal.CompareUIPlugin; import org.eclipse.compare.internal.core.patch.FilePatch2; import org.eclipse.compare.internal.core.patch.PatchReader; import org.eclipse.compare.internal.patch.FilePatch; import org.eclipse.compare.internal.patch.PatchWizard; import org.eclipse.compare.internal.patch.PatchWizardDialog; import org.eclipse.compare.internal.patch.Utilities; import org.eclipse.compare.patch.IFilePatch; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IStorage; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Status; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.swt.widgets.Shell; import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchPartSite; import org.eclipse.ui.ide.IDE; public class ApplyPatchOperation implements Runnable { private IWorkbenchPart part; private CompareConfiguration configuration; private IStorage patch; private IResource target; private ImageDescriptor patchWizardImage; private String patchWizardTitle; private boolean saveAllEditors = true; public static boolean isPatch(IStorage storage) throws CoreException { return internalParsePatch(storage).length > 0; } public static IFilePatch[] parsePatch(IStorage storage) throws CoreException { return internalParsePatch(storage); } public ApplyPatchOperation(IWorkbenchPart part, IStorage patch, IResource target, CompareConfiguration configuration) { Assert.isNotNull(configuration); this.part = part; this.patch = patch; this.target = target; this.configuration = configuration; } public ApplyPatchOperation(IWorkbenchPart targetPart, IResource resource) { this(targetPart, null, resource, new CompareConfiguration()); } public void openWizard() { saveAllEditors(); if (saveAllEditors) { PatchWizard wizard = createPatchWizard(patch, target, configuration); if (patchWizardImage != null) { wizard.setDefaultPageImageDescriptor(patchWizardImage); } if (patchWizardTitle != null) { wizard.setWindowTitle(patchWizardTitle); } wizard.setNeedsProgressMonitor(true); if (((wizard instanceof ApplyPatchSynchronizationWizard)) && (((ApplyPatchSynchronizationWizard)wizard).isComplete())) { wizard.performFinish(); } else { new PatchWizardDialog(getShell(), wizard).open(); } } } private PatchWizard createPatchWizard(IStorage patch, IResource target, CompareConfiguration configuration) { if (isApplyPatchInSynchronizeView()) { return new ApplyPatchSynchronizationWizard(patch, target, configuration); } return new PatchWizard(patch, target, configuration); } protected boolean isApplyPatchInSynchronizeView() { return TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean( "org.eclipse.team.ui.apply_patch_in_sychronize_view"); } protected Shell getShell() { if (part == null) { return CompareUIPlugin.getShell(); } return part.getSite().getShell(); } protected void saveAllEditors() { saveAllEditors = IDE.saveAllEditors(new IResource[] { ResourcesPlugin.getWorkspace().getRoot() }, !ComparePreferencePage.getSaveAllEditors()); } public void setPatchWizardTitle(String title) { patchWizardTitle = title; } public void setPatchWizardImageDescriptor(ImageDescriptor descriptor) { patchWizardImage = descriptor; } public void run() { openWizard(); } private static IFilePatch[] internalParsePatch(IStorage storage) throws CoreException { BufferedReader reader = Utilities.createReader(storage); try { PatchReader patchReader = new PatchReader() { protected FilePatch2 createFileDiff(IPath oldPath, long oldDate, IPath newPath, long newDate) { return new FilePatch(oldPath, oldDate, newPath, newDate); } }; patchReader.parse(reader); FilePatch2[] fileDiffs = patchReader.getAdjustedDiffs(); IFilePatch[] filePatch = new IFilePatch[fileDiffs.length]; for (int i = 0; i < fileDiffs.length; i++) { filePatch[i] = ((FilePatch)fileDiffs[i]); } return filePatch; } catch (IOException e) { throw new CoreException(new Status(4, "org.eclipse.compare", 0, e.getMessage(), e)); } finally { try { reader.close(); } catch (IOException localIOException2) {} } } } /* Location: * Qualified Name: org.eclipse.team.internal.ui.synchronize.patch.ApplyPatchOperation * Java Class Version: 1.2 (46.0) * JD-Core Version: 0.7.1 */ package org.eclipse.team.internal.ui.synchronize.patch; import org.eclipse.compare.internal.core.patch.FileDiffResult; import org.eclipse.compare.internal.core.patch.FilePatch2; import org.eclipse.compare.internal.core.patch.Hunk; import org.eclipse.compare.internal.patch.WorkspacePatcher; import org.eclipse.compare.patch.IHunk; import org.eclipse.core.resources.IResource; import org.eclipse.team.core.TeamException; import org.eclipse.team.core.synchronize.SyncInfo; import org.eclipse.team.core.variants.IResourceVariant; import org.eclipse.team.core.variants.IResourceVariantComparator; class ApplyPatchSubscriber$ApplyPatchSyncInfo extends SyncInfo { final ApplyPatchSubscriber this$0; ApplyPatchSubscriber$ApplyPatchSyncInfo(ApplyPatchSubscriber paramApplyPatchSubscriber, IResource paramIResource, IResourceVariant paramIResourceVariant1, IResourceVariant paramIResourceVariant2, IResourceVariantComparator paramIResourceVariantComparator, ApplyPatchSyncInfo paramApplyPatchSyncInfo) { this(paramApplyPatchSubscriber, paramIResource, paramIResourceVariant1, paramIResourceVariant2, paramIResourceVariantComparator); } private ApplyPatchSubscriber$ApplyPatchSyncInfo(ApplyPatchSubscriber paramApplyPatchSubscriber, IResource local, IResourceVariant base, IResourceVariant remote, IResourceVariantComparator comparator) { super(local, base, remote, comparator); this$0 = paramApplyPatchSubscriber; } protected int calculateKind() throws TeamException { if (!this$0.getPatcher().isEnabled(PatchModelProvider.getPatchObject(getLocal(), ApplyPatchSubscriber.access$0(this$0)))) { return 0; } if (getRemote() != null) { FilePatch2 filePatch2 = ((PatchedFileVariant)getRemote()).getDiff(); IHunk[] hunks = filePatch2.getHunks(); for (int i = 0; i < hunks.length; i++) { if (ApplyPatchSubscriber.access$0(this$0).isManuallyMerged((Hunk)hunks[i])) { return 0; } } } else { Object patchObject = PatchModelProvider.getPatchObject(getLocal(), ApplyPatchSubscriber.access$0(this$0)); if ((patchObject instanceof FilePatch2)) { FilePatch2 filePatch2 = (FilePatch2)patchObject; IHunk[] hunks = filePatch2.getHunks(); for (int i = 0; i < hunks.length; i++) { if (ApplyPatchSubscriber.access$0(this$0).isManuallyMerged((Hunk)hunks[i])) { return 0; } } } } int kind = super.calculateKind(); if ((getRemote() != null) && (this$0.getPatcher().getDiff Further reading...For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.New!JAR listings
|