GWT - newbie

Posted on 2012-09-17
Last Modified: 2013-01-21
hi guys
I am working on GWT and i have something like

public class QuickSearch extends Canvas
private HLayout mainBodyLayout = new HLayout(); //the main layout containing other layouts.

//button layout
private Layout getButtonLayout()
//here i want to check IF mainBodyLayout already contains
getButtonLayout() , if it does not contain only then add it like
Any idea how i can check if getButtonLayout() is already present in mainBodyLayout ?

return VLayout;

thanks in advance.
Question by:royjayd
    LVL 35

    Expert Comment

    It's not clear what you are asking. You are asking if the main layout contains 'getButtonLayout()' but that is a function not an object!? And if you mean, 'does the main layout contain whatever the returned object from getButtonLayout()' well then you have an infinite recursion problem. How can you know if the main layout contains an object that is returned from a function when you are still INSIDE that function?

    I think you need to explain at a higher level what it is you are trying to do!
    LVL 35

    Accepted Solution

    Once you sort the above out, it seems the Canvas objects (those objects that can be added as members of layouts) can take/be assigned an 'ID' . Then you can call mainBodyLayout.getMember("MY_ID") to see if it returns an object (ie. it has already been added) or null (ie. is has NOT yet been added)

    Author Comment

    ....can be assigned an I'D.
    Yeah, I am looking for that,  any idea how I can do that?
    Also getButtonlayout() returns a layout object.

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Suggested Solutions

    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now