mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git@git.labs.intellij.net:idea/community
This commit is contained in:
@@ -108,6 +108,16 @@ public abstract class FindManager {
|
||||
public abstract FindResult findString(@NotNull CharSequence text, int offset, @NotNull FindModel model,
|
||||
@Nullable VirtualFile findContextFile);
|
||||
|
||||
public static class MalformedReplacementStringException extends Exception {
|
||||
public MalformedReplacementStringException(String s) {
|
||||
super(s); //To change body of overridden methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
public MalformedReplacementStringException(String s, Throwable throwable) {
|
||||
super(s, throwable); //To change body of overridden methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string to replace with, given the specified found string and find/replace
|
||||
* settings. Supports case-preserving and regular expression replaces.
|
||||
@@ -116,8 +126,9 @@ public abstract class FindManager {
|
||||
* @param model the search and replace settings, including the replace string.
|
||||
* @return the string to replace the specified found string.
|
||||
*/
|
||||
public abstract String getStringToReplace(@NotNull String foundString, @NotNull FindModel model);
|
||||
public abstract String getStringToReplace(@NotNull String foundString, @NotNull FindModel model, int startOffset, @NotNull String documentText);
|
||||
public abstract String getStringToReplace(@NotNull String foundString, @NotNull FindModel model) throws MalformedReplacementStringException;
|
||||
public abstract String getStringToReplace(@NotNull String foundString, @NotNull FindModel model,
|
||||
int startOffset, @NotNull String documentText) throws MalformedReplacementStringException;
|
||||
|
||||
/**
|
||||
* Gets the flag indicating whether the "Find Next" and "Find Previous" actions are
|
||||
|
||||
+6
-2
@@ -135,8 +135,12 @@ public class EnterAfterJavadocTagHandler implements EnterHandlerDelegate {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c == '>') {
|
||||
if (startTagEndOffset < 0) {
|
||||
if (c == '>' && (startTagEndOffset < 0)) {
|
||||
if (i > startOffset && text.charAt(i - 1) == '/') {
|
||||
// Handle situation like '<p/>[offset]'
|
||||
break;
|
||||
}
|
||||
else {
|
||||
startTagEndOffset = i;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -184,6 +184,9 @@ public class StubBasedPsiElementBase<T extends StubElement> extends ASTDelegateP
|
||||
|
||||
@NotNull
|
||||
public IStubElementType getElementType() {
|
||||
if (!(myElementType instanceof IStubElementType)) {
|
||||
throw new AssertionError("Not a stub type: " + myElementType + " in " + getClass());
|
||||
}
|
||||
return (IStubElementType)myElementType;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.intellij.openapi.fileEditor.TextEditor;
|
||||
import com.intellij.openapi.fileEditor.ex.IdeDocumentHistory;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
@@ -440,6 +441,21 @@ public class FindUtil {
|
||||
}
|
||||
int startResultOffset = result.getStartOffset();
|
||||
model.setFromCursor(true);
|
||||
|
||||
int startOffset = result.getStartOffset();
|
||||
int endOffset = result.getEndOffset();
|
||||
String foundString = document.getCharsSequence().subSequence(startOffset, endOffset).toString();
|
||||
String toReplace;
|
||||
try {
|
||||
toReplace = findManager.getStringToReplace(foundString, model, startOffset, document.getText());
|
||||
}
|
||||
catch (FindManager.MalformedReplacementStringException e) {
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
Messages.showErrorDialog(project, e.getMessage(), FindBundle.message("find.replace.invalid.replacement.string.title"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (toPrompt) {
|
||||
int promptResult = findManager.showPromptDialog(model, FindBundle.message("find.replace.dialog.title"));
|
||||
if (promptResult == FindManager.PromptResult.SKIP) {
|
||||
@@ -455,12 +471,6 @@ public class FindUtil {
|
||||
}
|
||||
}
|
||||
|
||||
int startOffset = result.getStartOffset();
|
||||
int endOffset = result.getEndOffset();
|
||||
String foundString = document.getCharsSequence().subSequence(startOffset, endOffset).toString();
|
||||
String toReplace = findManager.getStringToReplace(foundString, model, startOffset, document.getText());
|
||||
if (toReplace == null) break;
|
||||
|
||||
boolean reallyReplace = toPrompt;
|
||||
TextRange textRange = doReplace(project, document, model, result, toReplace, reallyReplace, rangesToChange);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.intellij.find.impl;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.find.FindBundle;
|
||||
import com.intellij.find.FindManager;
|
||||
import com.intellij.find.FindModel;
|
||||
import com.intellij.find.FindSettings;
|
||||
import com.intellij.ide.util.scopeChooser.ScopeChooserCombo;
|
||||
|
||||
@@ -50,7 +50,6 @@ import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -512,7 +511,7 @@ public class FindManagerImpl extends FindManager implements PersistentStateCompo
|
||||
return pattern == null ? null : pattern.matcher(text);
|
||||
}
|
||||
|
||||
public String getStringToReplace(@NotNull String foundString, @NotNull FindModel model) {
|
||||
public String getStringToReplace(@NotNull String foundString, @NotNull FindModel model) throws MalformedReplacementStringException {
|
||||
String toReplace = model.getStringToReplace();
|
||||
if (model.isRegularExpressions()) {
|
||||
return getStringToReplaceByRegexp0(foundString, model);
|
||||
@@ -524,7 +523,8 @@ public class FindManagerImpl extends FindManager implements PersistentStateCompo
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStringToReplace(@NotNull String foundString, @NotNull FindModel model, int startOffset, @NotNull String documentText) {
|
||||
public String getStringToReplace(@NotNull String foundString, @NotNull FindModel model,
|
||||
int startOffset, @NotNull String documentText) throws MalformedReplacementStringException{
|
||||
String toReplace = model.getStringToReplace();
|
||||
if (model.isRegularExpressions()) {
|
||||
return getStringToReplaceByRegexp(model, documentText, startOffset);
|
||||
@@ -535,7 +535,7 @@ public class FindManagerImpl extends FindManager implements PersistentStateCompo
|
||||
return toReplace;
|
||||
}
|
||||
|
||||
private String getStringToReplaceByRegexp(@NotNull final FindModel model, @NotNull String text, int startOffset) {
|
||||
private String getStringToReplaceByRegexp(@NotNull final FindModel model, @NotNull String text, int startOffset) throws MalformedReplacementStringException{
|
||||
Matcher matcher = compileRegExp(model, text);
|
||||
|
||||
if (model.isForward()){
|
||||
@@ -563,17 +563,11 @@ public class FindManagerImpl extends FindManager implements PersistentStateCompo
|
||||
return replaced.substring(matcher.start());
|
||||
}
|
||||
catch (Exception e) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
Messages.showErrorDialog(myProject, FindBundle.message("find.replace.invalid.replacement.string", model.getStringToReplace()),
|
||||
FindBundle.message("find.replace.invalid.replacement.string.title"));
|
||||
}
|
||||
});
|
||||
return null;
|
||||
throw new MalformedReplacementStringException(FindBundle.message("find.replace.invalid.replacement.string", model.getStringToReplace()), e);
|
||||
}
|
||||
}
|
||||
|
||||
private String getStringToReplaceByRegexp0(String foundString, final FindModel model) {
|
||||
private String getStringToReplaceByRegexp0(String foundString, final FindModel model) throws MalformedReplacementStringException{
|
||||
String toFind = model.getStringToFind();
|
||||
String toReplace = model.getStringToReplace();
|
||||
Pattern pattern;
|
||||
@@ -594,13 +588,7 @@ public class FindManagerImpl extends FindManager implements PersistentStateCompo
|
||||
return matcher.replaceAll(StringUtil.unescapeStringCharacters(toReplace));
|
||||
}
|
||||
catch (Exception e) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
Messages.showErrorDialog(myProject, FindBundle.message("find.replace.invalid.replacement.string", model.getStringToReplace()),
|
||||
FindBundle.message("find.replace.invalid.replacement.string.title"));
|
||||
}
|
||||
});
|
||||
return null;
|
||||
throw new MalformedReplacementStringException(FindBundle.message("find.replace.invalid.replacement.string", model.getStringToReplace()), e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -113,8 +113,13 @@ public class LivePreviewController implements LivePreview.Delegate, UserActivity
|
||||
if (currentModel != null) {
|
||||
if (currentModel.isReplaceState()) {
|
||||
FindManager findManager = FindManager.getInstance(editor.getProject());
|
||||
stringToReplace = findManager.getStringToReplace(foundString, currentModel,
|
||||
liveOccurrence.getPrimaryRange().getStartOffset(), documentText);
|
||||
try {
|
||||
stringToReplace = findManager.getStringToReplace(foundString, currentModel,
|
||||
liveOccurrence.getPrimaryRange().getStartOffset(), documentText);
|
||||
}
|
||||
catch (FindManager.MalformedReplacementStringException e) {
|
||||
return null;
|
||||
}
|
||||
if (stringToReplace != null && stringToReplace.isEmpty()) {
|
||||
stringToReplace = EMPTY_STRING_DISPLAY_TEXT;
|
||||
}
|
||||
|
||||
+8
-2
@@ -341,8 +341,14 @@ public class ReplaceInProjectManager {
|
||||
if (!findResult.isStringFound()) {
|
||||
return;
|
||||
}
|
||||
String stringToReplace =
|
||||
findManager.getStringToReplace(foundString.toString(), replaceContext.getFindModel(), textOffset, document.getText());
|
||||
String stringToReplace = null;
|
||||
try {
|
||||
stringToReplace =
|
||||
findManager.getStringToReplace(foundString.toString(), replaceContext.getFindModel(), textOffset, document.getText());
|
||||
}
|
||||
catch (FindManager.MalformedReplacementStringException e) {
|
||||
Messages.showErrorDialog(myProject, e.getMessage(), FindBundle.message("find.replace.invalid.replacement.string.title"));
|
||||
}
|
||||
if (stringToReplace != null) {
|
||||
document.replaceString(textOffset, textEndOffset, stringToReplace);
|
||||
}
|
||||
|
||||
+6
@@ -82,6 +82,12 @@ public class EnterAfterJavadocTagHandlerTest {
|
||||
context = parse(text);
|
||||
assertEmpty(context);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void emptyTag() {
|
||||
EnterAfterJavadocTagHandler.Context context = parse("* <p/>");
|
||||
assertEmpty(context);
|
||||
}
|
||||
|
||||
private static EnterAfterJavadocTagHandler.Context parse(String text) {
|
||||
return parse(text, text.length());
|
||||
|
||||
+42
-3
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.plugins.groovy.lang.parser;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.stubs.*;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
@@ -27,6 +28,7 @@ import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifierList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.annotation.GrAnnotation;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrField;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariableDeclaration;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameterList;
|
||||
@@ -356,7 +358,17 @@ public interface GroovyElementTypes extends GroovyTokenTypes, GroovyDocElementTy
|
||||
GroovyElementType SYNCHRONIZED_STATEMENT = new GroovyElementType("synchronized block statement");
|
||||
GroovyElementType CLASS_INITIALIZER = new GroovyElementType("static compound statement");
|
||||
|
||||
GroovyElementType VARIABLE_DEFINITION_ERROR = new GroovyElementType("variable definitions with errors");
|
||||
EmptyStubElementType<GrVariableDeclaration> VARIABLE_DEFINITION_ERROR = new EmptyStubElementType<GrVariableDeclaration>("variable definitions with errors", GroovyFileType.GROOVY_LANGUAGE) {
|
||||
@Override
|
||||
public boolean shouldCreateStub(ASTNode node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GrVariableDeclaration createPsi(EmptyStub stub) {
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
};
|
||||
EmptyStubElementType<GrVariableDeclaration> VARIABLE_DEFINITION =
|
||||
new EmptyStubElementType<GrVariableDeclaration>("variable definitions", GroovyFileType.GROOVY_LANGUAGE) {
|
||||
@Override
|
||||
@@ -371,7 +383,34 @@ public interface GroovyElementTypes extends GroovyTokenTypes, GroovyDocElementTy
|
||||
|
||||
GroovyElementType TUPLE_ERROR = new GroovyElementType("tuple with error");
|
||||
|
||||
GroovyElementType VARIABLE = new GroovyElementType("assigned variable");
|
||||
GrStubElementType<StubElement, GrVariable> VARIABLE = new GrStubElementType<StubElement, GrVariable>("assigned variable") {
|
||||
|
||||
@Override
|
||||
public boolean shouldCreateStub(ASTNode node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GrVariable createPsi(StubElement stub) {
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public StubElement createStub(GrVariable psi, StubElement parentStub) {
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(StubElement stub, StubOutputStream dataStream) throws IOException {
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public StubElement deserialize(StubInputStream dataStream, StubElement parentStub) throws IOException {
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//modifiers
|
||||
GrStubElementType<GrModifierListStub, GrModifierList> MODIFIERS = new GrModifierListElementType("modifier list");
|
||||
@@ -391,4 +430,4 @@ public interface GroovyElementTypes extends GroovyTokenTypes, GroovyDocElementTy
|
||||
TokenSet VARIABLES = TokenSet.create(VARIABLE, FIELD);
|
||||
TokenSet TYPE_ELEMENTS = TokenSet.create(CLASS_TYPE_ELEMENT, ARRAY_TYPE, BUILT_IN_TYPE, TYPE_ARGUMENT);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class GrStubFileElementType extends IStubFileElementType<GrFileStub> {
|
||||
|
||||
@Override
|
||||
public int getStubVersion() {
|
||||
return super.getStubVersion() + 9;
|
||||
return super.getStubVersion() + 10;
|
||||
}
|
||||
|
||||
public String getExternalId() {
|
||||
|
||||
@@ -334,4 +334,8 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase {
|
||||
public void testMethodImplementedByDelegate() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTestMarkupStubs() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
abstract class X {
|
||||
<error descr="variable cannot have modifier 'abstract'">abstract def</error> foo<error descr="';', '}' or new line expected"><</error><error descr="';', '}' or new line expected">c</error>aret<error descr="';', '}' or new line expected">></error><error descr="';', '}' or new line expected">(</error><error descr="';', '}' or new line expected">S</error>tring s,<error descr="Identifier expected"> </error>int a<error descr="';', '}' or new line expected">)</error>
|
||||
|
||||
def foo(String s) {
|
||||
return foo(s, 5);
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,9 @@ import java.util.*;
|
||||
public class SvnAuthenticationManager extends DefaultSVNAuthenticationManager implements SvnAuthenticationListener {
|
||||
// while Mac storage not working for IDEA, we use this key to check whether to prompt abt plaintext or just store
|
||||
private static final Logger LOG = Logger.getInstance(SvnAuthenticationManager.class.getName());
|
||||
public static final String SVN_SSH = "svn+ssh";
|
||||
public static final String HTTP = "http";
|
||||
public static final String HTTPS = "https";
|
||||
private final Project myProject;
|
||||
private File myConfigDirectory;
|
||||
private PersistentAuthenticationProviderProxy myPersistentAuthenticationProviderProxy;
|
||||
@@ -400,7 +403,7 @@ public class SvnAuthenticationManager extends DefaultSVNAuthenticationManager im
|
||||
@Override
|
||||
public int getReadTimeout(final SVNRepository repository) {
|
||||
String protocol = repository.getLocation().getProtocol();
|
||||
if ("http".equals(protocol) || "https".equals(protocol)) {
|
||||
if (HTTP.equals(protocol) || HTTPS.equals(protocol)) {
|
||||
String host = repository.getLocation().getHost();
|
||||
String timeout = getServersPropertyIdea(host, "http-timeout");
|
||||
if (timeout != null) {
|
||||
@@ -412,9 +415,25 @@ public class SvnAuthenticationManager extends DefaultSVNAuthenticationManager im
|
||||
}
|
||||
return DEFAULT_READ_TIMEOUT;
|
||||
}
|
||||
if (SVN_SSH.equals(protocol)) {
|
||||
return (int) myConfig.mySSHReadTimeout;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConnectTimeout(SVNRepository repository) {
|
||||
String protocol = repository.getLocation().getProtocol();
|
||||
if (SVN_SSH.equals(protocol)) {
|
||||
return (int) myConfig.mySSHConnectionTimeout;
|
||||
}
|
||||
final int connectTimeout = super.getConnectTimeout(repository);
|
||||
if ((HTTP.equals(protocol) || HTTPS.equals(protocol)) && (connectTimeout <= 0)) {
|
||||
return DEFAULT_READ_TIMEOUT;
|
||||
}
|
||||
return connectTimeout;
|
||||
}
|
||||
|
||||
// taken from default manager as is
|
||||
private String getServersPropertyIdea(String host, final String name) {
|
||||
final SVNCompositeConfigFile serversFile = getHostOptionsProvider().getServersFile();
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.idea.svn.SvnConfigurable">
|
||||
<grid id="27dc6" binding="myComponent" layout-manager="GridLayoutManager" row-count="19" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="myComponent" layout-manager="GridLayoutManager" row-count="20" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="688" height="509"/>
|
||||
<xy x="20" y="20" width="688" height="606"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<vspacer id="76b6e">
|
||||
<constraints>
|
||||
<grid row="18" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="5" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="19" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="5" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="9b7ff" class="javax.swing.JLabel" binding="myConfigurationDirectoryLabel">
|
||||
@@ -188,6 +188,75 @@
|
||||
<text value="Check svn:mergeinfo in target subtree when preparing for merge"/>
|
||||
</properties>
|
||||
</component>
|
||||
<grid id="dace9" layout-manager="GridLayoutManager" row-count="2" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="18" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="234" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="SSH connection timeout:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<hspacer id="ca199">
|
||||
<constraints>
|
||||
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<component id="21604" class="javax.swing.JSpinner" binding="mySSHConnectionTimeout" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="44801" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="SSH read timeout:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8e59f" class="javax.swing.JSpinner" binding="mySSHReadTimeout" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<hspacer id="8e62f">
|
||||
<constraints>
|
||||
<grid row="1" column="3" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
<component id="b9617" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="seconds"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="732b" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="seconds"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<hspacer id="72c3d">
|
||||
<constraints>
|
||||
<grid row="18" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</hspacer>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -58,6 +58,8 @@ public class SvnConfigurable implements Configurable {
|
||||
private JCheckBox myShowMergeSourceInAnnotate;
|
||||
private JSpinner myNumRevsInAnnotations;
|
||||
private JCheckBox myMaximumNumberOfRevisionsCheckBox;
|
||||
private JSpinner mySSHConnectionTimeout;
|
||||
private JSpinner mySSHReadTimeout;
|
||||
|
||||
@NonNls private static final String HELP_ID = "project.propSubversion";
|
||||
|
||||
@@ -128,7 +130,7 @@ public class SvnConfigurable implements Configurable {
|
||||
}
|
||||
});
|
||||
myNumRevsInAnnotations.setEnabled(myMaximumNumberOfRevisionsCheckBox.isSelected());
|
||||
}
|
||||
}
|
||||
|
||||
private FileChooserDescriptor createFileDescriptor() {
|
||||
final FileChooserDescriptor descriptor = new FileChooserDescriptor(false, true, false, false, false, false);
|
||||
@@ -192,6 +194,12 @@ public class SvnConfigurable implements Configurable {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (configuration.mySSHConnectionTimeout != ((SpinnerNumberModel) mySSHConnectionTimeout.getModel()).getNumber().longValue()) {
|
||||
return true;
|
||||
}
|
||||
if (configuration.mySSHReadTimeout != ((SpinnerNumberModel) mySSHReadTimeout.getModel()).getNumber().longValue()) {
|
||||
return true;
|
||||
}
|
||||
return !configuration.getConfigurationDirectory().equals(myConfigurationDirectoryText.getText().trim());
|
||||
}
|
||||
|
||||
@@ -213,6 +221,8 @@ public class SvnConfigurable implements Configurable {
|
||||
} else {
|
||||
configuration.setMaxAnnotateRevisions(((SpinnerNumberModel) myNumRevsInAnnotations.getModel()).getNumber().intValue());
|
||||
}
|
||||
configuration.mySSHConnectionTimeout = ((SpinnerNumberModel) mySSHConnectionTimeout.getModel()).getNumber().longValue() * 1000;
|
||||
configuration.mySSHReadTimeout = ((SpinnerNumberModel) mySSHReadTimeout.getModel()).getNumber().longValue() * 1000;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
@@ -243,6 +253,8 @@ public class SvnConfigurable implements Configurable {
|
||||
myNumRevsInAnnotations.setValue(annotateRevisions);
|
||||
}
|
||||
myNumRevsInAnnotations.setEnabled(myMaximumNumberOfRevisionsCheckBox.isSelected());
|
||||
mySSHConnectionTimeout.setValue(configuration.mySSHConnectionTimeout / 1000);
|
||||
mySSHReadTimeout.setValue(configuration.mySSHReadTimeout / 1000);
|
||||
}
|
||||
|
||||
public void disposeUIResources() {
|
||||
@@ -264,6 +276,12 @@ public class SvnConfigurable implements Configurable {
|
||||
int value = configuration.getMaxAnnotateRevisions();
|
||||
value = (value == -1) ? SvnConfiguration.ourMaxAnnotateRevisionsDefault : value;
|
||||
myNumRevsInAnnotations = new JSpinner(new SpinnerNumberModel(value, 10, 100000, 100));
|
||||
|
||||
final int maximum = 30 * 60 * 1000;
|
||||
final long connection = configuration.mySSHConnectionTimeout <= maximum ? configuration.mySSHConnectionTimeout : maximum;
|
||||
final long read = configuration.mySSHReadTimeout <= maximum ? configuration.mySSHReadTimeout : maximum;
|
||||
mySSHConnectionTimeout = new JSpinner(new SpinnerNumberModel(connection / 1000, 0, maximum, 10));
|
||||
mySSHReadTimeout = new JSpinner(new SpinnerNumberModel(read / 1000, 0, maximum, 10));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vcs.annotate.AnnotationListener;
|
||||
import com.intellij.util.io.DataExternalizer;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.DataConversionException;
|
||||
import org.jdom.Element;
|
||||
@@ -80,6 +81,9 @@ public class SvnConfiguration implements ProjectComponent, JDOMExternalizable {
|
||||
private String myUpgradeMode;
|
||||
private SvnSupportOptions mySupportOptions;
|
||||
private int myMaxAnnotateRevisions = ourMaxAnnotateRevisionsDefault;
|
||||
private final static long DEFAULT_SSH_TIMEOUT = 30 * 1000;
|
||||
public long mySSHConnectionTimeout = DEFAULT_SSH_TIMEOUT;
|
||||
public long mySSHReadTimeout = DEFAULT_SSH_TIMEOUT;
|
||||
|
||||
public static final AuthStorage RUNTIME_AUTH_CACHE = new AuthStorage();
|
||||
public String LAST_MERGED_REVISION = null;
|
||||
|
||||
Reference in New Issue
Block a user