aClass = EditorGutterComponentImpl.class;
- //noinspection HardCodedStringLiteral
- flavors = new DataFlavor[]{new DataFlavor(
- DataFlavor.javaJVMLocalObjectMimeType + ";class=" + aClass.getName(), "GutterTransferable", aClass.getClassLoader()
- )};
- }
- catch (ClassNotFoundException e) {
- LOG.error(e); // should not happen
- flavors = new DataFlavor[0];
- }
- FLAVORS = flavors;
- }
-
- private class MyDragGestureListener implements DragGestureListener {
- public void dragGestureRecognized(DragGestureEvent dge) {
- if ((dge.getDragAction() & DnDConstants.ACTION_MOVE) == 0) return;
- final GutterIconRenderer renderer = getGutterRenderer(dge.getDragOrigin());
- if (renderer != null) {
- final GutterDraggableObject draggableObject = renderer.getDraggableObject();
- if (draggableObject != null) {
- try {
- myGutterDraggableObject = draggableObject;
- final MyDragSourceListener dragSourceListener = new MyDragSourceListener();
- dge.startDrag(DragSource.DefaultMoveNoDrop, new Transferable () {
- public DataFlavor[] getTransferDataFlavors() {
- return FLAVORS;
- }
-
- public boolean isDataFlavorSupported(DataFlavor flavor) {
- DataFlavor[] flavors = getTransferDataFlavors();
- for (DataFlavor flavor1 : flavors) {
- if (flavor.equals(flavor1)) {
- return true;
- }
- }
- return false;
- }
-
- public Object getTransferData(DataFlavor flavor) {
- return null;
- }
- }, dragSourceListener);
- }
- catch (InvalidDnDOperationException e) {
- // OK, can't dnd
- }
- }
-
- }
- }
- }
-
- private class MyDragSourceListener extends DragSourceAdapter {
- public void dragEnter(DragSourceDragEvent e) {
- updateCursor(e);
- }
-
- public void dragOver(DragSourceDragEvent e) {
- updateCursor(e);
- }
-
- public void dropActionChanged(DragSourceDragEvent e) {
- e.getDragSourceContext().setCursor(null);//setCursor (e.getDragSourceContext());
- }
-
- private void updateCursor(final DragSourceDragEvent e) {
- final DragSourceContext context = e.getDragSourceContext();
- final Point screenPoint = e.getLocation();
- if (screenPoint != null) {
- final Point gutterPoint = new Point(screenPoint);
- SwingUtilities.convertPointFromScreen(gutterPoint, EditorGutterComponentImpl.this);
- if (contains(gutterPoint)){
- final Point editorPoint = new Point(screenPoint);
- SwingUtilities.convertPointFromScreen(editorPoint, myEditor.getContentComponent());
- int line = myEditor.yPositionToLogicalLineNumber((int)editorPoint.getY());
- final Cursor cursor = myGutterDraggableObject.getCursor(line);
- context.setCursor(cursor);
- return;
- }
- }
- context.setCursor(null);
- }
-
- public void dragDropEnd(DragSourceDropEvent e) {
- if (!e.getDropSuccess()) return;
-
- if (e.getDropAction() == DnDConstants.ACTION_MOVE) {
- myGutterDraggableObject.removeSelf();
- }
- }
- }
-
- private class MyDropTargetListener extends DropTargetAdapter {
- public void drop(DropTargetDropEvent e) {
- if (myGutterDraggableObject != null) {
- int dropAction = e.getDropAction();
- if ((dropAction & DnDConstants.ACTION_MOVE) != 0) {
- int line = myEditor.yPositionToLogicalLineNumber((int)e.getLocation().getY());
- e.dropComplete(myGutterDraggableObject.copy(line));
- return;
- }
- }
- e.rejectDrop();
- }
- }
}
diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java
index b7f931f603d6..7320e895d910 100644
--- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java
+++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java
@@ -270,8 +270,7 @@ public class XLineBreakpointImpl extends XBreak
}
}
- private boolean canMoveTo(int line) {
- final VirtualFile file = getFile();
+ private boolean canMoveTo(int line, VirtualFile file) {
return file != null && myType.canPutAt(file, line, getProject());
}
@@ -389,11 +388,9 @@ public class XLineBreakpointImpl
extends XBreak
@Override
public GutterDraggableObject getDraggableObject() {
return new GutterDraggableObject() {
- public void removeSelf() {
- }
-
- public boolean copy(int line) {
- if (canMoveTo(line)) {
+ public boolean copy(int line, VirtualFile file) {
+ if (canMoveTo(line, file)) {
+ setFileUrl(file.getUrl());
setLine(line);
return true;
}
@@ -401,7 +398,7 @@ public class XLineBreakpointImpl
extends XBreak
}
public Cursor getCursor(int line) {
- return canMoveTo(line) ? DragSource.DefaultMoveDrop : DragSource.DefaultMoveNoDrop;
+ return canMoveTo(line, getFile()) ? DragSource.DefaultMoveDrop : DragSource.DefaultMoveNoDrop;
}
};
}
diff --git a/plugins/android/resources/fileTemplates/j2ee/Application.java.ft b/plugins/android/resources/fileTemplates/j2ee/Application.java.ft
new file mode 100644
index 000000000000..336051a028f2
--- /dev/null
+++ b/plugins/android/resources/fileTemplates/j2ee/Application.java.ft
@@ -0,0 +1,7 @@
+package ${PACKAGE_NAME};
+
+import android.app.Application;
+
+#parse("File Header.java")
+public class ${NAME} extends Application {
+}
diff --git a/plugins/android/resources/fileTemplates/j2ee/Application.java.html b/plugins/android/resources/fileTemplates/j2ee/Application.java.html
new file mode 100644
index 000000000000..09a7bfbff9e3
--- /dev/null
+++ b/plugins/android/resources/fileTemplates/j2ee/Application.java.html
@@ -0,0 +1,5 @@
+
+
+This is a built-in file template used to create custom Application class in Android applications.
+
+
\ No newline at end of file
diff --git a/plugins/android/resources/messages/AndroidBundle.properties b/plugins/android/resources/messages/AndroidBundle.properties
index e98186580071..6a224277a061 100644
--- a/plugins/android/resources/messages/AndroidBundle.properties
+++ b/plugins/android/resources/messages/AndroidBundle.properties
@@ -231,4 +231,5 @@ android.compilation.error.apt.gen.not.specified=AAPT destination directory not s
android.compilation.error.aidl.gen.not.specified=AIDL destination directory not specified for module {0}
android.compilation.error.apk.path.not.specified=Final APK path not specified for module {0}
android.restart.logcat.action.text=Restart
-android.restart.logcat.action.description=Restart logging
\ No newline at end of file
+android.restart.logcat.action.description=Restart logging
+android.new.component.dialog.application.item=Application
\ No newline at end of file
diff --git a/plugins/android/src/org/jetbrains/android/AndroidFileTemplateProvider.java b/plugins/android/src/org/jetbrains/android/AndroidFileTemplateProvider.java
index 660aa42babc8..b35681b54376 100644
--- a/plugins/android/src/org/jetbrains/android/AndroidFileTemplateProvider.java
+++ b/plugins/android/src/org/jetbrains/android/AndroidFileTemplateProvider.java
@@ -42,6 +42,7 @@ public class AndroidFileTemplateProvider implements FileTemplateGroupDescriptorF
@NonNls public static final String RESOURCE_FILE_TEMPLATE = "resourceFile.xml";
@NonNls public static final String LAYOUT_RESOURCE_FILE_TEMPLATE = "layoutResourceFile.xml";
@NonNls public static final String ACTIVITY = "Activity.java";
+ @NonNls public static final String APPLICATION = "Application.java";
@NonNls public static final String SERVICE = "Service.java";
@NonNls public static final String BROADCAST_RECEIVER = "Broadcast Receiver.java";
@@ -52,6 +53,7 @@ public class AndroidFileTemplateProvider implements FileTemplateGroupDescriptorF
group.addTemplate(new FileTemplateDescriptor(RESOURCE_FILE_TEMPLATE, StdFileTypes.XML.getIcon()));
group.addTemplate(new FileTemplateDescriptor(LAYOUT_RESOURCE_FILE_TEMPLATE, StdFileTypes.XML.getIcon()));
group.addTemplate(new FileTemplateDescriptor(ACTIVITY, StdFileTypes.JAVA.getIcon()));
+ group.addTemplate(new FileTemplateDescriptor(APPLICATION, StdFileTypes.JAVA.getIcon()));
group.addTemplate(new FileTemplateDescriptor(SERVICE, StdFileTypes.JAVA.getIcon()));
group.addTemplate(new FileTemplateDescriptor(BROADCAST_RECEIVER, StdFileTypes.JAVA.getIcon()));
group.addTemplate(new FileTemplateDescriptor(REMOTE_INTERFACE_TEMPLATE, AndroidIdlFileType.ourFileType.getIcon()));
diff --git a/plugins/android/src/org/jetbrains/android/actions/NewAndroidComponentAction.java b/plugins/android/src/org/jetbrains/android/actions/NewAndroidComponentAction.java
index a09b41c039f4..bba3e11c914e 100644
--- a/plugins/android/src/org/jetbrains/android/actions/NewAndroidComponentAction.java
+++ b/plugins/android/src/org/jetbrains/android/actions/NewAndroidComponentAction.java
@@ -18,7 +18,6 @@ package org.jetbrains.android.actions;
import com.intellij.ide.IdeView;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.module.Module;
-import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.psi.JavaDirectoryService;
import com.intellij.psi.PsiDirectory;
@@ -64,12 +63,14 @@ public class NewAndroidComponentAction extends AnAction {
return;
}
- final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
+ final Module module = LangDataKeys.MODULE.getData(dataContext);
+
+ if (module == null) return;
final PsiDirectory dir = view.getOrChooseDirectory();
if (dir == null) return;
- NewAndroidComponentDialog dialog = new NewAndroidComponentDialog(project, dir);
+ NewAndroidComponentDialog dialog = new NewAndroidComponentDialog(module, dir);
dialog.show();
if (dialog.getExitCode() != DialogWrapper.OK_EXIT_CODE) {
return;
diff --git a/plugins/android/src/org/jetbrains/android/actions/NewAndroidComponentDialog.java b/plugins/android/src/org/jetbrains/android/actions/NewAndroidComponentDialog.java
index 9e9ff9cf8e7d..aa3cbd09b151 100644
--- a/plugins/android/src/org/jetbrains/android/actions/NewAndroidComponentDialog.java
+++ b/plugins/android/src/org/jetbrains/android/actions/NewAndroidComponentDialog.java
@@ -18,16 +18,19 @@ package org.jetbrains.android.actions;
import com.intellij.CommonBundle;
import com.intellij.ide.actions.ElementCreator;
import com.intellij.ide.actions.TemplateKindCombo;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.util.Computable;
import com.intellij.psi.*;
+import com.intellij.psi.search.searches.ClassInheritorsSearch;
import com.intellij.util.Icons;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.android.AndroidFileTemplateProvider;
-import org.jetbrains.android.dom.manifest.*;
import org.jetbrains.android.dom.manifest.Action;
+import org.jetbrains.android.dom.manifest.*;
import org.jetbrains.android.dom.resources.ResourceValue;
import org.jetbrains.android.facet.AndroidFacet;
import org.jetbrains.android.util.AndroidBundle;
@@ -55,12 +58,18 @@ public class NewAndroidComponentDialog extends DialogWrapper {
private PsiElement[] myCreatedElements;
- protected NewAndroidComponentDialog(final Project project, final PsiDirectory directory) {
- super(project);
+ protected NewAndroidComponentDialog(@NotNull final Module module, final PsiDirectory directory) {
+ super(module.getProject());
myKindLabel.setLabelFor(myKindCombo);
myKindCombo.registerUpDownHint(myNameField);
myUpDownHint.setIcon(Icons.UP_DOWN_ARROWS);
myKindCombo.addItem(AndroidBundle.message("android.new.component.dialog.activity.item"), null, AndroidFileTemplateProvider.ACTIVITY);
+
+ if (!containsCustomApplicationClass(module)) {
+ myKindCombo.addItem(AndroidBundle.message("android.new.component.dialog.application.item"), null,
+ AndroidFileTemplateProvider.APPLICATION);
+ }
+
myKindCombo.addItem(AndroidBundle.message("android.new.component.dialog.service.item"), null, AndroidFileTemplateProvider.SERVICE);
myKindCombo.addItem(AndroidBundle.message("android.new.component.dialog.broadcast.receiver.item"), null,
AndroidFileTemplateProvider.BROADCAST_RECEIVER);
@@ -68,7 +77,7 @@ public class NewAndroidComponentDialog extends DialogWrapper {
AndroidFileTemplateProvider.REMOTE_INTERFACE_TEMPLATE);
init();
setTitle(AndroidBundle.message("android.new.component.action.command.name"));
- myCreator = new ElementCreator(project, CommonBundle.getErrorTitle()) {
+ myCreator = new ElementCreator(module.getProject(), CommonBundle.getErrorTitle()) {
@Override
protected void checkBeforeCreate(String newName) throws IncorrectOperationException {
JavaDirectoryService.getInstance().checkCreateClass(directory, newName);
@@ -76,7 +85,7 @@ public class NewAndroidComponentDialog extends DialogWrapper {
@Override
protected PsiElement[] create(String newName) throws Exception {
- final PsiElement element = NewAndroidComponentDialog.this.create(newName, directory, project);
+ final PsiElement element = NewAndroidComponentDialog.this.create(newName, directory, module.getProject());
if (element != null) {
return new PsiElement[]{element};
}
@@ -93,11 +102,23 @@ public class NewAndroidComponentDialog extends DialogWrapper {
public void actionPerformed(ActionEvent e) {
String selected = myKindCombo.getSelectedName();
myMarkAsStartupActivityCheckBox.setEnabled(AndroidFileTemplateProvider.ACTIVITY.equals(selected));
- myLabelField.setEnabled(!AndroidFileTemplateProvider.REMOTE_INTERFACE_TEMPLATE.equals(selected));
+ myLabelField.setEnabled(!AndroidFileTemplateProvider.REMOTE_INTERFACE_TEMPLATE.equals(selected) &&
+ !AndroidFileTemplateProvider.APPLICATION.equals(selected));
}
});
}
+ private static boolean containsCustomApplicationClass(@NotNull final Module module) {
+ final JavaPsiFacade facade = JavaPsiFacade.getInstance(module.getProject());
+ PsiClass applicationClass = ApplicationManager.getApplication().runReadAction(new Computable() {
+ @Nullable
+ public PsiClass compute() {
+ return facade.findClass(AndroidUtils.APPLICATION_CLASS_NAME, module.getModuleWithDependenciesAndLibrariesScope(false));
+ }
+ });
+ return applicationClass != null && ClassInheritorsSearch.search(applicationClass, module.getModuleScope(), true).findFirst() != null;
+ }
+
@Nullable
private PsiElement create(String newName, PsiDirectory directory, Project project) throws Exception {
return doCreate(myKindCombo.getSelectedName(), directory, project, newName, myLabelField.getText(),
@@ -175,6 +196,9 @@ public class NewAndroidComponentDialog extends DialogWrapper {
receiver.getReceiverClass().setValue(aClass);
return receiver;
}
+ else if (AndroidFileTemplateProvider.APPLICATION.equals(templateName)) {
+ application.getName().setValue(aClass);
+ }
return null;
}
diff --git a/plugins/android/src/org/jetbrains/android/facet/AndroidFacetConfiguration.java b/plugins/android/src/org/jetbrains/android/facet/AndroidFacetConfiguration.java
index 5c5369ad61a4..25ba1e9fb203 100644
--- a/plugins/android/src/org/jetbrains/android/facet/AndroidFacetConfiguration.java
+++ b/plugins/android/src/org/jetbrains/android/facet/AndroidFacetConfiguration.java
@@ -77,15 +77,19 @@ public class AndroidFacetConfiguration implements FacetConfiguration {
private AndroidFacet myFacet = null;
public void init(@NotNull Module module, @NotNull VirtualFile contentRoot) {
+ init(module, contentRoot.getPath());
+ }
+
+ public void init(@NotNull Module module, @NotNull String baseDirectoryPath) {
String moduleDirPath = AndroidRootUtil.getModuleDirPath(module);
if (moduleDirPath == null) {
return;
}
- if (moduleDirPath.equals(contentRoot.getPath())) {
+ if (moduleDirPath.equals(baseDirectoryPath)) {
return;
}
- String s = FileUtil.getRelativePath(moduleDirPath, contentRoot.getPath(), '/');
+ String s = FileUtil.getRelativePath(moduleDirPath, baseDirectoryPath, '/');
GEN_FOLDER_RELATIVE_PATH_APT = '/' + s + GEN_FOLDER_RELATIVE_PATH_APT;
GEN_FOLDER_RELATIVE_PATH_AIDL = '/' + s + GEN_FOLDER_RELATIVE_PATH_AIDL;
diff --git a/plugins/android/src/org/jetbrains/android/facet/AndroidFacetEditorTab.java b/plugins/android/src/org/jetbrains/android/facet/AndroidFacetEditorTab.java
index 5afed5173670..99ef1974899a 100644
--- a/plugins/android/src/org/jetbrains/android/facet/AndroidFacetEditorTab.java
+++ b/plugins/android/src/org/jetbrains/android/facet/AndroidFacetEditorTab.java
@@ -171,6 +171,10 @@ public class AndroidFacetEditorTab extends FacetEditorTab {
public void actionPerformed(ActionEvent e) {
AndroidFacetConfiguration configuration = new AndroidFacetConfiguration();
Module module = myContext.getModule();
+ VirtualFile[] contentRoots = ModuleRootManager.getInstance(module).getContentRoots();
+ if (contentRoots.length == 1) {
+ configuration.init(module, contentRoots[0]);
+ }
if (AndroidMavenUtil.isMavenizedModule(module)) {
AndroidMavenProvider mavenProvider = AndroidMavenUtil.getMavenProvider();
if (mavenProvider != null) {
diff --git a/plugins/android/src/org/jetbrains/android/maven/AndroidFacetImporter.java b/plugins/android/src/org/jetbrains/android/maven/AndroidFacetImporter.java
index 8149f074ff51..9e9b93a75adc 100644
--- a/plugins/android/src/org/jetbrains/android/maven/AndroidFacetImporter.java
+++ b/plugins/android/src/org/jetbrains/android/maven/AndroidFacetImporter.java
@@ -76,6 +76,8 @@ public class AndroidFacetImporter extends FacetImporter
+
diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java
index 6cb51c691072..bc27bb0833ba 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java
@@ -1,5 +1,9 @@
package org.jetbrains.plugins.github;
+import com.intellij.notification.Notification;
+import com.intellij.notification.NotificationDisplayType;
+import com.intellij.notification.NotificationType;
+import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.application.ApplicationManager;
@@ -12,6 +16,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.util.IconLoader;
+import com.intellij.openapi.util.JDOMUtil;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.changes.ChangeListManager;
@@ -113,7 +118,7 @@ public class GithubShareAction extends DumbAwareAction {
try {
LOG.info("Creating GitHub repository");
GithubUtil.doREST(settings.getHost(), settings.getLogin(), settings.getPassword(),
- "/repos/create?name=" + name + "&description=" + description + "&public=" + (isPrivate ? "0" : "1"), true);
+ "/repos/create?name=" + name + "&public=" + (isPrivate ? "0" : "1") + "&description=" + JDOMUtil.escapeText(description, true, true), true);
LOG.info("Successfully created GitHub repository");
}
catch (final Exception e1) {
@@ -121,6 +126,8 @@ public class GithubShareAction extends DumbAwareAction {
return;
}
bindToGithub(project, root, gitDetected, settings.getLogin(), name);
+ Notifications.Bus.notify(new Notification("github", "Success", "Successfully created project ''" + name + "'' on github",
+ NotificationType.INFORMATION), NotificationDisplayType.BALLOON_ONLY, null);
}
private void bindToGithub(final Project project, final VirtualFile root, final boolean gitDetected, final String login, final String name) {
diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubUtil.java b/plugins/github/src/org/jetbrains/plugins/github/GithubUtil.java
index 030bdb249568..9cac56ee2348 100644
--- a/plugins/github/src/org/jetbrains/plugins/github/GithubUtil.java
+++ b/plugins/github/src/org/jetbrains/plugins/github/GithubUtil.java
@@ -6,7 +6,6 @@ import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Computable;
-import com.intellij.openapi.util.JDOMUtil;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.VcsException;
@@ -94,7 +93,7 @@ public class GithubUtil {
public static HttpMethod doREST(final String url, final String login, final String password, final String request, final boolean post) throws Exception {
final HttpClient client = getHttpClient(login, password);
client.getParams().setContentCharset("UTF-8");
- final String uri = JDOMUtil.escapeText("https://" + getHostByUrl(url) + API_URL + request, true, true);
+ final String uri = "https://" + getHostByUrl(url) + API_URL + request;
final HttpMethod method = post ? new PostMethod(uri) : new GetMethod(uri);
client.executeMethod(method);
return method;
@@ -171,7 +170,7 @@ public class GithubUtil {
}
final Element plan = element.getChild("plan");
assert plan != null : "Authentification failed";
- final String privateRepos = plan.getChildText("private_repos");
+ final String privateRepos = plan.getChildText("private-repos");
return privateRepos != null && Integer.valueOf(privateRepos) > 0;
}
catch (Exception e) {
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/GroovyElementTypes.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/GroovyElementTypes.java
index 6fb3bafe4c6b..3d6b5fae30e2 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/GroovyElementTypes.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/GroovyElementTypes.java
@@ -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;
@@ -356,7 +357,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 VARIABLE_DEFINITION_ERROR = new EmptyStubElementType("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 VARIABLE_DEFINITION =
new EmptyStubElementType("variable definitions", GroovyFileType.GROOVY_LANGUAGE) {
@Override
@@ -391,4 +402,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);
-}
\ No newline at end of file
+}
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/CompleteReferenceExpression.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/CompleteReferenceExpression.java
index daa91c385429..7452788e63e5 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/CompleteReferenceExpression.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/CompleteReferenceExpression.java
@@ -148,6 +148,11 @@ public class CompleteReferenceExpression {
}
}
+ @NotNull
+ public static LookupElementBuilder createPropertyLookupElement(@NotNull String name, @NotNull PsiType type) {
+ return LookupElementBuilder.create(name).setIcon(GroovyIcons.PROPERTY).setTypeText(type.getPresentableText());
+ }
+
@Nullable
public static LookupElementBuilder createPropertyLookupElement(@NotNull PsiMethod accessor, @Nullable GroovyResolveResult resolveResult) {
String propName;
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrStubFileElementType.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrStubFileElementType.java
index 77e62a6a469c..893daddfc483 100644
--- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrStubFileElementType.java
+++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrStubFileElementType.java
@@ -53,7 +53,7 @@ public class GrStubFileElementType extends IStubFileElementType {
@Override
public int getStubVersion() {
- return super.getStubVersion() + 9;
+ return super.getStubVersion() + 10;
}
public String getExternalId() {
diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java
index abf11cd65bb9..60b284be13b2 100644
--- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java
+++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java
@@ -334,4 +334,8 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase {
public void testMethodImplementedByDelegate() {
doTest();
}
+
+ public void testTestMarkupStubs() {
+ doTest();
+ }
}
\ No newline at end of file
diff --git a/plugins/groovy/testdata/highlighting/TestMarkupStubs.groovy b/plugins/groovy/testdata/highlighting/TestMarkupStubs.groovy
new file mode 100644
index 000000000000..8175bc3a4981
--- /dev/null
+++ b/plugins/groovy/testdata/highlighting/TestMarkupStubs.groovy
@@ -0,0 +1,7 @@
+abstract class X {
+ abstract def foo<caret>(String s, int a)
+
+ def foo(String s) {
+ return foo(s, 5);
+ }
+}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnAuthenticationManager.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnAuthenticationManager.java
index 74846f450921..a683ee9a8aa1 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnAuthenticationManager.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnAuthenticationManager.java
@@ -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();
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurable.form b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurable.form
index da771de23f12..d10d3b6dcc5b 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurable.form
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurable.form
@@ -1,16 +1,16 @@
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurable.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurable.java
index abf476929546..f0eb2258165a 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurable.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfigurable.java
@@ -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));
}
}
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfiguration.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfiguration.java
index 7c0333e99354..b334ae07c122 100644
--- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfiguration.java
+++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnConfiguration.java
@@ -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;