sam.ui.awt
Class RulingInterface

java.lang.Object
  |
  +--sam.ui.RulingInterface
        |
        +--sam.ui.awt.RulingInterface

public class RulingInterface
extends RulingInterface

AWT-based implementation of a RulingInterface


Nested Class Summary
 
Nested classes inherited from class sam.ui.RulingInterface
RulingInterface.AccessMode
 
Field Summary
 
Fields inherited from class sam.ui.RulingInterface
FILE, READABLE_DIRECTORY, READABLE_FILE, READABLE_FILE_OR_DIRECTORY, WRITABLE_DIRECTORY, WRITABLE_FILE
 
Constructor Summary
RulingInterface()
           
 
Method Summary
protected  java.lang.String choose(java.lang.String title, java.lang.String[] values)
          Prompts the user for entering a string.
protected  sam.cipher.Specification[] enterCiphers(java.lang.String title, sam.cipher.Specification[] ciphers, boolean canAddCiphers)
          Prompts the user for entering the ciphers/passwords.
protected  java.io.File enterFileOrDirectory(java.lang.String title, java.io.File suggestedValue, RulingInterface.AccessMode mode)
          Prompts the user for entering a file name.
protected  int enterInteger(java.lang.String title, int suggestedValue, int min, int max)
          Prompts the user for entering an integral number.
protected  java.lang.String enterString(java.lang.String title, java.lang.String suggestedValue)
          Prompts the user for entering a string.
 
Methods inherited from class sam.ui.RulingInterface
chooseCiphers, chooseInteger, chooseString, enterPasswords, getFileOrDirectory, getFileOrDirectory, getInteger, getString, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RulingInterface

public RulingInterface()
Method Detail

enterString

protected java.lang.String enterString(java.lang.String title,
                                       java.lang.String suggestedValue)
Description copied from class: RulingInterface
Prompts the user for entering a string. This is a basic and general-purpose method.

Specified by:
enterString in class RulingInterface
Parameters:
title - the title (or type) of the value to be chosen
suggestedValue - the suggested (yet invalid) value In current implementation this will always be null since this is the only "invalid" String

enterInteger

protected int enterInteger(java.lang.String title,
                           int suggestedValue,
                           int min,
                           int max)
Description copied from class: RulingInterface
Prompts the user for entering an integral number.

Specified by:
enterInteger in class RulingInterface
Parameters:
title - the title (or type) of the value to be chosen
suggestedValue - the suggested number to be returned if valid
min - the minimum allowed value, or Integer.MIN_VALUE
max - the maximum allowed value, or Integer.MAX_VALUE

enterFileOrDirectory

protected java.io.File enterFileOrDirectory(java.lang.String title,
                                            java.io.File suggestedValue,
                                            RulingInterface.AccessMode mode)
Description copied from class: RulingInterface
Prompts the user for entering a file name.

Specified by:
enterFileOrDirectory in class RulingInterface
Parameters:
title - the title (or type) of the directory to be chosen
suggestedValue - the suggested (yet invalid) file or directory to be returned
mode - the required access mode for this file

choose

protected java.lang.String choose(java.lang.String title,
                                  java.lang.String[] values)
Description copied from class: RulingInterface
Prompts the user for entering a string.

Specified by:
choose in class RulingInterface
Parameters:
title - the title (or type) of the value to be chosen
values - the list of allowed values

enterCiphers

protected sam.cipher.Specification[] enterCiphers(java.lang.String title,
                                                  sam.cipher.Specification[] ciphers,
                                                  boolean canAddCiphers)
Description copied from class: RulingInterface
Prompts the user for entering the ciphers/passwords.

Specified by:
enterCiphers in class RulingInterface
Parameters:
title - the non-null title
ciphers - the suggested ciphers list or null if none specified
canAddCiphers - wether the user can add/remove ciphers or simply supply passwords