FileDocCategorySizeDatePackage
ToolBean.javaAPI DocExample909Thu Apr 05 20:37:38 BST 2001None

ToolBean

public class ToolBean extends Object

Fields Summary
private Tool[]
tools
private String
state
Constructors Summary
public ToolBean()

 
Methods Summary
public Tool[]getTools(java.lang.String state)

    if (tools == null) {
      throw new IllegalStateException(
        "You must always set the toolsFile property on a ToolBean");
    }

    if (state == null) {
      return tools;
    }
    else {
      // Return only tools matching the given "state"
      List list = new LinkedList();
      for (int i = 0; i < tools.length; i++) {
        if (tools[i].getStateFlag().equalsIgnoreCase(state)) {
          list.add(tools[i]);
        }
      }
      return (Tool[]) list.toArray(new Tool[0]);
    }
  
public voidsetToolsFile(java.lang.String toolsFile)

    // No way to gain access to the application context directly from a bean
    tools = Tool.loadTools(toolsFile);