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:
@@ -430,22 +430,26 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
public PsiComment findExistingDocComment(final PsiComment _element) {
|
||||
PsiElement parentElement = _element.getParent();
|
||||
|
||||
return parentElement instanceof PsiDocCommentOwner ? ((PsiDocCommentOwner)parentElement).getDocComment() : null;
|
||||
public PsiComment findExistingDocComment(final PsiComment comment) {
|
||||
if (comment instanceof PsiDocComment) {
|
||||
final PsiDocCommentOwner owner = ((PsiDocComment)comment).getOwner();
|
||||
if (owner != null) {
|
||||
return owner.getDocComment();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String generateDocumentationContentStub(PsiComment _element) {
|
||||
PsiElement parentElement = _element.getParent();
|
||||
final Project project = _element.getProject();
|
||||
public String generateDocumentationContentStub(PsiComment _comment) {
|
||||
final PsiDocCommentOwner commentOwner = ((PsiDocComment)_comment).getOwner();
|
||||
final Project project = commentOwner.getProject();
|
||||
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
|
||||
try {
|
||||
if (parentElement instanceof PsiMethod) {
|
||||
PsiMethod psiMethod = (PsiMethod)parentElement;
|
||||
final CodeDocumentationAwareCommenter commenter = (CodeDocumentationAwareCommenter)LanguageCommenters.INSTANCE
|
||||
.forLanguage(commentOwner.getLanguage());
|
||||
if (commentOwner instanceof PsiMethod) {
|
||||
PsiMethod psiMethod = (PsiMethod)commentOwner;
|
||||
final PsiParameter[] parameters = psiMethod.getParameterList().getParameters();
|
||||
final CodeDocumentationAwareCommenter commenter = (CodeDocumentationAwareCommenter)LanguageCommenters.INSTANCE
|
||||
.forLanguage(parentElement.getLanguage());
|
||||
final Map<String, String> param2Description = new HashMap<String, String>();
|
||||
final PsiMethod[] superMethods = psiMethod.findSuperMethods();
|
||||
for (PsiMethod superMethod : superMethods) {
|
||||
@@ -499,11 +503,9 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
builder.append(LINE_SEPARATOR);
|
||||
}
|
||||
}
|
||||
else if (parentElement instanceof PsiClass) {
|
||||
final PsiTypeParameterList typeParameterList = ((PsiClass)parentElement).getTypeParameterList();
|
||||
else if (commentOwner instanceof PsiClass) {
|
||||
final PsiTypeParameterList typeParameterList = ((PsiClass)commentOwner).getTypeParameterList();
|
||||
if (typeParameterList != null) {
|
||||
final CodeDocumentationAwareCommenter commenter = (CodeDocumentationAwareCommenter)LanguageCommenters.INSTANCE
|
||||
.forLanguage(parentElement.getLanguage());
|
||||
createTypeParamsListComment(builder, project, commenter, typeParameterList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.psi.impl.compiled;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.tree.JavaDocElementType;
|
||||
import com.intellij.psi.impl.source.tree.TreeElement;
|
||||
@@ -26,12 +25,10 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class ClsDocCommentImpl extends ClsElementImpl implements PsiDocComment, JavaTokenType, PsiJavaToken {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.compiled.ClsDocCommentImpl");
|
||||
|
||||
private final ClsElementImpl myParent;
|
||||
private final PsiDocCommentOwner myParent;
|
||||
private final PsiDocTag[] myTags;
|
||||
|
||||
ClsDocCommentImpl(ClsElementImpl parent) {
|
||||
ClsDocCommentImpl(PsiDocCommentOwner parent) {
|
||||
myParent = parent;
|
||||
|
||||
PsiDocTag[] tags = new PsiDocTag[1];
|
||||
@@ -63,10 +60,16 @@ class ClsDocCommentImpl extends ClsElementImpl implements PsiDocComment, JavaTok
|
||||
return myParent;
|
||||
}
|
||||
|
||||
public PsiDocCommentOwner getOwner() {
|
||||
return myParent;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiElement[] getDescriptionElements() {
|
||||
return EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiDocTag[] getTags() {
|
||||
return myTags;
|
||||
}
|
||||
@@ -76,6 +79,7 @@ class ClsDocCommentImpl extends ClsElementImpl implements PsiDocComment, JavaTok
|
||||
return getTags()[0];
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiDocTag[] findTagsByName(@NonNls String name) {
|
||||
if (!name.equals("deprecated")) return PsiDocTag.EMPTY_ARRAY;
|
||||
return getTags();
|
||||
|
||||
@@ -18,10 +18,7 @@ package com.intellij.psi.impl.source.javadoc;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.JavaElementVisitor;
|
||||
import com.intellij.psi.JavaTokenType;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
|
||||
import com.intellij.psi.impl.source.Constants;
|
||||
import com.intellij.psi.impl.source.PsiElementArrayConstructor;
|
||||
@@ -57,18 +54,32 @@ public class PsiDocCommentImpl extends LazyParseablePsiElement implements PsiDoc
|
||||
super(JavaDocElementType.DOC_COMMENT, text);
|
||||
}
|
||||
|
||||
public PsiDocCommentOwner getOwner() {
|
||||
final PsiElement parent = getParent();
|
||||
if (parent instanceof PsiDocCommentOwner) {
|
||||
final PsiDocCommentOwner owner = (PsiDocCommentOwner)parent;
|
||||
if (owner.getDocComment() == this) {
|
||||
return owner;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiElement[] getDescriptionElements() {
|
||||
ArrayList<ASTNode> array = new ArrayList<ASTNode>();
|
||||
ArrayList<PsiElement> array = new ArrayList<PsiElement>();
|
||||
for (ASTNode child = getFirstChildNode(); child != null; child = child.getTreeNext()) {
|
||||
IElementType i = child.getElementType();
|
||||
if (i == DOC_TAG) break;
|
||||
if (i != DOC_COMMENT_START && i != DOC_COMMENT_END && i != DOC_COMMENT_LEADING_ASTERISKS) {
|
||||
array.add(child);
|
||||
array.add(child.getPsi());
|
||||
}
|
||||
}
|
||||
return array.toArray(new PsiElement[array.size()]);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiDocTag[] getTags() {
|
||||
return getChildrenAsPsiElements(TAG_BIT_SET, PSI_TAG_ARRAY_CONSTRUCTOR);
|
||||
}
|
||||
@@ -92,6 +103,7 @@ public class PsiDocCommentImpl extends LazyParseablePsiElement implements PsiDoc
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiDocTag[] findTagsByName(String name) {
|
||||
ArrayList<PsiDocTag> array = new ArrayList<PsiDocTag>();
|
||||
PsiDocTag[] tags = getTags();
|
||||
|
||||
@@ -40,8 +40,6 @@ import java.util.Set;
|
||||
*/
|
||||
public abstract class JspManager implements IBaseJspManager {
|
||||
|
||||
public static final Key<VirtualFile[]> DIRECTORIES_KEY = Key.create("TagDirOriginalDirs");
|
||||
|
||||
public static JspManager getInstance(@NotNull Project project) {
|
||||
return ServiceManager.getService(project, JspManager.class);
|
||||
}
|
||||
|
||||
@@ -16,13 +16,25 @@
|
||||
package com.intellij.psi.javadoc;
|
||||
|
||||
import com.intellij.psi.PsiComment;
|
||||
import com.intellij.psi.PsiDocCommentOwner;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface PsiDocComment extends PsiComment {
|
||||
@Nullable
|
||||
PsiDocCommentOwner getOwner();
|
||||
|
||||
@NotNull
|
||||
PsiElement[] getDescriptionElements();
|
||||
|
||||
@NotNull
|
||||
PsiDocTag[] getTags();
|
||||
|
||||
@Nullable
|
||||
PsiDocTag findTagByName(@NonNls String name);
|
||||
|
||||
@NotNull
|
||||
PsiDocTag[] findTagsByName(@NonNls String name);
|
||||
}
|
||||
+20
-158
@@ -15,27 +15,14 @@
|
||||
*/
|
||||
package com.intellij.application.options.codeStyle;
|
||||
|
||||
import com.intellij.application.options.CodeStyleAbstractPanel;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.application.ApplicationBundle;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsScheme;
|
||||
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.ui.treeStructure.Tree;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.tree.TreeUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.*;
|
||||
@@ -46,7 +33,6 @@ import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
@@ -54,8 +40,8 @@ import java.util.Arrays;
|
||||
public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleAbstractPanel {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.application.options.CodeStyleSpacesPanel");
|
||||
private final JTree myOptionsTree;
|
||||
private final HashMap myKeyToFieldMap = new HashMap();
|
||||
private final ArrayList myKeys = new ArrayList();
|
||||
private final HashMap<BooleanOptionKey, Field> myKeyToFieldMap = new HashMap<BooleanOptionKey, Field>();
|
||||
private final ArrayList<BooleanOptionKey> myKeys = new ArrayList<BooleanOptionKey>();
|
||||
private final JPanel myPanel = new JPanel(new GridBagLayout());
|
||||
|
||||
public OptionTreeWithPreviewPanel(CodeStyleSettings settings) {
|
||||
@@ -84,32 +70,14 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode();
|
||||
String groupName = "";
|
||||
DefaultMutableTreeNode groupNode = null;
|
||||
for (int i = 0; i < myKeys.size(); i++) {
|
||||
if (myKeys.get(i) instanceof BooleanOptionKey) {
|
||||
BooleanOptionKey key = (BooleanOptionKey)myKeys.get(i);
|
||||
String newGroupName = key.groupName;
|
||||
if (!newGroupName.equals(groupName) || groupNode == null) {
|
||||
groupName = newGroupName;
|
||||
groupNode = new DefaultMutableTreeNode(newGroupName);
|
||||
rootNode.add(groupNode);
|
||||
}
|
||||
groupNode.add(new MyToggleTreeNode(key, key.cbName));
|
||||
}
|
||||
else if (myKeys.get(i) instanceof IntSelectionOptionKey) {
|
||||
IntSelectionOptionKey key = (IntSelectionOptionKey)myKeys.get(i);
|
||||
String newGroupName = key.groupName;
|
||||
if (!newGroupName.equals(groupName) || groupNode == null) {
|
||||
groupName = newGroupName;
|
||||
groupNode = new DefaultMutableTreeNode(newGroupName);
|
||||
rootNode.add(groupNode);
|
||||
}
|
||||
MyToggleTreeNode[] nodes = new MyToggleTreeNode[key.rbNames.length];
|
||||
for (int j = 0; j < nodes.length; j++) {
|
||||
nodes[j] = new MyToggleTreeNode(key, key.rbNames[j]);
|
||||
groupNode.add(nodes[j]);
|
||||
}
|
||||
key.setCreatedNodes(nodes);
|
||||
for (BooleanOptionKey key: myKeys) {
|
||||
String newGroupName = key.groupName;
|
||||
if (!newGroupName.equals(groupName) || groupNode == null) {
|
||||
groupName = newGroupName;
|
||||
groupNode = new DefaultMutableTreeNode(newGroupName);
|
||||
rootNode.add(groupNode);
|
||||
}
|
||||
groupNode.add(new MyToggleTreeNode(key, key.cbName));
|
||||
}
|
||||
|
||||
DefaultTreeModel model = new DefaultTreeModel(rootNode);
|
||||
@@ -156,19 +124,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
Object o = treePath.getLastPathComponent();
|
||||
if (o instanceof MyToggleTreeNode) {
|
||||
MyToggleTreeNode node = (MyToggleTreeNode)o;
|
||||
if (node.isCheckbox()) {
|
||||
node.setSelected(!node.isSelected());
|
||||
}
|
||||
else {
|
||||
MyToggleTreeNode[] group = node.getGroup();
|
||||
for (int i = 0; i < group.length; i++) {
|
||||
MyToggleTreeNode groupNode = group[i];
|
||||
groupNode.setSelected(false);
|
||||
int row = myOptionsTree.getRowForPath(new TreePath(groupNode.getPath()));
|
||||
myOptionsTree.repaint(myOptionsTree.getRowBounds(row));
|
||||
}
|
||||
node.setSelected(true);
|
||||
}
|
||||
node.setSelected(!node.isSelected());
|
||||
int row = myOptionsTree.getRowForPath(treePath);
|
||||
myOptionsTree.repaint(myOptionsTree.getRowBounds(row));
|
||||
//updatePreview();
|
||||
@@ -201,21 +157,9 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
|
||||
private void resetMyTreeNode(MyToggleTreeNode childNode, final CodeStyleSettings settings) {
|
||||
try {
|
||||
if (childNode.getKey() instanceof BooleanOptionKey) {
|
||||
BooleanOptionKey key = (BooleanOptionKey)childNode.getKey();
|
||||
Field field = (Field)myKeyToFieldMap.get(key);
|
||||
childNode.setSelected(field.getBoolean(settings));
|
||||
}
|
||||
else if (childNode.getKey() instanceof IntSelectionOptionKey) {
|
||||
IntSelectionOptionKey key = (IntSelectionOptionKey)childNode.getKey();
|
||||
Field field = (Field)myKeyToFieldMap.get(key);
|
||||
int fieldValue = field.getInt(settings);
|
||||
for (int i = 0; i < key.rbNames.length; i++) {
|
||||
if (childNode.getText().equals(key.rbNames[i])) {
|
||||
childNode.setSelected(fieldValue == key.values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
BooleanOptionKey key = (BooleanOptionKey)childNode.getKey();
|
||||
Field field = myKeyToFieldMap.get(key);
|
||||
childNode.setSelected(field.getBoolean(settings));
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
LOG.error(e);
|
||||
@@ -244,22 +188,9 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
|
||||
private void applyToggleNode(MyToggleTreeNode childNode, final CodeStyleSettings settings) {
|
||||
try {
|
||||
if (childNode.getKey() instanceof BooleanOptionKey) {
|
||||
BooleanOptionKey key = (BooleanOptionKey)childNode.getKey();
|
||||
Field field = (Field)myKeyToFieldMap.get(key);
|
||||
field.set(settings, childNode.isSelected() ? Boolean.TRUE : Boolean.FALSE);
|
||||
}
|
||||
else if (childNode.getKey() instanceof IntSelectionOptionKey) {
|
||||
if (!childNode.isSelected()) return;
|
||||
IntSelectionOptionKey key = (IntSelectionOptionKey)childNode.getKey();
|
||||
Field field = (Field)myKeyToFieldMap.get(key);
|
||||
for (int i = 0; i < key.rbNames.length; i++) {
|
||||
if (childNode.getText().equals(key.rbNames[i])) {
|
||||
field.set(settings, new Integer(key.values[i]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
BooleanOptionKey key = (BooleanOptionKey)childNode.getKey();
|
||||
Field field = myKeyToFieldMap.get(key);
|
||||
field.set(settings, childNode.isSelected() ? Boolean.TRUE : Boolean.FALSE);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
LOG.error(e);
|
||||
@@ -296,21 +227,9 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
|
||||
private boolean isToggleNodeModified(MyToggleTreeNode childNode, final CodeStyleSettings settings) {
|
||||
try {
|
||||
if (childNode.getKey() instanceof BooleanOptionKey) {
|
||||
BooleanOptionKey key = (BooleanOptionKey)childNode.getKey();
|
||||
Field field = (Field)myKeyToFieldMap.get(key);
|
||||
return childNode.isSelected() != field.getBoolean(settings);
|
||||
}
|
||||
else if (childNode.getKey() instanceof IntSelectionOptionKey) {
|
||||
if (!childNode.isSelected()) return false;
|
||||
IntSelectionOptionKey key = (IntSelectionOptionKey)childNode.getKey();
|
||||
Field field = (Field)myKeyToFieldMap.get(key);
|
||||
for (int i = 0; i < key.rbNames.length; i++) {
|
||||
if (childNode.getText().equals(key.rbNames[i])) {
|
||||
return field.getInt(settings) != key.values[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
BooleanOptionKey key = (BooleanOptionKey)childNode.getKey();
|
||||
Field field = myKeyToFieldMap.get(key);
|
||||
return childNode.isSelected() != field.getBoolean(settings);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
LOG.error(e);
|
||||
@@ -335,20 +254,6 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
}
|
||||
}
|
||||
|
||||
protected void initRadioGroupField(String fieldName, String groupName, String[] rbNames, int[] values) {
|
||||
try {
|
||||
Class styleSettingsClass = CodeStyleSettings.class;
|
||||
Field field = styleSettingsClass.getField(fieldName);
|
||||
IntSelectionOptionKey key = new IntSelectionOptionKey(groupName, rbNames, values);
|
||||
myKeyToFieldMap.put(key, field);
|
||||
myKeys.add(key);
|
||||
}
|
||||
catch (NoSuchFieldException e) {
|
||||
}
|
||||
catch (SecurityException e) {
|
||||
}
|
||||
}
|
||||
|
||||
protected void prepareForReformat(final PsiFile psiFile) {
|
||||
//psiFile.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.HIGHEST);
|
||||
}
|
||||
@@ -356,12 +261,10 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
protected class MyTreeCellRenderer implements TreeCellRenderer {
|
||||
private final MyLabelPanel myLabel;
|
||||
private final JCheckBox myCheckBox;
|
||||
private final JRadioButton myRadioButton;
|
||||
|
||||
public MyTreeCellRenderer() {
|
||||
myLabel = new MyLabelPanel();
|
||||
myCheckBox = new JCheckBox();
|
||||
myRadioButton = new JRadioButton();
|
||||
myCheckBox.setMargin(new Insets(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
@@ -370,7 +273,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
|
||||
if (value instanceof MyToggleTreeNode) {
|
||||
MyToggleTreeNode treeNode = (MyToggleTreeNode)value;
|
||||
JToggleButton button = treeNode.isCheckbox() ? (JToggleButton)myCheckBox : (JToggleButton)myRadioButton;
|
||||
JToggleButton button = myCheckBox;
|
||||
button.setText(treeNode.getText());
|
||||
button.setSelected(treeNode.isSelected);
|
||||
if (isSelected) {
|
||||
@@ -473,64 +376,23 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA
|
||||
}
|
||||
}
|
||||
|
||||
private static class IntSelectionOptionKey {
|
||||
final String groupName;
|
||||
final String[] rbNames;
|
||||
final int[] values;
|
||||
private MyToggleTreeNode[] myNodes;
|
||||
|
||||
public IntSelectionOptionKey(String groupName, String[] rbNames, int[] values) {
|
||||
this.groupName = groupName;
|
||||
this.rbNames = rbNames;
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof IntSelectionOptionKey)) return false;
|
||||
|
||||
final IntSelectionOptionKey intSelectionOptionKey = (IntSelectionOptionKey)o;
|
||||
|
||||
if (!groupName.equals(intSelectionOptionKey.groupName)) return false;
|
||||
if (!Arrays.equals(rbNames, intSelectionOptionKey.rbNames)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return groupName.hashCode() + rbNames[0].hashCode() * 29;
|
||||
}
|
||||
|
||||
public void setCreatedNodes(MyToggleTreeNode[] nodes) { myNodes = nodes; }
|
||||
|
||||
public MyToggleTreeNode[] getNodes() { return myNodes; }
|
||||
}
|
||||
|
||||
private static class MyToggleTreeNode extends DefaultMutableTreeNode {
|
||||
private final Object myKey;
|
||||
private final String myText;
|
||||
private boolean isSelected;
|
||||
private final boolean isCheckbox;
|
||||
|
||||
public MyToggleTreeNode(Object key, String text) {
|
||||
myKey = key;
|
||||
myText = text;
|
||||
isCheckbox = true;
|
||||
}
|
||||
|
||||
public Object getKey() { return myKey; }
|
||||
|
||||
public String getText() { return myText; }
|
||||
|
||||
public boolean isCheckbox() { return isCheckbox; }
|
||||
|
||||
public void setSelected(boolean val) { isSelected = val; }
|
||||
|
||||
public boolean isSelected() { return isSelected; }
|
||||
|
||||
public MyToggleTreeNode[] getGroup() {
|
||||
return ((IntSelectionOptionKey)myKey).getNodes();
|
||||
}
|
||||
}
|
||||
|
||||
public JComponent getInternalPanel() {
|
||||
|
||||
@@ -642,7 +642,7 @@ public class ContainerUtil {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T, V> List<V> mapNotNull(T[] array, Function<T, V> mapping) {
|
||||
public static <T, V> List<V> mapNotNull(@NotNull T[] array, Function<T, V> mapping) {
|
||||
return mapNotNull(Arrays.asList(array), mapping);
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -98,6 +98,7 @@ public class GrDocCommentImpl extends LazyParseablePsiElement implements GroovyD
|
||||
return list.toArray(new GrDocTag[list.size()]);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiElement[] getDescriptionElements() {
|
||||
ArrayList<PsiElement> array = new ArrayList<PsiElement>();
|
||||
for (PsiElement child = getFirstChild(); child != null; child = child.getNextSibling()) {
|
||||
|
||||
@@ -46,6 +46,7 @@ class HgIncomingStatusUpdater implements HgUpdater {
|
||||
public void run() {
|
||||
new Task.Backgroundable(project, "Checking Incoming Changesets", true) {
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
if (project.isDisposed()) return;
|
||||
HgIncomingCommand command = new HgIncomingCommand(project);
|
||||
VcsRoot[] roots = ProjectLevelVcsManager.getInstance(project).getAllVcsRoots();
|
||||
List<HgFileRevision> changesets = new LinkedList<HgFileRevision>();
|
||||
@@ -57,7 +58,7 @@ class HgIncomingStatusUpdater implements HgUpdater {
|
||||
}
|
||||
}.queue();
|
||||
}
|
||||
});
|
||||
}, project.getDisposed());
|
||||
}
|
||||
|
||||
private final class IncomingChangesetFormatter implements HgChangesetStatus.ChangesetWriter {
|
||||
|
||||
@@ -46,6 +46,7 @@ class HgOutgoingStatusUpdater implements HgUpdater {
|
||||
public void run() {
|
||||
new Task.Backgroundable(project, "Checking Outgoing Changesets", true) {
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
if (project.isDisposed()) return;
|
||||
HgOutgoingCommand command = new HgOutgoingCommand(project);
|
||||
VcsRoot[] roots = ProjectLevelVcsManager.getInstance(project).getAllVcsRoots();
|
||||
List<HgFileRevision> outgoing = new LinkedList<HgFileRevision>();
|
||||
@@ -57,7 +58,7 @@ class HgOutgoingStatusUpdater implements HgUpdater {
|
||||
}
|
||||
}.queue();
|
||||
}
|
||||
});
|
||||
}, project.getDisposed());
|
||||
}
|
||||
|
||||
private final class OutgoingChangesetFormatter implements HgChangesetStatus.ChangesetWriter {
|
||||
|
||||
@@ -189,7 +189,7 @@ public class HgVcs extends AbstractVcs {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void start() throws VcsException {
|
||||
protected void activate() {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
@@ -203,7 +203,7 @@ public class HgVcs extends AbstractVcs {
|
||||
addListeners();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, myProject.getDisposed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user