diff options
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java')
-rw-r--r-- | bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java index 52163627b..5b2485847 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java @@ -305,30 +305,30 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC } private TextViewer createText(SashForm parent) { - SourceViewer result = new SourceViewer(parent, null, null, true, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY); - result.getTextWidget().setIndent(2); - result.configure(new TextSourceViewerConfiguration(EditorsUI.getPreferenceStore()) { - @Override + SourceViewer result = new SourceViewer(parent, null, null, true, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY); + result.getTextWidget().setIndent(2); + result.configure(new TextSourceViewerConfiguration(EditorsUI.getPreferenceStore()) { + @Override protected Map getHyperlinkDetectorTargets(ISourceViewer sourceViewer) { - return Collections.singletonMap("org.eclipse.ui.DefaultTextEditor", //$NON-NLS-1$ - new IAdaptable() { - @Override + return Collections.singletonMap("org.eclipse.ui.DefaultTextEditor", //$NON-NLS-1$ + new IAdaptable() { + @Override public <T> T getAdapter(Class<T> adapter) { - if(adapter==IFile.class && getInput() instanceof IFile) { - return adapter.cast(getInput()); - } else if(adapter==IFileHistory.class && getInput() instanceof IFileHistory) { - return adapter.cast(getInput()); - } - return Platform.getAdapterManager().getAdapter(CVSHistoryPage.this, adapter); - } - }); - } - }); - - result.addSelectionChangedListener(event -> copyAction.update()); - result.setTextDoubleClickStrategy( - new DefaultTextDoubleClickStrategy(), - IDocument.DEFAULT_CONTENT_TYPE); + if(adapter==IFile.class && getInput() instanceof IFile) { + return adapter.cast(getInput()); + } else if(adapter==IFileHistory.class && getInput() instanceof IFileHistory) { + return adapter.cast(getInput()); + } + return Platform.getAdapterManager().getAdapter(CVSHistoryPage.this, adapter); + } + }); + } + }); + + result.addSelectionChangedListener(event -> copyAction.update()); + result.setTextDoubleClickStrategy( + new DefaultTextDoubleClickStrategy(), + IDocument.DEFAULT_CONTENT_TYPE); result.activatePlugins(); return result; } @@ -380,10 +380,10 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC CVSTag tag1 = (CVSTag) e1; CVSTag tag2 = (CVSTag) e2; int type1 = tag1.getType(); - int type2 = tag2.getType(); - if (type1 != type2) { - return type2 - type1; - } + int type2 = tag2.getType(); + if (type1 != type2) { + return type2 - type1; + } if (sortTagsAscending) return super.compare(viewer, tag1, tag2); else @@ -591,7 +591,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC monitor.done(); } }); - PlatformUI.getWorkbench().getHelpSystem().setHelp(getContentsAction, IHelpContextIds.GET_FILE_CONTENTS_ACTION); + PlatformUI.getWorkbench().getHelpSystem().setHelp(getContentsAction, IHelpContextIds.GET_FILE_CONTENTS_ACTION); getRevisionAction = getContextMenuAction(CVSUIMessages.HistoryView_getRevisionAction, true /* needs progress */, monitor -> { ICVSRemoteFile remoteFile = (ICVSRemoteFile) CVSWorkspaceRoot.getRemoteResourceFor(((CVSFileRevision) currentSelection).getCVSRemoteFile()); @@ -616,7 +616,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC // Cancelled by user } }); - PlatformUI.getWorkbench().getHelpSystem().setHelp(getRevisionAction, IHelpContextIds.GET_FILE_REVISION_ACTION); + PlatformUI.getWorkbench().getHelpSystem().setHelp(getRevisionAction, IHelpContextIds.GET_FILE_REVISION_ACTION); // Override MoveRemoteTagAction to work for log entries final IActionDelegate tagActionDelegate = new MoveRemoteTagAction() { @@ -651,31 +651,31 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC } return resources; } - /* - * Override the creation of the tag operation in order to support - * the refresh of the view after the tag operation completes - */ - @Override + /* + * Override the creation of the tag operation in order to support + * the refresh of the view after the tag operation completes + */ + @Override protected ITagOperation createTagOperation() { - return new TagInRepositoryOperation(getTargetPart(), getSelectedRemoteResources()) { - @Override + return new TagInRepositoryOperation(getTargetPart(), getSelectedRemoteResources()) { + @Override public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException { - super.execute(monitor); - Display.getDefault().asyncExec(() -> { - if( ! wasCancelled()) { - refresh(); - } + super.execute(monitor); + Display.getDefault().asyncExec(() -> { + if( ! wasCancelled()) { + refresh(); + } }); - }; - }; - } + }; + }; + } }; tagWithExistingAction = getContextMenuAction(CVSUIMessages.HistoryView_tagWithExistingAction, false /* no progress */, monitor -> { tagActionDelegate.selectionChanged(tagWithExistingAction, treeViewer.getSelection()); tagActionDelegate.run(tagWithExistingAction); }); - PlatformUI.getWorkbench().getHelpSystem().setHelp(getRevisionAction, IHelpContextIds.TAG_WITH_EXISTING_ACTION); - + PlatformUI.getWorkbench().getHelpSystem().setHelp(getRevisionAction, IHelpContextIds.TAG_WITH_EXISTING_ACTION); + // Toggle text visible action toggleTextAction = new Action(TeamUIMessages.GenericHistoryView_ShowCommentViewer) { @Override @@ -717,7 +717,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC store.setValue(ICVSUIConstants.PREF_SHOW_SEARCH, toggleSearchAction.isChecked()); if (!toggleSearchAction.isChecked()){ if (searchFilter != null) - treeViewer.removeFilter(searchFilter); + treeViewer.removeFilter(searchFilter); } else { searchField.setMessage(CVSUIMessages.CVSHistoryPage_EnterSearchTerm); searchField.selectAll(); @@ -863,7 +863,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC manager.add(new Separator("openCompare")); //$NON-NLS-1$ } if (file != null && - !(file instanceof RemoteFile)) { + !(file instanceof RemoteFile)) { // Add the "Add to Workspace" action if 1 revision is selected. ISelection sel = treeViewer.getSelection(); if (!sel.isEmpty()) { @@ -1416,8 +1416,8 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC String searchString = searchField.getText(); if (searchString.equals("") || //$NON-NLS-1$ searchString.equals(CVSUIMessages.CVSHistoryPage_EnterSearchTerm)) { - if (searchFilter != null) - treeViewer.removeFilter(searchFilter); + if (searchFilter != null) + treeViewer.removeFilter(searchFilter); return; } @@ -1698,7 +1698,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC message = CVSUIMessages.CVSHistoryPage_NoRevisions; break; } - + MessageHistoryCategory messageCategory = new MessageHistoryCategory(NLS.bind(CVSUIMessages.CVSHistoryPage_NoRevisionsForMode, new String[] { message })); return messageCategory; } @@ -1746,7 +1746,7 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC //Safety check for non-managed files that are added with the CVSHistoryPage //in view if (file == null || file.getIResource() == null) - return; + return; IResourceDelta resourceDelta = root.findMember(((IFile)file.getIResource()).getFullPath()); if (resourceDelta != null){ |