webfunds.client
Class AccountBrowserImpl

java.lang.Object
  |
  +--webfunds.utils.Debug
        |
        +--webfunds.client.AccountBrowserImpl

public class AccountBrowserImpl
extends Debug
implements AccountBrowser, java.awt.event.ActionListener, CorePart


Fields inherited from class webfunds.utils.Debug
bug, debugAll, logfix
 
Constructor Summary
AccountBrowserImpl(java.io.PrintWriter bug)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 void addPlugins(PluginInfo[] plugins, WalletInterface wi)
          Add plugins to this wallet.
protected  Contract checkContract(Contract contract)
           
 void displayNewContract(ItemId id, javax.swing.tree.DefaultMutableTreeNode node)
           
 void displayNewContracts(ItemId[] ids, javax.swing.tree.DefaultMutableTreeNode node)
           
protected  java.lang.Object getBestLastNode(ItemId id)
          The last node should be a contract.
protected  Contract getContract(java.io.File f)
           
protected  Contract getContract(ItemId id)
           
protected  ItemId getItemId(java.lang.Object obj)
          The last node should be a contract, but sometimes the contract is lost, in which case, we get by with the ItemId.
 java.lang.String getType()
           
 boolean isPresent(ItemId id, javax.swing.tree.DefaultMutableTreeNode node)
           
static void main(java.lang.String[] args)
           
 javax.swing.JPopupMenu newAccountPopup()
           
 javax.swing.JPopupMenu newContractPopup()
           
 javax.swing.JPopupMenu newWalletPopup()
           
 void refreshNode(javax.swing.tree.DefaultMutableTreeNode node)
           
 void run()
           
protected  void sendAdminEvent(int code, java.lang.String reason)
           
 void setCore(Core core)
           
 void setPlugins(PluginInfo[] plugins)
          Set the plugins across the board.
 void setWallets(WalletInterface[] wallets)
           
 void startPlugins(PluginInfo[] plugins, WalletInterface wi)
          Start the plugins for this wallet only.
 java.lang.String toString()
           
 void treeClicked(java.awt.event.MouseEvent evt)
           
 void wink()
           
 
Methods inherited from class webfunds.utils.Debug
debug, debug, debug, debug, err, getDebug, logend, logmsg, logstart, logword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AccountBrowserImpl

public AccountBrowserImpl(java.io.PrintWriter bug)
Method Detail

setCore

public void setCore(Core core)
Specified by:
setCore in interface CorePart

getType

public java.lang.String getType()
Specified by:
getType in interface CorePart

wink

public void wink()

run

public void run()
Specified by:
run in interface AccountBrowser

getContract

protected Contract getContract(java.io.File f)
Returns:
A good contract, else null, and all warnings done.

getContract

protected Contract getContract(ItemId id)
Returns:
A good contract, else null, and all warnings done.

checkContract

protected Contract checkContract(Contract contract)
Returns:
A good contract, else null, and all warnings done.

isPresent

public boolean isPresent(ItemId id,
                         javax.swing.tree.DefaultMutableTreeNode node)

displayNewContract

public void displayNewContract(ItemId id,
                               javax.swing.tree.DefaultMutableTreeNode node)

displayNewContracts

public void displayNewContracts(ItemId[] ids,
                                javax.swing.tree.DefaultMutableTreeNode node)

refreshNode

public void refreshNode(javax.swing.tree.DefaultMutableTreeNode node)

sendAdminEvent

protected void sendAdminEvent(int code,
                              java.lang.String reason)

getItemId

protected ItemId getItemId(java.lang.Object obj)
The last node should be a contract, but sometimes the contract is lost, in which case, we get by with the ItemId. As the ItemId is the thing most often required, here's a handy conversion routine.

getBestLastNode

protected java.lang.Object getBestLastNode(ItemId id)
The last node should be a contract. Return the best for this.

newContractPopup

public javax.swing.JPopupMenu newContractPopup()

newAccountPopup

public javax.swing.JPopupMenu newAccountPopup()

newWalletPopup

public javax.swing.JPopupMenu newWalletPopup()

setPlugins

public void setPlugins(PluginInfo[] plugins)
Set the plugins across the board. Effects all wallets.
Specified by:
setPlugins in interface AccountBrowser

startPlugins

public void startPlugins(PluginInfo[] plugins,
                         WalletInterface wi)
Start the plugins for this wallet only. Should be called after all common plugins above are set, as the already set ones are copied. May be called multiple times, ignored after first time. A concession to extended wallets that can't figure out who called what first...
Specified by:
startPlugins in interface AccountBrowser

addPlugins

public void addPlugins(PluginInfo[] plugins,
                       WalletInterface wi)
Add plugins to this wallet. Should be called after startPlugins() above, else will crash. May be called multiple times, each call inserts a line in the menu.
Specified by:
addPlugins in interface AccountBrowser

setWallets

public void setWallets(WalletInterface[] wallets)
Specified by:
setWallets in interface AccountBrowser

treeClicked

public void treeClicked(java.awt.event.MouseEvent evt)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception