bsorrentino / swixml2

Project that extends the original swixml project providing integration with Swing Application Framework (JSR 296) and Beans Binding (JSR 295) to further simplifying the GUI creation & management
0 stars 0 forks source link

Actions related to slider objects do not work #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Define a slider object with an action Example: <slider 
constraints="3,43,5,1" minimum="0" maximum="255" value="200" 
action="transparencyAction" id="transparency" />
2. Define a Java action

    public Action transparencyAction = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {

            // Read the transparency to use
            //
            System.out.println("DEBUG: This event is not called. It is a swixml bug. Open a ticket");
        }
    };
3. Move le slider

What is the expected output? What do you see instead?
I expect the action to be called, but instead the action is not called

What version of the product are you using? On what operating system?
Swixml 2.5 on Windows

Please provide any additional information below.

Original issue reported on code.google.com by mario.st...@gmail.com on 16 Sep 2010 at 2:59

GoogleCodeExporter commented 9 years ago
hi

thx for feedbacks. i'll investigate soon

Original comment by bartolom...@gmail.com on 16 Sep 2010 at 5:01

GoogleCodeExporter commented 9 years ago
hi 

you right ... on the slider component action is not implemented (yet)

Meanwhile you could solve the problem using 'bindWith' attribute as shown below:

1.) Add bindWith to Xml tag 
==================
<slider constraints="3,43,5,1" minimum="0" maximum="255" value="200" 
id="transparency" bindWith="transparency"/> 

2.) add setter/getter on your Dialog
======================

    public final int getTransparency() { return transparency; }

    public final void setTransparency(int value) {
                System.out.println("DEBUG: This setter is automatically called every change. " + value );
        this.transparency = value;
    }

That's all ... use setter as an event handler.

Hope this help

However I'll add the action support ... 

Original comment by bartolom...@gmail.com on 17 Sep 2010 at 6:05

GoogleCodeExporter commented 9 years ago

Original comment by bartolom...@gmail.com on 20 Apr 2011 at 9:59