webfunds.client.plugins
Class Plugin

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--webfunds.client.plugins.Plugin
Direct Known Subclasses:
ContractBrowser, PaymentFrame, SignContractWizard, SimpleDepositFrame, SimplePaymentFrame, UpgradesManager

public abstract class Plugin
extends java.lang.Thread
implements java.beans.PropertyChangeListener, Diagnostics


Field Summary
static int ACCOUNTMODE
           
protected  java.io.PrintWriter bug
          Diagnostics.
static int CONTRACTMODE
           
protected  ChangeContractStore cs
           
protected  java.lang.String fix
           
static int GENERALMODE
           
protected  java.lang.String name
           
protected  PluginManager pm
           
static java.lang.String spec
           
protected  Store store
           
protected  UInterface ui
           
protected static java.lang.String unsup
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Plugin()
           
 
Method Summary
 void debug(java.io.PrintWriter pw, java.lang.String s)
           
 java.io.PrintWriter err()
          Do stack trace prints to err(), should always return something.
 java.lang.String getAccountAction()
          Account action causes the account popup to get a button, and will result in init(wallet, ac) being called, below.
 java.lang.String getContractAction()
          Contract action causes the subaccount popup to get a button, and will result in init(wallet, ac, id) being called, below.
 java.io.PrintWriter getDebug()
          Returns a debug writer, if any is set.
 java.lang.String getGeneralAction()
          Supply one of these, each returning the name of the displayed button.
abstract  java.lang.String getPluginName()
          The name of the plugin, for titles and such like.
 void init()
          One of these is called depending on the location of the click in the hierarchy.
 void init(WalletInterface wi, AccountInfo info)
           
 void init(WalletInterface wi, AccountInfo info, ItemId id)
           
 void logmsg(java.lang.String s)
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void setContractStore(ChangeContractStore contractstore)
           
 void setPluginManager(PluginManager plugm)
           
 void setStore(Store store)
           
 void setUInterface(UInterface uinterface)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GENERALMODE

public static final int GENERALMODE

CONTRACTMODE

public static final int CONTRACTMODE

ACCOUNTMODE

public static final int ACCOUNTMODE

spec

public static final java.lang.String spec

name

protected java.lang.String name

pm

protected PluginManager pm

ui

protected UInterface ui

cs

protected ChangeContractStore cs

store

protected Store store

bug

protected java.io.PrintWriter bug
Diagnostics. We need a proper diags module. PM may in future provide individual files for Plugin debug purposes.

fix

protected java.lang.String fix

unsup

protected static final java.lang.String unsup
Constructor Detail

Plugin

public Plugin()
Method Detail

debug

public void debug(java.io.PrintWriter pw,
                  java.lang.String s)

logmsg

public void logmsg(java.lang.String s)
Specified by:
logmsg in interface Diagnostics

getDebug

public java.io.PrintWriter getDebug()
Description copied from interface: Diagnostics
Returns a debug writer, if any is set.
Specified by:
getDebug in interface Diagnostics

err

public java.io.PrintWriter err()
Description copied from interface: Diagnostics
Do stack trace prints to err(), should always return something.
Specified by:
err in interface Diagnostics

getPluginName

public abstract java.lang.String getPluginName()
The name of the plugin, for titles and such like.

getGeneralAction

public java.lang.String getGeneralAction()
Supply one of these, each returning the name of the displayed button. Also supply applicable call to init, below. General action is on the top button bar, and will result in init() being called, below.

getAccountAction

public java.lang.String getAccountAction()
Account action causes the account popup to get a button, and will result in init(wallet, ac) being called, below.

getContractAction

public java.lang.String getContractAction()
Contract action causes the subaccount popup to get a button, and will result in init(wallet, ac, id) being called, below.

init

public void init()
          throws ModeNotSupportedException
One of these is called depending on the location of the click in the hierarchy. You should supply at least one of them, according to which get*Action() calls are present, above. init with no arguments is called if a general button is clicked. init(wallet, ac) is called if an account popup button is clicked. init(wallet, ac, contract) if a subaccount popup button is clicked.

init

public void init(WalletInterface wi,
                 AccountInfo info)
          throws ModeNotSupportedException

init

public void init(WalletInterface wi,
                 AccountInfo info,
                 ItemId id)
          throws ModeNotSupportedException

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

setPluginManager

public void setPluginManager(PluginManager plugm)

setContractStore

public void setContractStore(ChangeContractStore contractstore)

setUInterface

public void setUInterface(UInterface uinterface)

setStore

public void setStore(Store store)