mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
old UML (for Java) no more available
This commit is contained in:
@@ -32,6 +32,7 @@ import java.util.Set;
|
||||
* Defines a single folding region in the code.
|
||||
*
|
||||
* @author max
|
||||
* @author Konstantin Bulenkov
|
||||
* @see FoldingBuilder
|
||||
*/
|
||||
public class FoldingDescriptor {
|
||||
@@ -41,6 +42,7 @@ public class FoldingDescriptor {
|
||||
private final TextRange myRange;
|
||||
@Nullable private final FoldingGroup myGroup;
|
||||
private Set<Object> myDependencies;
|
||||
private String myText;
|
||||
|
||||
/**
|
||||
* Creates a folding region related to the specified AST node and covering the specified
|
||||
@@ -107,19 +109,38 @@ public class FoldingDescriptor {
|
||||
|
||||
@Nullable
|
||||
public String getPlaceholderText() {
|
||||
final PsiElement psiElement = myElement.getPsi();
|
||||
if (psiElement == null) return null;
|
||||
|
||||
final Language lang = psiElement.getLanguage();
|
||||
final FoldingBuilder foldingBuilder = LanguageFolding.INSTANCE.forLanguage(lang);
|
||||
if (foldingBuilder != null) {
|
||||
return foldingBuilder.getPlaceholderText(myElement);
|
||||
if (myText == null) {
|
||||
final FoldingBuilder builder = getFoldingBuilder();
|
||||
return builder == null ? null : builder.getPlaceholderText(myElement);
|
||||
} else {
|
||||
return myText;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected FoldingBuilder getFoldingBuilder() {
|
||||
final PsiElement psi = myElement.getPsi();
|
||||
if (psi == null) return null;
|
||||
|
||||
final Language lang = psi.getLanguage();
|
||||
return LanguageFolding.INSTANCE.forLanguage(lang);
|
||||
}
|
||||
|
||||
public boolean isCollapsedByDefault() {
|
||||
final FoldingBuilder builder = getFoldingBuilder();
|
||||
return builder == null ? false : builder.isCollapsedByDefault(myElement);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Set<Object> getDependencies() {
|
||||
return myDependencies;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return myText;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
myText = text;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user