On 28.08.2012 22:35, Michaël Michaud wrote:
> Hi Matthias,
>> now i remember me to the discussion and problems about the
>> addMainMenuItem. Because i need my plugin runnable in actual versions, i
>> try to look for an other way.
> Just curious. I wonder why back compatibility is so important
> for a software which is both cheap and easy to install (deployment issue ?)

what exactly do you mean Michael?
 
> Now I may have a (awful) hack if you really want to get your
> checkbox state without changing the api.
> If you keep a reference to the popupMenu in your PlugIn, you can iterate 
> through
> its menu items with getSubElements (recursive recursion if needed) and 
> search for
> a JCheckBoxMenuItem which name (or text ?) is your menuItemName.
> Would it be correct ?

that would be working with old versions and only, although unlikely, if there 
is no other menu entry before that with the same name.

> 
> You may also know that beanshell scripts can be executed in a mode
> with extended accessibility to private methods.
> 
>> But for the future i can made this changes in the FeatureInstaller class
>> in the same way as for the addMainMenuItem. Leave the actual
>> void-returning method untouched and mark them as deprecated. Second
>> create the corresponding new methods with a returning JMenuItem.
>> Is this OK???
> That's OK for me.

fine with me. for continuity please use the method name 'addPopupMenuPlugin'.

..ede

> 
> Michaël
>>
>> Matthias
>>> not sure if i understand correctly:
>>>
>>> you want a checkable checkbox? or as in the layer status "editable" and
>>> selectable, a checkmark shown that appear or disappears on re-click?
>>>    
>> Yes i need the same as the layer status "editable" in the layer view panel.
>>> or am I thinking of the wrong menu?
>>>
>>> cheers,
>>> stefan
>>>
>>> Am 20.08.12 15:56, schrieb Michaël Michaud:
>>>    
>>>> Hi Matthias,
>>>>
>>>> You're right and I can't see any solution without adding a new method,
>>>> or changing the accessibility of the third one from private to public.
>>>>
>>>> I was tempted to say it is safe to change the return value from void to a
>>>> JMenuItem, but after I have read this article, I wouldn't recommend to
>>>> do it :
>>>> http://stackoverflow.com/questions/3589946/retrofitting-void-methods-to-return-its-argument-to-facilitate-fluency-breaking
>>>>
>>>> Finally, the solution I suggest is to add the missing method.
>>>> A better solution anyone ?
>>>>
>>>> Michaël
>>>>
>>>>
>>>>      
>>>>> Hi Ede,
>>>>>
>>>>> i have to disappoint you. You mean the new addMainMenuItem methods, but
>>>>> i talk about addPopupMenuItem. The addPopupMenuItem methods does not
>>>>> return the menuitem at the moment :-(
>>>>>
>>>>> Matthias
>>>>>        
>>>>>> the new addMenu methods of featureinstaller return the menuitem created. 
>>>>>> you can easily save the reference and ask it on execute which state it 
>>>>>> is in.
>>>>>>
>>>>>> regards ede
>>>>>>
>>>>>> On 18.08.2012 18:58, Matthias Scholz wrote:
>>>>>>
>>>>>>          
>>>>>>> Hi,
>>>>>>>
>>>>>>> i use the
>>>>>>>
>>>>>>> FeatureInstaller.addPopupMenuItem(JPopupMenu popupMenu, PlugIn 
>>>>>>> executable,
>>>>>>>           String[] menuPath, String menuItemName, boolean checkBox, 
>>>>>>> Icon icon,
>>>>>>>           EnableCheck enableCheck)
>>>>>>>
>>>>>>> to add a PopupMenuItem with a checkbox. Is there an easy way to get the
>>>>>>> state of the chackbox inside the Plugin.execute() method?
>>>>>>>
>>>>>>> thanks
>>>>>>>
>>>>>>> Matthias
>>>>>>>
>>>>>>>
>>>>>>>            
>>>>>> ------------------------------------------------------------------------------
>>>>>> Live Security Virtual Conference
>>>>>> Exclusive live event will cover all the ways today's security and
>>>>>> threat landscape has changed and how IT managers can respond. Discussions
>>>>>> will include endpoint security, mobile security and the latest in malware
>>>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>>>> _______________________________________________
>>>>>> Jump-pilot-devel mailing list
>>>>>> Jump-pilot-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>>>>
>>>>>>          
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and
>>>> threat landscape has changed and how IT managers can respond. Discussions
>>>> will include endpoint security, mobile security and the latest in malware
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> Jump-pilot-devel mailing list
>>>> Jump-pilot-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>>
>>>>      
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Jump-pilot-devel mailing list
>>> Jump-pilot-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>    
>>
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to