How to delete an auto-created ActionEvent ?

23 views
Skip to first unread message

steve.h...@openmailbox.org

unread,
Jul 1, 2014, 3:57:02 PM7/1/14
to codenameone...@googlegroups.com
Hello,
I began some days ago the development of a calculator. First I was curious to know if it is possible to rename events and I saw we can in the autogenerated file by the designer, it works but it is very risky. So I created again the default Action Events, which needs many methods on my personal file. The related methods call a unique one, but it is taking too much place... I have a button whose Action Event is not used anymore. I would like to remove it. How to do it ?

Thanks everyone,

Shai Almog

unread,
Jul 2, 2014, 1:35:55 AM7/2/14
to codenameone...@googlegroups.com, steve.h...@openmailbox.org
Hi,
when you rename a component and save you will get some compilation error thanks to the @Override annotations.
This is good, this means you need to go to every one of these errors and rename the value there too.

Just remove the methods you don't need from the state machine code, you don't need the GUI builder for that.

steve.h...@openmailbox.org

unread,
Jul 2, 2014, 1:45:17 AM7/2/14
to codenameone...@googlegroups.com
I bad expressed. In modern RADs, we can personalise the name of the methods of events and use the same for many components acting the same way. So I edit StateMachineBase, and I would like to remove an event from theme.res to clean my code. Sorry.

steve.h...@openmailbox.org

unread,
Jul 2, 2014, 8:22:29 AM7/2/14
to codenameone...@googlegroups.com, steve.h...@openmailbox.org
Sorry. You were right. I have just noticed Buttons get auto-generated Action Event on StateMachineBase. I also created a new class called StateMachineCode where I migrated the true code relied by the methods of StateMachine. The methods call simply the same in StateMachineCode.

Thank you Shai. ;)

orme...@gmail.com

unread,
May 10, 2015, 6:52:25 AM5/10/15
to codenameone...@googlegroups.com
Hi shai, this is a continuation from my stackoverflow question:
I accidentally made an action event for a List component, and deleting it from StateMachine doesn't make it go away.  The event is still triggered (I see the entire List get pressed/selected), and the selectionListener I attached does not get triggered.

בתאריך יום רביעי, 2 ביולי 2014 בשעה 08:35:55 UTC+3, מאת Shai Almog:

Shai Almog

unread,
May 10, 2015, 10:09:33 AM5/10/15
to codenameone...@googlegroups.com, orme...@gmail.com, orme...@gmail.com
Hi,
can you please open your own discussion thread? Replying to existing unrelated discussions creates a lot of noise and makes them hard to follow in retrospect.

That's selection state, its got nothing to do with the event handling. Just define a selected style for the list in the theme.
Reply all
Reply to author
Forward
0 new messages