These tips all depend on using Eclipse.
Start with all the ClickListeners and do them all at once. Use Eclipse "Java Search": Search String = ClickListener, Search For = Type, Limit To = References.
For simple click situations, copy these lines:
.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event)
{
and paste them in to replace every instance of
.addClickListener(new ClickListener() {
public void onClick(Widget sender)
{
Here's an extra tip: Instead of pasting the above code from here, paste it once into one of your classes. Once you get it valid there, copy that and paste it in to replace all your listeners. When you copy and paste this way, eclipse automatically pulls in the imports for you as well.
If the sender parameter had been used, replace references to it with event.getSource(). You will probably have to cast it.
For other situations, make heavy use of auto-complete (CTRL-SPACE). For example
myObject.addCl<CTRL-SPACE><ENTER> -> myObject.addClickHandler()
myObject.addClickHandler(new <CTRL-SPACE><ENTER>) -> myObject.addClickHandler(new ClickHander)
myObject.addClickHandler(new ClickHander() {<ENTER>) ->
myObject.addClickHandler(new ClickHander() {
})
myObject.addClickHandler(new ClickHander() {
<CTRL-SPACE><ENTER>
})
->
myObject.addClickHandler(new ClickHander() {
public void onClick(ClickEvent event) {
// TODO Auto-generated method stub
}
})
Final tip: Put your cursor at the end of a listener class name (ex: new ClickListener|()) and press <CTRL-SPACE>. This will bring up the class along with other suggestions in a list. But it will also show the Java Doc for that class, which will tell you what handler(s) you should use instead. The same works for methods like addClickListener().
Secure, private AI inspired by behavioral sciences and evolutionary anthropology, built on Tiny Neural Networks (TNN, TLM), and a distributed agent system.
As an Amazon Associate I earn from qualifying purchases.
Subscribe to:
Post Comments (Atom)
Post Scriptum
The views in this article are mine and do not reflect those of my employer.
I am preparing to cancel the subscription to the e-mail newsletter that sends my articles.
Follow me on:
X.com (Twitter)
LinkedIn
Google Scholar
I am preparing to cancel the subscription to the e-mail newsletter that sends my articles.
Follow me on:
X.com (Twitter)
Google Scholar
My favorite quotations..
“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.” by Robert A. Heinlein
"We are but habits and memories we chose to carry along." ~ Uki D. Lucas
Popular Recent Posts
-
Choice D Since we are currently renting, we started looking at the houses we could afford. This place fits our budget, but the baby blue col...
-
Every couple of years, I write a post about my career in which I review the past and consider pivots for the future. It is time to post an u...
-
How to get a model from HuggingFace on Mac OS This guide documents the steps needed to download HuggingFace models (especially MLX models) c...
-
Something subtle but powerful just landed in my AI pipeline: agent_Observer. It listens. Not to spy, but to sense the mood and intent. It ...
-
I have been reading a book, "Brave New Words," by Salman Khan of Khan Academy, and I got inspired to design an AI tutor (named Mai...
-
I am working on truly multi-persona (Marcus Aurelius, Seneca, etc.) I had fun while testing the interaction with the AI chat. I got this res...
-
Sometimes the AI chats surprise me on a new level. Here is an interaction I just had when fixing my AIKO app's Human-AI Interaction (HAi...
-
I never thought that I will need agent_HOA_rules.py but it is very useful! The bylaws are many and long and not text searchable, getting a ...
-
When I work with ChatGPT, I don't just ask for an answer and move on. Instead, we engage in a real dialogue, going back and forth like ...
-
I tested to belong to Haplogroup R1b1b2a1a1d1. Subclade R1b1b2a1a1d1* (as named by 23andMe ) or R1b1a2a1a1a4 (per FTDNA ) is a paternal (...
Most Popular Articles
-
In my journey building software and managing technology teams, I've often witnessed the allure and danger of what Melissa Perri aptly na...
-
I have noticed a very unsettling statistic on my blog. This prompted a fascinating question about AI, blogs' future, and maybe even the...
-
Choice D Since we are currently renting, we started looking at the houses we could afford. This place fits our budget, but the baby blue col...
-
Prompt: What do you really see in the selfie of myself? AI: I see a volcano about to blow up and I see a lost, scared boy in front of it. ...
-
Every couple of years, I write a post about my career in which I review the past and consider pivots for the future. It is time to post an u...
-
How to get a model from HuggingFace on Mac OS This guide documents the steps needed to download HuggingFace models (especially MLX models) c...
-
Something subtle but powerful just landed in my AI pipeline: agent_Observer. It listens. Not to spy, but to sense the mood and intent. It ...
-
I tested to belong to Haplogroup R1b1b2a1a1d1. Subclade R1b1b2a1a1d1* (as named by 23andMe ) or R1b1a2a1a1a4 (per FTDNA ) is a paternal (...
-
I have been reading a book, "Brave New Words," by Salman Khan of Khan Academy, and I got inspired to design an AI tutor (named Mai...
-
Introduction: A Language Model of My Own We are surrounded by large language models: systems trained on the vastness of the internet. Models...
No comments:
Post a Comment
Please be polite.