mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,6 +33,7 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actions.EditorActionUtil;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
@@ -82,7 +83,14 @@ public class TargetElementUtilBase {
|
||||
|
||||
@Nullable
|
||||
public static PsiReference findReference(Editor editor) {
|
||||
return findReference(editor, editor.getCaretModel().getOffset());
|
||||
PsiReference result = findReference(editor, editor.getCaretModel().getOffset());
|
||||
if (result == null) {
|
||||
final Integer offset = editor.getUserData(EditorActionUtil.EXPECTED_CARET_OFFSET);
|
||||
if (offset != null) {
|
||||
result = findReference(editor, offset);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -124,7 +132,15 @@ public class TargetElementUtilBase {
|
||||
public static PsiElement findTargetElement(Editor editor, int flags) {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
|
||||
return getInstance().findTargetElement(editor, flags, editor.getCaretModel().getOffset());
|
||||
final PsiElement result = getInstance().findTargetElement(editor, flags, editor.getCaretModel().getOffset());
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
final Integer offset = editor.getUserData(EditorActionUtil.EXPECTED_CARET_OFFSET);
|
||||
if (offset != null) {
|
||||
return getInstance().findTargetElement(editor, flags, offset);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static boolean inVirtualSpace(Editor editor, int offset) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,6 +26,7 @@ import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.dnd.FileCopyPasteUtil;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actions.EditorActionUtil;
|
||||
import com.intellij.openapi.editor.colors.EditorColors;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager;
|
||||
import com.intellij.openapi.editor.markup.TextAttributes;
|
||||
@@ -109,7 +110,7 @@ public class CopyReferenceAction extends AnAction {
|
||||
private static PsiElement getElementToCopy(final Editor editor, final DataContext dataContext) {
|
||||
PsiElement element = null;
|
||||
if (editor != null) {
|
||||
PsiReference reference = TargetElementUtilBase.findReference(editor, editor.getCaretModel().getOffset());
|
||||
PsiReference reference = TargetElementUtilBase.findReference(editor);
|
||||
if (reference != null) {
|
||||
element = reference.getElement();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.fileTypes.FileTypes;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.fileTypes.ex.FileTypeManagerEx;
|
||||
@@ -55,6 +56,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
@@ -351,4 +353,9 @@ public class FileTemplateUtil{
|
||||
CreateFromTemplateHandler handler = findHandler(template);
|
||||
return handler.canCreate(dirs);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Icon getIcon(@NotNull FileTemplate fileTemplate) {
|
||||
return FileTypeManager.getInstance().getFileTypeByExtension(fileTemplate.getExtension()).getIcon();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,10 +17,10 @@
|
||||
package com.intellij.ide.fileTemplates.actions;
|
||||
|
||||
import com.intellij.ide.fileTemplates.FileTemplate;
|
||||
import com.intellij.ide.fileTemplates.FileTemplateUtil;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
import com.intellij.openapi.fileTypes.ex.FileTypeManagerEx;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -30,7 +30,7 @@ public class CreateFromTemplateAction extends CreateFromTemplateActionBase {
|
||||
private final FileTemplate myTemplate;
|
||||
|
||||
public CreateFromTemplateAction(FileTemplate template){
|
||||
super(template.getName(), null, FileTypeManagerEx.getInstanceEx().getFileTypeByExtension(template.getExtension()).getIcon());
|
||||
super(template.getName(), null, FileTemplateUtil.getIcon(template));
|
||||
myTemplate = template;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,7 +17,7 @@
|
||||
package com.intellij.ide.fileTemplates.impl;
|
||||
|
||||
import com.intellij.ide.fileTemplates.FileTemplate;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.ide.fileTemplates.FileTemplateUtil;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -52,7 +52,7 @@ abstract class FileTemplateTabAsList extends FileTemplateTab {
|
||||
Icon icon = null;
|
||||
if (value instanceof FileTemplate) {
|
||||
FileTemplate template = (FileTemplate) value;
|
||||
icon = FileTypeManager.getInstance().getFileTypeByExtension(template.getExtension()).getIcon();
|
||||
icon = FileTemplateUtil.getIcon(template);
|
||||
final boolean internalTemplate = AllFileTemplatesConfigurable.isInternalTemplate(template.getName(), getTitle());
|
||||
if (internalTemplate) {
|
||||
setFont(getFont().deriveFont(Font.BOLD));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,10 +16,11 @@
|
||||
|
||||
package com.intellij.ide.fileTemplates.ui;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.fileTemplates.FileTemplate;
|
||||
import com.intellij.ide.fileTemplates.FileTemplateManager;
|
||||
import com.intellij.ide.fileTemplates.FileTemplateUtil;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.ui.ListCellRendererWrapper;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.ui.FixedSizeButton;
|
||||
@@ -80,6 +81,15 @@ public class SelectTemplateDialog extends DialogWrapper{
|
||||
}
|
||||
if(myCbxTemplates == null){
|
||||
myCbxTemplates = new JComboBox(model);
|
||||
myCbxTemplates.setRenderer(new ListCellRendererWrapper<FileTemplate>(myCbxTemplates.getRenderer()) {
|
||||
@Override
|
||||
public void customize(JList list, FileTemplate fileTemplate, int index, boolean selected, boolean hasFocus) {
|
||||
if (fileTemplate != null) {
|
||||
setIcon(FileTemplateUtil.getIcon(fileTemplate));
|
||||
setText(fileTemplate.getName());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
Object selected = myCbxTemplates.getSelectedItem();
|
||||
|
||||
+5
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -25,8 +25,12 @@ import java.util.EventListener;
|
||||
* @see EditorMouseMotionListener
|
||||
*/
|
||||
public interface EditorMouseListener extends EventListener {
|
||||
|
||||
/**
|
||||
* Called when a mouse button is pressed over the editor.
|
||||
* <p/>
|
||||
* <b>Note:</b> this callback is assumed to be at the very start of 'mouse press' processing, i.e. common actions
|
||||
* like 'caret position change', 'selection change' etc implied by the 'mouse press' have not been performed yet.
|
||||
*
|
||||
* @param e the event containing information about the mouse press.
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
*/
|
||||
package com.intellij.help.impl;
|
||||
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.impl.IdeFocusManagerHeadless;
|
||||
import com.intellij.ui.AppUIUtil;
|
||||
import com.intellij.util.Alarm;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.help.*;
|
||||
@@ -207,6 +210,9 @@ class IdeaHelpBroker extends DefaultHelpBroker implements KeyListener{
|
||||
//myFrame.setLocationRelativeTo(null);
|
||||
myFrame.setVisible(visible);
|
||||
myFrame.setState(JFrame.NORMAL);
|
||||
IdeFocusManager focusManager = IdeFocusManager.findInstance();
|
||||
JComponent target = focusManager.getFocusTargetFor(myFrame.getRootPane());
|
||||
focusManager.requestFocus(target != null ? target : myFrame, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -671,8 +677,9 @@ class IdeaHelpBroker extends DefaultHelpBroker implements KeyListener{
|
||||
if(myDialog.isShowing()){
|
||||
myDialog.hide();
|
||||
}
|
||||
if(myOwnerWindow!=null)
|
||||
if (myOwnerWindow != null) {
|
||||
myOwnerWindow.removeWindowListener(dl);
|
||||
}
|
||||
myOwnerWindow=null;
|
||||
modalDeactivated=true;
|
||||
}
|
||||
@@ -694,22 +701,24 @@ class IdeaHelpBroker extends DefaultHelpBroker implements KeyListener{
|
||||
}
|
||||
}
|
||||
} else{
|
||||
if(myFrame==null){
|
||||
myFrame=new JFrame(helpTitle);
|
||||
if (myFrame == null) {
|
||||
myFrame = new JFrame(helpTitle);
|
||||
resize = true;
|
||||
AppUIUtil.updateFrameIcon(myFrame);
|
||||
WindowListener l=new WindowAdapter(){
|
||||
public void windowClosing(WindowEvent e){
|
||||
WindowListener l = new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
myFrame.setVisible(false);
|
||||
}
|
||||
|
||||
public void windowClosed(WindowEvent e){
|
||||
public void windowClosed(WindowEvent e) {
|
||||
myFrame.setVisible(false);
|
||||
}
|
||||
};
|
||||
myFrame.addWindowListener(l);
|
||||
} else
|
||||
}
|
||||
else {
|
||||
pos = myFrame.getLocation();
|
||||
}
|
||||
if(myDialog!=null){
|
||||
pos=myDialog.getLocation();
|
||||
size=myDialog.getSize();
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.intellij.openapi.actionSystem.ActionPopupMenu;
|
||||
import com.intellij.openapi.editor.*;
|
||||
import com.intellij.openapi.editor.event.EditorMouseEvent;
|
||||
import com.intellij.openapi.editor.event.EditorMouseEventArea;
|
||||
import com.intellij.openapi.editor.event.EditorMouseListener;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.editor.impl.EditorImpl;
|
||||
@@ -49,6 +50,21 @@ import java.awt.event.MouseEvent;
|
||||
import java.util.List;
|
||||
|
||||
public class EditorActionUtil {
|
||||
|
||||
/**
|
||||
* Editor actions may be invoked multiple ways - programmatically, via keyboard/mouse shortcut, main/context menu etc.
|
||||
* Action processing may also interfere with standard editor behavior (caret position change, selection change etc).
|
||||
* <p/>
|
||||
* E.g. consider a situation when context menu is shown on right mouse click -
|
||||
* {@link EditorMouseListener#mousePressed(EditorMouseEvent) the contract says} that no common actions have been performed yet.
|
||||
* However, some actions may operate on an 'active element' (an element under caret), hence, they would incorrectly because the
|
||||
* caret position has not been changed yet.
|
||||
* <p/>
|
||||
* We address that problem by providing a special key that is intended to hold 'expected caret offset', i.e. offset where we
|
||||
* expect the caret to be located at the near future.
|
||||
*/
|
||||
public static final Key<Integer> EXPECTED_CARET_OFFSET = Key.create("expectedEditorOffset");
|
||||
|
||||
protected static final Object EDIT_COMMAND_GROUP = Key.create("EditGroup");
|
||||
public static final Object DELETE_COMMAND_GROUP = Key.create("DeleteGroup");
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ import com.intellij.openapi.command.UndoConfirmationPolicy;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.*;
|
||||
import com.intellij.openapi.editor.actionSystem.*;
|
||||
import com.intellij.openapi.editor.actions.EditorActionUtil;
|
||||
import com.intellij.openapi.editor.colors.*;
|
||||
import com.intellij.openapi.editor.colors.impl.DelegateColorScheme;
|
||||
import com.intellij.openapi.editor.event.*;
|
||||
@@ -5078,6 +5079,10 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
TooltipController.getInstance().cancelTooltip(FOLDING_TOOLTIP_GROUP, e, true);
|
||||
}
|
||||
private void runMousePressedCommand(@NotNull final MouseEvent e) {
|
||||
|
||||
final int clickOffset = logicalPositionToOffset(xyToLogicalPosition(e.getPoint()));
|
||||
putUserData(EditorActionUtil.EXPECTED_CARET_OFFSET, clickOffset);
|
||||
|
||||
mySelectionTweaked = false;
|
||||
myMousePressedEvent = e;
|
||||
EditorMouseEvent event = new EditorMouseEvent(EditorImpl.this, e, getMouseEventArea(e));
|
||||
|
||||
@@ -64,4 +64,6 @@ public interface CommittedChangesProvider<T extends CommittedChangeList, U exten
|
||||
*/
|
||||
@Nullable
|
||||
Pair<T, FilePath> getOneList(final VirtualFile file, final VcsRevisionNumber number) throws VcsException;
|
||||
|
||||
RepositoryLocation getForNonLocal(final VirtualFile file);
|
||||
}
|
||||
|
||||
+34
-4
@@ -34,6 +34,8 @@ import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author irengrig
|
||||
* Date: 3/16/11
|
||||
@@ -60,6 +62,7 @@ public class ShowAllAffectedGenericAction extends AnAction {
|
||||
public static void showSubmittedFiles(final Project project, final VcsRevisionNumber revision, final VirtualFile virtualFile, final VcsKey vcsKey) {
|
||||
final AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).findVcsByName(vcsKey.getName());
|
||||
if (vcs == null) return;
|
||||
if (! isInLocalFSHack(virtualFile) && ! canPresentNonLocal(project, vcsKey, virtualFile)) return;
|
||||
|
||||
final String title = VcsBundle.message("paths.affected.in.revision",
|
||||
revision instanceof ShortVcsRevisionNumber
|
||||
@@ -71,9 +74,20 @@ public class ShowAllAffectedGenericAction extends AnAction {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
try {
|
||||
final Pair<CommittedChangeList, FilePath> pair = vcs.getCommittedChangesProvider().getOneList(virtualFile, revision);
|
||||
if (pair != null) {
|
||||
list[0] = pair.getFirst();
|
||||
final CommittedChangesProvider provider = vcs.getCommittedChangesProvider();
|
||||
if (isInLocalFSHack(virtualFile)) {
|
||||
final Pair<CommittedChangeList, FilePath> pair = provider.getOneList(virtualFile, revision);
|
||||
if (pair != null) {
|
||||
list[0] = pair.getFirst();
|
||||
}
|
||||
} else {
|
||||
final RepositoryLocation local = provider.getForNonLocal(virtualFile);
|
||||
if (local != null) {
|
||||
final List<CommittedChangeList> changes = provider.getCommittedChanges(provider.createDefaultSettings(), local, 1);
|
||||
if (changes != null && changes.size() == 1) {
|
||||
list[0] = changes.get(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (VcsException e) {
|
||||
@@ -95,6 +109,12 @@ public class ShowAllAffectedGenericAction extends AnAction {
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean isInLocalFSHack(final VirtualFile vf) {
|
||||
if (vf.isInLocalFileSystem()) return true;
|
||||
final String url = vf.getPresentableUrl();
|
||||
return ! url.contains("://") && ! url.contains(":\\\\");
|
||||
}
|
||||
|
||||
private static String failedText(VirtualFile virtualFile, VcsRevisionNumber revision) {
|
||||
return "Show all affected files for " + virtualFile.getPath() + " at " + revision.asString() + " failed";
|
||||
}
|
||||
@@ -108,6 +128,16 @@ public class ShowAllAffectedGenericAction extends AnAction {
|
||||
return;
|
||||
}
|
||||
final VirtualFile revisionVirtualFile = e.getData(VcsDataKeys.VCS_VIRTUAL_FILE);
|
||||
e.getPresentation().setEnabled((e.getData(VcsDataKeys.VCS_FILE_REVISION) != null) && (revisionVirtualFile != null));
|
||||
boolean enabled = (e.getData(VcsDataKeys.VCS_FILE_REVISION) != null) && (revisionVirtualFile != null);
|
||||
enabled = enabled && (isInLocalFSHack(revisionVirtualFile) || canPresentNonLocal(project, vcsKey, revisionVirtualFile));
|
||||
e.getPresentation().setEnabled(enabled);
|
||||
}
|
||||
|
||||
private static boolean canPresentNonLocal(Project project, VcsKey key, final VirtualFile file) {
|
||||
final AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).findVcsByName(key.getName());
|
||||
if (vcs == null) return false;
|
||||
final CommittedChangesProvider provider = vcs.getCommittedChangesProvider();
|
||||
if (provider == null) return false;
|
||||
return provider.getForNonLocal(file) != null;
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -161,6 +161,11 @@ public class CompositeCommittedChangesProvider implements CommittedChangesProvid
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepositoryLocation getForNonLocal(VirtualFile file) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static class CompositeChangeBrowserSettings extends ChangeBrowserSettings {
|
||||
private final Map<AbstractVcs, ChangeBrowserSettings> myMap;
|
||||
private final Set<AbstractVcs> myEnabledVcs = new HashSet<AbstractVcs>();
|
||||
|
||||
@@ -642,6 +642,7 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton {
|
||||
VcsHistoryUtil.showDiff(project, myFilePath, left, right, leftTitle, rightTitle);
|
||||
}
|
||||
catch (final VcsException e) {
|
||||
LOG.info(e);
|
||||
WaitForProgressToShow.runOrInvokeLaterAboveProgress(new Runnable() {
|
||||
public void run() {
|
||||
Messages.showErrorDialog(VcsBundle.message("message.text.cannot.show.differences", e.getLocalizedMessage()),
|
||||
@@ -650,7 +651,7 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton {
|
||||
}, null, project);
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e);
|
||||
LOG.info(e);
|
||||
}
|
||||
catch (ProcessCanceledException ex) {
|
||||
LOG.info(ex);
|
||||
|
||||
+5
@@ -207,6 +207,11 @@ public class CvsCommittedChangesProvider implements CachingCommittedChangesProvi
|
||||
return new Pair<CvsChangeList, FilePath>(result.get(), filePath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepositoryLocation getForNonLocal(VirtualFile file) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<CvsChangeList> getCommittedChanges(ChangeBrowserSettings settings, RepositoryLocation location, final int maxCount)
|
||||
throws VcsException {
|
||||
final CvsRepositoryLocation cvsLocation = (CvsRepositoryLocation) location;
|
||||
|
||||
@@ -266,6 +266,11 @@ public class GitCommittedChangeListProvider implements CommittedChangesProvider<
|
||||
return new Pair<CommittedChangeList, FilePath>(commit, ((GitFileRevision) history.get(history.size() - 1)).getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepositoryLocation getForNonLocal(VirtualFile file) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getFormatVersion() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.jetbrains.plugins.gradle.task;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.AbstractProjectComponent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.util.Alarm;
|
||||
@@ -47,6 +48,7 @@ public class GradleTaskManager extends AbstractProjectComponent implements Gradl
|
||||
@NotNull private final Alarm myAlarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
|
||||
|
||||
@NotNull private final GradleApiFacadeManager myFacadeManager;
|
||||
@NotNull private final GradleProgressNotificationManager myProgressNotificationManager;
|
||||
|
||||
public GradleTaskManager(@NotNull Project project,
|
||||
@NotNull GradleApiFacadeManager facadeManager,
|
||||
@@ -54,6 +56,11 @@ public class GradleTaskManager extends AbstractProjectComponent implements Gradl
|
||||
{
|
||||
super(project);
|
||||
myFacadeManager = facadeManager;
|
||||
myProgressNotificationManager = notificationManager;
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
notificationManager.addNotificationListener(this);
|
||||
myAlarm.addRequest(new Runnable() {
|
||||
@Override
|
||||
@@ -73,7 +80,12 @@ public class GradleTaskManager extends AbstractProjectComponent implements Gradl
|
||||
}
|
||||
}, DETECT_HANGED_TASKS_FREQUENCY_MILLIS);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void disposeComponent() {
|
||||
myProgressNotificationManager.removeNotificationListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to check if any task of the given type is being executed at the moment.
|
||||
*
|
||||
|
||||
@@ -286,4 +286,9 @@ public class HgCachingCommitedChangesProvider
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepositoryLocation getForNonLocal(VirtualFile file) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vcs.*;
|
||||
import com.intellij.openapi.vcs.changes.Change;
|
||||
import com.intellij.openapi.vcs.changes.ContentRevision;
|
||||
@@ -33,6 +34,7 @@ import com.intellij.openapi.vcs.history.VcsRevisionNumber;
|
||||
import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings;
|
||||
import com.intellij.openapi.vcs.versionBrowser.ChangesBrowserSettingsEditor;
|
||||
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.AsynchConsumer;
|
||||
import com.intellij.util.Consumer;
|
||||
@@ -563,6 +565,12 @@ public class SvnCommittedChangesProvider implements CachingCommittedChangesProvi
|
||||
return new Pair<SvnChangeList, FilePath>(result[0], new FilePathImpl(file));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepositoryLocation getForNonLocal(VirtualFile file) {
|
||||
final String url = file.getPresentableUrl();
|
||||
return new SvnRepositoryLocation(FileUtil.toSystemIndependentName(url));
|
||||
}
|
||||
|
||||
private static class RenameContext {
|
||||
@NotNull
|
||||
private String myCurrentPath;
|
||||
|
||||
@@ -619,10 +619,10 @@ public class SvnHistoryProvider implements VcsHistoryProvider, VcsCacheableHisto
|
||||
super(vcs, url, pegRevision, lastPath, result, repoRootURL, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
protected SvnFileRevision createRevision(final SVNLogEntry logEntry, final String copyPath) {
|
||||
return new SvnFileRevision(myVcs, SVNRevision.UNDEFINED, logEntry, myUrl, copyPath, null);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private class MergeSourceColumnInfo extends ColumnInfo<VcsFileRevision, VcsFileRevision> {
|
||||
|
||||
Reference in New Issue
Block a user