Drag and Drop

  • Nov 30, 2012

I hope everyone had a very Happy Thanksgiving!

I had forgotten the ability to use the transaction history in Looking Glass from over the summer, but having found that, I quickly identified the appropriate class to add the nodeLabeler for the the user. It would be best if it labeled anything that was inserted by the user through drag and drop. We only want to label nodes that have been successfully dropped into the project space as created by the user. I believe InsertStatementEdit is called for editing Kyle's tutorials, but it is also called for the transaction history. By editing the node's origin property at this point, it prevents the need for adding the NodeLabeler to every single class of item that can be added into the project. Instead, when a statement or expression is dropped into the project, its originProperty is automatically relabeled with USER. 

One thing that I hadn't taken into account is that the insertions don't take into account situations like the forEachLoop. The forEachLoop requires Looking Glass to have a collection of objects to iterate through. If a collection doesn't already exist, it can help the user create one. However, this does not count as being dropped into the project. This means that the collection generated is not labeled as the USER. This means that I may need to start looking into where Looking Glass assists the user in generating certain sections of code. 

Still having problems with JavaMethod/JavaMethodParameters not being labeled as SYSTEM generated. It seems as if this may be due to the fact that things are being generated after the labelGenerated is called by performGeneratedSetup. This means that there are additional methods that affect the major elements of the project before inserting anything special. 



  • No comments yet

Log In or Sign Up to leave a comment.