com.sage.accpac.sm
Interface ViewFieldPresentationList


public interface ViewFieldPresentationList

The ViewFieldPresentationList interface corresponds to the list of values that a field may take.

Normally you obtain such a list by calling ViewField.getPresentationList() on a field.

Alternatively a subclass of ViewField may want to use the ViewFieldPresentationListFactory to create one to return.


Method Summary
 int getCount()
          Gets the number of presentation items defined in the list
 java.lang.String getFieldString()
          Gets the display string defined for the current field value
 ViewField getParent()
          Gets the ViewField object to which the presentation list belongs
 java.lang.String getPredefinedString(int index)
          Gets the predefined display string of a presentation item according to the zero-base index in the list.
 java.lang.Object getPredefinedValue(int index)
          Gets the predefined value of a presentation item according to the zero-based index in the list.
 void refresh()
          Refreshes the presentation list from the underlying view.
 int setFieldValue(int index)
          Sets the current field value as the predefined value of the specified presentation item.
 

Method Detail

getCount

int getCount()
Gets the number of presentation items defined in the list

Returns:
the number of items in the list

getFieldString

java.lang.String getFieldString()
Gets the display string defined for the current field value

Returns:
the value that should be displayed to the user for the current value of the field

getParent

ViewField getParent()
Gets the ViewField object to which the presentation list belongs

Returns:
the ViewField to which the list belongs

getPredefinedString

java.lang.String getPredefinedString(int index)
Gets the predefined display string of a presentation item according to the zero-base index in the list.

Parameters:
index - the zero-based index that identifies the presentation item
Returns:
the string to display to the user for the given entry

getPredefinedValue

java.lang.Object getPredefinedValue(int index)
Gets the predefined value of a presentation item according to the zero-based index in the list.

Parameters:
index - the zero-based index that identifies the presentation item
Returns:
the value to be passed to Accpac for the given entry

refresh

void refresh()
Refreshes the presentation list from the underlying view. Applications should call this method to refresh the list if the field attributes indicate that the presentation information may change. Refreshing the list ensures it retrieves the most current presentation list as of the current view state.

Throws:
java.lang.UnsupportedOperationException - if the list does not support this.

setFieldValue

int setFieldValue(int index)
Sets the current field value as the predefined value of the specified presentation item. The presentation item is identified by the zero-based index in the presentation list.

This is equivalent to getParent().setValue(getPredefinedValue(index),true)

Parameters:
index - The zero-based index that identifies the presentation item in the list.
Returns:
the status of the call.
Throws:
ViewException - if an error occurred other than those permitted errors listed in the return values. Call ViewException.getReason() to get the error code.


Copyright © 2011 Sage Software, Inc. All rights reserved.