Fix tooltip

This commit is contained in:
Clément Fournier
2019-01-24 00:09:31 +01:00
parent ec4ff88fd5
commit 70ab933d2c
2 changed files with 14 additions and 13 deletions

View File

@ -17,6 +17,7 @@ import net.sourceforge.pmd.lang.Parser;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.util.fxdesigner.DesignerRoot;
import net.sourceforge.pmd.util.fxdesigner.model.LogEntry.Category;
import net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil;
/**
@ -28,15 +29,6 @@ import net.sourceforge.pmd.util.fxdesigner.model.LogEntry.Category;
public class ASTManager {
private final DesignerRoot designerRoot;
/**
* Last valid source that was compiled, corresponds to {@link #compilationUnit}.
*/
private String lastValidSource;
/**
* Last language version used.
*/
private LanguageVersion lastLanguageVersion;
/**
* Most up-to-date compilation unit. Is null if the current source cannot be parsed.
*/
@ -45,6 +37,14 @@ public class ASTManager {
* Selected language version.
*/
private final Var<LanguageVersion> languageVersion = Var.newSimpleVar(LanguageRegistry.getDefaultLanguage().getDefaultVersion());
/**
* Last valid source that was compiled, corresponds to {@link #compilationUnit}.
*/
private String lastValidSource;
/**
* Last language version used.
*/
private LanguageVersion lastLanguageVersion;
public ASTManager(DesignerRoot owner) {
@ -53,7 +53,8 @@ public class ASTManager {
public LanguageVersion getLanguageVersion() {
return languageVersion.getValue();
LanguageVersion ver = languageVersion.getValue();
return ver == null ? DesignerUtil.defaultLanguageVersion() : ver;
}

View File

@ -53,7 +53,7 @@ public class NodeParentageCrumbBar extends BreadCrumbBar<Node> {
Button button = originalCrumbFactory.call(item);
if (item == ellipsisCrumb) {
button.setText("... (" + numElidedNodes + ")");
button.setTooltip(new Tooltip(numElidedNodes + " parents are not shown"));
button.setTooltip(new Tooltip(numElidedNodes + " ancestors are not shown"));
}
// we use that to communicate the node later on
button.setUserData(item);