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:
Binary file not shown.
@@ -31,19 +31,21 @@ public class EditSourceAction extends DebuggerAction{
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
|
||||
|
||||
if(project == null) return;
|
||||
if(project == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
|
||||
final DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
|
||||
if(debuggerContext != null && selectedNode != null) {
|
||||
debuggerContext.getDebugProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
|
||||
public void threadAction() {
|
||||
final SourcePosition sourcePosition = getSourcePosition(selectedNode, debuggerContext);
|
||||
if (sourcePosition != null) {
|
||||
sourcePosition.navigate(true);
|
||||
}
|
||||
public void threadAction() {
|
||||
final SourcePosition sourcePosition = getSourcePosition(selectedNode, debuggerContext);
|
||||
if (sourcePosition != null) {
|
||||
sourcePosition.navigate(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,21 +53,24 @@ public class EditSourceAction extends DebuggerAction{
|
||||
DebuggerTreeNodeImpl node = selectedNode;
|
||||
final DebuggerContextImpl context = debuggerContext;
|
||||
|
||||
if(node == null) return null;
|
||||
if(context == null) return null;
|
||||
if(node == null || context == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final Project project = context.getProject();
|
||||
|
||||
final DebuggerSession debuggerSession = context.getDebuggerSession();
|
||||
|
||||
if(debuggerSession == null) return null;
|
||||
if(debuggerSession == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
NodeDescriptorImpl nodeDescriptor = node.getDescriptor();
|
||||
if(nodeDescriptor instanceof WatchItemDescriptor) {
|
||||
Modifier modifier = ((WatchItemDescriptor)nodeDescriptor).getModifier();
|
||||
|
||||
if(modifier == null) return null;
|
||||
|
||||
if(modifier == null) {
|
||||
return null;
|
||||
}
|
||||
nodeDescriptor = (NodeDescriptorImpl)modifier.getInspectItem(project);
|
||||
}
|
||||
|
||||
@@ -90,32 +95,24 @@ public class EditSourceAction extends DebuggerAction{
|
||||
final DebuggerTreeNodeImpl node = getSelectedNode(e.getDataContext());
|
||||
|
||||
final Presentation presentation = e.getPresentation();
|
||||
|
||||
presentation.setEnabled(true);
|
||||
|
||||
//if user used shortcut actionPerformed is called immediately after update
|
||||
//we not disable presentation here to allow actionPerform work
|
||||
DebuggerInvocationUtil.invokeLater(project, new Runnable() {
|
||||
public void run() {
|
||||
presentation.setEnabled(false);
|
||||
}
|
||||
});
|
||||
|
||||
if(debuggerContext != null && debuggerContext.getDebugProcess() != null) {
|
||||
presentation.setEnabled(true);
|
||||
debuggerContext.getDebugProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
|
||||
public void threadAction() {
|
||||
final SourcePosition position = getSourcePosition(node, debuggerContext);
|
||||
if (position != null) {
|
||||
if (position == null) {
|
||||
DebuggerInvocationUtil.swingInvokeLater(project, new Runnable() {
|
||||
public void run() {
|
||||
presentation.setEnabled(true);
|
||||
presentation.setEnabled(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
else {
|
||||
presentation.setEnabled(false);
|
||||
}
|
||||
e.getPresentation().setText(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE).getTemplatePresentation().getText());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
@@ -12,15 +12,18 @@
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{52ADCA3D-82E9-86CF-9DEC-FF1A4A1B4E15}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
||||
+3
@@ -131,11 +131,14 @@ public class ModuleExtendedModelBuilderImpl implements ModelBuilderService {
|
||||
}
|
||||
|
||||
ideaSourceDirectories.removeAll(resourceDirectories);
|
||||
sourceDirectories.removeAll(ideaTestDirectories);
|
||||
sourceDirectories.addAll(ideaSourceDirectories);
|
||||
ideaTestDirectories.removeAll(testResourceDirectories);
|
||||
testDirectories.addAll(ideaTestDirectories);
|
||||
|
||||
resourceDirectories.removeAll(ideaExtTestResourceDirectories);
|
||||
resourceDirectories.addAll(ideaExtResourceDirectories);
|
||||
testResourceDirectories.removeAll(ideaExtResourceDirectories);
|
||||
testResourceDirectories.addAll(ideaExtTestResourceDirectories);
|
||||
|
||||
// ensure disjoint directories with different type
|
||||
|
||||
+29
@@ -72,3 +72,32 @@ project("withIdeaPluginCustomization2") {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// see http://youtrack.jetbrains.com/issue/IDEA-120562
|
||||
project("withIdeaPluginCustomization3") {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'idea'
|
||||
|
||||
idea {
|
||||
module {
|
||||
sourceDirs += file('src/main/java')
|
||||
testSourceDirs += file('src/awesome-test/java')
|
||||
testSourceDirs += file('src/awesome-with-resource-test/java')
|
||||
ext.testResourceDirs += file('src/awesome-with-resource-test/resources')
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
'awesome-test' {
|
||||
java {
|
||||
srcDir 'src/awesome-test/java'
|
||||
}
|
||||
compileClasspath += sourceSets.main.runtimeClasspath
|
||||
}
|
||||
'awesome-with-resource-test' {
|
||||
java {
|
||||
srcDir 'src/awesome-with-resource-test/java'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -5,4 +5,5 @@ include 'moduleWithSourceSetDirBothAsResourceAndJava'
|
||||
include 'moduleWithCustomSourceSet'
|
||||
include 'withIntegrationTests'
|
||||
include 'withIdeaPluginCustomization1'
|
||||
include 'withIdeaPluginCustomization2'
|
||||
include 'withIdeaPluginCustomization2'
|
||||
include 'withIdeaPluginCustomization3'
|
||||
+11
-1
@@ -50,7 +50,7 @@ public class ModuleExtendedModelBuilderImplTest extends AbstractModelBuilderTest
|
||||
|
||||
@Test
|
||||
public void testGradleSourcesSetsInterpretation() throws Exception {
|
||||
final int modulesSize = 7;
|
||||
final int modulesSize = 8;
|
||||
|
||||
DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getIdeaProject().getModules();
|
||||
|
||||
@@ -119,6 +119,16 @@ public class ModuleExtendedModelBuilderImplTest extends AbstractModelBuilderTest
|
||||
assertEquals(ContainerUtil.newArrayList("some-extra-test-resource-folder"), testResourceDirectories);
|
||||
assertEquals(ContainerUtil.newArrayList(".gradle", "build"), excludeDirectories);
|
||||
}
|
||||
else if (module.getName().equals("withIdeaPluginCustomization3")) {
|
||||
assertEquals(ContainerUtil.newArrayList("src/main/java"), sourceDirectories);
|
||||
assertEquals(ContainerUtil.newArrayList(
|
||||
"src/awesome-test/resources", "src/main/resources"), resourceDirectories);
|
||||
assertEquals(ContainerUtil.newArrayList(
|
||||
"src/awesome-test/java", "src/awesome-with-resource-test/java", "src/test/java"), testDirectories);
|
||||
assertEquals(ContainerUtil.newArrayList(
|
||||
"src/awesome-with-resource-test/resources", "src/test/resources"), testResourceDirectories);
|
||||
assertEquals(ContainerUtil.newArrayList(".gradle", "build"), excludeDirectories);
|
||||
}
|
||||
else {
|
||||
fail();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user