Examples of MButton


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

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

  }
 
 
  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

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

  // ----------------------------------------------------------------------
 
  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

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

    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

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

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

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

  // 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

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

  // 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

Examples of net.sourceforge.marathon.component.MButton

            throw new RuntimeException("tried to add already existing component to TestDialog");
        }
    }

    public MButton getMButton() {
        return new MButton(button, button.getName(), null, WindowMonitor.getInstance());
    }
View Full Code Here

Examples of net.sourceforge.marathon.component.MButton

    public void tearDown() throws Exception {
    }

    @Test
    public void testRecordWindowTagOnClick() {
        MButton button = getMButton("dialog1", "button1");
        recorder.record(click(button, 1));
        recorder.record(click(button, 2));
        AWTSync.sync();
        assertScriptEquals(i1 + "if window('dialog1'):\n" + i2 + "click('button1')\n" + i2 + "doubleclick('button1')\n" + i1
                + "close()\n");
View Full Code Here

Examples of net.sourceforge.marathon.component.MButton

        };
    }

    @Test
    public void testRecordWindowTagOnSelect() {
        MButton button = new MButton(new JButton("text"), "button1", null, WindowMonitor.getInstance());
        WindowId windowId = new WindowIdMock("dialog1");
        button.setWindowId(windowId);
        recorder.record(new MockRecordedSelect(button.getComponentId(), windowId, "text"));
        AWTSync.sync();
        assertScriptEquals(i1 + "if window('dialog1'):\n" + i2 + "select('button1', 'text')\n" + i1 + "close()\n");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.