Package net.datacrow.core.modules

Source Code of net.datacrow.core.modules.TabModule

/******************************************************************************
*                                     __                                     *
*                              <-----/@@\----->                              *
*                             <-< <  \\//  > >->                             *
*                               <-<-\ __ /->->                               *
*                               Data /  \ Crow                               *
*                                   ^    ^                                   *
*                              info@datacrow.net                             *
*                                                                            *
*                       This file is part of Data Crow.                      *
*       Data Crow is free software; you can redistribute it and/or           *
*        modify it under the terms of the GNU General Public                 *
*       License as published by the Free Software Foundation; either         *
*              version 3 of the License, or any later version.               *
*                                                                            *
*        Data Crow is distributed in the hope that it will be useful,        *
*      but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.             *
*           See the GNU General Public License for more details.             *
*                                                                            *
*        You should have received a copy of the GNU General Public           *
*  License along with this program. If not, see http://www.gnu.org/licenses  *
*                                                                            *
******************************************************************************/

package net.datacrow.core.modules;

import net.datacrow.console.ComponentFactory;
import net.datacrow.core.DcRepository;
import net.datacrow.core.objects.DcField;
import net.datacrow.core.objects.DcObject;
import net.datacrow.core.objects.Tab;

public class TabModule extends DcPropertyModule {

    public TabModule() {
        super(DcModules._TAB, "Tab", "Tab", "Tab", "Tab", "Tabs");
    }

    @Override
    public DcObject createItem() {
        return new Tab();
    }
   
    @Override
    public boolean hasDependingModules() {
        return true;   
    }
   
    @Override
    public int getDefaultSortFieldIdx() {
        return Tab._C_ORDER;
    }

    /**
     * Initializes the default fields.
     */
    @Override
    protected void initializeFields() {
        super.initializeFields();
        addField(new DcField(Tab._C_ORDER, getIndex(), "Order",
                false, true, false, false,
                4, ComponentFactory._NUMBERFIELD, getIndex(), DcRepository.ValueTypes._LONG,
                "SortOrder"));
       
        addField(new DcField(Tab._D_MODULE, getIndex(), "Module",
                false, true, false, false,
                4, ComponentFactory._NUMBERFIELD, getIndex(), DcRepository.ValueTypes._LONG,
                "Module"));       
       
        getField(DcObject._ID).setEnabled(false);
        getField(Tab._C_ORDER).setEnabled(false);
    }     
}
TOP

Related Classes of net.datacrow.core.modules.TabModule

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.