I am using Resource Change Listener to track the changes done to my project. Out of these changes i want know if the change was done via Eclipse menu or some other eclipse plugin or if it was typed in by user. Please suggest a way to achieve this.
I am not sure whether there is a direct API to to that, because the interface IResourceDelta that it mainly implements does not have a method on who modified the resource.
You can track most the changes mainly on the resource it modified, but 'who' modified it is an unanswered question for me too. I found this resource useful in this regards,
http://www.eclipse.org/articles/Article-Resource-deltas/resource-deltas.html
Related
Do you know any way to find (un)used code from the perspective of a specific main method (or what IntelliJ calls an entry point)?
The background is that we have a big java project in which we have custom code for several clients. Sometimes we give clients the current state of the project in source form but would obviously want to remove the parts which only concern other clients. We have a Main file for each client so it should be possible to follow imports from there to find exactly the files relevant to each client.
I was hoping to be able to run intellij's code inspection on a single entry point but was unable to find anything. I'm open to any solution though.
You could remove all other entry points and run intellij's code inspection again to detect unused code. Now that you have only one entry point it should be able to tell you what code is unused. With that knowledge you can revert you changes and remove this code.
Hope that helps.
I am trying to use JSCIPOpt to solve a maximization problem but I couldn't find a way to set the problem objective. The scip document says
The default objective sense for SCIP problems is minimizing. Since we have a
maximization problem we have to change this:
SCIP_CALL_EXC(SCIPsetObjsense(scip, SCIP_OBJSENSE_MAXIMIZE));
But I was not able to find any API call in the JSCIPOpt to set objective. I was, however, able to find setMaximize in PySCIPOpt. Am I missing something? What is the correct way to set the objective using JSCIPOpt?
It doesn't seem to be supported yet. You should just create an issue on the github page and submit a feature request: https://github.com/SCIP-Interfaces/JSCIPOpt
Even better, though: Implement the feature yourself (see https://github.com/SCIP-Interfaces/JSCIPOpt#how-to-extend-the-interface) by introducing the necessary interface function in the same way it's done in PySCIPOpt and submit a merge request! This way you learn something on the way and everyone's happy :-)
I have a task where we need to generate UML(or similar) from XML and will be able to edit text, property type and drag dependency row. But I can't find any Java lib or component wich will allow me to do such.
For example PlantText is a good lib but it does not allow to make edit.
If someone known such lib/compoment please share.
Thanks
EDIT:
Sorry, maybe I wasn't wrote clear. Actually, I need library which I can implement into my project, and after I will be able to generate UML from my project, then edit it and save into XML.
draw.io is very good site where you can create (not only) UML's and save them to XML file so in future you can edit it. The drawback is it is not automatic and must be drawn from scratch.
I am currently using a library for "Notify My Android". The library is using an outdated URL so i tried to change it. I attached the source file and now I can edit the code. Before attaching the source file it just said "compiled code". But when i save it it does not seem to save the changes. It is still using the old URL. Also the change I made is underlined in blue. I hope somebody knows how to make the .jar to accept my changes.
Thanks in advance
it's highly discouraged to modify jars you depend on simply because if you ever want to upgrade versions you'd need to modify the new jar you are looking for.
In those situations you have these options:
if it is an open source project, contribute to the project and correct the URL
try and set the property from your code (this may not be possible in certain situations)
try and extend the class you're trying to use and set the URL on the property you need (like the previous one, it may not be possible to do this)
this should be your last resource: create your own project (from the original jar), make the changes you require, package it up and add it to you app.
This is in reference to the question posted at org.netbeans.validation.api.ui.ValidationGroup.add() - How to specify ValidationStrategy?
I am trying to do something similar. Please guide me on what needs to be changed and where. I went through the given links but couldn't find the relevant info.
P.S.: Asking in a separate question because I can't comment on the original one due to lack of reputation points.
Regards
Uday
I found out what was required.
Check out the code from their repository (https://svn.kenai.com/svn/simplevalidation~src) and open ValidationAPI as a project in Netbeans (or whatever IDE you're using).
To change the default validation strategy you'll need to make the changes in ValidationGroup and SwingValidationGroup classes under org.netbeans.validation.api.ui and org.netbeans.validation.api.ui.swing respectively.
In these classes find ValidationStrategy.DEFAULT and replace it with the strategy you want (INPUT_VERIFIER, ON_FOCUS_LOSS, ON_CHANGE_OR_ACTION).
Build the project to generate a new jar and incorporate that jar in your own project.
That's it.