Package com.bitmovers.maui.components.foundation

Examples of com.bitmovers.maui.components.foundation.MButton


    return (clicked ? redirect (aRenderable) :
              doRender (aRenderable));
  }
  private String redirect (I_Renderable aRenderable)
  {
    MButton theButton = (MButton) aRenderable;
   
    if (theButton.getLink () != null)
    {
      MauiApplication theApplication = (MauiApplication) theButton.getRootParent ();
      theApplication.setURLString (theButton.getLink ());
    }
    clicked = false;
    return super.render (aRenderable);
  }
View Full Code Here


  }
 
 
  public void actionPerformed (MActionEvent aActionEvent)
  {
    MButton theButton = (MButton) aActionEvent.getSource ();
    //
    //  If this is an external URL, then setup redirection to the link.  Since this should take precedence, we must
    //  guarantee that this occurs, rather than any other of kind of redirection (like application chaining).
    //
   
    String theURL = theButton.getLink ();
    if (theURL != null && theURL.indexOf ("://") != -1)
    {
      clicked = true;
    }
  }
View Full Code Here

  // ----------------------------------------------------------------------
 
  protected String doRender(I_Renderable aRenderable)
  {
    super.doRender(aRenderable);
    MButton button = (MButton)aRenderable;
    StringBuffer returnValue = new StringBuffer();
   
    if (button.isEnabled())
    {
      // Enabled
      returnValue.append("<!-- MButton: ");
      returnValue.append(button.getComponentID());
      returnValue.append(" (start) -->\n");
     
      returnValue.append("<input type=\"submit\" name=\"");
      returnValue.append(button.getComponentID());
      returnValue.append("\" value=\"");
      returnValue.append(HTMLCompositor.encodeHTML(button.getLabel()));
      returnValue.append("\">\n");
     
      returnValue.append("<!-- MButton: ");
      returnValue.append(button.getComponentID());
      returnValue.append(" (end) -->\n");
    }
    else
    {
      // Disabled
      returnValue.append("<!-- MButton: Disabled,");
      returnValue.append(button.getComponentID());
      returnValue.append(" (start) -->\n");
     
      returnValue.append("<font color=\"#C0C0C0\">(");
      returnValue.append(HTMLCompositor.encodeHTML(button.getLabel()));
      returnValue.append(")</font>");
     
      returnValue.append("<!-- MButton: Disabled,");
      returnValue.append(button.getComponentID());
      returnValue.append(" (end) -->\n");
    }

    return returnValue.toString();
  }
View Full Code Here

    MLabel theLabel =
      new MLabel ("License level does not allow more than " +
            theAuth.getAuthorizationValue (theAuth.AUTHORIZATION_SESSIONS).
              toString () + " sessions");
    frame.add (theLabel);
    MButton theButton = new MButton ("OK");
    theButton.setLink ("http://maui.bitmovers.com");
    theButton.addActionListener (new MActionListener ()
      {
        public void actionPerformed (MActionEvent aEvent)
        {
          exitAll ();
        }
View Full Code Here

  // METHOD: getRenderTemplate
  // ----------------------------------------------------------------------
 
  protected String getRenderTemplate(I_Renderable aRenderable)
  {
    MButton theButton = (MButton)aRenderable;
    return renderTemplate [theButton.isEnabled () ? 0 : 1];
  }
View Full Code Here

  // METHOD: doRender
  // ----------------------------------------------------------------------
 
  protected String doRender(I_Renderable aRenderable)
  {
    MButton theButton = (MButton) aRenderable;
   
    if (theButton.getLink () != null)
    {
      theButton.addActionListener (this);
    }
    else
    {
      theButton.removeActionListener (this);
    }
    return super.render (aRenderable);
  }
View Full Code Here

  // METHOD: actionPerformed
  // ----------------------------------------------------------------------
 
  public void actionPerformed (MActionEvent aActionEvent)
  {
    MButton theButton = (MButton) aActionEvent.getSource ();
    //
    //  If this is an external URL, then setup redirection to the link.  Since this should take precedence, we must
    //  guarantee that this occurs, rather than any other of kind of redirection (like application chaining).
    //
   
    String theURL = theButton.getLink ();
    if (theURL != null && theURL.indexOf ("://") != -1)
    {
      MauiApplication theApplication = (MauiApplication) theButton.getRootParent ();
      theApplication.setURLString (theButton.getLink ());
    }
  }
View Full Code Here

TOP

Related Classes of com.bitmovers.maui.components.foundation.MButton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.