FilterColumnEditPanel.java :  » HTTP » sonav » org » jminor » sonav » beans » ui » Java Open Source

Java Open Source » HTTP » sonav 
sonav » org » jminor » sonav » beans » ui » FilterColumnEditPanel.java
/*
 * Copyright (c) 2010 Bjrn Darri Sigursson
 *
 * This file is part of Sonav.
 *
 * Sonav 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 (at your option) any later version.
 *
 * This program 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 org.jminor.sonav.beans.ui;

import org.jminor.common.ui.UiUtil;
import org.jminor.common.ui.layout.FlexibleGridLayout;
import org.jminor.framework.client.model.EntityEditModel;
import org.jminor.framework.client.ui.EntityEditPanel;
import org.jminor.sonav.domain.Sonav;

import javax.swing.JTextField;

/**
 * An edit panel for Filter Columns.
 */
public final class FilterColumnEditPanel extends EntityEditPanel {

  /**
   * Instantiates a new FilterColumnEditPanel.
   * @param editModel the edit model to base this edit panel on.
   */
  public FilterColumnEditPanel(final EntityEditModel editModel) {
    super(editModel);
  }

  /** {@inheritDoc} */
  protected void initializeUI() {
    setInitialFocusComponentKey(Sonav.FILTER_COLUMNS_FILTER_ID_FK);

    createEntityComboBox(Sonav.FILTER_COLUMNS_FILTER_ID_FK);
    final JTextField txtFamily = createTextField(Sonav.FILTER_COLUMNS_FAMILY);
    txtFamily.setColumns(18);
    final JTextField txtKee = createTextField(Sonav.FILTER_COLUMNS_KEE);
    UiUtil.makeLowerCase(txtKee);
    txtKee.setColumns(18);
    createValueListComboBox(Sonav.FILTER_COLUMNS_SORT_DIRECTION);
    final JTextField txtIndex = createTextField(Sonav.FILTER_COLUMNS_ORDER_INDEX);
    txtIndex.setColumns(18);

    setLayout(new FlexibleGridLayout(5, 1, 5, 5, true, false)
            .setFixedRowHeight(UiUtil.getPreferredTextFieldHeight() * 2));

    addPropertyPanel(Sonav.FILTER_COLUMNS_FILTER_ID_FK);
    addPropertyPanel(Sonav.FILTER_COLUMNS_FAMILY);
    addPropertyPanel(Sonav.FILTER_COLUMNS_KEE);
    addPropertyPanel(Sonav.FILTER_COLUMNS_SORT_DIRECTION);
    addPropertyPanel(Sonav.FILTER_COLUMNS_ORDER_INDEX);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.