URLClassLoader in eclipse plugin - eclipse-plugin

I am implementing a plugin for content assist in xml. In the implementation I am loading the classes of a project as,
URLClassLoader classLoader = new URLClassLoader(urls,Thread.currentThread().getContextClassLoader());
But when i make changes in the classes, and try for content assist, it still loading the previous class.
Does there any way to load new modified classes?

Related

Jaxb Annox plugin : Is it possible to change annotation in objectFactory class #XmlElementDecl

Im getting 2 counts of IllegalAnnotationExceptions The element has more than one mapping. Issue after using an episode file to generate the common classes from 2 xsd files. Now I have 2 objectFactory class with mapping for same element . Im thinking to remove the annotation from one of the factory method as nothing else seems working.
I have solved this issue through another XJC plugin as jaxb2-annotate-plugin didn't have a provision to add or replace annotations in the ObjectFactory class.
I Found any-annotate plugin which does handle this like a charm.
For more details:
https://gitlab.com/virtual-machinist/any-annotate

Reusing the eclipse plug in to create the customized plug in

Problem: I am using the eclipse editor plugin to create the customized plug in. So in that plug in i will be using only some classes to get the customized view of the editor. But I will not be using all classes now for example there are classes Class A,Class B, and Class C in the editor plug in and Class A will be initiating Class C.Now in my customized plugin I will be extending the Class C and customize the Class as per my requirement and I don't want to modify the Class A.
Actual problem is if open the eclipse editor i want Class A to initiate the extended Class C present in my plug in and not present in the eclipse editor plug in.
I.e During compile time binding i want Class A of the eclipse plug in to bind with the extended Class C present in my plugin.
Thanks
You can't change the behavior of an existing editor by trying to extend its classes in a new plugin.
If the existing editor provides 'extension points' to add new functionality to can extend it using those.
You can write a new editor using the classes from an existing plugin provided the existing plugin exports the packages you need to use.
You can sometimes use the org.eclipse.ui.activities extension point to suppress existing menus items, but this will require research to identify menu ids.
You can also sometimes add to menus by using the org.eclipse.ui.menus extension point. Again this requires research to identify menu ids. The 'plug-in Spy' may help with this.

Javafx dynamically fxml load at Runtime

I have an application that cover a wide number of use cases each with completely independent workflows but workflows are pretty static after installation.
I have therefore created an HBox placeholder that will load the workflow for an installation.
Is there a way to dynamically load a section of the fxml from a database or a separate file archive? This fpml will have to have its own set of images and resources needed to achieve the workflows functionality.
TBH, I don't know where to start on this one.
Regards
I do not quite understand your problem. You can modify the scene graph at any time you want. So, of course it is possible to load a part of the scene graph from an FXML file at any time and hook it up to the already existing part. In your controller you have access to your HBox placeholder and when you have loaded the second part of the scene graph you can just add it via hbox.getChildren().add(newpart), were newpart is the root node of your second scene graph part. Of course you have to make sure that the layout works correctly for your constellation.
Your question seems nonsense because the FXML is always loaded dynamically. My guess is you are confused because most of the examples use FXML in the same bundle as the classes and so are loaded trough the getResource method. But the FXML loader takes any kind of InputStream, so you can just open a database blob or a file as an InputStream and give that InputStream as an argument to the loader. Be sure to catch the runtime exceptions though :)
Hope this helps.

AS3 FDT How to instantiate an fla asset with a custom class?

I jsut started working at a company that uses flash builder, but I am using fdt at the moment. I am hvaing trouble getting FDT to instantiate the sprite in an fla project along with the custom class that goes with it.
Also, for some reasont he people here say instantiating a sprite like this is WRONG:
var mc:MovieClip = new MoviClip()
and this is right:
var _someClass:Class = getDfinitionByName("Linkage") as Class;
var _mc:Sprite = new _someClass() as Sprite
I cannot figure out how to instantiate the movieclip in the fla and also the as class at the same time with this method.
Is the asset a 'Sprite' or a 'MovieClip'? Although you can create Sprite assets in Flash Professional (FLA) it's likely the asset is a Movieclip.
Please confirm this.
Alao, a 'Movieclip' is a 'Sprite' since it inherits from 'Sprite'.
That way of linking is quite verbose and not typical. Are you linking the asset at compile or runtime?
Most people just export assets as a SWC. If you want to get the asset at runtime it's a different thing a bit...
Look at this post.
You use getDfinitionByName("Linkage") when your assets are loaded at runtime. If they are linked at compile time (as an swc library) then you're free to do var mc:Linkage = new Linkage(); instead.

Aptana Code Assist with custom Class Loader

Is it possible to setup Aptanta to provide code assist for classes loaded with a framework's autoloading class?
For example:
$myInstance = Project_Loader::load('MyClass');
Here, my class would be loaded from a hierarchy as soon as it was found, so if I had these libraries setup:
/library/Library1
/library/Library2
/library/Library3
If MyClass was in Library2, it wound find Library2_MyClass. Aptana works great if I initiate the object using:
$myInstance = new Library2_MyClass();
But is there any way to let Aptana know to load it and use Code Assist/Intellisense based on Project_Loader::load('MyClass')?
Not possible at the moment, as it's very dynamic, and specific to a framework.
What you can do is to add a comment that will hint for the type.
For example:
/* #var $myInstance MyClass*/
$myInstance-> // and you'll get the MyClass code-assist.