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:
@@ -8,6 +8,7 @@ target('default' : "Developers update") {
|
||||
|
||||
private List platformImplementationModules() {
|
||||
return [
|
||||
"core-impl",
|
||||
"platform-impl",
|
||||
"vcs-impl",
|
||||
"lang-impl",
|
||||
@@ -25,7 +26,7 @@ private List platformImplementationModules() {
|
||||
}
|
||||
|
||||
private List<String> platformApiModules() {
|
||||
return ["platform-api", "lvcs-api", "lang-api", "vcs-api", "usageView", "xdebugger-api", "xml-openapi"]
|
||||
return ["core-api", "platform-api", "lvcs-api", "lang-api", "vcs-api", "usageView", "xdebugger-api", "xml-openapi"]
|
||||
}
|
||||
|
||||
def layoutFull(String home, String targetDirectory) {
|
||||
|
||||
@@ -143,10 +143,8 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
|
||||
if (myGeneratedSources.contains(FileBasedIndex.getFileId(file))) {
|
||||
return true;
|
||||
}
|
||||
for (final VirtualFile root : myRootToModuleMap.keySet()) {
|
||||
if (VfsUtil.isAncestor(root, file, false)) {
|
||||
return true;
|
||||
}
|
||||
if (isUnderRoots(myRootToModuleMap.keySet(), file)) {
|
||||
return true;
|
||||
}
|
||||
final Module module = getModuleByFile(file);
|
||||
if (module != null) {
|
||||
@@ -467,10 +465,8 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
|
||||
if (myProjectFileIndex.isInTestSourceContent(fileOrDir)) {
|
||||
return true;
|
||||
}
|
||||
for (final VirtualFile root : myGeneratedTestRoots) {
|
||||
if (VfsUtil.isAncestor(root, fileOrDir, false)) {
|
||||
return true;
|
||||
}
|
||||
if (isUnderRoots(myGeneratedTestRoots, fileOrDir)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -479,11 +475,23 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
|
||||
if (myProjectFileIndex.isInSourceContent(fileOrDir)) {
|
||||
return true;
|
||||
}
|
||||
for (final VirtualFile root : myRootToModuleMap.keySet()) {
|
||||
if (VfsUtil.isAncestor(root, fileOrDir, false)) {
|
||||
return true;
|
||||
}
|
||||
if (isUnderRoots(myRootToModuleMap.keySet(), fileOrDir)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isUnderRoots(@NotNull Set<VirtualFile> roots, @NotNull VirtualFile file) {
|
||||
VirtualFile parent = file;
|
||||
while (true) {
|
||||
if (parent == null) {
|
||||
return false;
|
||||
}
|
||||
if (roots.contains(parent)) {
|
||||
return true;
|
||||
}
|
||||
parent = parent.getParent();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+44
-25
@@ -22,6 +22,7 @@ import com.intellij.compiler.make.MakeUtil;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.compiler.*;
|
||||
import com.intellij.openapi.compiler.ex.CompileContextEx;
|
||||
import com.intellij.openapi.components.ApplicationComponent;
|
||||
@@ -45,6 +46,7 @@ import com.intellij.openapi.vfs.newvfs.ManagingFS;
|
||||
import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
|
||||
import com.intellij.openapi.vfs.newvfs.persistent.FSRecords;
|
||||
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.SLRUCache;
|
||||
import com.intellij.util.indexing.FileBasedIndex;
|
||||
@@ -121,7 +123,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
}
|
||||
};
|
||||
private final ProjectManager myProjectManager;
|
||||
private final TIntHashSet myInitInProgress = new TIntHashSet(); // projectId fior successfully initialized projects
|
||||
private final TIntIntHashMap myInitInProgress = new TIntIntHashMap(); // projectId fior successfully initialized projects
|
||||
private final Object myAsyncScanLock = new Object();
|
||||
|
||||
public TranslatingCompilerFilesMonitor(VirtualFileManager vfsManager, ProjectManager projectManager, Application application) {
|
||||
@@ -967,7 +969,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
public void ensureInitializationCompleted(Project project, ProgressIndicator indicator) {
|
||||
final int id = getProjectId(project);
|
||||
synchronized (myAsyncScanLock) {
|
||||
while (myInitInProgress.contains(id)) {
|
||||
while (myInitInProgress.containsKey(id)) {
|
||||
if (!project.isOpen() || project.isDisposed() || (indicator != null && indicator.isCanceled())) {
|
||||
// makes no sense to continue waiting
|
||||
break;
|
||||
@@ -1095,7 +1097,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
catch (ProjectRef.ProjectClosedException swallowed) {
|
||||
}
|
||||
finally {
|
||||
terminateAsyncScan(projectId);
|
||||
terminateAsyncScan(projectId, false);
|
||||
}
|
||||
}
|
||||
}.queue();
|
||||
@@ -1103,17 +1105,28 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
});
|
||||
}
|
||||
|
||||
private void terminateAsyncScan(int projectId) {
|
||||
private void terminateAsyncScan(int projectId, final boolean clearCounter) {
|
||||
synchronized (myAsyncScanLock) {
|
||||
if (myInitInProgress.remove(projectId)) {
|
||||
int counter = myInitInProgress.remove(projectId);
|
||||
if (clearCounter) {
|
||||
myAsyncScanLock.notifyAll();
|
||||
}
|
||||
else {
|
||||
if (--counter > 0) {
|
||||
myInitInProgress.put(projectId, counter);
|
||||
}
|
||||
else {
|
||||
myAsyncScanLock.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void startAsyncScan(final int projectId) {
|
||||
synchronized (myAsyncScanLock) {
|
||||
myInitInProgress.add(projectId);
|
||||
int counter = myInitInProgress.get(projectId);
|
||||
counter = (counter > 0)? counter + 1 : 1;
|
||||
myInitInProgress.put(projectId, counter);
|
||||
myAsyncScanLock.notifyAll();
|
||||
}
|
||||
}
|
||||
@@ -1130,6 +1143,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
|
||||
conn.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
|
||||
private VirtualFile[] myRootsBefore;
|
||||
private Alarm myAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD, project);
|
||||
|
||||
public void beforeRootsChange(final ModuleRootEvent event) {
|
||||
try {
|
||||
@@ -1164,26 +1178,31 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
}
|
||||
}
|
||||
|
||||
startAsyncScan(projectId);
|
||||
new Task.Backgroundable(project, CompilerBundle.message("compiler.initial.scanning.progress.text"), false) {
|
||||
public void run(@NotNull final ProgressIndicator indicator) {
|
||||
try {
|
||||
if (newRoots.size() > 0) {
|
||||
scanSourceContent(projRef, newRoots, newRoots.size(), true);
|
||||
myAlarm.cancelAllRequests(); // need alarm to deal with multiple rootsChanged events
|
||||
myAlarm.addRequest(new Runnable() {
|
||||
public void run() {
|
||||
startAsyncScan(projectId);
|
||||
new Task.Backgroundable(project, CompilerBundle.message("compiler.initial.scanning.progress.text"), false) {
|
||||
public void run(@NotNull final ProgressIndicator indicator) {
|
||||
try {
|
||||
if (newRoots.size() > 0) {
|
||||
scanSourceContent(projRef, newRoots, newRoots.size(), true);
|
||||
}
|
||||
if (oldRoots.size() > 0) {
|
||||
scanSourceContent(projRef, oldRoots, oldRoots.size(), false);
|
||||
}
|
||||
markOldOutputRoots(projRef, buildOutputRootsLayout(projRef));
|
||||
}
|
||||
catch (ProjectRef.ProjectClosedException swallowed) {
|
||||
// ignored
|
||||
}
|
||||
finally {
|
||||
terminateAsyncScan(projectId, false);
|
||||
}
|
||||
}
|
||||
if (oldRoots.size() > 0) {
|
||||
scanSourceContent(projRef, oldRoots, oldRoots.size(), false);
|
||||
}
|
||||
markOldOutputRoots(projRef, buildOutputRootsLayout(projRef));
|
||||
}
|
||||
catch (ProjectRef.ProjectClosedException swallowed) {
|
||||
// ignored
|
||||
}
|
||||
finally {
|
||||
terminateAsyncScan(projectId);
|
||||
}
|
||||
}.queue();
|
||||
}
|
||||
}.queue();
|
||||
}, 500, ModalityState.NON_MODAL);
|
||||
}
|
||||
catch (ProjectRef.ProjectClosedException e) {
|
||||
LOG.info(e);
|
||||
@@ -1196,7 +1215,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
|
||||
public void projectClosed(final Project project) {
|
||||
final int projectId = getProjectId(project);
|
||||
terminateAsyncScan(projectId);
|
||||
terminateAsyncScan(projectId, true);
|
||||
myConnections.remove(project).disconnect();
|
||||
synchronized (myDataLock) {
|
||||
mySourcesToRecompile.remove(projectId);
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$SimpleWithIndent"/>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$BoldWithIndent"/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/CompilerBundle" title-key="eclipse.options.group.title"/>
|
||||
<children>
|
||||
@@ -38,8 +38,8 @@
|
||||
<text resource-bundle="messages/CompilerBundle" key="java.compiler.option.generate.no.warnings"/>
|
||||
</properties>
|
||||
</component>
|
||||
<grid id="d7ddf" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="5" vgap="5">
|
||||
<margin top="10" left="0" bottom="0" right="0"/>
|
||||
<grid id="d7ddf" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="8" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$SimpleWithIndent"/>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$BoldWithIndent"/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/CompilerBundle" title-key="javac.options.group.title"/>
|
||||
<children>
|
||||
@@ -37,8 +37,8 @@
|
||||
<text resource-bundle="messages/CompilerBundle" key="java.compiler.option.generate.no.warnings"/>
|
||||
</properties>
|
||||
</component>
|
||||
<grid id="d7ddf" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="5" vgap="5">
|
||||
<margin top="10" left="0" bottom="0" right="0"/>
|
||||
<grid id="d7ddf" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="8" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
|
||||
+9
-9
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.compiler.impl.javaCompiler.jikes.JikesConfigurable">
|
||||
<grid id="66887" binding="myPanel" layout-manager="GridLayoutManager" row-count="6" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="0">
|
||||
<grid id="66887" binding="myPanel" layout-manager="GridLayoutManager" row-count="6" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="103" y="66" width="429" height="205"/>
|
||||
<xy x="103" y="66" width="429" height="225"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$SimpleWithIndent"/>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$BoldWithIndent"/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/CompilerBundle" title-key="jikes.options.group.title"/>
|
||||
<children>
|
||||
@@ -46,10 +46,10 @@
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<grid id="62794" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="5" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<grid id="62794" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="8" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -93,10 +93,10 @@
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="8f7f6" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="5" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<grid id="8f7f6" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="8" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="4" 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"/>
|
||||
|
||||
@@ -16,45 +16,11 @@
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="2dbd6" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="5" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" 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/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$SimpleWithIndent"/>
|
||||
</clientProperties>
|
||||
<border type="none" title-resource-bundle="messages/CompilerBundle" title-key="label.option.resource.patterns.text"/>
|
||||
<children>
|
||||
<component id="263f1" class="javax.swing.JTextField" binding="myResourcePatternsField">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="9" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<focusable value="true"/>
|
||||
<margin top="0" left="2" bottom="0" right="0"/>
|
||||
<text value="" noi18n="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="316d6" class="javax.swing.JLabel" binding="myPatternLegendLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/CompilerBundle" key="label.resource.patterns.legend"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<component id="889a8" class="javax.swing.JCheckBox" binding="myCbClearOutputDirectory">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="2" left="3" bottom="2" right="3"/>
|
||||
<text resource-bundle="messages/CompilerBundle" key="label.option.clear.output.directory.on.rebuild"/>
|
||||
</properties>
|
||||
</component>
|
||||
@@ -63,7 +29,6 @@
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="2" left="3" bottom="2" right="3"/>
|
||||
<text resource-bundle="messages/CompilerBundle" key="add.notnull.assertions"/>
|
||||
</properties>
|
||||
</component>
|
||||
@@ -72,7 +37,6 @@
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="2" left="3" bottom="2" right="3"/>
|
||||
<text resource-bundle="messages/CompilerBundle" key="label.option.compile.in.background"/>
|
||||
</properties>
|
||||
</component>
|
||||
@@ -81,10 +45,52 @@
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="2" left="3" bottom="2" right="3"/>
|
||||
<text resource-bundle="messages/CompilerBundle" key="label.option.autoshow.first.error"/>
|
||||
</properties>
|
||||
</component>
|
||||
<grid id="21dd4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="5" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" 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>
|
||||
<grid id="2dbd6" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" 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/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$SimpleWithIndent"/>
|
||||
</clientProperties>
|
||||
<border type="none" title-resource-bundle="messages/CompilerBundle" title-key="label.option.resource.patterns.text"/>
|
||||
<children>
|
||||
<component id="263f1" class="javax.swing.JTextField" binding="myResourcePatternsField">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="9" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<focusable value="true"/>
|
||||
<margin top="0" left="2" bottom="0" right="0"/>
|
||||
<text value="" noi18n="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="316d6" class="javax.swing.JLabel" binding="myPatternLegendLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/CompilerBundle" key="label.resource.patterns.legend"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<vspacer id="67edf">
|
||||
|
||||
@@ -1,27 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.compiler.options.RmicConfigurable">
|
||||
<grid id="49284" binding="myPanel" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="49284" binding="myPanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="37" y="129" width="521" height="280"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="9b938" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="9b938" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="0" y="0" width="521" height="111"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="3c8c0" class="javax.swing.JCheckBox" binding="myCbEnabled">
|
||||
<constraints>
|
||||
<xy x="0" y="0" width="191" height="24"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/CompilerBundle" key="rmic.option.enable.rmi.stubs"/>
|
||||
@@ -29,8 +26,7 @@
|
||||
</component>
|
||||
<component id="70faa" class="javax.swing.JCheckBox" binding="myCbGenerateIiopStubs">
|
||||
<constraints>
|
||||
<xy x="0" y="29" width="142" height="24"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/CompilerBundle" key="rmic.option.generate.iiop.stubs"/>
|
||||
@@ -38,8 +34,7 @@
|
||||
</component>
|
||||
<component id="3d38f" class="javax.swing.JCheckBox" binding="myCbDebuggingInfo">
|
||||
<constraints>
|
||||
<xy x="0" y="58" width="170" height="24"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<selected value="false"/>
|
||||
@@ -48,8 +43,7 @@
|
||||
</component>
|
||||
<component id="90803" class="javax.swing.JCheckBox" binding="myCbGenerateNoWarnings">
|
||||
<constraints>
|
||||
<xy x="0" y="87" width="153" height="24"/>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/CompilerBundle" key="java.compiler.option.generate.no.warnings"/>
|
||||
@@ -57,19 +51,17 @@
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="3f1e9" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="0" bottom="0" right="0"/>
|
||||
<grid id="3f1e9" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="8" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="0" y="116" width="521" height="164"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" anchor="1" fill="3"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="f8a80" class="javax.swing.JLabel" binding="myFieldLabel">
|
||||
<constraints>
|
||||
<xy x="0" y="10" width="220" height="16"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="0"/>
|
||||
<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 resource-bundle="messages/CompilerBundle" key="java.compiler.option.additional.command.line.parameters"/>
|
||||
@@ -77,11 +69,11 @@
|
||||
</component>
|
||||
<component id="479c2" class="com.intellij.ui.RawCommandLineEditor" binding="myAdditionalOptionsField">
|
||||
<constraints>
|
||||
<xy x="230" y="10" width="291" height="20"/>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="1" fill="1">
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
|
||||
+17
-7
@@ -25,9 +25,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.PanelWithButtons;
|
||||
import com.intellij.ui.RightAlignedLabelUI;
|
||||
import com.intellij.ui.ScrollPaneFactory;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.table.JBTable;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -308,12 +306,24 @@ public class ExcludedEntriesConfigurable implements UnnamedConfigurable {
|
||||
((DefaultCellEditor)editor).setClickCountToStart(1);
|
||||
}
|
||||
|
||||
//ToolbarDecorator.createDecorator(myExcludedTable)
|
||||
// .disableUpAction()
|
||||
// .disableDownAction()
|
||||
return ToolbarDecorator.createDecorator(myExcludedTable)
|
||||
.disableUpAction()
|
||||
.disableDownAction()
|
||||
.setAddAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton anActionButton) {
|
||||
addPath(myDescriptor);
|
||||
}
|
||||
})
|
||||
.setRemoveAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton anActionButton) {
|
||||
removePaths();
|
||||
}
|
||||
}).createPanel();
|
||||
|
||||
|
||||
return ScrollPaneFactory.createScrollPane(myExcludedTable);
|
||||
//return ScrollPaneFactory.createScrollPane(myExcludedTable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ public class DebuggerExpressionComboBox extends DebuggerEditorImpl {
|
||||
setLayout(new BorderLayout(0, 0));
|
||||
|
||||
myComboBox = new ComboBox(new MyComboboxModel(getRecents()), -1);
|
||||
myComboBox.setSwingPopup(false);
|
||||
|
||||
// Have to turn this off because when used in DebuggerTreeInplaceEditor, the combobox popup is hidden on every change of selection
|
||||
// See comment to SynthComboBoxUI.FocusHandler.focusLost()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.execution.applet.AppletConfigurable">
|
||||
<grid id="e5f4d" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="7" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="e5f4d" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="8" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="133" y="39" width="564" height="646"/>
|
||||
<xy x="133" y="39" width="564" height="584"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -22,7 +22,7 @@
|
||||
</constraints>
|
||||
<properties>
|
||||
<selected value="true"/>
|
||||
<text resource-bundle="messages/ExecutionBundle" key="applet.configuration.applet.class.label"/>
|
||||
<text resource-bundle="messages/ExecutionBundle" key="applet.configuration.applet.class.option"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="74d77" class="javax.swing.JRadioButton" binding="myURL">
|
||||
@@ -37,33 +37,38 @@
|
||||
</grid>
|
||||
<component id="5dbf7" class="com.intellij.openapi.ui.LabeledComponent" binding="myPolicyFile">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<componentClass value="com.intellij.openapi.ui.TextFieldWithBrowseButton"/>
|
||||
<labelInsets top="0" left="0" bottom="5" right="0"/>
|
||||
<labelInsets top="0" left="0" bottom="0" right="0"/>
|
||||
<labelLocation value="West"/>
|
||||
<labelPreferredSize width="212" height="16"/>
|
||||
<text resource-bundle="messages/ExecutionBundle" key="applet.configuration.policy.file.label"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="67632" class="com.intellij.openapi.ui.LabeledComponent" binding="myVMParameters">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<componentClass value="com.intellij.ui.RawCommandLineEditor"/>
|
||||
<labelInsets top="5" left="0" bottom="2" right="0"/>
|
||||
<labelInsets top="0" left="0" bottom="0" right="0"/>
|
||||
<labelLocation value="West"/>
|
||||
<labelPreferredSize width="212" height="16"/>
|
||||
<text resource-bundle="messages/ExecutionBundle" key="applet.configuration.vm.parameters.for.appletviewer.label"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="eac49" class="com.intellij.openapi.ui.LabeledComponent" binding="myModule">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<componentClass value="javax.swing.JComboBox"/>
|
||||
<labelInsets top="5" left="0" bottom="5" right="0"/>
|
||||
<labelInsets top="0" left="0" bottom="0" right="0"/>
|
||||
<labelLocation value="West"/>
|
||||
<text resource-bundle="messages/ExecutionBundle" key="applet.configuration.use.classpath.and.jdk.of.module.label"/>
|
||||
</properties>
|
||||
</component>
|
||||
@@ -75,16 +80,16 @@
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="dbe39" binding="myHTMLOptions" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="5" vgap="-1">
|
||||
<margin top="5" left="5" bottom="5" right="5"/>
|
||||
<grid id="dbe39" binding="myHTMLOptions" layout-manager="GridLayoutManager" row-count="1" 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>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$SimpleWithIndent"/>
|
||||
<BorderFactoryClass class="java.lang.String" value=""/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/ExecutionBundle" title-key="applet.configuration.url.border"/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="a2b70" class="javax.swing.JLabel" binding="myHtmlFileLabel">
|
||||
<constraints>
|
||||
@@ -104,8 +109,8 @@
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="71bb1" binding="myClassOptions" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="7">
|
||||
<margin top="5" left="5" bottom="5" right="5"/>
|
||||
<grid id="71bb1" binding="myClassOptions" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
@@ -113,9 +118,9 @@
|
||||
<enabled value="true"/>
|
||||
</properties>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$SimpleWithIndent"/>
|
||||
<BorderFactoryClass class="java.lang.String" value=""/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/ExecutionBundle" title-key="applet.configuration.applet.class.border"/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="9c777" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
@@ -252,12 +257,18 @@
|
||||
</grid>
|
||||
<vspacer id="8b063">
|
||||
<constraints>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="b2d36" class="com.intellij.execution.ui.AlternativeJREPanel" binding="myAlternativeJREPanel">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="9e31a" class="javax.swing.JSeparator">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
|
||||
+7
-2
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.execution.application.ApplicationConfigurable">
|
||||
<grid id="93687" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="6" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="10">
|
||||
<grid id="93687" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="6" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="53" y="36" width="596" height="433"/>
|
||||
@@ -21,9 +21,13 @@
|
||||
</component>
|
||||
<component id="50d08" class="com.intellij.openapi.ui.LabeledComponent" binding="myMainClass" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="154" height="25"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<labelLocation value="West"/>
|
||||
<labelPreferredSize width="144" height="16"/>
|
||||
<text resource-bundle="messages/ExecutionBundle" key="application.configuration.main.class.label"/>
|
||||
</properties>
|
||||
</component>
|
||||
@@ -33,6 +37,7 @@
|
||||
</constraints>
|
||||
<properties>
|
||||
<componentClass value="javax.swing.JComboBox"/>
|
||||
<labelLocation value="West"/>
|
||||
<text resource-bundle="messages/ExecutionBundle" key="application.configuration.use.classpath.and.jdk.of.module.label"/>
|
||||
</properties>
|
||||
</component>
|
||||
|
||||
@@ -45,8 +45,9 @@ public class AlternativeJREPanel extends JPanel {
|
||||
super(new GridBagLayout());
|
||||
|
||||
myCbEnabled = new JCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));
|
||||
final GridBagConstraints gc = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0, GridBagConstraints.NORTHWEST,
|
||||
GridBagConstraints.HORIZONTAL, new Insets(2, -2, 2, 2), 0, 0);
|
||||
myCbEnabled.setPreferredSize(new Dimension(154, 16));
|
||||
final GridBagConstraints gc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST,
|
||||
GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0);
|
||||
add(myCbEnabled, gc);
|
||||
|
||||
myFieldWithHistory = new TextFieldWithHistory();
|
||||
@@ -61,7 +62,8 @@ public class AlternativeJREPanel extends JPanel {
|
||||
ExecutionBundle.message("run.configuration.select.jre.dir.label"),
|
||||
null, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
|
||||
TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
gc.insets.left = 20;
|
||||
gc.gridx = 1;
|
||||
gc.weightx = 1;
|
||||
add(myPathField, gc);
|
||||
InsertPathAction.addTo(myFieldWithHistory.getTextEditor());
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ import com.intellij.execution.ExecutionBundle;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.ui.RawCommandLineEditor;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class CommonJavaParametersPanel extends CommonProgramParametersPanel {
|
||||
private LabeledComponent<RawCommandLineEditor> myVMParameters;
|
||||
|
||||
@@ -33,6 +35,9 @@ public class CommonJavaParametersPanel extends CommonProgramParametersPanel {
|
||||
ExecutionBundle.message("run.configuration.java.vm.parameters.label"));
|
||||
copyDialogCaption(myVMParameters);
|
||||
|
||||
myVMParameters.setLabelLocation(BorderLayout.WEST);
|
||||
myVMParameters.setLabelPreferredSize(super.getProgramParametersComponent().getLabelPreferredSize());
|
||||
|
||||
add(myVMParameters);
|
||||
super.addComponents();
|
||||
}
|
||||
|
||||
+5
-14
@@ -26,19 +26,16 @@ import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class AddFacetAction extends AnAction implements DumbAware {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.facet.impl.ui.actions.AddFacetAction");
|
||||
public class AddFacetToModuleAction extends AnAction implements DumbAware {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.facet.impl.ui.actions.AddFacetToModuleAction");
|
||||
private final FacetEditorFacade myEditor;
|
||||
private final Project myProject;
|
||||
private final FacetType myType;
|
||||
|
||||
public AddFacetAction(final FacetEditorFacade editor, Project project, final FacetType type) {
|
||||
private AddFacetToModuleAction(final FacetEditorFacade editor, Project project, final FacetType type) {
|
||||
super(type.getPresentableName(), null, type.getIcon());
|
||||
myEditor = editor;
|
||||
myProject = project;
|
||||
@@ -95,16 +92,10 @@ public class AddFacetAction extends AnAction implements DumbAware {
|
||||
}
|
||||
|
||||
public static AnAction[] createAddFacetActions(FacetEditorFacade editor, Project project) {
|
||||
final FacetType[] types = FacetTypeRegistry.getInstance().getFacetTypes();
|
||||
Arrays.sort(types, new Comparator<FacetType>() {
|
||||
public int compare(final FacetType o1, final FacetType o2) {
|
||||
return o1.getPresentableName().compareTo(o2.getPresentableName());
|
||||
}
|
||||
});
|
||||
|
||||
final FacetType[] types = FacetTypeRegistry.getInstance().getSortedFacetTypes();
|
||||
AnAction[] actions = new AnAction[types.length];
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
actions[i] = new AddFacetAction(editor, project, types[i]);
|
||||
actions[i] = new AddFacetToModuleAction(editor, project, types[i]);
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
+32
-33
@@ -20,8 +20,8 @@ import com.intellij.facet.FacetType;
|
||||
import com.intellij.facet.FacetTypeId;
|
||||
import com.intellij.facet.FacetTypeRegistry;
|
||||
import com.intellij.facet.impl.ProjectFacetsConfigurator;
|
||||
import com.intellij.facet.impl.invalid.InvalidFacetType;
|
||||
import com.intellij.ide.util.ChooseElementsDialog;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
@@ -29,10 +29,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog;
|
||||
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.NamedConfigurable;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
@@ -44,16 +41,18 @@ import java.util.List;
|
||||
* @author nik
|
||||
*/
|
||||
class AddFacetOfTypeAction extends DumbAwareAction {
|
||||
private final FacetStructureConfigurable myFacetStructureConfigurable;
|
||||
private final FacetType myFacetType;
|
||||
private final StructureConfigurableContext myContext;
|
||||
|
||||
AddFacetOfTypeAction(FacetStructureConfigurable facetStructureConfigurable) {
|
||||
super("New Facet", null, PlatformIcons.ADD_ICON);
|
||||
this.myFacetStructureConfigurable = facetStructureConfigurable;
|
||||
AddFacetOfTypeAction(final FacetType type, final StructureConfigurableContext context) {
|
||||
super(type.getPresentableName(), null, type.getIcon());
|
||||
myFacetType = type;
|
||||
myContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
final FacetType type = getSelectedType();
|
||||
final FacetType type = myFacetType;
|
||||
if (type == null) return;
|
||||
|
||||
final FacetTypeId underlyingFacetType = type.getUnderlyingFacetType();
|
||||
@@ -66,10 +65,9 @@ class AddFacetOfTypeAction extends DumbAwareAction {
|
||||
}
|
||||
|
||||
private void addSubFacet(FacetType type, FacetTypeId<?> underlyingType) {
|
||||
final StructureConfigurableContext context = myFacetStructureConfigurable.myContext;
|
||||
final ProjectFacetsConfigurator facetsConfigurator = context.getModulesConfigurator().getFacetsConfigurator();
|
||||
final ProjectFacetsConfigurator facetsConfigurator = myContext.getModulesConfigurator().getFacetsConfigurator();
|
||||
List<Facet> suitableParents = new ArrayList<Facet>();
|
||||
for (Module module : context.getModules()) {
|
||||
for (Module module : myContext.getModules()) {
|
||||
if (type.isSuitableModuleType(module.getModuleType())) {
|
||||
suitableParents.addAll(facetsConfigurator.getFacetsByType(module, underlyingType));
|
||||
}
|
||||
@@ -83,14 +81,14 @@ class AddFacetOfTypeAction extends DumbAwareAction {
|
||||
}
|
||||
}
|
||||
|
||||
final Project project = context.getProject();
|
||||
final Project project = myContext.getProject();
|
||||
if (suitableParents.isEmpty()) {
|
||||
final String parentType = FacetTypeRegistry.getInstance().findFacetType(underlyingType).getPresentableName();
|
||||
Messages.showErrorDialog(project, "No suitable parent " + parentType + " facets found", "Cannot Create " + type.getPresentableName() + " Facet");
|
||||
return;
|
||||
}
|
||||
|
||||
ChooseParentFacetDialog dialog = new ChooseParentFacetDialog(project, suitableParents, "Select Parent Facet", null);
|
||||
ChooseParentFacetDialog dialog = new ChooseParentFacetDialog(project, suitableParents);
|
||||
dialog.show();
|
||||
final List<Facet> chosen = dialog.getChosenElements();
|
||||
if (!dialog.isOK() || chosen.size() != 1) return;
|
||||
@@ -101,9 +99,8 @@ class AddFacetOfTypeAction extends DumbAwareAction {
|
||||
}
|
||||
|
||||
private void addFacetToModule(@NotNull FacetType type) {
|
||||
final StructureConfigurableContext context = myFacetStructureConfigurable.myContext;
|
||||
final ProjectFacetsConfigurator facetsConfigurator = context.getModulesConfigurator().getFacetsConfigurator();
|
||||
List<Module> suitableModules = new ArrayList<Module>(Arrays.asList(context.getModules()));
|
||||
final ProjectFacetsConfigurator facetsConfigurator = myContext.getModulesConfigurator().getFacetsConfigurator();
|
||||
List<Module> suitableModules = new ArrayList<Module>(Arrays.asList(myContext.getModules()));
|
||||
final Iterator<Module> iterator = suitableModules.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Module module = iterator.next();
|
||||
@@ -111,7 +108,7 @@ class AddFacetOfTypeAction extends DumbAwareAction {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
final Project project = context.getProject();
|
||||
final Project project = myContext.getProject();
|
||||
if (suitableModules.isEmpty()) {
|
||||
Messages.showErrorDialog(project, "No suitable modules for " + type.getPresentableName() + " facet found.", "Cannot Create Facet");
|
||||
return;
|
||||
@@ -129,27 +126,29 @@ class AddFacetOfTypeAction extends DumbAwareAction {
|
||||
ProjectStructureConfigurable.getInstance(project).select(facet, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent e) {
|
||||
final FacetType type = getSelectedType();
|
||||
e.getPresentation().setEnabled(myFacetStructureConfigurable.myContext.getModules().length > 0 && type != null && !(type instanceof InvalidFacetType));
|
||||
public static AnAction[] createAddFacetActions(FacetStructureConfigurable configurable) {
|
||||
final List<AnAction> result = new ArrayList<AnAction>();
|
||||
final StructureConfigurableContext context = configurable.myContext;
|
||||
for (FacetType type : FacetTypeRegistry.getInstance().getSortedFacetTypes()) {
|
||||
if (hasSuitableModules(context, type)) {
|
||||
result.add(new AddFacetOfTypeAction(type, context));
|
||||
}
|
||||
}
|
||||
return result.toArray(new AnAction[result.size()]);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private FacetType getSelectedType() {
|
||||
final NamedConfigurable configurable = myFacetStructureConfigurable.getSelectedConfugurable();
|
||||
if (configurable instanceof FacetTypeConfigurable) {
|
||||
return ((FacetTypeConfigurable)configurable).getFacetType();
|
||||
private static boolean hasSuitableModules(StructureConfigurableContext context, FacetType type) {
|
||||
for (Module module : context.getModules()) {
|
||||
if (type.isSuitableModuleType(module.getModuleType())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (configurable instanceof FacetConfigurable) {
|
||||
return ((FacetConfigurable)configurable).getEditableObject().getType();
|
||||
}
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static class ChooseParentFacetDialog extends ChooseElementsDialog<Facet> {
|
||||
private ChooseParentFacetDialog(Project project, List<? extends Facet> items, String title, String description) {
|
||||
super(project, items, title, description, true);
|
||||
private ChooseParentFacetDialog(Project project, List<? extends Facet> items) {
|
||||
super(project, items, "Select Parent Facet", null, true);
|
||||
myChooser.setSingleSelectionMode();
|
||||
}
|
||||
|
||||
|
||||
+23
-3
@@ -36,6 +36,8 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStr
|
||||
import com.intellij.openapi.ui.DetailsComponent;
|
||||
import com.intellij.openapi.ui.NamedConfigurable;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.util.ui.tree.TreeUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -52,6 +54,7 @@ public class FacetStructureConfigurable extends BaseStructureConfigurable {
|
||||
private final ModuleManager myModuleManager;
|
||||
private final Map<FacetType<?, ?>, FacetTypeEditor> myFacetTypeEditors = new HashMap<FacetType<?,?>, FacetTypeEditor>();
|
||||
private MultipleFacetSettingsEditor myCurrentMultipleSettingsEditor;
|
||||
@NonNls private static final String NO_FRAMEWORKS_NODE = "No facets are configured";
|
||||
|
||||
public FacetStructureConfigurable(final Project project, ModuleManager moduleManager) {
|
||||
super(project);
|
||||
@@ -80,15 +83,20 @@ public class FacetStructureConfigurable extends BaseStructureConfigurable {
|
||||
protected void loadTree() {
|
||||
myTree.setRootVisible(false);
|
||||
myTree.setShowsRootHandles(false);
|
||||
boolean hasFacetTypeNodes = false;
|
||||
for (FacetType<?,?> facetType : FacetTypeRegistry.getInstance().getFacetTypes()) {
|
||||
final FacetTypeEditor editor = getOrCreateFacetTypeEditor(facetType);
|
||||
if (editor.isVisible() || ProjectFacetManager.getInstance(myProject).hasFacets(facetType.getId())) {
|
||||
if (ProjectFacetManager.getInstance(myProject).hasFacets(facetType.getId())) {
|
||||
hasFacetTypeNodes = true;
|
||||
addFacetTypeNode(facetType);
|
||||
}
|
||||
}
|
||||
if (!InvalidFacetManager.getInstance(myProject).getInvalidFacets().isEmpty()) {
|
||||
hasFacetTypeNodes = true;
|
||||
addFacetTypeNode(InvalidFacetType.getInstance());
|
||||
}
|
||||
if (!hasFacetTypeNodes) {
|
||||
addNode(new MyNode(new TextConfigurable<String>(NO_FRAMEWORKS_NODE, NO_FRAMEWORKS_NODE, "Facets", "Press '+' button to add a new facet", null, null)), myRoot);
|
||||
}
|
||||
addNode(new MyNode(new FrameworkDetectionConfigurable(myProject)), myRoot);
|
||||
}
|
||||
|
||||
@@ -108,6 +116,11 @@ public class FacetStructureConfigurable extends BaseStructureConfigurable {
|
||||
}
|
||||
|
||||
private MyNode addFacetTypeNode(FacetType<?, ?> facetType) {
|
||||
final MyNode noFrameworksNode = findNodeByObject(myRoot, NO_FRAMEWORKS_NODE);
|
||||
if (noFrameworksNode != null) {
|
||||
removePaths(TreeUtil.getPathFromRoot(noFrameworksNode));
|
||||
}
|
||||
|
||||
FacetTypeConfigurable facetTypeConfigurable = new FacetTypeConfigurable(this, facetType);
|
||||
MyNode facetTypeNode = new MyNode(facetTypeConfigurable);
|
||||
addNode(facetTypeNode, myRoot);
|
||||
@@ -167,6 +180,7 @@ public class FacetStructureConfigurable extends BaseStructureConfigurable {
|
||||
public void reset() {
|
||||
super.reset();
|
||||
myFacetTypeEditors.clear();
|
||||
TreeUtil.expandAll(myTree);
|
||||
}
|
||||
|
||||
|
||||
@@ -202,7 +216,13 @@ public class FacetStructureConfigurable extends BaseStructureConfigurable {
|
||||
@NotNull
|
||||
protected ArrayList<AnAction> createActions(final boolean fromPopup) {
|
||||
ArrayList<AnAction> actions = new ArrayList<AnAction>();
|
||||
actions.add(new AddFacetOfTypeAction(this));
|
||||
actions.add(new AbstractAddGroup("Add") {
|
||||
@NotNull
|
||||
@Override
|
||||
public AnAction[] getChildren(@Nullable AnActionEvent e) {
|
||||
return AddFacetOfTypeAction.createAddFacetActions(FacetStructureConfigurable.this);
|
||||
}
|
||||
});
|
||||
if (fromPopup) {
|
||||
actions.add(new MyNavigateAction());
|
||||
}
|
||||
|
||||
-4
@@ -58,10 +58,6 @@ public class FacetTypeConfigurable extends NamedConfigurable<FacetType> {
|
||||
return myFacetType.getIcon();
|
||||
}
|
||||
|
||||
public FacetType getFacetType() {
|
||||
return myFacetType;
|
||||
}
|
||||
|
||||
public String getHelpTopic() {
|
||||
final FacetTypeEditor editor = myFacetStructureConfigurable.getFacetTypeEditor(myFacetType);
|
||||
return editor != null ? editor.getHelpTopic() : null;
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class FacetsTreeCellRenderer extends GroupedElementsRenderer.Tree impleme
|
||||
final NamedConfigurable configurable = node.getConfigurable();
|
||||
if (configurable != null) {
|
||||
final Icon icon = configurable.getIcon(expanded);
|
||||
final boolean showSeparator = icon == null;
|
||||
final boolean showSeparator = configurable instanceof FrameworkDetectionConfigurable;
|
||||
int width = -1;
|
||||
if (showSeparator) {
|
||||
final int treeWidth = tree.getSize().width;
|
||||
|
||||
+12
-4
@@ -19,7 +19,7 @@ package com.intellij.openapi.roots.ui.configuration.projectRoot;
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.facet.Facet;
|
||||
import com.intellij.facet.impl.ProjectFacetsConfigurator;
|
||||
import com.intellij.facet.impl.ui.actions.AddFacetAction;
|
||||
import com.intellij.facet.impl.ui.actions.AddFacetToModuleAction;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.highlighter.ModuleFileType;
|
||||
import com.intellij.ide.projectView.impl.ModuleGroup;
|
||||
@@ -63,6 +63,7 @@ import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.ui.navigation.Place;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.tree.TreeUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -234,7 +235,8 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
|
||||
},
|
||||
new Function<ModuleGroup, MyNode>() {
|
||||
public MyNode fun(final ModuleGroup moduleGroup) {
|
||||
final NamedConfigurable moduleGroupConfigurable = new ModuleGroupConfigurable(moduleGroup);
|
||||
final NamedConfigurable moduleGroupConfigurable =
|
||||
createModuleGroupConfigurable(moduleGroup);
|
||||
return new MyNode(moduleGroupConfigurable, true);
|
||||
}
|
||||
});
|
||||
@@ -281,7 +283,7 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
|
||||
}
|
||||
}, new Function<ModuleGroup, MyNode>() {
|
||||
public MyNode fun(final ModuleGroup moduleGroup) {
|
||||
final NamedConfigurable moduleGroupConfigurable = new ModuleGroupConfigurable(moduleGroup);
|
||||
final NamedConfigurable moduleGroupConfigurable = createModuleGroupConfigurable(moduleGroup);
|
||||
return new MyNode(moduleGroupConfigurable, true);
|
||||
}
|
||||
});
|
||||
@@ -536,6 +538,12 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
|
||||
return myContext;
|
||||
}
|
||||
|
||||
private static TextConfigurable<ModuleGroup> createModuleGroupConfigurable(final ModuleGroup moduleGroup) {
|
||||
return new TextConfigurable<ModuleGroup>(moduleGroup, moduleGroup.toString(),
|
||||
ProjectBundle.message("module.group.banner.text", moduleGroup.toString()),
|
||||
ProjectBundle.message("project.roots.module.groups.text"),
|
||||
PlatformIcons.OPENED_MODULE_GROUP_ICON, PlatformIcons.CLOSED_MODULE_GROUP_ICON);
|
||||
}
|
||||
|
||||
private class MyDataProviderWrapper extends JPanel implements DataProvider {
|
||||
public MyDataProviderWrapper(final JComponent component) {
|
||||
@@ -639,7 +647,7 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
|
||||
ArrayList<AnAction> result = new ArrayList<AnAction>();
|
||||
result.add(module);
|
||||
|
||||
final AnAction[] facets = AddFacetAction.createAddFacetActions(myFacetEditorFacade, myProject);
|
||||
final AnAction[] facets = AddFacetToModuleAction.createAddFacetActions(myFacetEditorFacade, myProject);
|
||||
if (facets.length > 0) {
|
||||
result.add(new Separator(ProjectBundle.message("add.group.facet.separator")));
|
||||
ContainerUtil.addAll(result, facets);
|
||||
|
||||
+52
-46
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2011 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.
|
||||
@@ -13,68 +13,44 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: Anna.Kozlova
|
||||
* Date: 16-Jul-2006
|
||||
* Time: 16:52:27
|
||||
*/
|
||||
package com.intellij.openapi.roots.ui.configuration.projectRoot;
|
||||
|
||||
import com.intellij.ide.projectView.impl.ModuleGroup;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.project.ProjectBundle;
|
||||
import com.intellij.openapi.ui.NamedConfigurable;
|
||||
import com.intellij.openapi.ui.PanelWithText;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class ModuleGroupConfigurable extends NamedConfigurable<ModuleGroup> {
|
||||
private final ModuleGroup myModuleGroup;
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public class TextConfigurable<T> extends NamedConfigurable<T> {
|
||||
private final T myObject;
|
||||
private final String myBannerSlogan;
|
||||
private final String myDisplayName;
|
||||
private final Icon myOpenedIcon;
|
||||
private final Icon myClosedIcon;
|
||||
private final String myDescriptionText;
|
||||
|
||||
public ModuleGroupConfigurable(final ModuleGroup moduleGroup) {
|
||||
myModuleGroup = moduleGroup;
|
||||
public TextConfigurable(final T object,
|
||||
final String displayName,
|
||||
final String bannerSlogan,
|
||||
final String descriptionText,
|
||||
final Icon openedIcon, final Icon closedIcon) {
|
||||
myDisplayName = displayName;
|
||||
myBannerSlogan = bannerSlogan;
|
||||
myDescriptionText = descriptionText;
|
||||
myOpenedIcon = openedIcon;
|
||||
myClosedIcon = closedIcon;
|
||||
myObject = object;
|
||||
}
|
||||
|
||||
public void setDisplayName(final String name) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
public ModuleGroup getEditableObject() {
|
||||
return myModuleGroup;
|
||||
}
|
||||
|
||||
public String getBannerSlogan() {
|
||||
return ProjectBundle.message("module.group.banner.text", myModuleGroup.toString());
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return myModuleGroup.toString();
|
||||
}
|
||||
|
||||
public Icon getIcon() {
|
||||
return PlatformIcons.OPENED_MODULE_GROUP_ICON;
|
||||
}
|
||||
|
||||
public Icon getIcon(final boolean open) {
|
||||
return open ? PlatformIcons.OPENED_MODULE_GROUP_ICON : PlatformIcons.CLOSED_MODULE_GROUP_ICON;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NonNls
|
||||
public String getHelpTopic() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public JComponent createOptionsPanel() {
|
||||
return new PanelWithText(ProjectBundle.message("project.roots.module.groups.text"));
|
||||
}
|
||||
|
||||
public boolean isModified() {
|
||||
return false;
|
||||
}
|
||||
@@ -90,4 +66,34 @@ public class ModuleGroupConfigurable extends NamedConfigurable<ModuleGroup> {
|
||||
public void disposeUIResources() {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NonNls
|
||||
public String getHelpTopic() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public T getEditableObject() {
|
||||
return myObject;
|
||||
}
|
||||
|
||||
public String getBannerSlogan() {
|
||||
return myBannerSlogan;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return myDisplayName;
|
||||
}
|
||||
|
||||
public Icon getIcon() {
|
||||
return myOpenedIcon;
|
||||
}
|
||||
|
||||
public Icon getIcon(final boolean open) {
|
||||
return open ? myOpenedIcon : myClosedIcon;
|
||||
}
|
||||
|
||||
public JComponent createOptionsPanel() {
|
||||
return new PanelWithText(myDescriptionText);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,6 @@
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightUtilBase;
|
||||
import com.intellij.codeInsight.completion.impl.CompletionServiceImpl;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -27,7 +26,6 @@ import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.PostprocessReformattingAspect;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.PsiShortNamesCache;
|
||||
import com.intellij.psi.search.searches.AllClassesSearch;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
@@ -153,7 +151,11 @@ public class AllClassesGetter {
|
||||
final GlobalSearchScope scope = filterByScope ? context.getContainingFile().getResolveScope() : GlobalSearchScope.allScope(project);
|
||||
final boolean pkgContext = JavaCompletionUtil.inSomePackage(context);
|
||||
|
||||
final Processor<PsiClass> classProcessor = new Processor<PsiClass>() {
|
||||
AllClassesSearch.search(scope, project, new Condition<String>() {
|
||||
public boolean value(String s) {
|
||||
return prefixMatcher.prefixMatches(s);
|
||||
}
|
||||
}).forEach(new Processor<PsiClass>() {
|
||||
public boolean process(PsiClass psiClass) {
|
||||
assert psiClass != null;
|
||||
if (isSuitable(context, packagePrefix, qnames, psiClass, filterByScope, pkgContext)) {
|
||||
@@ -162,33 +164,7 @@ public class AllClassesGetter {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
PsiShortNamesCache shortNamesCache = JavaPsiFacade.getInstance(project).getShortNamesCache();
|
||||
|
||||
Set<String> words = WordCompletionContributor.getAllWords(context, parameters.getOffset());
|
||||
words.add(prefixMatcher.getPrefix());
|
||||
for (String s : words) {
|
||||
if (prefixMatcher.prefixMatches(s)) {
|
||||
for (PsiClass wordMatch : shortNamesCache.getClassesByName(s, scope)) {
|
||||
classProcessor.process(wordMatch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final CompletionProgressIndicator indicator = CompletionServiceImpl.getCompletionService().getCurrentCompletion();
|
||||
if (indicator != null) {
|
||||
indicator.delayAllowingFocusedLookup(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
AllClassesSearch.search(scope, project, new Condition<String>() {
|
||||
public boolean value(String s) {
|
||||
return prefixMatcher.prefixMatches(s);
|
||||
}
|
||||
}).forEach(classProcessor);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2000-2011 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.codeInsight.lookup.AutoCompletionPolicy;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.util.Consumer;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class JavaBasicToClassNameDelegator extends CompletionContributor {
|
||||
|
||||
@Override
|
||||
public void fillCompletionVariants(final CompletionParameters parameters, final CompletionResultSet result) {
|
||||
if (parameters.getCompletionType() != CompletionType.BASIC ||
|
||||
parameters.getInvocationCount() != 1 ||
|
||||
!JavaCompletionContributor.mayStartClassName(result, false) ||
|
||||
!JavaCompletionContributor.isClassNamePossible(parameters.getPosition())) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Ref<Boolean> empty = Ref.create(true);
|
||||
result.runRemainingContributors(parameters, new Consumer<CompletionResult>() {
|
||||
public void consume(final CompletionResult lookupElement) {
|
||||
empty.set(false);
|
||||
result.passResult(lookupElement);
|
||||
}
|
||||
});
|
||||
|
||||
if (empty.get()) {
|
||||
JavaClassNameCompletionContributor.addAllClasses(parameters, JavaCompletionSorting.addJavaSorting(parameters, result), new Consumer<LookupElement>() {
|
||||
@Override
|
||||
public void consume(LookupElement element) {
|
||||
JavaPsiClassReferenceElement classElement = element.as(JavaPsiClassReferenceElement.CLASS_CONDITION_KEY);
|
||||
if (classElement != null) {
|
||||
classElement.setAutoCompletionPolicy(AutoCompletionPolicy.NEVER_AUTOCOMPLETE);
|
||||
}
|
||||
result.addElement(element);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-7
@@ -270,16 +270,11 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
|
||||
final boolean isSwitchLabel = SWITCH_LABEL.accepts(position);
|
||||
final PsiFile originalFile = parameters.getOriginalFile();
|
||||
Set<LookupElement> set = JavaCompletionUtil.processJavaReference(position,
|
||||
for (LookupElement element : JavaCompletionUtil.processJavaReference(position,
|
||||
(PsiJavaReference)reference,
|
||||
new ElementExtractorFilter(filter),
|
||||
checkAccess,
|
||||
result.getPrefixMatcher(), parameters);
|
||||
PsiClass arrays = JavaPsiFacade.getInstance(position.getProject()).findClass(CommonClassNames.JAVA_UTIL_ARRAYS, position.getResolveScope());
|
||||
if (arrays != null && filter.isAcceptable(arrays, position) && isClassNamePossible(parameters.getPosition())) {
|
||||
set.add(JavaClassNameCompletionContributor.createClassLookupItem(arrays, true));
|
||||
}
|
||||
for (LookupElement element : set) {
|
||||
result.getPrefixMatcher(), parameters)) {
|
||||
if (inheritors.alreadyProcessed(element)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ public class JavaGlobalMemberNameCompletionContributor extends CompletionContrib
|
||||
@Override
|
||||
public void renderElement(LookupElementPresentation presentation) {
|
||||
super.renderElement(presentation);
|
||||
myHelper.renderElement(presentation, getAttribute(FORCE_QUALIFY) != null, PsiSubstitutor.EMPTY);
|
||||
myHelper.renderElement(presentation, getAttribute(FORCE_QUALIFY) != null ? Boolean.TRUE : null, PsiSubstitutor.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,16 +22,14 @@ import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.filters.getters.ExpectedTypesGetter;
|
||||
import com.intellij.psi.infos.MethodCandidateInfo;
|
||||
import com.intellij.psi.statistics.JavaStatisticsManager;
|
||||
import com.intellij.psi.statistics.StatisticsInfo;
|
||||
import com.intellij.psi.statistics.StatisticsManager;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.psi.util.TypeConversionUtil;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.ProcessingContext;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.*;
|
||||
import gnu.trove.THashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -137,8 +135,13 @@ public class JavaInheritorsGetter extends CompletionProvider<CompletionParameter
|
||||
final PsiVariable declaredVar = (PsiVariable)((PsiDeclarationStatement)statement).getDeclaredElements()[0];
|
||||
final PsiNewExpression initializer = (PsiNewExpression)declaredVar.getInitializer();
|
||||
final boolean hasDefaultConstructorOrNoGenericsOne = PsiDiamondType.hasDefaultConstructor(psiClass) || !PsiDiamondType.haveConstructorsGenericsParameters(psiClass);
|
||||
if (hasDefaultConstructorOrNoGenericsOne && PsiDiamondType.resolveInferredTypes(initializer).getErrorMessage() == null) {
|
||||
psiType = initializer.getType();
|
||||
if (hasDefaultConstructorOrNoGenericsOne) {
|
||||
final PsiDiamondType.DiamondInferenceResult inferenceResult = PsiDiamondType.resolveInferredTypes(initializer);
|
||||
if (inferenceResult.getErrorMessage() == null &&
|
||||
!psiClass.hasModifierProperty(PsiModifier.ABSTRACT) &&
|
||||
areInferredTypesApplicable(inferenceResult.getTypes(), parameters.getOriginalPosition())) {
|
||||
psiType = initializer.getType();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,7 +156,21 @@ public class JavaInheritorsGetter extends CompletionProvider<CompletionParameter
|
||||
return LookupElementDecorator.withInsertHandler(item, myConstructorInsertHandler);
|
||||
}
|
||||
|
||||
public static void processInheritors(final CompletionParameters parameters,
|
||||
private static boolean areInferredTypesApplicable(PsiType[] types, PsiElement originalPosition) {
|
||||
final PsiNewExpression newExpression = PsiTreeUtil.getParentOfType(originalPosition, PsiNewExpression.class);
|
||||
if (newExpression != null) {
|
||||
final PsiMethodCallExpression methodCallExpression = PsiTreeUtil.getParentOfType(originalPosition, PsiMethodCallExpression.class);
|
||||
if (methodCallExpression != null &&
|
||||
ArrayUtil.find(methodCallExpression.getArgumentList().getExpressions(), newExpression) > -1) {
|
||||
final JavaResolveResult resolveResult = methodCallExpression.resolveMethodGenerics();
|
||||
return PsiUtil.getApplicabilityLevel((PsiMethod)resolveResult.getElement(), resolveResult.getSubstitutor(), types, PsiUtil.getLanguageLevel(originalPosition))
|
||||
!= MethodCandidateInfo.ApplicabilityLevel.NOT_APPLICABLE;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void processInheritors(final CompletionParameters parameters,
|
||||
final Collection<PsiClassType> expectedClassTypes,
|
||||
final PrefixMatcher matcher, final Consumer<PsiType> consumer) {
|
||||
//quick
|
||||
|
||||
+1
-5
@@ -24,16 +24,12 @@ import com.intellij.psi.PsiFile;
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public class BasicToClassNameDelegator extends AbstractBasicToClassNameDelegator {
|
||||
public class XmlBasicToClassNameDelegator extends AbstractBasicToClassNameDelegator {
|
||||
|
||||
@Override
|
||||
protected boolean isClassNameCompletionSupported(CompletionResultSet result, PsiFile file, PsiElement position) {
|
||||
if (!JavaCompletionContributor.mayStartClassName(result, false)) return false;
|
||||
|
||||
if (file.getLanguage() == StdLanguages.JAVA) {
|
||||
return JavaCompletionContributor.isClassNamePossible(position);
|
||||
}
|
||||
|
||||
return file.getLanguage().isKindOf(StdLanguages.XML);
|
||||
}
|
||||
|
||||
@@ -26,12 +26,15 @@ import com.intellij.codeInsight.navigation.ListBackgroundUpdaterTask;
|
||||
import com.intellij.ide.util.MethodCellRenderer;
|
||||
import com.intellij.ide.util.PsiClassListCellRenderer;
|
||||
import com.intellij.ide.util.PsiElementListCellRenderer;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.search.PsiElementProcessorAdapter;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import com.intellij.psi.search.searches.ClassInheritorsSearch;
|
||||
import com.intellij.psi.search.searches.OverridingMethodsSearch;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
@@ -235,7 +238,12 @@ public class MarkerType {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
super.run(indicator);
|
||||
ClassInheritorsSearch.search(myClass, myClass.getUseScope(), true).forEach(new CommonProcessors.CollectProcessor<PsiClass>() {
|
||||
ClassInheritorsSearch.search(myClass, ApplicationManager.getApplication().runReadAction(new Computable<SearchScope>() {
|
||||
@Override
|
||||
public SearchScope compute() {
|
||||
return myClass.getUseScope();
|
||||
}
|
||||
}), true).forEach(new CommonProcessors.CollectProcessor<PsiClass>() {
|
||||
@Override
|
||||
public boolean process(final PsiClass o) {
|
||||
updateComponent(o, myRenderer.getComparator());
|
||||
@@ -266,7 +274,7 @@ public class MarkerType {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
super.run(indicator);
|
||||
OverridingMethodsSearch.search(myMethod, myMethod.getUseScope(), true).forEach(
|
||||
OverridingMethodsSearch.search(myMethod, true).forEach(
|
||||
new CommonProcessors.CollectProcessor<PsiMethod>() {
|
||||
@Override
|
||||
public boolean process(PsiMethod psiMethod) {
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.intellij.ide;
|
||||
|
||||
import com.intellij.application.options.IndentOptionsEditor;
|
||||
import com.intellij.application.options.JavaIndentOptionsEditor;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.StdLanguages;
|
||||
import com.intellij.lang.java.JavaLanguage;
|
||||
@@ -79,7 +81,9 @@ public class JavaLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSett
|
||||
|
||||
@Override
|
||||
public CommonCodeStyleSettings getDefaultCommonSettings() {
|
||||
return new CommonCodeStyleSettings(JavaLanguage.INSTANCE);
|
||||
CommonCodeStyleSettings settings = new CommonCodeStyleSettings(JavaLanguage.INSTANCE);
|
||||
settings.initIndentOptions();
|
||||
return settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,6 +91,11 @@ public class JavaLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSett
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndentOptionsEditor getIndentOptionsEditor() {
|
||||
return new JavaIndentOptionsEditor();
|
||||
}
|
||||
|
||||
private static final String GENERAL_CODE_SAMPLE =
|
||||
"public class Foo {\n" +
|
||||
" public int[] X = new int[]{1, 3, 5 7, 9, 11};\n" +
|
||||
|
||||
@@ -67,7 +67,12 @@ public class JavaDirectInheritorsSearcher implements QueryExecutor<PsiClass, Dir
|
||||
}
|
||||
|
||||
final GlobalSearchScope scope = useScope instanceof GlobalSearchScope ? (GlobalSearchScope)useScope : new EverythingGlobalScope(psiManager.getProject());
|
||||
final String searchKey = aClass.getName();
|
||||
final String searchKey = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
|
||||
@Override
|
||||
public String compute() {
|
||||
return aClass.getName();
|
||||
}
|
||||
});
|
||||
if (StringUtil.isEmpty(searchKey)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -22,9 +22,10 @@ import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
|
||||
import com.intellij.openapi.editor.highlighter.EditorHighlighterFactory;
|
||||
import com.intellij.openapi.editor.impl.DocumentImpl;
|
||||
import com.intellij.openapi.editor.impl.EditorHighlighterCache;
|
||||
import com.intellij.psi.JspPsiUtil;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.JspPsiUtil;
|
||||
import com.intellij.psi.impl.cache.impl.id.IdTableBuilding;
|
||||
import com.intellij.psi.impl.source.tree.StdTokenSets;
|
||||
import com.intellij.psi.jsp.JspFile;
|
||||
@@ -44,8 +45,7 @@ public class JspIndexPatternBuilder implements IndexPatternBuilder {
|
||||
EditorHighlighter cachedEditorHighlighter;
|
||||
boolean alreadyInitializedHighlighter = false;
|
||||
|
||||
if (document instanceof DocumentImpl &&
|
||||
(cachedEditorHighlighter = ((DocumentImpl)document).getEditorHighlighterForCachesBuilding()) != null &&
|
||||
if ((cachedEditorHighlighter = EditorHighlighterCache.getEditorHighlighterForCachesBuilding(document)) != null &&
|
||||
IdTableBuilding.checkCanUseCachedEditorHighlighter(file.getText(), cachedEditorHighlighter)
|
||||
) {
|
||||
highlighter = cachedEditorHighlighter;
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiJavaReference;
|
||||
import com.intellij.psi.PsiNamedElement;
|
||||
import com.intellij.psi.WalkingState;
|
||||
import com.intellij.util.WalkingState;
|
||||
import com.intellij.psi.impl.source.tree.SourceUtil;
|
||||
import com.intellij.util.NullableFunction;
|
||||
import com.intellij.util.PairProcessor;
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.util.NullableFunction;
|
||||
import com.intellij.util.PairProcessor;
|
||||
import com.intellij.util.WalkingState;
|
||||
import com.intellij.util.containers.FactoryMap;
|
||||
import gnu.trove.THashMap;
|
||||
import gnu.trove.THashSet;
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class MyClass {
|
||||
public void foo() {
|
||||
MyDD<String> d = new MyDD<String>() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
abstract class MyDD<T> {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class MyClass {
|
||||
public void foo() {
|
||||
MyDD<String> d = new MyD<caret>
|
||||
}
|
||||
}
|
||||
|
||||
abstract class MyDD<T> {
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CompletionWithPassToMethod {
|
||||
|
||||
public static void main(String[] args) {
|
||||
foo(new ArrayList<String>());
|
||||
}
|
||||
|
||||
|
||||
static void foo(ArrayList<String> ll) {
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CompletionWithPassToMethod {
|
||||
|
||||
public static void main(String[] args) {
|
||||
foo(new ArrayL<caret>);
|
||||
}
|
||||
|
||||
|
||||
static void foo(ArrayList<String> ll) {
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import com.intellij.ide.DataManager;
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
||||
import com.intellij.openapi.editor.ex.DocumentEx;
|
||||
import com.intellij.openapi.editor.impl.DocumentImpl;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
|
||||
/**
|
||||
@@ -29,6 +29,6 @@ public class GenerateJavadocTest extends CodeInsightTestCase {
|
||||
EditorActionManager actionManager = EditorActionManager.getInstance();
|
||||
EditorActionHandler actionHandler = actionManager.getActionHandler(IdeActions.ACTION_EDITOR_ENTER);
|
||||
actionHandler.execute(myEditor, DataManager.getInstance().getDataContext());
|
||||
((DocumentEx)myEditor.getDocument()).stripTrailingSpaces(false);
|
||||
((DocumentImpl)myEditor.getDocument()).stripTrailingSpaces();
|
||||
}
|
||||
}
|
||||
|
||||
+20
-1
@@ -2,7 +2,8 @@ package com.intellij.codeInsight.completion;
|
||||
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
|
||||
import com.intellij.codeInsight.CodeInsightSettings
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.ArrayUtil
|
||||
import com.intellij.codeInsight.lookup.LookupElementPresentation;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
@@ -54,6 +55,24 @@ public class Foo {
|
||||
class Bar {{ Foo.abcfield<caret> }}"""
|
||||
}
|
||||
|
||||
public void testFieldNamePresentation() {
|
||||
myFixture.addClass("""
|
||||
package foo;
|
||||
|
||||
public class Foo {
|
||||
public static int abcfield = 2
|
||||
static final int fieldThatsNotVisible = 3
|
||||
}
|
||||
""")
|
||||
myFixture.configureByText "a.java", "class Bar {{ abcf<caret> }}"
|
||||
def element = myFixture.complete(CompletionType.CLASS_NAME)[0]
|
||||
def presentation = new LookupElementPresentation()
|
||||
element.renderElement(presentation)
|
||||
assert 'Foo.abcfield' == presentation.itemText
|
||||
assert ' (foo)' == presentation.tailText
|
||||
assert 'int' == presentation.typeText
|
||||
}
|
||||
|
||||
public void testQualifiedMethodName() throws Exception {
|
||||
myFixture.addClass("""
|
||||
package foo;
|
||||
|
||||
+3
-2
@@ -934,8 +934,9 @@ public class Bar {
|
||||
|
||||
public void testArrays() {
|
||||
myFixture.configureByText "a.java", "class Foo {{ <caret> }}"
|
||||
type 'Arrays'
|
||||
assert myFixture.lookupElementStrings == ['Arrays', 'ArrayStoreException']
|
||||
type 'Arrays.'
|
||||
myFixture.checkResult "class Foo {{ Arrays.<caret> }}"
|
||||
assert !lookup
|
||||
}
|
||||
|
||||
|
||||
|
||||
+8
@@ -41,6 +41,14 @@ public class SmartType17CompletionTest extends LightFixtureCompletionTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDiamondNotCollapsedInCaseOfAnonymousClasses() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDiamondNotCollapsedInCaseOfInapplicableInference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDiamondPresentation() {
|
||||
configureByFile("/" + getTestName(false) + ".java");
|
||||
LookupElementPresentation presentation = new LookupElementPresentation();
|
||||
|
||||
+1
-2
@@ -21,7 +21,6 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.editor.ex.DocumentEx;
|
||||
import com.intellij.openapi.editor.impl.DocumentImpl;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
@@ -200,7 +199,7 @@ public abstract class AbstractJavaFormatterTest extends LightIdeaTestCase {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
((DocumentEx)doc).stripTrailingSpaces(false);
|
||||
((DocumentImpl)doc).stripTrailingSpaces();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,10 +72,10 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
|
||||
myTable = new JBTable();
|
||||
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable);
|
||||
|
||||
add(scrollPane, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 3, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(4, 4, 4, 6), 0, 0));
|
||||
add(myAddClassButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 4), 0, 0));
|
||||
add(myAddPatternButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 4), 0, 0));
|
||||
add(myRemoveButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 4), 0, 0));
|
||||
add(scrollPane, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 3, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(4, 0, 4, 6), 0, 0));
|
||||
add(myAddClassButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 0), 0, 0));
|
||||
add(myAddPatternButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 0), 0, 0));
|
||||
add(myRemoveButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(4, 0, 0, 0), 0, 0));
|
||||
|
||||
myChooserFilter = classFilter;
|
||||
myProject = project;
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedAction;
|
||||
import com.intellij.openapi.editor.ex.DocumentEx;
|
||||
import com.intellij.openapi.editor.impl.DocumentImpl;
|
||||
import com.intellij.openapi.editor.impl.EditorImpl;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
|
||||
@@ -480,7 +481,7 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
|
||||
public void run() {
|
||||
getProject().getComponent(PostprocessReformattingAspect.class).doPostponedFormatting();
|
||||
if (stripTrailingSpaces) {
|
||||
((DocumentEx)myEditor.getDocument()).stripTrailingSpaces(false);
|
||||
((DocumentImpl)myEditor.getDocument()).stripTrailingSpaces();
|
||||
}
|
||||
|
||||
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
|
||||
@@ -522,7 +523,7 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
|
||||
String newFileText1 = newFileText;
|
||||
if (stripTrailingSpaces) {
|
||||
Document document1 = EditorFactory.getInstance().createDocument(newFileText);
|
||||
((DocumentEx)document1).stripTrailingSpaces(false);
|
||||
((DocumentImpl)document1).stripTrailingSpaces();
|
||||
newFileText1 = document1.getText();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<orderEntry type="module" module-name="execution-impl" exported="" scope="RUNTIME" />
|
||||
<orderEntry type="library" name="Groovy" level="project" />
|
||||
<orderEntry type="module" module-name="testFramework" exported="" />
|
||||
<orderEntry type="module" module-name="relaxng" exported="" scope="TEST" />
|
||||
</component>
|
||||
<component name="copyright">
|
||||
<Base>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="util" exported="" />
|
||||
<orderEntry type="module" module-name="extensions" exported="" />
|
||||
<orderEntry type="library" name="picocontainer" level="project" />
|
||||
<orderEntry type="module" module-name="platform-resources-en" exported="" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
+2
@@ -331,4 +331,6 @@ public interface Application extends ComponentManager {
|
||||
* Returns lock used for write operations, should be closed in finally block
|
||||
*/
|
||||
AccessToken acquireWriteActionLock(@Nullable Class marker);
|
||||
|
||||
boolean isInternal();
|
||||
}
|
||||
+1
-2
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.openapi.fileTypes;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -35,7 +34,7 @@ public class UnknownFileType implements FileType {
|
||||
|
||||
@NotNull
|
||||
public String getDescription() {
|
||||
return IdeBundle.message("filetype.description.unknown");
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user