eclipse-jdt

How to build Eclipse JDT Core from source code via Git?

随声附和 提交于 2021-02-08 12:42:08
问题 I want to build Eclipse JDT Core from source code via Git. Naïvely, I cloned git://git.eclipse.org/gitroot/jdt/eclipse.jdt.core.git and tried to run mvn validate (the most basic of Maven phases) from the Git master branch but this failed with errors below. I am a Debian Linux user with Maven 3.0.5 and JDK 1.7 installed. I am interested to hack on class ASTParser, which can parse Java code. I realise building Eclipse projects is hard, but I cannot find the definitive "recipe" page anywhere on

Error while Installing TestNG Eclipse Plugin 6.14.3 Version

☆樱花仙子☆ 提交于 2021-01-28 05:30:35
问题 I am getting the following error while installing TestNG plugin( 6.14.3) in Eclipse. Missing requirement: TestNG Eclipse Support 6.14.3.201902250526 (org.testng.eclipse 6.14.3.201902250526) requires 'bundle org.eclipse.jdt.launching 3.10.0' but it could not be found Cannot satisfy dependency: From: TestNG 6.14.3.201902250526 (org.testng.eclipse.feature.group 6.14.3.201902250526) To: org.testng.eclipse [6.14.3.201902250526] I am using Eclipse Oxygen- March Edition. Could anyone please help me

Eclipse 2019 black background

﹥>﹥吖頭↗ 提交于 2020-05-16 22:13:46
问题 After install of 2019-12 version of Eclipse I can't set black background while using Dark theme and Default set of colors. If I change color in General -> Editors -> Text Editors -> Appearance color options -> Background color - I see line numbers background color get changed to my choice, while text area remain in same dark grey, regardless of the color I choose. I tried to manually edit epf preferences and import them back, but even this way doesn't work. Is there a some change/bug in

How to redefine an import using Eclipse JDT Core

戏子无情 提交于 2020-02-06 19:33:47
问题 Does anyone have an example how to redefine an import in a java source file using the Eclipse JDT Core API? I have the following (which does not work) and it's driving me mad. try { for (IPackageFragmentRoot root : project.getPackageFragmentRoots()) { if (root.getElementName().equals("src")) { for (ICompilationUnit unit : root.getPackageFragment("soap.service.implementation.strongProfile.delegate").getCompilationUnits()) { System.out.println(unit.getElementName()); for (IImportDeclaration dec

How do I get rid of “Current text selection cannot be opened in an editor” in Eclipse?

天大地大妈咪最大 提交于 2020-01-20 04:30:05
问题 Sometimes, I get this message in the status bar when I press F3 on a Type in a Java editor: Current text selection cannot be opened in an editor When I copy the selection into the clipboard and use Ctrl+Shift+T to open the "Open Type" dialog, I can paste the value and it will display the type and I can open it. The type is on the class path (no compile errors). In other Java editors in the same project, F3 / Ctrl-Click works. In the "broken" editor, it only works on internal fields and

possible bug in Maven + plexus + eclipse compiler on case sensitive packages?

我是研究僧i 提交于 2020-01-16 03:26:09
问题 I encounter a very strange problem with Maven and Eclipse compiler. While in Eclipse+m2eclipse, I have no problem compiling a small project (archetype quick start) with the following single class. package test.test; import com.Ostermiller.util.CSVParser; public class TestCaseSensitive { CSVParser csvParser; } Ostermiller utils is added to pom.xml. Eclipse Kepler compiles the project. Next, mvn compile works out-of-the-box. Now the issue, I switch to compiler 3.1 and asks for Eclipse compiler

How to check if a visited node is in if part or else part of IfStatement node in Eclipse JDT parsing?

回眸只為那壹抹淺笑 提交于 2020-01-15 10:17:17
问题 When I visit a MethodInvocation node during AST traversal, I want to know if it lies in the IfStatement then part or else part or in the expression part. The then part can be a complete block of code but I think my code is handling only a single then statement. Here is the code snippet for visiting a method invocation @Override public boolean visit(MethodInvocation node) { StructuralPropertyDescriptor location = node.getLocationInParent(); setNodeRegion(location); Here is how I want to set

How to check if a visited node is in if part or else part of IfStatement node in Eclipse JDT parsing?

倖福魔咒の 提交于 2020-01-15 10:17:04
问题 When I visit a MethodInvocation node during AST traversal, I want to know if it lies in the IfStatement then part or else part or in the expression part. The then part can be a complete block of code but I think my code is handling only a single then statement. Here is the code snippet for visiting a method invocation @Override public boolean visit(MethodInvocation node) { StructuralPropertyDescriptor location = node.getLocationInParent(); setNodeRegion(location); Here is how I want to set

Track files changes done by eclipse cleanup programmatically

时光总嘲笑我的痴心妄想 提交于 2020-01-14 05:12:27
问题 I have written one eclipse osgi plugin that runs cleanup and formatting actions on java files present in eclipse project. Some thing like: Run batch file that has eclipse command It open's eclipse editor Loads eclipse project passed as parameter in batch command Run cleanup and formatting actions Closes eclipse Now my problem is I need to track the files that has been changed by this action. I am performing cleanup changes using cleanUpsAction that runs as thread over multiple files and forks

Eclipse Java AST parser: insert statement before if/for/while

半世苍凉 提交于 2020-01-14 03:05:52
问题 I'm using the org.eclipse.jdt parser. I want to rewrite this code: public void foo(){ ... ... if(a>b) ... ... } into this: public void foo(){ ... ... System.out.println("hello"); if(a>b) ... ... } Supposing that ifnode is an IF_STATEMENT node, I can do something similar to this: Block block = ast.newBlock(); TextElement siso = ast.newTextElement(); siso.setText("System.out.println(\"hello\");"); ListRewrite listRewrite = rewriter.getListRewrite(block, Block.STATEMENTS_PROPERTY); listRewrite