com.ldodds.foaf.thinlet
Class FriendBuilder

java.lang.Object
  |
  +--com.ldodds.foaf.thinlet.FriendBuilder

public class FriendBuilder
extends java.lang.Object

Populates the Friend table in the user interface, and uses that data to populate the model.

This code is Public Domain

Author:
ccslrd

Constructor Summary
FriendBuilder()
           
 
Method Summary
 void addFriendToTable(boolean update)
          Add/update a friend in the table.
 boolean addToArray(java.lang.String[] fields, java.lang.Object field, int index, boolean required)
          Add field data to the provided array.
 void build()
          Adds friends data, stored in the table, to the internal model
 java.lang.String getProperName(java.lang.String name)
           
 java.lang.String getText(java.lang.Object field)
           
 java.lang.String getText(java.lang.Object context, java.lang.String field)
           
 boolean isNullOrEmpty(java.lang.String value)
           
 void populateModel()
          Populate the current model with data stored in the friend table
 void removeFriendFromTable()
          Remove existing friend(s) from the table
 void showCue(java.lang.Object field)
          Show data entry hints
 void showSelected()
          Populate the data entry fields from the row currently selected in the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FriendBuilder

public FriendBuilder()
Method Detail

addFriendToTable

public void addFriendToTable(boolean update)
Add/update a friend in the table. Performs validation on the entered fields

showSelected

public void showSelected()
Populate the data entry fields from the row currently selected in the table.

addToArray

public boolean addToArray(java.lang.String[] fields,
                          java.lang.Object field,
                          int index,
                          boolean required)
Add field data to the provided array. As a side-effect will trigger showing of data entry hints if required fields aren't provided.

showCue

public void showCue(java.lang.Object field)
Show data entry hints

build

public void build()
Adds friends data, stored in the table, to the internal model

isNullOrEmpty

public boolean isNullOrEmpty(java.lang.String value)

getText

public java.lang.String getText(java.lang.Object field)

getText

public java.lang.String getText(java.lang.Object context,
                                java.lang.String field)

getProperName

public java.lang.String getProperName(java.lang.String name)

removeFriendFromTable

public void removeFriendFromTable()
Remove existing friend(s) from the table

populateModel

public void populateModel()
Populate the current model with data stored in the friend table