Action Listeners : How do they work?

0 views
Skip to first unread message

Paritosh Ranjan

unread,
Nov 22, 2010, 1:08:03 AM11/22/10
to DataCleaner-dev
Hi,

I wanted to add a preview data support.

However,I saw that there is an built in support in the form of
PreviewTransformedDataActionListener.

Can someone explain how it (Action Listeners) works( read it
architecture, usage :)).

Thanks and Regards,
Paritosh

Kasper Sørensen

unread,
Nov 22, 2010, 1:47:41 AM11/22/10
to DataCleaner-dev
Hi Paritosh,

ActionListeners are the main sort of "action" object in Swing. If you
want your button to have an action, you'll do something like this:

JButton button = new JButton("click me");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("hello");
}
});

paritosh ranjan

unread,
Nov 22, 2010, 3:32:16 AM11/22/10
to datacle...@googlegroups.com
Actually I wanted some information about How PreviewTransformedDataActionListener works. I will try to make the question more clear this time.

What all do I have to do to create a Preview Button which shows some data in a different window?
Looking at the classes shows, there is already something of this sort implemented.

I figured out the button being added in TransformerJobBuilderPanel. However, mine is an Analyzer.
Can you please explain a little bit about Jobs also.

Thanks and Regards,
Paritosh




2010/11/22 Kasper Sørensen <kas...@eobjects.dk>
--
You received this message because you are subscribed to the Google Groups "DataCleaner-dev" group.
To post to this group, send email to datacle...@googlegroups.com.
To unsubscribe from this group, send email to datacleaner-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/datacleaner-dev?hl=en.


Kasper Sørensen

unread,
Nov 22, 2010, 4:20:39 AM11/22/10
to datacle...@googlegroups.com
Well the PreviewTransformedDataActionListener is actually quite complicated so I think it's maybe not the place to start. In short it simulates a complete job where rows are being transformed and if you just want to preview some data then this is not needed.

Rather I would refer you to DataSetWindow, which is a window class used to present a dataset. There are a few different constructor options for DataSetWindow - either you can base it on a Query, a TableModel and you're also invited to consider if we need to supply other constructors.

I will get back to you about jobs ... Actually I am going to write a little bit about it in the developer FAQ and post the link in a few hours.

/Kasper

Paritosh Ranjan

unread,
Nov 22, 2010, 4:29:48 AM11/22/10
to DataCleaner-dev
It works great. Thanks.

On Nov 22, 2:20 pm, Kasper Sørensen <kas...@eobjects.dk> wrote:
> Well the PreviewTransformedDataActionListener is actually quite complicated
> so I think it's maybe not the place to start. In short it simulates a
> complete job where rows are being transformed and if you just want to
> preview some data then this is not needed.
>
> Rather I would refer you to DataSetWindow, which is a window class used to
> present a dataset. There are a few different constructor options for
> DataSetWindow - either you can base it on a Query, a TableModel and you're
> also invited to consider if we need to supply other constructors.
>
> I will get back to you about jobs ... Actually I am going to write a little
> bit about it in the developer FAQ and post the link in a few hours.
>
> /Kasper
>
> On Mon, Nov 22, 2010 at 9:32 AM, paritosh ranjan
> <paritoshranj...@gmail.com>wrote:
> >> datacleaner-d...@googlegroups.com<datacleaner-dev%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/datacleaner-dev?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "DataCleaner-dev" group.
> > To post to this group, send email to datacle...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > datacleaner-d...@googlegroups.com<datacleaner-dev%2Bunsu...@googlegroups.com>
> > .

Kasper Sørensen

unread,
Nov 22, 2010, 4:56:51 AM11/22/10
to datacle...@googlegroups.com
Hi everyone,

I'm using these questions as an opportunity to build up a site with questions and answers and some explanations about the architecture of DataCleaner and AnalyzerBeans. Please check the website (it's work in progress) here:

http://analyzerbeans.eobjects.org/

and for paritosh's particular question regarding jobs:

http://analyzerbeans.eobjects.org/architecture.html

Let me know if you have more questions or topics that we need to provide on the site.

Best,
Kasper

To unsubscribe from this group, send email to datacleaner-d...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages