Add varags version of the add method of java.awt.Container

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P5
    • None
    • Affects Version/s: 7
    • Component/s: client-libs
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      Can we a have an add method on java.awt.Container that uses varagrs?

      Like this:
      public Component add(Component comp, Object ... constraints) ;


      JUSTIFICATION :
      This would allow layout managers to be designed to take a variable number of arguments when adding a component to a container. This could eliminate a special "constraint" object to bind multiple parameters into one add call. This is exemplified by GridBagConstraints.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      // I would like to see a system where the following would be possible
      // fictional varargs based layout manager
      component.add(new JList(), location(1,1), NORTHWEST_ANCHOR, vspan(5), hspan(2) );

            Assignee:
            Andrei Dmitriev (Inactive)
            Reporter:
            Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: