Example usage for org.springframework.beans.support MutableSortDefinition MutableSortDefinition

List of usage examples for org.springframework.beans.support MutableSortDefinition MutableSortDefinition

Introduction

In this page you can find the example usage for org.springframework.beans.support MutableSortDefinition MutableSortDefinition.

Prototype

public MutableSortDefinition(boolean toggleAscendingOnSameProperty) 

Source Link

Document

Create a new MutableSortDefinition.

Usage

From source file:de.iteratec.iteraplan.presentation.dialog.GuiSearchController.java

/**
 * Set initial columns for this dialog./*from w w  w .j  av  a2  s .  c o  m*/
 */
private void initTableState(T dialogMemory) {
    GuiContext guiContext = GuiContext.getCurrentGuiContext();
    GuiTableState tableState;

    TableActionParams params = dialogMemory.getTableActionParameter();
    if (params != null) {
        Boolean showTreeView = params.getShowTreeView();
        if (showTreeView != null) {
            dialogMemory.setTreeView(showTreeView.booleanValue());
        }

        Integer loadAllId = params.getLoadAllFrom();
        if (loadAllId != null) {
            TreeViewHelper treeViewHelper = dialogMemory.getTreeViewHelper();
            if (treeViewHelper != null) {
                treeViewHelper.loadAllFrom(loadAllId);
            }
        }
    }

    if (guiContext.getTableState(getDialogName()) != null) {
        tableState = guiContext.getTableState(getDialogName());
    } else {
        tableState = new GuiTableState();
        tableState.addColumnEntries(dialogMemory.getInitialColumnDefinitions());

        if (isBuildingBlockType()) {
            List<AttributeType> attributeTypes = attributeTypeService
                    .getAttributeTypesForTypeOfBuildingBlock(getTob(), true);
            for (AttributeType at : attributeTypes) {
                tableState.addColumnEntry(new ColumnDefinition(at, false));
            }
        }

        tableState.setSortDefinition(new MutableSortDefinition(true));
        guiContext.storeTableState(getDialogName(), tableState);
    }

    dialogMemory.setTableState(tableState);
}