Package limelight.ui.model

Source Code of limelight.ui.model.TempTextAccessor

//- Copyright © 2008-2011 8th Light, Inc. All Rights Reserved.
//- Limelight and all included source files are distributed under terms of the MIT License.

package limelight.ui.model;

import limelight.LimelightException;

public class TempTextAccessor implements TextAccessor
{
  private static TextAccessor instance;

  static
  {
    instance = new TempTextAccessor();
  }

  public static TextAccessor instance()
  {
    return instance;
  }

  private TempTextAccessor()
  {
  }

  public void setText(String text, Prop panel) throws LimelightException
  {
    if(text == null || text.length() == 0)
      return;
    if(panel.getTextAccessor() != this)
      throw new LimelightException("You may only set text on empty props.");
    TextPanel textPanel = new TextPanel(panel);
    panel.add(textPanel);
    panel.sterilize();
    panel.setTextAccessor(textPanel);
    textPanel.setText(text, panel);
  }

  public String getText()
  {
    return "";
  }

  public void markAsDirty()
  {
  }

  public void markAsNeedingLayout()
  {
  }

  public boolean hasFocus()
  {
    return false;
  }
}
TOP

Related Classes of limelight.ui.model.TempTextAccessor

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.