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:
-9
@@ -15,15 +15,6 @@
|
||||
*/
|
||||
package com.intellij.lang.documentation;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Dmitry Avdeev
|
||||
*/
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.psi.PsiManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -57,4 +58,9 @@ public class DocumentationProviderEx implements DocumentationProvider {
|
||||
public PsiElement getCustomDocumentationElement(@NotNull final Editor editor, @NotNull final PsiFile file, @Nullable PsiElement contextElement) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Image getLocalImageForElement(@NotNull PsiElement element, @NotNull String imageSpec) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+49
-3
@@ -68,10 +68,9 @@ import javax.swing.event.HyperlinkListener;
|
||||
import javax.swing.text.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.Collections;
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
public class DocumentationComponent extends JPanel implements Disposable, DataProvider {
|
||||
|
||||
@@ -103,6 +102,13 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
|
||||
private final MyShowSettingsButton myShowSettingsButton;
|
||||
private boolean myIgnoreFontSizeSliderChange;
|
||||
private String myEffectiveExternalUrl;
|
||||
private final MyDictionary<String, Image> myImageProvider = new MyDictionary<String, Image>() {
|
||||
@Override
|
||||
public Image get(Object key) {
|
||||
PsiElement element = getElement();
|
||||
return element == null ? null : myManager.getElementImage(element, ((URL)key).toExternalForm());
|
||||
}
|
||||
};
|
||||
|
||||
private static class Context {
|
||||
final SmartPsiElementPointer element;
|
||||
@@ -180,6 +186,14 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
|
||||
GraphicsUtil.setupAntialiasing(g);
|
||||
super.paintComponent(g);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDocument(Document doc) {
|
||||
super.setDocument(doc);
|
||||
if (doc instanceof StyledDocument) {
|
||||
doc.putProperty("imageCache", myImageProvider);
|
||||
}
|
||||
}
|
||||
};
|
||||
DataProvider helpDataProvider = new DataProvider() {
|
||||
@Override
|
||||
@@ -880,4 +894,36 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
|
||||
mySettingsPanel.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class MyDictionary<K, V> extends Dictionary<K, V> {
|
||||
@Override
|
||||
public int size() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<K> keys() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<V> elements() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public V put(K key, V value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public V remove(Object key) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -994,6 +994,20 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
return getTitle(element, true);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Image getElementImage(@NotNull PsiElement element, @NotNull String imageSpec) {
|
||||
DocumentationProvider provider = getProviderFromElement(element);
|
||||
if (provider instanceof CompositeDocumentationProvider) {
|
||||
for (DocumentationProvider p : ((CompositeDocumentationProvider)provider).getAllProviders()) {
|
||||
if (p instanceof DocumentationProviderEx) {
|
||||
Image image = ((DocumentationProviderEx)p).getLocalImageForElement(element, imageSpec);
|
||||
if (image != null) return image;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private interface DocumentationCollector {
|
||||
@Nullable
|
||||
String getDocumentation() throws Exception;
|
||||
|
||||
@@ -52,14 +52,14 @@ public class FindInProjectManager {
|
||||
|
||||
public void findInProject(@NotNull DataContext dataContext) {
|
||||
final boolean isOpenInNewTabEnabled;
|
||||
final boolean[] toOpenInNewTab = new boolean[1];
|
||||
final boolean toOpenInNewTab;
|
||||
Content selectedContent = UsageViewManager.getInstance(myProject).getSelectedContent(true);
|
||||
if (selectedContent != null && selectedContent.isPinned()) {
|
||||
toOpenInNewTab[0] = true;
|
||||
toOpenInNewTab = true;
|
||||
isOpenInNewTabEnabled = false;
|
||||
}
|
||||
else {
|
||||
toOpenInNewTab[0] = FindSettings.getInstance().isShowResultsInSeparateView();
|
||||
toOpenInNewTab = FindSettings.getInstance().isShowResultsInSeparateView();
|
||||
isOpenInNewTabEnabled = UsageViewManager.getInstance(myProject).getReusableContentsCount() > 0;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class FindInProjectManager {
|
||||
findModel.setReplaceState(false);
|
||||
findModel.setOpenInNewTabVisible(true);
|
||||
findModel.setOpenInNewTabEnabled(isOpenInNewTabEnabled);
|
||||
findModel.setOpenInNewTab(toOpenInNewTab[0]);
|
||||
findModel.setOpenInNewTab(toOpenInNewTab);
|
||||
FindInProjectUtil.setDirectoryName(findModel, dataContext);
|
||||
|
||||
String text = PlatformDataKeys.PREDEFINED_TEXT.getData(dataContext);
|
||||
@@ -85,7 +85,7 @@ public class FindInProjectManager {
|
||||
public void run() {
|
||||
findModel.setOpenInNewTabVisible(false);
|
||||
if (isOpenInNewTabEnabled) {
|
||||
FindSettings.getInstance().setShowResultsInSeparateView(toOpenInNewTab[0] = findModel.isOpenInNewTab());
|
||||
FindSettings.getInstance().setShowResultsInSeparateView(findModel.isOpenInNewTab());
|
||||
}
|
||||
|
||||
startFindInProject(findModel);
|
||||
|
||||
+24
-7
@@ -20,6 +20,7 @@ import com.intellij.find.*;
|
||||
import com.intellij.find.actions.FindInPathAction;
|
||||
import com.intellij.find.findInProject.FindInProjectManager;
|
||||
import com.intellij.find.impl.FindInProjectUtil;
|
||||
import com.intellij.find.impl.FindManagerImpl;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.notification.NotificationGroup;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
@@ -38,6 +39,7 @@ import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Factory;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.Segment;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.ReadonlyStatusHandler;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -48,9 +50,8 @@ import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.usageView.*;
|
||||
import com.intellij.usageView.UsageInfo;
|
||||
import com.intellij.usages.*;
|
||||
import com.intellij.usages.UsageViewManager;
|
||||
import com.intellij.usages.impl.UsageViewImpl;
|
||||
import com.intellij.usages.rules.UsageInFile;
|
||||
import com.intellij.util.AdapterProcessor;
|
||||
@@ -115,9 +116,23 @@ public class ReplaceInProjectManager {
|
||||
}
|
||||
|
||||
public void replaceInProject(@NotNull DataContext dataContext) {
|
||||
final boolean isOpenInNewTabEnabled;
|
||||
final boolean toOpenInNewTab;
|
||||
final Content selectedContent = com.intellij.usageView.UsageViewManager.getInstance(myProject).getSelectedContent(true);
|
||||
if (selectedContent != null && selectedContent.isPinned()) {
|
||||
toOpenInNewTab = true;
|
||||
isOpenInNewTabEnabled = false;
|
||||
}
|
||||
else {
|
||||
toOpenInNewTab = FindSettings.getInstance().isShowResultsInSeparateView();
|
||||
isOpenInNewTabEnabled = com.intellij.usageView.UsageViewManager.getInstance(myProject).getReusableContentsCount() > 0;
|
||||
}
|
||||
final FindManager findManager = FindManager.getInstance(myProject);
|
||||
final FindModel findModel = (FindModel)findManager.getFindInProjectModel().clone();
|
||||
final FindModel findModel = findManager.getFindInProjectModel().clone();
|
||||
findModel.setReplaceState(true);
|
||||
findModel.setOpenInNewTabVisible(true);
|
||||
findModel.setOpenInNewTabEnabled(isOpenInNewTabEnabled);
|
||||
findModel.setOpenInNewTab(toOpenInNewTab);
|
||||
FindInProjectUtil.setDirectoryName(findModel, dataContext);
|
||||
|
||||
Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
|
||||
@@ -138,9 +153,9 @@ public class ReplaceInProjectManager {
|
||||
|
||||
if (manager == null) return;
|
||||
findManager.getFindInProjectModel().copyFrom(findModel);
|
||||
final FindModel findModelCopy = (FindModel)findModel.clone();
|
||||
final FindModel findModelCopy = findModel.clone();
|
||||
|
||||
final UsageViewPresentation presentation = FindInProjectUtil.setupViewPresentation(true, findModelCopy);
|
||||
final UsageViewPresentation presentation = FindInProjectUtil.setupViewPresentation(findModel.isOpenInNewTab(), findModelCopy);
|
||||
final FindUsagesProcessPresentation processPresentation = FindInProjectUtil.setupProcessPresentation(myProject, true, presentation);
|
||||
|
||||
UsageSearcherFactory factory = new UsageSearcherFactory(findModelCopy, psiDirectory, processPresentation);
|
||||
@@ -168,7 +183,7 @@ public class ReplaceInProjectManager {
|
||||
@Override
|
||||
public String getLongDescriptiveName() {
|
||||
UsageViewPresentation presentation = FindInProjectUtil.setupViewPresentation(false, myFindModel);
|
||||
return "Replace "+presentation.getToolwindowTitle()+" with '"+ myFindModel.getStringToReplace()+"'";
|
||||
return "Replace "+ StringUtil.decapitalize(presentation.getToolwindowTitle())+" with '"+ myFindModel.getStringToReplace()+"'";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,7 +208,9 @@ public class ReplaceInProjectManager {
|
||||
final FindManager findManager) {
|
||||
presentation.setMergeDupLinesAvailable(false);
|
||||
final ReplaceContext[] context = new ReplaceContext[1];
|
||||
manager.searchAndShowUsages(new UsageTarget[]{new ReplaceInProjectTarget(myProject, findModelCopy)},
|
||||
final ReplaceInProjectTarget target = new ReplaceInProjectTarget(myProject, findModelCopy);
|
||||
((FindManagerImpl)FindManager.getInstance(myProject)).getFindUsagesManager().addToHistory(target);
|
||||
manager.searchAndShowUsages(new UsageTarget[]{target},
|
||||
usageSearcherFactory, processPresentation, presentation, new UsageViewManager.UsageViewStateListener() {
|
||||
@Override
|
||||
public void usageViewCreated(@NotNull UsageView usageView) {
|
||||
|
||||
@@ -93,6 +93,9 @@ public class ConfigurableEP<T extends UnnamedConfigurable> extends AbstractExten
|
||||
@Attribute("groupId")
|
||||
public String groupId;
|
||||
|
||||
@Attribute("groupWeight")
|
||||
public int groupWeight;
|
||||
|
||||
/** Marks project level configurables that do not apply to the default project. */
|
||||
@Attribute("nonDefaultProject")
|
||||
public boolean nonDefaultProject;
|
||||
|
||||
@@ -59,16 +59,20 @@ public class DialogBuilder implements Disposable {
|
||||
showImpl(false);
|
||||
}
|
||||
|
||||
public DialogBuilder(Project project) {
|
||||
public DialogBuilder(@Nullable Project project) {
|
||||
myDialogWrapper = new MyDialogWrapper(project, true);
|
||||
Disposer.register(myDialogWrapper.getDisposable(), this);
|
||||
}
|
||||
|
||||
public DialogBuilder(Component parent) {
|
||||
public DialogBuilder(@Nullable Component parent) {
|
||||
myDialogWrapper = new MyDialogWrapper(parent, true);
|
||||
Disposer.register(myDialogWrapper.getDisposable(), this);
|
||||
}
|
||||
|
||||
public DialogBuilder() {
|
||||
this(((Project)null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
@@ -90,6 +94,12 @@ public class DialogBuilder implements Disposable {
|
||||
myCenterPanel = centerPanel;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public DialogBuilder centerPanel(@NotNull JComponent centerPanel) {
|
||||
myCenterPanel = centerPanel;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public DialogBuilder setNorthPanel(@NotNull JComponent northPanel) {
|
||||
myNorthPanel = northPanel;
|
||||
@@ -100,6 +110,7 @@ public class DialogBuilder implements Disposable {
|
||||
myTitle = title;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public DialogBuilder title(@NotNull String title) {
|
||||
myTitle = title;
|
||||
return this;
|
||||
@@ -267,7 +278,7 @@ public class DialogBuilder implements Disposable {
|
||||
protected Action createAction(final DialogWrapper dialogWrapper) {
|
||||
return new AbstractAction(){
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
public void actionPerformed(@NotNull ActionEvent e) {
|
||||
dialogWrapper.close(myExitCode);
|
||||
}
|
||||
};
|
||||
@@ -325,7 +336,7 @@ public class DialogBuilder implements Disposable {
|
||||
|
||||
private class MyDialogWrapper extends DialogWrapper {
|
||||
private String myHelpId = null;
|
||||
private MyDialogWrapper(Project project, boolean canBeParent) {
|
||||
private MyDialogWrapper(@Nullable Project project, boolean canBeParent) {
|
||||
super(project, canBeParent);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,17 @@
|
||||
*/
|
||||
package com.intellij.openapi.util;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class PasswordUtil {
|
||||
private PasswordUtil() { }
|
||||
|
||||
// weak encryption just to avoid plain text passwords in text files
|
||||
public static String encodePassword(String password) {
|
||||
public static String encodePassword(@Nullable String password) {
|
||||
String result = "";
|
||||
if (password == null) return result;
|
||||
if (password == null) {
|
||||
return result;
|
||||
}
|
||||
for (int i = 0; i < password.length(); i++) {
|
||||
int c = password.charAt(i);
|
||||
c ^= 0xdfaa;
|
||||
@@ -30,9 +34,11 @@ public class PasswordUtil {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String decodePassword(String password) throws NumberFormatException {
|
||||
public static String decodePassword(@Nullable String password) throws NumberFormatException {
|
||||
String result = "";
|
||||
if (password == null) return result;
|
||||
if (password == null) {
|
||||
return result;
|
||||
}
|
||||
for (int i = 0; i < password.length(); i += 4) {
|
||||
String s = password.substring(i, i + 4);
|
||||
int c = Integer.parseInt(s, 16);
|
||||
|
||||
+1
-1
@@ -651,7 +651,7 @@ public class FileDocumentManagerImpl extends FileDocumentManager implements Virt
|
||||
public boolean process(final VirtualFile file, final Document document) {
|
||||
String message = UIBundle.message("file.cache.conflict.message.text", file.getPresentableUrl());
|
||||
|
||||
final DialogBuilder builder = new DialogBuilder((Project)null);
|
||||
final DialogBuilder builder = new DialogBuilder();
|
||||
builder.setCenterPanel(new JLabel(message, Messages.getQuestionIcon(), SwingConstants.CENTER));
|
||||
builder.addOkAction().setText(UIBundle.message("file.cache.conflict.load.fs.changes.button"));
|
||||
builder.addCancelAction().setText(UIBundle.message("file.cache.conflict.keep.memory.changes.button"));
|
||||
|
||||
@@ -165,10 +165,6 @@ public class ConfigurableWrapper implements SearchableConfigurable {
|
||||
return myEp;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return myEp.groupId;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return myEp.parentId;
|
||||
}
|
||||
|
||||
+2
-2
@@ -100,7 +100,7 @@ public final class MixedConfigurableGroup implements SearchableConfigurable, Con
|
||||
for (Configurable configurable : configurables) {
|
||||
String groupId = null;
|
||||
if (configurable instanceof ConfigurableWrapper) {
|
||||
groupId = ((ConfigurableWrapper)configurable).getGroupId();
|
||||
groupId = ((ConfigurableWrapper)configurable).getExtensionPoint().groupId;
|
||||
}
|
||||
ArrayList<Configurable> list = map.get(groupId);
|
||||
if (list == null) {
|
||||
@@ -110,7 +110,7 @@ public final class MixedConfigurableGroup implements SearchableConfigurable, Con
|
||||
}
|
||||
ArrayList<Configurable> buildList = map.get("build");
|
||||
if (buildList != null) {
|
||||
NodeConfigurable buildTools = new NodeConfigurable("build.tools");
|
||||
NodeConfigurable buildTools = new NodeConfigurable("build.tools", 1000);
|
||||
buildTools.add(find("MavenSettings", buildList.iterator()));
|
||||
buildTools.add(find("reference.settingsdialog.project.gradle", buildList.iterator()));
|
||||
buildTools.add(find("reference.settingsdialog.project.gant", buildList.iterator()));
|
||||
|
||||
@@ -27,9 +27,15 @@ import java.util.ArrayList;
|
||||
public final class NodeConfigurable extends SearchableConfigurable.Parent.Abstract {
|
||||
private final ArrayList<Configurable> myConfigurables = new ArrayList<Configurable>();
|
||||
private final String myId;
|
||||
private final int myWeight;
|
||||
|
||||
public NodeConfigurable(@NotNull String id) {
|
||||
public NodeConfigurable(@NotNull String id, int weight) {
|
||||
myId = id;
|
||||
myWeight = weight;
|
||||
}
|
||||
|
||||
public int getGroupWeight() {
|
||||
return myWeight;
|
||||
}
|
||||
|
||||
public void add(Configurable configurable) {
|
||||
|
||||
+48
-2
@@ -24,6 +24,7 @@ import com.intellij.openapi.options.ex.NodeConfigurable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.ActionCallback;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.treeStructure.*;
|
||||
import com.intellij.ui.treeStructure.filtered.FilteringTreeBuilder;
|
||||
@@ -441,7 +442,17 @@ final class SettingsTreeView extends JComponent implements Disposable, OptionsEd
|
||||
|
||||
@Override
|
||||
public int getWeight() {
|
||||
return WeightBasedComparator.UNDEFINED_WEIGHT;
|
||||
SimpleNode parent = getParent();
|
||||
if (parent != null && myRoot == parent.getParent()) {
|
||||
if (myConfigurable instanceof NodeConfigurable) {
|
||||
return ((NodeConfigurable)myConfigurable).getGroupWeight();
|
||||
}
|
||||
if (myConfigurable instanceof ConfigurableWrapper) {
|
||||
return ((ConfigurableWrapper)myConfigurable).getExtensionPoint().groupWeight;
|
||||
}
|
||||
return 0; // sort by name
|
||||
}
|
||||
return Integer.MIN_VALUE; // do not sort
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,6 +535,17 @@ final class SettingsTreeView extends JComponent implements Disposable, OptionsEd
|
||||
else if (myFilter.myContext.getModified().contains(configurable)) {
|
||||
myTextLabel.setForeground(JBColor.BLUE);
|
||||
}
|
||||
else {
|
||||
SimpleNode simpleNode = node;
|
||||
while (simpleNode != null) {
|
||||
SimpleNode parent = simpleNode.getParent();
|
||||
if (parent != null && myRoot == parent.getParent() && simpleNode.getWeight() == 0) {
|
||||
myTextLabel.setForeground(JBColor.GRAY);
|
||||
parent = null;
|
||||
}
|
||||
simpleNode = parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// configure project icon
|
||||
@@ -744,7 +766,7 @@ final class SettingsTreeView extends JComponent implements Disposable, OptionsEd
|
||||
boolean myWasHoldingFilter;
|
||||
|
||||
public MyBuilder(SimpleTreeStructure structure) {
|
||||
super(myTree, myFilter, structure, new WeightBasedComparator(false));
|
||||
super(myTree, myFilter, structure, COMPARATOR);
|
||||
myTree.addTreeExpansionListener(new TreeExpansionListener() {
|
||||
public void treeExpanded(TreeExpansionEvent event) {
|
||||
invalidateExpansions();
|
||||
@@ -832,4 +854,28 @@ final class SettingsTreeView extends JComponent implements Disposable, OptionsEd
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final Comparator<NodeDescriptor> COMPARATOR = new Comparator<NodeDescriptor>() {
|
||||
@Override
|
||||
public int compare(NodeDescriptor descriptor1, NodeDescriptor descriptor2) {
|
||||
MyNode node1 = extractNode(descriptor1);
|
||||
MyNode node2 = extractNode(descriptor2);
|
||||
if (node1 == null || node2 == null) {
|
||||
return node2 != null ? -1 : node1 != null ? 1 : 0;
|
||||
}
|
||||
int weight1 = node1.getWeight();
|
||||
int weight2 = node2.getWeight();
|
||||
|
||||
if (weight1 > weight2) {
|
||||
return -1;
|
||||
}
|
||||
if (weight1 < weight2) {
|
||||
return 1;
|
||||
}
|
||||
if (weight1 == Integer.MIN_VALUE) {
|
||||
return 0; // do not sort if undefined weight
|
||||
}
|
||||
return StringUtil.naturalCompare(node1.myDisplayName, node2.myDisplayName);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+11
-5
@@ -27,18 +27,24 @@ import java.awt.event.MouseMotionListener;
|
||||
|
||||
public abstract class LinkMouseListenerBase<T> extends ClickListener implements MouseMotionListener {
|
||||
public static void installSingleTagOn(@NotNull SimpleColoredComponent component) {
|
||||
new LinkMouseListenerBase<Consumer<MouseEvent>>() {
|
||||
new LinkMouseListenerBase<Object>() {
|
||||
@Nullable
|
||||
@Override
|
||||
protected Consumer<MouseEvent> getTagAt(@NotNull MouseEvent e) {
|
||||
protected Object getTagAt(@NotNull MouseEvent e) {
|
||||
//noinspection unchecked
|
||||
return (Consumer<MouseEvent>)((SimpleColoredComponent)e.getSource()).getFragmentTagAt(e.getX());
|
||||
return ((SimpleColoredComponent)e.getSource()).getFragmentTagAt(e.getX());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleTagClick(@Nullable Consumer<MouseEvent> tag, @NotNull MouseEvent event) {
|
||||
protected void handleTagClick(@Nullable Object tag, @NotNull MouseEvent event) {
|
||||
if (tag != null) {
|
||||
tag.consume(event);
|
||||
if (tag instanceof Consumer) {
|
||||
//noinspection unchecked
|
||||
((Consumer<MouseEvent>)tag).consume(event);
|
||||
}
|
||||
else {
|
||||
((Runnable)tag).run();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.installOn(component);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package net.sf.cglib.proxy;
|
||||
|
||||
import com.intellij.ide.plugins.PluginManager;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.ide.plugins.cl.PluginClassLoader;
|
||||
import com.intellij.util.ReflectionUtil;
|
||||
import net.sf.cglib.core.*;
|
||||
@@ -127,7 +127,7 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
|
||||
/** Internal interface, only public due to ClassLoader issues. */
|
||||
public interface EnhancerKey {
|
||||
public Object newInstance(String type,
|
||||
Object newInstance(String type,
|
||||
String[] interfaces,
|
||||
CallbackFilter filter,
|
||||
Type[] callbackTypes,
|
||||
@@ -251,18 +251,6 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
this.interceptDuringConstruction = interceptDuringConstruction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the single type of {@link Callback} to use.
|
||||
* This may be used instead of {@link #setCallback} when calling
|
||||
* {@link #createClass}, since it may not be possible to have
|
||||
* an array of actual callback instances.
|
||||
* @param callbackType the type of callback to use for all methods
|
||||
* @see #setCallbackTypes
|
||||
*/
|
||||
public void setCallbackType(Class callbackType) {
|
||||
setCallbackTypes(new Class[]{ callbackType });
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the array of callback types to use.
|
||||
* This may be used instead of {@link #setCallbacks} when calling
|
||||
@@ -317,27 +305,6 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a new class if necessary and return it without creating a new instance.
|
||||
* This ignores any callbacks that have been set.
|
||||
* To create a new instance you will have to use reflection, and methods
|
||||
* called during the constructor will not be intercepted. To avoid this problem,
|
||||
* use the multi-arg <code>create</code> method.
|
||||
* @see #create(Class[], Object[])
|
||||
*/
|
||||
public Class createClass() {
|
||||
classOnly = true;
|
||||
return (Class)createHelper();
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a static serialVersionUID field into the generated class.
|
||||
* @param sUID the field value, or null to avoid generating field.
|
||||
*/
|
||||
public void setSerialVersionUID(Long sUID) {
|
||||
serialVersionUID = sUID;
|
||||
}
|
||||
|
||||
private void validate() {
|
||||
if (classOnly ^ (callbacks == null)) {
|
||||
if (classOnly) {
|
||||
@@ -403,7 +370,7 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
for (final Class anInterface : interfaces) {
|
||||
final ClassLoader loader = anInterface.getClassLoader();
|
||||
if (loader instanceof PluginClassLoader) {
|
||||
final int order = PluginManager.getPluginLoadingOrder(((PluginClassLoader)loader).getPluginId());
|
||||
final int order = PluginManagerCore.getPluginLoadingOrder(((PluginClassLoader)loader).getPluginId());
|
||||
if (maxIndex < order) {
|
||||
maxIndex = order;
|
||||
bestLoader = loader;
|
||||
@@ -415,7 +382,7 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
if (superclass != null) {
|
||||
superLoader = superclass.getClassLoader();
|
||||
if (superLoader instanceof PluginClassLoader &&
|
||||
maxIndex < PluginManager.getPluginLoadingOrder(((PluginClassLoader)superLoader).getPluginId())) {
|
||||
maxIndex < PluginManagerCore.getPluginLoadingOrder(((PluginClassLoader)superLoader).getPluginId())) {
|
||||
return superLoader;
|
||||
}
|
||||
}
|
||||
@@ -428,24 +395,6 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
sig.getDescriptor());
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all of the methods that will be extended by an
|
||||
* Enhancer-generated class using the specified superclass and
|
||||
* interfaces. This can be useful in building a list of Callback
|
||||
* objects. The methods are added to the end of the given list. Due
|
||||
* to the subclassing nature of the classes generated by Enhancer,
|
||||
* the methods are guaranteed to be non-static, non-final, and
|
||||
* non-private. Each method signature will only occur once, even if
|
||||
* it occurs in multiple classes.
|
||||
* @param superclass the class that will be extended, or null
|
||||
* @param interfaces the list of interfaces that will be implemented, or null
|
||||
* @param methods the list into which to copy the applicable methods
|
||||
*/
|
||||
public static void getMethods(Class superclass, Class[] interfaces, List<Method> methods)
|
||||
{
|
||||
getMethods(superclass, interfaces, methods, null, null);
|
||||
}
|
||||
|
||||
private static void getMethods(Class superclass, Class[] interfaces, List<Method> methods, List<Method> interfaceMethods, Set forcePublic)
|
||||
{
|
||||
ReflectUtils.addAllMethods(superclass, methods);
|
||||
@@ -628,57 +577,6 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this method to register the {@link Callback} array to use before
|
||||
* creating a new instance of the generated class via reflection. If you are using
|
||||
* an instance of <code>Enhancer</code> or the {@link Factory} interface to create
|
||||
* new instances, this method is unnecessary. Its primary use is for when you want to
|
||||
* cache and reuse a generated class yourself, and the generated class does
|
||||
* <i>not</i> implement the {@link Factory} interface.
|
||||
* <p>
|
||||
* Note that this method only registers the callbacks on the current thread.
|
||||
* If you want to register callbacks for instances created by multiple threads,
|
||||
* use {@link #registerStaticCallbacks}.
|
||||
* <p>
|
||||
* The registered callbacks are overwritten and subsequently cleared
|
||||
* when calling any of the <code>create</code> methods (such as
|
||||
* {@link #create}).
|
||||
* @param generatedClass a class previously created by {@link Enhancer}
|
||||
* @param callbacks the array of callbacks to use when instances of the generated
|
||||
* class are created
|
||||
* @see #setUseFactory
|
||||
*/
|
||||
public static void registerCallbacks(Class generatedClass, Callback[] callbacks) {
|
||||
setThreadCallbacks(generatedClass, callbacks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to {@link #registerCallbacks}, but suitable for use
|
||||
* when multiple threads will be creating instances of the generated class.
|
||||
* The thread-level callbacks will always override the static callbacks.
|
||||
* Static callbacks are never cleared.
|
||||
* @param generatedClass a class previously created by {@link Enhancer}
|
||||
* @param callbacks the array of callbacks to use when instances of the generated
|
||||
* class are created
|
||||
*/
|
||||
public static void registerStaticCallbacks(Class generatedClass, Callback[] callbacks) {
|
||||
setCallbacksHelper(generatedClass, callbacks, SET_STATIC_CALLBACKS_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a class was generated using <code>Enhancer</code>.
|
||||
* @param type any class
|
||||
* @return whether the class was generated using <code>Enhancer</code>
|
||||
*/
|
||||
public static boolean isEnhanced(Class type) {
|
||||
try {
|
||||
getCallbacksSetter(type, SET_THREAD_CALLBACKS_NAME);
|
||||
return true;
|
||||
} catch (NoSuchMethodException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void setThreadCallbacks(Class type, Callback[] callbacks) {
|
||||
setCallbacksHelper(type, callbacks, SET_THREAD_CALLBACKS_NAME);
|
||||
}
|
||||
@@ -720,54 +618,6 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to create an intercepted object.
|
||||
* For finer control over the generated instance, use a new instance of <code>Enhancer</code>
|
||||
* instead of this static method.
|
||||
* @param type class to extend or interface to implement
|
||||
* @param callback the callback to use for all methods
|
||||
*/
|
||||
public static Object create(Class type, Callback callback) {
|
||||
Enhancer e = new Enhancer();
|
||||
e.setSuperclass(type);
|
||||
e.setCallback(callback);
|
||||
return e.create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to create an intercepted object.
|
||||
* For finer control over the generated instance, use a new instance of <code>Enhancer</code>
|
||||
* instead of this static method.
|
||||
* @param type class to extend or interface to implement
|
||||
* @param interfaces array of interfaces to implement, or null
|
||||
* @param callback the callback to use for all methods
|
||||
*/
|
||||
public static Object create(Class superclass, Class interfaces[], Callback callback) {
|
||||
Enhancer e = new Enhancer();
|
||||
e.setSuperclass(superclass);
|
||||
e.setInterfaces(interfaces);
|
||||
e.setCallback(callback);
|
||||
return e.create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to create an intercepted object.
|
||||
* For finer control over the generated instance, use a new instance of <code>Enhancer</code>
|
||||
* instead of this static method.
|
||||
* @param type class to extend or interface to implement
|
||||
* @param interfaces array of interfaces to implement, or null
|
||||
* @param filter the callback filter to use when generating a new class
|
||||
* @param callbacks callback implementations to use for the enhanced object
|
||||
*/
|
||||
public static Object create(Class superclass, Class[] interfaces, CallbackFilter filter, Callback[] callbacks) {
|
||||
Enhancer e = new Enhancer();
|
||||
e.setSuperclass(superclass);
|
||||
e.setInterfaces(interfaces);
|
||||
e.setCallbackFilter(filter);
|
||||
e.setCallbacks(callbacks);
|
||||
return e.create();
|
||||
}
|
||||
|
||||
private void emitConstructors(ClassEmitter ce, List constructors) {
|
||||
boolean seenNull = false;
|
||||
for (final Object constructor1 : constructors) {
|
||||
@@ -801,7 +651,7 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
return keys;
|
||||
}
|
||||
|
||||
private void emitGetCallback(ClassEmitter ce, int[] keys) {
|
||||
private static void emitGetCallback(ClassEmitter ce, int[] keys) {
|
||||
final CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, GET_CALLBACK, null);
|
||||
e.load_this();
|
||||
e.invoke_static_this(BIND_CALLBACKS);
|
||||
@@ -876,14 +726,14 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
e.end_method();
|
||||
}
|
||||
|
||||
private void emitNewInstanceCallbacks(ClassEmitter ce) {
|
||||
private static void emitNewInstanceCallbacks(ClassEmitter ce) {
|
||||
CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, NEW_INSTANCE, null);
|
||||
e.load_arg(0);
|
||||
e.invoke_static_this(SET_THREAD_CALLBACKS);
|
||||
emitCommonNewInstance(e);
|
||||
}
|
||||
|
||||
private void emitCommonNewInstance(CodeEmitter e) {
|
||||
private static void emitCommonNewInstance(CodeEmitter e) {
|
||||
e.new_instance_this();
|
||||
e.dup();
|
||||
e.invoke_constructor_this();
|
||||
@@ -915,7 +765,7 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
emitCommonNewInstance(e);
|
||||
}
|
||||
|
||||
private void emitNewInstanceMultiarg(ClassEmitter ce, List constructors) {
|
||||
private static void emitNewInstanceMultiarg(ClassEmitter ce, List constructors) {
|
||||
final CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, MULTIARG_NEW_INSTANCE, null);
|
||||
e.load_arg(2);
|
||||
e.invoke_static_this(SET_THREAD_CALLBACKS);
|
||||
@@ -1044,7 +894,7 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
se.end_method();
|
||||
}
|
||||
|
||||
private void emitSetThreadCallbacks(ClassEmitter ce) {
|
||||
private static void emitSetThreadCallbacks(ClassEmitter ce) {
|
||||
CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC | Constants.ACC_STATIC,
|
||||
SET_THREAD_CALLBACKS,
|
||||
null);
|
||||
@@ -1055,7 +905,7 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
e.end_method();
|
||||
}
|
||||
|
||||
private void emitSetStaticCallbacks(ClassEmitter ce) {
|
||||
private static void emitSetStaticCallbacks(ClassEmitter ce) {
|
||||
CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC | Constants.ACC_STATIC,
|
||||
SET_STATIC_CALLBACKS,
|
||||
null);
|
||||
@@ -1065,7 +915,7 @@ public class AdvancedEnhancer extends AbstractClassGenerator
|
||||
e.end_method();
|
||||
}
|
||||
|
||||
private void emitCurrentCallback(CodeEmitter e, int index) {
|
||||
private static void emitCurrentCallback(CodeEmitter e, int index) {
|
||||
e.load_this();
|
||||
e.getfield(getCallbackField(index));
|
||||
e.dup();
|
||||
|
||||
@@ -360,25 +360,25 @@
|
||||
serviceImplementation="com.intellij.codeInspection.ex.ProjectInspectionProfilesVisibleTreeState"/>
|
||||
|
||||
<!-- Editor -->
|
||||
<applicationConfigurable groupId="editor" instance="com.intellij.application.options.editor.EditorOptions" id="editor" key="title.editor"
|
||||
<applicationConfigurable groupId="editor" groupWeight="190" instance="com.intellij.application.options.editor.EditorOptions" id="editor" key="title.editor"
|
||||
bundle="messages.ApplicationBundle" order="after appearance"
|
||||
childrenEPName="com.intellij.editorOptionsProvider"/>
|
||||
|
||||
<projectService serviceInterface="com.intellij.semantic.SemService" serviceImplementation="com.intellij.semantic.SemServiceImpl"/>
|
||||
|
||||
<!-- Global Code Style -->
|
||||
<projectConfigurable groupId="editor" dynamic="true" displayName="Code Style" instance="com.intellij.application.options.CodeStyleSchemesConfigurable" order="after colors"/>
|
||||
<projectConfigurable groupId="editor" groupWeight="170" dynamic="true" displayName="Code Style" instance="com.intellij.application.options.CodeStyleSchemesConfigurable" order="after colors"/>
|
||||
<applicationService serviceInterface="com.intellij.application.options.codeStyle.CodeStyleSchemesUIConfiguration"
|
||||
serviceImplementation="com.intellij.application.options.codeStyle.CodeStyleSchemesUIConfiguration"/>
|
||||
|
||||
<!-- File Types -->
|
||||
<applicationConfigurable groupId="editor" instance="com.intellij.openapi.fileTypes.impl.FileTypeConfigurable" id="preferences.fileTypes"
|
||||
<applicationConfigurable groupId="editor" groupWeight="120" instance="com.intellij.openapi.fileTypes.impl.FileTypeConfigurable" id="preferences.fileTypes"
|
||||
key="filetype.settings.title" bundle="messages.FileTypesBundle"/>
|
||||
|
||||
<applicationConfigurable groupId="editor" key="intention.settings" bundle="messages.CodeInsightBundle" instance="com.intellij.codeInsight.intention.impl.config.IntentionSettingsConfigurable" id="intentions"/>
|
||||
|
||||
<!-- Live Templates -->
|
||||
<applicationConfigurable groupId="editor" instance="com.intellij.codeInsight.template.impl.LiveTemplatesConfigurable" id="editing.templates"
|
||||
<applicationConfigurable groupId="editor" groupWeight="130" instance="com.intellij.codeInsight.template.impl.LiveTemplatesConfigurable" id="editing.templates"
|
||||
key="templates.settings.page.title" bundle="messages.CodeInsightBundle"/>
|
||||
<lookup.actionProvider implementation="com.intellij.codeInsight.template.impl.LiveTemplateLookupActionProvider"/>
|
||||
<documentationProvider implementation="com.intellij.codeInsight.template.impl.LiveTemplateDocumentationProvider"/>
|
||||
@@ -386,7 +386,7 @@
|
||||
serviceImplementation="com.intellij.codeInsight.template.impl.TemplateManagerImpl"/>
|
||||
|
||||
<!-- File Templates-->
|
||||
<applicationConfigurable groupId="editor" instance="com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable" id="fileTemplates"
|
||||
<applicationConfigurable groupId="editor" groupWeight="150" instance="com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable" id="fileTemplates"
|
||||
key="title.file.templates" bundle="messages.IdeBundle"/>
|
||||
|
||||
<!-- T.O.D.O -->
|
||||
@@ -394,7 +394,7 @@
|
||||
bundle="messages.IdeBundle"/>
|
||||
|
||||
<!-- External Tools -->
|
||||
<applicationConfigurable groupId="tools" instance="com.intellij.tools.ToolConfigurable" id="preferences.externalTools" key="tools.settings.title"
|
||||
<applicationConfigurable groupId="tools" groupWeight="140" instance="com.intellij.tools.ToolConfigurable" id="preferences.externalTools" key="tools.settings.title"
|
||||
bundle="messages.ToolsBundle"/>
|
||||
<stepsBeforeRunProvider implementation="com.intellij.tools.ToolBeforeRunTaskProvider"/>
|
||||
<checkinHandlerFactory implementation="com.intellij.tools.ExternalToolsCheckinHandlerFactory"/>
|
||||
@@ -613,7 +613,7 @@
|
||||
<editorCustomization implementation="com.intellij.ui.RightMarginEditorCustomization"/>
|
||||
|
||||
<!-- Colors & Fonts-->
|
||||
<applicationConfigurable groupId="editor" dynamic="true" instance="com.intellij.application.options.colors.ColorAndFontOptions"
|
||||
<applicationConfigurable groupId="editor" groupWeight="180" dynamic="true" instance="com.intellij.application.options.colors.ColorAndFontOptions"
|
||||
id="reference.settingsdialog.IDE.editor.colors"/>
|
||||
<editorOptionsProvider instance="com.intellij.application.options.editor.EditorTabsConfigurable" id="editor.preferences.tabs"
|
||||
displayName="Editor Tabs"/>
|
||||
@@ -753,7 +753,7 @@
|
||||
<psi.fileReferenceHelper implementation="com.intellij.psi.impl.source.resolve.reference.impl.providers.HttpFileReferenceHelper"/>
|
||||
<psi.fileReferenceHelper implementation="com.intellij.psi.impl.source.resolve.reference.impl.providers.NullFileReferenceHelper" order="last"/>
|
||||
|
||||
<projectConfigurable groupId="editor" key="file.encodings.configurable" bundle="messages.IdeBundle" instance="com.intellij.openapi.vfs.encoding.FileEncodingConfigurable"/>
|
||||
<projectConfigurable groupId="editor" groupWeight="140" key="file.encodings.configurable" bundle="messages.IdeBundle" instance="com.intellij.openapi.vfs.encoding.FileEncodingConfigurable"/>
|
||||
<projectConfigurable groupId="appearance" instance="com.intellij.ui.tabs.FileColorsConfigurable" id="fileColors" displayName="File Colors"/>
|
||||
|
||||
<uiDebuggerExtension implementation="com.intellij.ui.debugger.extensions.PlaybackDebugger"/>
|
||||
|
||||
@@ -197,14 +197,14 @@
|
||||
serviceImplementation="com.intellij.openapi.editor.impl.LazyRangeMarkerFactoryImpl"/>
|
||||
|
||||
<!-- General -->
|
||||
<applicationConfigurable groupId="appearance" key="title.general" bundle="messages.IdeBundle" id="preferences.general" instance="com.intellij.ide.GeneralSettingsConfigurable"/>
|
||||
<applicationConfigurable groupId="appearance" groupWeight="120" key="title.general" bundle="messages.IdeBundle" id="preferences.general" instance="com.intellij.ide.GeneralSettingsConfigurable"/>
|
||||
|
||||
<!-- Appearance -->
|
||||
<applicationConfigurable groupId="appearance" instance="com.intellij.ide.ui.AppearanceConfigurable" id="appearance" key="title.appearance"
|
||||
<applicationConfigurable groupId="appearance" groupWeight="150" instance="com.intellij.ide.ui.AppearanceConfigurable" id="appearance" key="title.appearance"
|
||||
bundle="messages.IdeBundle"/>
|
||||
|
||||
<!-- Keymap -->
|
||||
<applicationConfigurable groupId="appearance" instance="com.intellij.openapi.keymap.impl.ui.KeymapPanel" id="preferences.keymap" key="keymap.display.name"
|
||||
<applicationConfigurable groupId="appearance" groupWeight="140" instance="com.intellij.openapi.keymap.impl.ui.KeymapPanel" id="preferences.keymap" key="keymap.display.name"
|
||||
bundle="messages.KeyMapBundle"/>
|
||||
<applicationConfigurable parentId="appearance" instance="com.intellij.openapi.keymap.impl.ui.QuickListsPanel" id="reference.idesettings.quicklists"
|
||||
displayName="Quick Lists"/>
|
||||
@@ -214,10 +214,10 @@
|
||||
key="title.customizations" bundle="messages.IdeBundle"/>
|
||||
|
||||
<!-- Notifications -->
|
||||
<applicationConfigurable groupId="appearance" displayName="Notifications" instance="com.intellij.notification.impl.NotificationsConfigurable"/>
|
||||
<applicationConfigurable groupId="appearance" groupWeight="110" displayName="Notifications" instance="com.intellij.notification.impl.NotificationsConfigurable"/>
|
||||
|
||||
<!-- Plugins -->
|
||||
<applicationConfigurable groupId="appearance" instance="com.intellij.ide.plugins.PluginManagerConfigurable" id="preferences.pluginManager"
|
||||
<applicationConfigurable groupId="appearance" groupWeight="130" instance="com.intellij.ide.plugins.PluginManagerConfigurable" id="preferences.pluginManager"
|
||||
displayName="Plugins"/>
|
||||
<actionFromOptionDescriptorProvider implementation="com.intellij.ide.plugins.InstalledPluginsManagerMain$PluginsActionFromOptionDescriptorProvider"/>
|
||||
<applicationConfigurable parentId="preferences.general" instance="com.intellij.util.net.HTTPProxySettingsPanel" id="http.proxy" displayName="HTTP Proxy" />
|
||||
@@ -250,7 +250,7 @@
|
||||
<componentConfigurationMerger implementation="com.intellij.openapi.vcs.changes.shelf.ShelfManagerConfigurationMerger"/>
|
||||
<editorActionHandler action="EditorEscape" implementationClass="com.intellij.codeInsight.hint.EscapeHandler" id="hide-hints"/>
|
||||
|
||||
<projectConfigurable groupId="language" instance="com.intellij.javaee.ExternalResourceConfigurable" key="display.name.edit.external.resource"
|
||||
<projectConfigurable groupId="language" groupWeight="110" instance="com.intellij.javaee.ExternalResourceConfigurable" key="display.name.edit.external.resource"
|
||||
bundle="messages.XmlBundle" id="preferences.externalResources">
|
||||
<configurable instance="com.intellij.javaee.XMLCatalogConfigurable" displayName="XML Catalog" id="xml.catalog"/>
|
||||
</projectConfigurable>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
<programRunner implementation="com.intellij.execution.runners.BasicProgramRunner" order="last"/>
|
||||
|
||||
<projectConfigurable groupId="editor" displayName="Inspections" provider="com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurableProvider" order="before intentions"/>
|
||||
<projectConfigurable groupId="editor" groupWeight="160" displayName="Inspections" provider="com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurableProvider" order="before intentions"/>
|
||||
<projectConfigurable groupId="project" instance="com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable" id="project.scopes" key="scopes.display.name" bundle="messages.IdeBundle" />
|
||||
|
||||
<checkoutCompletedListener implementation="com.intellij.openapi.vcs.checkout.PlatformProjectCheckoutListener" id="PlatformProjectCheckoutListener"/>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<selectInTarget implementation="com.intellij.openapi.vcs.changes.SelectInChangesViewTarget"/>
|
||||
|
||||
<projectConfigurable groupId="project" dynamic="true" key="version.control.main.configurable.name" bundle="messages.VcsBundle" instance="com.intellij.openapi.vcs.configurable.VcsManagerConfigurable" id="vcs"/>
|
||||
<projectConfigurable groupId="project" groupWeight="110" dynamic="true" key="version.control.main.configurable.name" bundle="messages.VcsBundle" instance="com.intellij.openapi.vcs.configurable.VcsManagerConfigurable" id="vcs"/>
|
||||
|
||||
<changesViewContent tabName="Repository" className="com.intellij.openapi.vcs.changes.committed.CommittedChangesViewManager"
|
||||
predicateClassName="com.intellij.openapi.vcs.changes.committed.CommittedChangesVisibilityPredicate"/>
|
||||
|
||||
@@ -531,7 +531,7 @@
|
||||
<selectInTarget implementation="com.intellij.ide.browsers.actions.SelectInDefaultBrowserTarget"/>
|
||||
<xml.xmlExtension implementation="com.intellij.xml.HtmlXmlExtension"/>
|
||||
|
||||
<applicationConfigurable groupId="tools" instance="com.intellij.ide.browsers.BrowserSettings" id="reference.settings.ide.settings.web.browsers"
|
||||
<applicationConfigurable groupId="tools" groupWeight="160" instance="com.intellij.ide.browsers.BrowserSettings" id="reference.settings.ide.settings.web.browsers"
|
||||
key="browsers.settings" bundle="messages.IdeBundle"/>
|
||||
<lang.inspectionSuppressor language="XML" implementationClass="com.intellij.codeInspection.XmlInspectionSuppressor"/>
|
||||
|
||||
|
||||
+8
-13
@@ -15,9 +15,11 @@
|
||||
*/
|
||||
package com.intellij.execution.testframework.sm.runner.states;
|
||||
|
||||
import com.intellij.execution.process.ProcessOutputTypes;
|
||||
import com.intellij.execution.testframework.AbstractTestProxy;
|
||||
import com.intellij.execution.testframework.CompositePrintable;
|
||||
import com.intellij.execution.testframework.Printer;
|
||||
import com.intellij.execution.testframework.sm.runner.ui.TestsPresentationUtil;
|
||||
import com.intellij.execution.testframework.stacktrace.DiffHyperlink;
|
||||
import com.intellij.execution.ui.ConsoleViewContentType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -41,10 +43,8 @@ public class TestComparisionFailedState extends TestFailedState implements Abstr
|
||||
super(localizedMessage, stackTrace);
|
||||
myHyperlink = new DiffHyperlink(expectedText, actualText, null);
|
||||
|
||||
myErrorMsgPresentation = StringUtil.isEmptyOrSpaces(localizedMessage) ? ""
|
||||
: localizedMessage;
|
||||
myStacktracePresentation = StringUtil.isEmptyOrSpaces(stackTrace) ? ""
|
||||
: stackTrace;
|
||||
myErrorMsgPresentation = StringUtil.isEmptyOrSpaces(localizedMessage) ? "" : localizedMessage;
|
||||
myStacktracePresentation = StringUtil.isEmptyOrSpaces(stackTrace) ? "" : stackTrace;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,20 +53,15 @@ public class TestComparisionFailedState extends TestFailedState implements Abstr
|
||||
printer.mark();
|
||||
|
||||
// Error msg
|
||||
if (myErrorMsgPresentation != null) {
|
||||
printer.print(myErrorMsgPresentation, ConsoleViewContentType.ERROR_OUTPUT);
|
||||
}
|
||||
TestsPresentationUtil.printWithAnsiColoring(printer, myErrorMsgPresentation, ProcessOutputTypes.STDERR);
|
||||
|
||||
// Diff link
|
||||
myHyperlink.printOn(printer);
|
||||
|
||||
// Stacktrace
|
||||
if (myStacktracePresentation != null) {
|
||||
printer.print(CompositePrintable.NEW_LINE, ConsoleViewContentType.ERROR_OUTPUT);
|
||||
|
||||
printer.print(myStacktracePresentation, ConsoleViewContentType.ERROR_OUTPUT);
|
||||
printer.print(CompositePrintable.NEW_LINE, ConsoleViewContentType.ERROR_OUTPUT);
|
||||
}
|
||||
printer.print(CompositePrintable.NEW_LINE, ConsoleViewContentType.ERROR_OUTPUT);
|
||||
TestsPresentationUtil.printWithAnsiColoring(printer, myStacktracePresentation, ProcessOutputTypes.STDERR);
|
||||
printer.print(CompositePrintable.NEW_LINE, ConsoleViewContentType.ERROR_OUTPUT);
|
||||
}
|
||||
|
||||
public void openDiff(final Project project) {
|
||||
|
||||
+3
-1
@@ -15,8 +15,10 @@
|
||||
*/
|
||||
package com.intellij.execution.testframework.sm.runner.states;
|
||||
|
||||
import com.intellij.execution.process.ProcessOutputTypes;
|
||||
import com.intellij.execution.testframework.CompositePrintable;
|
||||
import com.intellij.execution.testframework.Printer;
|
||||
import com.intellij.execution.testframework.sm.runner.ui.TestsPresentationUtil;
|
||||
import com.intellij.execution.ui.ConsoleViewContentType;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.containers.ContainerUtilRt;
|
||||
@@ -75,7 +77,7 @@ public class TestFailedState extends AbstractState {
|
||||
printer.mark();
|
||||
addMark = false;
|
||||
}
|
||||
printer.print(errorText, ConsoleViewContentType.ERROR_OUTPUT);
|
||||
TestsPresentationUtil.printWithAnsiColoring(printer, errorText, ProcessOutputTypes.STDERR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+19
@@ -15,14 +15,19 @@
|
||||
*/
|
||||
package com.intellij.execution.testframework.sm.runner.ui;
|
||||
|
||||
import com.intellij.execution.process.AnsiEscapeDecoder;
|
||||
import com.intellij.execution.process.ProcessOutputTypes;
|
||||
import com.intellij.execution.testframework.PoolOfTestIcons;
|
||||
import com.intellij.execution.testframework.Printer;
|
||||
import com.intellij.execution.testframework.TestConsoleProperties;
|
||||
import com.intellij.execution.testframework.TestsUIUtil;
|
||||
import com.intellij.execution.testframework.sm.SMTestsRunnerBundle;
|
||||
import com.intellij.execution.testframework.sm.runner.SMTestProxy;
|
||||
import com.intellij.execution.testframework.sm.runner.states.TestStateInfo;
|
||||
import com.intellij.execution.testframework.ui.TestsProgressAnimator;
|
||||
import com.intellij.execution.ui.ConsoleViewContentType;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.ColoredTableCellRenderer;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
@@ -448,4 +453,18 @@ public class TestsPresentationUtil {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void printWithAnsiColoring(@NotNull final Printer printer, @NotNull String text, @NotNull final Key processOutputType) {
|
||||
AnsiEscapeDecoder decoder = new AnsiEscapeDecoder();
|
||||
decoder.escapeText(text, ProcessOutputTypes.STDOUT, new AnsiEscapeDecoder.ColoredTextAcceptor() {
|
||||
@Override
|
||||
public void coloredTextAvailable(String text, Key attributes) {
|
||||
ConsoleViewContentType contentType = ConsoleViewContentType.getConsoleViewType(attributes);
|
||||
if (contentType == null || contentType == ConsoleViewContentType.NORMAL_OUTPUT) {
|
||||
contentType = ConsoleViewContentType.getConsoleViewType(processOutputType);
|
||||
}
|
||||
printer.print(text, contentType);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
-7
@@ -44,13 +44,6 @@ class ReplaceUsageViewContext extends UsageViewContext {
|
||||
return command;
|
||||
}
|
||||
|
||||
protected String _getPresentableText() {
|
||||
return SSRBundle.message("replaceusageview.text",
|
||||
getConfiguration().getMatchOptions().getSearchPattern(),
|
||||
((ReplaceConfiguration)getConfiguration()).getOptions().getReplacement()
|
||||
);
|
||||
}
|
||||
|
||||
public Replacer getReplacer() {
|
||||
return replacer;
|
||||
}
|
||||
|
||||
+15
-19
@@ -8,9 +8,13 @@ import com.intellij.openapi.fileEditor.FileEditor;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.structuralsearch.MatchOptions;
|
||||
import com.intellij.structuralsearch.SSRBundle;
|
||||
import com.intellij.structuralsearch.plugin.replace.ui.ReplaceCommand;
|
||||
import com.intellij.usages.*;
|
||||
import com.intellij.usages.ConfigurableUsageTarget;
|
||||
import com.intellij.usages.Usage;
|
||||
import com.intellij.usages.UsageView;
|
||||
import com.intellij.usages.UsageViewPresentation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -61,20 +65,15 @@ public class UsageViewContext {
|
||||
return new SearchCommand(mySearchContext.getProject(), this);
|
||||
}
|
||||
|
||||
protected String _getPresentableText() {
|
||||
return myConfiguration.getMatchOptions().getSearchPattern();
|
||||
}
|
||||
|
||||
public UsageTarget getTarget() {
|
||||
return new MyUsageTarget(_getPresentableText());
|
||||
public ConfigurableUsageTarget getTarget() {
|
||||
return new MyUsageTarget();
|
||||
}
|
||||
|
||||
public void configure(@NotNull UsageViewPresentation presentation) {
|
||||
String s = _getPresentableText();
|
||||
if (s.length() > 15) s = s.substring(0,15) + "...";
|
||||
final String usagesString = SSRBundle.message("occurrences.of", s);
|
||||
presentation.setUsagesString(usagesString);
|
||||
presentation.setTabText(StringUtil.capitalize(usagesString));
|
||||
final String pattern = myConfiguration.getMatchOptions().getSearchPattern();
|
||||
final String usagesString = SSRBundle.message("occurrences.of", StringUtil.shortenTextWithEllipsis(pattern, 50, 0, true));
|
||||
presentation.setUsagesString(SSRBundle.message("occurrences.of", pattern));
|
||||
presentation.setTabText(usagesString);
|
||||
presentation.setUsagesWord(SSRBundle.message("occurrence"));
|
||||
presentation.setCodeUsagesString(SSRBundle.message("found.occurrences"));
|
||||
}
|
||||
@@ -82,15 +81,12 @@ public class UsageViewContext {
|
||||
protected void configureActions() {}
|
||||
|
||||
private class MyUsageTarget implements ConfigurableUsageTarget,ItemPresentation {
|
||||
private final String myPresentableText;
|
||||
|
||||
MyUsageTarget(String str) {
|
||||
myPresentableText = str;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getPresentableText() {
|
||||
return myPresentableText;
|
||||
final MatchOptions matchOptions = myConfiguration.getMatchOptions();
|
||||
return SSRBundle.message("occurrences.of.0.in.1", matchOptions.getSearchPattern(), matchOptions.getScope().getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -177,7 +173,7 @@ public class UsageViewContext {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getLongDescriptiveName() {
|
||||
return _getPresentableText();
|
||||
return getPresentableText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,10 @@ search.dialog.file.dialect.label=D&ialect:
|
||||
#search usage view specific
|
||||
looking.in.progress.message=Looking in {0}
|
||||
found.progress.message=Found {0} occurrences
|
||||
occurrences.of=occurrences of {0}
|
||||
occurrences.of=Occurrences of ''{0}''
|
||||
occurrences.of.0.in.1=Occurrences of ''{0}'' in {1}
|
||||
occurrence=occurrence
|
||||
found.occurrences=Found occurrence
|
||||
found.occurrences=Found occurrences
|
||||
|
||||
# search dialog messages
|
||||
this.pattern.is.malformed.message=This pattern is malformed\n {0}
|
||||
@@ -48,7 +49,6 @@ selecttemplate.template.label.please.select.template=<html><body><center>Please
|
||||
# Replace Dialog specific titles/options
|
||||
structural.replace.title=Structural Replace
|
||||
shorten.fully.qualified.names.checkbox=Sh&orten fully qualified names
|
||||
format.according.to.style.checkbox=Fo&rmat according to style
|
||||
replacement.template.label=Replacement template:
|
||||
|
||||
# Replace validation messages
|
||||
|
||||
@@ -69,6 +69,7 @@ public abstract class Logger {
|
||||
return ourFactory.getLoggerInstance(category);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Logger getInstance(Class cl) {
|
||||
return getInstance("#" + cl.getName());
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.util;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@@ -49,6 +50,7 @@ public class Ref<T> {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <T> Ref<T> create() {
|
||||
return new Ref<T>();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<depends optional="true" config-file="java.xml">com.intellij.modules.java</depends>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<projectConfigurable groupId="editor" dynamic="true" displayName="Copyright" instance="com.maddyhome.idea.copyright.ui.CopyrightProjectConfigurable"/>
|
||||
<projectConfigurable groupId="editor" groupWeight="110" dynamic="true" displayName="Copyright" instance="com.maddyhome.idea.copyright.ui.CopyrightProjectConfigurable"/>
|
||||
<errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
|
||||
<checkinHandlerFactory implementation="com.maddyhome.idea.copyright.actions.UpdateCopyrightCheckinHandlerFactory"/>
|
||||
<applicationService serviceInterface="com.maddyhome.idea.copyright.util.FileTypeUtil"
|
||||
|
||||
@@ -17,7 +17,6 @@ import org.netbeans.lib.cvsclient.file.IReaderFactory;
|
||||
import org.netbeans.lib.cvsclient.file.IWriterFactory;
|
||||
import org.netbeans.lib.cvsclient.io.IStreamLogger;
|
||||
import org.netbeans.lib.cvsclient.util.BugLog;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.zip.Deflater;
|
||||
@@ -43,8 +42,6 @@ public final class ConnectionStreams
|
||||
private OutputStream outputStream;
|
||||
private DeflaterOutputStream deflaterOutputStream;
|
||||
private final String myCharset;
|
||||
@NonNls private static final String UNTIL_HERE_THE_CONTENT_IS_GZIPPED_MESSAGE = "@until here the content is gzipped@";
|
||||
@NonNls private static final String FROM_NOW_ON_THE_CONTENT_IS_GZIPPED_MESSAGE = "@from now on the content is gzipped@";
|
||||
|
||||
// Setup ==================================================================
|
||||
|
||||
@@ -111,8 +108,6 @@ public final class ConnectionStreams
|
||||
loggedWriter.flush();
|
||||
if (deflaterOutputStream != null) {
|
||||
deflaterOutputStream.finish();
|
||||
|
||||
println(UNTIL_HERE_THE_CONTENT_IS_GZIPPED_MESSAGE, streamLogger.getOutputLogStream());
|
||||
}
|
||||
loggedOutputStream.flush();
|
||||
}
|
||||
@@ -155,9 +150,6 @@ public final class ConnectionStreams
|
||||
loggedWriter.flush();
|
||||
loggedOutputStream.flush();
|
||||
|
||||
println(FROM_NOW_ON_THE_CONTENT_IS_GZIPPED_MESSAGE, streamLogger.getInputLogStream());
|
||||
println(FROM_NOW_ON_THE_CONTENT_IS_GZIPPED_MESSAGE, streamLogger.getOutputLogStream());
|
||||
|
||||
deflaterOutputStream = new DeflaterOutputStream(connection.getOutputStream(), new Deflater(6));
|
||||
setOutputStream(deflaterOutputStream);
|
||||
|
||||
@@ -179,15 +171,4 @@ public final class ConnectionStreams
|
||||
this.loggedOutputStream = streamLogger.createLoggingOutputStream(outputStream);
|
||||
this.loggedWriter = createWriter(this.loggedOutputStream);
|
||||
}
|
||||
|
||||
private void println(String text, OutputStream outputStream) throws IOException {
|
||||
final OutputStreamWriter writerNoSpecialEncoding = new OutputStreamWriter(outputStream);
|
||||
println(text, writerNoSpecialEncoding);
|
||||
writerNoSpecialEncoding.flush();
|
||||
}
|
||||
|
||||
private void println(String text, Writer writer) throws IOException {
|
||||
writer.write(text);
|
||||
writer.write('\n');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<toolWindow id="Terminal" anchor="bottom" icon="TerminalIcons.OpenTerminal_13x13"
|
||||
factoryClass="org.jetbrains.plugins.terminal.TerminalToolWindowFactory" secondary="false"/>
|
||||
|
||||
<projectConfigurable groupId="tools" displayName="Terminal" instance="org.jetbrains.plugins.terminal.TerminalOptionsConfigurable"/>
|
||||
<projectConfigurable groupId="tools" groupWeight="130" displayName="Terminal" instance="org.jetbrains.plugins.terminal.TerminalOptionsConfigurable"/>
|
||||
|
||||
<fileEditorProvider implementation="org.jetbrains.plugins.terminal.vfs.TerminalSessionEditorProvider"/>
|
||||
</extensions>
|
||||
|
||||
@@ -239,10 +239,10 @@
|
||||
|
||||
<!-- Errors -->
|
||||
<!-- Show full error options configurable only in full IDEA - platform supports only default IDE profile for now -->
|
||||
<projectConfigurable groupId="editor" displayName="Inspections" provider="com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurableProvider"/>
|
||||
<projectConfigurable groupId="editor" groupWeight="160" displayName="Inspections" provider="com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurableProvider"/>
|
||||
|
||||
<!-- Compiler -->
|
||||
<projectConfigurable groupId="build" instance="com.intellij.compiler.options.CompilerConfigurable" id="project.propCompiler" order="after project"
|
||||
<projectConfigurable groupId="build" groupWeight="130" instance="com.intellij.compiler.options.CompilerConfigurable" id="project.propCompiler" order="after project"
|
||||
key="compiler.configurable.display.name" bundle="messages.CompilerBundle" childrenEPName="com.intellij.compilerSettingsFactory">
|
||||
<configurable instance="com.intellij.openapi.compiler.options.ExcludedEntriesConfigurable" id="reference.projectsettings.compiler.excludes"
|
||||
displayName="Excludes"/>
|
||||
|
||||
@@ -49,6 +49,9 @@ public class SpellcheckingStrategy {
|
||||
|
||||
@NotNull
|
||||
public Tokenizer getTokenizer(PsiElement element) {
|
||||
if (element instanceof PsiLanguageInjectionHost && InjectedLanguageUtil.hasInjections((PsiLanguageInjectionHost)element)) {
|
||||
return EMPTY_TOKENIZER;
|
||||
}
|
||||
if (element instanceof PsiNameIdentifierOwner) return new PsiIdentifierOwnerTokenizer();
|
||||
if (element instanceof PsiComment) {
|
||||
if (SuppressionUtil.isSuppressionComment(element)) {
|
||||
|
||||
Reference in New Issue
Block a user