Re: How can I extend with new attributes

Kovári László <[email protected]> Tue, 14 Sep 2004 08:26:22 +0200
Newsgroups gmane.comp.embedded.carlsbad-cubes
Message-ID <003301c49a23$c1f37fb0$0800000a@ojektum>
Hi Bharat,

Thank you your example.

As I see in this case I must inherit from the base "class"(JButton in your example) one own "class"(CustomButton). eg. If I want to extend all visible controls (visible tag in swixML terminology) with one attribute it is a little difficult. 
Available any other way for this, without any modifications in the original source?

Thanks,

LK.


----- Original Message ----- 
  From: Bharat Panchal 
  To: List for Users of Carlsbad Cubes' Technologies and Products 
  Sent: Tuesday, September 14, 2004 5:45 AM
  Subject: RE: [Forum] How can I extend with new attributes


  Hi LK,
  You have to extend the available tag and can specify the attributes you want.
  For example,

  public class CustomButton extends JButton{
   
   /**
    * page_id specifies the page to be called on click of this action.
    */
   private String page_id = null;
   
   public CustomAction() {
    setVisible(true);
   }
   
   public void setPage_Id(String page) {
    page_id = page;
   }
   
   public String getPage_Id() {
    return page_id;
   }
   
  }

  And in your xml you can write:
  <CustomButton id="btn" name="btn" page_id="HomePage.xml" />

  You can also refer the examples provided in SwiXML tutorial.

  Bharat 
    -----Original Message-----
    From: [email protected] [mailto:[email protected]]On Behalf Of Kovári László
    Sent: Monday, September 13, 2004 8:06 PM
    To: SwixML Forum
    Subject: [Forum] How can I extend with new attributes


    Hi All,

    How can I extend an available tag with a new attribute?

    thanks,

    LK.

  http://www.patni.com
  World-Wide Partnerships. World-Class Solutions. 
  _____________________________________________________________________ 

  This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at [email protected] and delete this mail. 
  _____________________________________________________________________ 


------------------------------------------------------------------------------


  _______________________________________________
  Forum mailing list
  [email protected]
  http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com

_______________________________________________
Forum mailing list
[email protected]
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com