com.sun.source.tree.OpensTree Java Examples
The following examples show how to use
com.sun.source.tree.OpensTree.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GoToSupport.java From netbeans with Apache License 2.0 | 6 votes |
private static TreePath adjustPathForModuleName(TreePath path) { TreePath tp = path; while (tp != null && (tp.getLeaf().getKind() == Kind.IDENTIFIER || tp.getLeaf().getKind() == Kind.MEMBER_SELECT)) { Tree parent = tp.getParentPath().getLeaf(); if (parent.getKind() == Kind.MODULE && ((ModuleTree)parent).getName() == tp.getLeaf()) { return tp.getParentPath(); } if (parent.getKind() == Kind.REQUIRES && ((RequiresTree)parent).getModuleName() == tp.getLeaf() || parent.getKind() == Kind.EXPORTS && ((ExportsTree)parent).getModuleNames() != null && ((ExportsTree)parent).getModuleNames().contains(tp.getLeaf()) || parent.getKind() == Kind.OPENS && ((OpensTree)parent).getModuleNames() != null && ((OpensTree)parent).getModuleNames().contains(tp.getLeaf())) { return tp; } tp = tp.getParentPath(); } return path; }
Example #2
Source File: TreeDuplicator.java From netbeans with Apache License 2.0 | 5 votes |
@Override public Tree visitOpens(OpensTree tree, Void p) { OpensTree n = make.Opens(tree.getPackageName(), tree.getModuleNames()); model.setType(n, model.getType(tree)); comments.copyComments(tree, n); model.setPos(n, model.getPos(tree)); return n; }
Example #3
Source File: SemanticHighlighterBase.java From netbeans with Apache License 2.0 | 5 votes |
@Override public Void visitOpens(OpensTree tree, Void p) { tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(), tree)); Token t = firstIdentifierToken("opens"); //NOI18N if (t != null) { contextKeywords.add(t); } scan(tree.getPackageName(), p); tl.moveToOffset(sourcePositions.getEndPosition(info.getCompilationUnit(), tree.getPackageName())); t = firstIdentifierToken("to"); //NOI18N if (t != null) { contextKeywords.add(t); } return scan(tree.getModuleNames(), p); }
Example #4
Source File: ExpectedTypeResolver.java From netbeans with Apache License 2.0 | 4 votes |
@Override public List<? extends TypeMirror> visitOpens(OpensTree node, Object p) { return null; }
Example #5
Source File: JavacModuleParser.java From pro with GNU General Public License v3.0 | 4 votes |
public void visitOpens(OpensTree node, @SuppressWarnings("unused") TreeVisitor<?, ?> __) { mv.visitOpen(qualifiedString(node.getPackageName()), 0, toArray(node.getModuleNames())); }
Example #6
Source File: JavaInputAstVisitor.java From google-java-format with Apache License 2.0 | 4 votes |
@Override public Void visitOpens(OpensTree node, Void unused) { visitDirective("opens", "to", node.getPackageName(), node.getModuleNames()); return null; }