com.sage.accpac.sm
Class FieldChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.sage.accpac.sm.FieldChangeEvent
All Implemented Interfaces:
java.io.Serializable

@Immutable
@ThreadSafe
public class FieldChangeEvent
extends java.util.EventObject

Contains the details of a field change notification.

The notification event's View can be retrieved by obtaining the event's source using getSource().

Use getFieldID() to see which field generated this event.

If this is associated with a field attribute change then call isEditable(), isEnabled() and isRequired() to see what the new values are for these dynamic attributes.

See Also:
NotificationListener, NotificationListener.fieldValueChanged(FieldChangeEvent), NotificationListener.fieldPresentationChanged(FieldChangeEvent), NotificationListener.fieldAttributesChanged(FieldChangeEvent), Serialized Form
Thread safety
Immutable and therefore thread-safe

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
FieldChangeEvent(View view, int field, boolean enabled, boolean editable, boolean required)
          constructs an instance of the FieldChangeEvent class, based upon the three given boolean attributes
FieldChangeEvent(View view, int field, int attributes)
          constructs an instance of the FieldChangeEvent class.
 
Method Summary
 int getFieldID()
          Get the view field index of the field that is changing.
 boolean isEditable()
          returns true if and only if the value of the field can be changed by the caller.
 boolean isEnabled()
          returns true if and only if the field can be meaningfully used.
 boolean isRequired()
          returns true if and only if the value must be changed interactively before the record can be inserted.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldChangeEvent

public FieldChangeEvent(View view,
                        int field,
                        int attributes)
constructs an instance of the FieldChangeEvent class. All of the attributes must be provided, not merely the changes. This version is mainly for use by the actual view notification system.

Parameters:
view - the view on which the change occurred
field - the view field index of the field that changed
attributes - the new field attributes

FieldChangeEvent

public FieldChangeEvent(View view,
                        int field,
                        boolean enabled,
                        boolean editable,
                        boolean required)
constructs an instance of the FieldChangeEvent class, based upon the three given boolean attributes

Parameters:
view - the view on which the change occurred
field - the view field index of the field that changed
enabled - the new enabled value
editable - the new editable value
required - the new required value
Method Detail

getFieldID

public int getFieldID()
Get the view field index of the field that is changing.

Returns:
the field index of the field that is changing
See Also:
ViewFields.get(int)

isEditable

public boolean isEditable()
returns true if and only if the value of the field can be changed by the caller.

If ViewField.mustCheckEditable() is true then this property can change but if it returns false then the property will remain the same.

Returns:
true if, and only if, the value of the field can be changed by the caller
See Also:
ViewField.mustCheckEditable(), ViewField.isEditable()

isEnabled

public boolean isEnabled()
returns true if and only if the field can be meaningfully used.

If this returns false most field operations are not permitted and will result in an exception being thrown.

Returns:
true if, and only if, the field can be meaningfully used.
See Also:
ViewField.isEnabled()

isRequired

public boolean isRequired()
returns true if and only if the value must be changed interactively before the record can be inserted.

Returns:
true if, and only if, the value must be changed interactively before the record can be inserted.
See Also:
ViewField.isRequired()


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