com.sas.dataselectors.filters
Class SimpleFilterListEditorModelBase

com.sas.dataselectors.filters.SimpleFilterListEditorModelBase
All Implemented Interfaces:
SimpleFilterDefinitionModelInterface, SimpleFilterListEditorModelInterface
Direct Known Subclasses:
BusinessQueryToSimpleFilterListEditorModelAdapter, DefaultAdvancedFilterModelAdapter, InformationMapToSimpleFilterListEditorModelAdapter

public class SimpleFilterListEditorModelBase
implements SimpleFilterListEditorModelInterface

The base implementation of the SimpleFilterListEditorModelInterface, this class provides the ability to construct and maintain a simple list of filter definitions to treat as a single compound filter.


Field Summary
protected  SimpleLogicListAdapterInterface _adapter
           
protected  FilterLogicListInterface _filterLogicList
           
protected  int _selectionIndex
           
protected  FilterLogicTestNodeInterface _selectionModel
           
 
Constructor Summary
SimpleFilterListEditorModelBase()
          Constructs a new list model with default properties.
SimpleFilterListEditorModelBase(SimpleLogicListAdapterInterface adapter)
          Constructs a new list model from the given logic list adapter.
 
Method Summary
 boolean addSelection(FilterLogicTestNodeInterface value)
          adds a new selection to the end of the FilterLogicList (cursor position unchanged after an add)
 boolean commitChanges()
          Commit any changes to the filter model and apply them to the native model.
 java.lang.Object getApplicationData()
          Used to retrieve application specific data.
protected  FilterLogicEditableTestNodeInterface getChangableSelectionModel(FilterLogicTestNodeInterface selectionModel)
          Returns a test node, based on the given test node, that can be modified.
 FilterItemListInterface getDataSource()
          Gets the primary model for the adapter.
 FilterLogicListInterface getFilterLogicList()
          Returns the filter logic list.
 java.lang.Object getRootFilterObject()
          Returns the native filter object.
 FilterLogicTestNodeInterface getSelection()
          Gets the selection model for the adapter.
 int getSelectionCount()
          Get the number of selectable entries in the model.
 int getSelectionCursor()
          Returns the index of the model cursor.
 void removeSelection()
          removes the current selection from the FilterLogicList (cursor position is undefined after remove)
protected  void setAdapter(SimpleLogicListAdapterInterface adapter)
          Sets the adapter used as a container for the list model.
 void setApplicationData(java.lang.Object data)
          Used to store application specific data.
 void setSelection(FilterLogicTestNodeInterface value)
          Sets the selection model for the adapter.
 void setSelectionCursor(int index)
          Move the model cursor to a new selection index.
 

Field Detail

_adapter

protected SimpleLogicListAdapterInterface _adapter

_selectionModel

protected FilterLogicTestNodeInterface _selectionModel

_filterLogicList

protected FilterLogicListInterface _filterLogicList

_selectionIndex

protected int _selectionIndex
Constructor Detail

SimpleFilterListEditorModelBase

public SimpleFilterListEditorModelBase()
Constructs a new list model with default properties.


SimpleFilterListEditorModelBase

public SimpleFilterListEditorModelBase(SimpleLogicListAdapterInterface adapter)
Constructs a new list model from the given logic list adapter.

Parameters:
adapter - the source model for the list model
Method Detail

setAdapter

protected void setAdapter(SimpleLogicListAdapterInterface adapter)
Sets the adapter used as a container for the list model.

Parameters:
adapter - the source model for the list model

getDataSource

public FilterItemListInterface getDataSource()
Gets the primary model for the adapter. (synonym of getFilterItemList)

Specified by:
getDataSource in interface SimpleFilterDefinitionModelInterface
Returns:
the data source
See Also:
SimpleFilterDefinitionModelInterface.getDataSource()

getSelection

public FilterLogicTestNodeInterface getSelection()
Gets the selection model for the adapter.

Specified by:
getSelection in interface SimpleFilterDefinitionModelInterface
Returns:
the selection model.
See Also:
SimpleFilterDefinitionModelInterface.getSelection()

setSelection

public void setSelection(FilterLogicTestNodeInterface value)
Sets the selection model for the adapter.

Specified by:
setSelection in interface SimpleFilterDefinitionModelInterface
Parameters:
value - the new selection
See Also:
SimpleFilterDefinitionModelInterface.setSelection(FilterLogicTestNodeInterface)

setApplicationData

public void setApplicationData(java.lang.Object data)
Used to store application specific data.

Specified by:
setApplicationData in interface SimpleFilterDefinitionModelInterface
Parameters:
data - to be stored with this object for application use
See Also:
SimpleFilterDefinitionModelInterface.setApplicationData(Object)

getApplicationData

public java.lang.Object getApplicationData()
Used to retrieve application specific data.

Specified by:
getApplicationData in interface SimpleFilterDefinitionModelInterface
Returns:
the user data
See Also:
SimpleFilterDefinitionModelInterface.getApplicationData()

commitChanges

public boolean commitChanges()
Commit any changes to the filter model and apply them to the native model.

Specified by:
commitChanges in interface SimpleFilterDefinitionModelInterface
Returns:
true if everything succeeded
See Also:
SimpleFilterDefinitionModelInterface.commitChanges()

getRootFilterObject

public java.lang.Object getRootFilterObject()
Returns the native filter object.

Specified by:
getRootFilterObject in interface SimpleFilterDefinitionModelInterface
Returns:
the root filter object (a single filter item or a List)

getFilterLogicList

public FilterLogicListInterface getFilterLogicList()
Returns the filter logic list. This list is a simple, flat list of the test nodes that define the current filter.

Specified by:
getFilterLogicList in interface SimpleFilterListEditorModelInterface
Returns:
the filter logic list
See Also:
SimpleFilterListEditorModelInterface.getFilterLogicList()

setSelectionCursor

public void setSelectionCursor(int index)
Move the model cursor to a new selection index.

Specified by:
setSelectionCursor in interface SimpleFilterListEditorModelInterface
Parameters:
index - the target index for the cursor
See Also:
SimpleFilterListEditorModelInterface.setSelectionCursor(int)

getSelectionCount

public int getSelectionCount()
Get the number of selectable entries in the model.

Specified by:
getSelectionCount in interface SimpleFilterListEditorModelInterface
Returns:
the number of selectable entries
See Also:
SimpleFilterListEditorModelInterface.getSelectionCursor()

getSelectionCursor

public int getSelectionCursor()
Returns the index of the model cursor.

Specified by:
getSelectionCursor in interface SimpleFilterListEditorModelInterface
Returns:
the index of the model cursor
See Also:
SimpleFilterListEditorModelInterface.getSelectionCursor()

addSelection

public boolean addSelection(FilterLogicTestNodeInterface value)
adds a new selection to the end of the FilterLogicList (cursor position unchanged after an add)

Specified by:
addSelection in interface SimpleFilterListEditorModelInterface
Parameters:
FilterLogicTestNodeInterface - logic test node values to make up the new object
Returns:
boolean true if successful
See Also:
SimpleFilterListEditorModelInterface.addSelection(FilterLogicTestNodeInterface)

removeSelection

public void removeSelection()
removes the current selection from the FilterLogicList (cursor position is undefined after remove)

Specified by:
removeSelection in interface SimpleFilterListEditorModelInterface
See Also:
SimpleFilterListEditorModelInterface.removeSelection()

getChangableSelectionModel

protected FilterLogicEditableTestNodeInterface getChangableSelectionModel(FilterLogicTestNodeInterface selectionModel)
Returns a test node, based on the given test node, that can be modified.

Parameters:
selectionModel - the test node to process
Returns:
an editable version of the given test node



Copyright © 2009 SAS Institute Inc. All Rights Reserved.