The only way I can see to do something like that would be to write an Illustrator plugin which tracks the mouse interactions and then fires an event to be handled by the extension.
Thanks for the reply Harbs! I am okay with writing a plugin which works with the extension.. My question is, will I be able to get the art object based on the mouse positions?
I came upon the NativeDragManager class of the CS Extension. We can use it to drag and drop objects from the panel to the application document. For this we use the ClipBoard and specify the format of the clipboard data. There are quite a few formats, namely, bitmap, text, url, file, etc. However, I couldn't use any of these so that I might drag a color from my panel to the document.
Here is a code to drag and drop a text from panel to document,
var clip:Clipboard = new Clipboard();
var allowedActions:NativeDragOptions = new NativeDragOptions();
NativeDragManager.doDrag(designsDG.selectedItem as InteractiveObject, clip);
Here designsDG is the datagrid containing the text.
How can I do something similar for a color object?
Colors in Illustrator is custom data. The only way you could possibly use NativeDragManager would be if you could write custom data that matches what Illustrotor expects on a drop. I don't know whether Illustrotor will accept color data from an outside app at all. One test you could do to determine whether ther's something to even look at would be to see if you can drag a color from one version of Illustraotr to another. If the answer is no, then don't bother looking further...