當前位置: 首頁>>代碼示例>>Java>>正文


Java TableFilterHeader類代碼示例

本文整理匯總了Java中net.coderazzi.filters.gui.TableFilterHeader的典型用法代碼示例。如果您正苦於以下問題:Java TableFilterHeader類的具體用法?Java TableFilterHeader怎麽用?Java TableFilterHeader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TableFilterHeader類屬於net.coderazzi.filters.gui包,在下文中一共展示了TableFilterHeader類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: tableFilterUpdated

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
public void tableFilterUpdated(TableFilterHeader header, final IFilterEditor editor, TableColumn tableColumn) {
    Object content = editor.getContent();
    Field field = fields.get(tableColumn.getModelIndex());
    FilterFactory factory = filterManager.getFilterFactory(context, query.getEntityType(), field, true);
    if(AnyChoice.choose.equals(content)) {
        // restore the previous editor value (we record it on every change)
        // this prevents double-popup that started to appear after instant filtering was turned off
        editor.setContent(lastValues.get(field.getName()));

        String value = query.getValue(field.getName());
        FilterChooser popup = factory.createChooser(value);
        popup.show();
        if(query.setValue(field.getName(), popup.getSelectedValue())) {
            fireChangeEvent();
        }
        setContent(factory, query.getEntityType(), field.getName(), popup.getSelectedValue(), editor);
    } else {
        if(!content.toString().isEmpty() && factory != null && factory.getCustomChoices() == null) {
            // ignore, it's the callback from resolver that resolved the filter display value
        } else {
            if(query.setValue(field.getName(), content.toString())) {
                fireChangeEvent();
            }
        }
    }
}
 
開發者ID:janotav,項目名稱:ali-idea-plugin,代碼行數:27,代碼來源:FilterObserver.java

示例2: tableFilterEditorCreated

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
public void tableFilterEditorCreated(TableFilterHeader header, IFilterEditor editor, TableColumn tableColumn) {
    Field field = fields.get(tableColumn.getModelIndex());
    if(field == null || !field.isCanFilter()) {
        editor.setEditable(false);
        editor.setUserInteractionEnabled(false);
    } else {
        boolean chooser = false;
        FilterFactory filterFactory = filterManager.getFilterFactory(context, query.getEntityType(), field, true);
        if(filterFactory != null) {
            List<String> customChoices = filterFactory.getCustomChoices();
            if(customChoices != null) {
                setCustomChoices(editor, customChoices);
            } else {
                chooser = true;
            }
        } else {
            updateCustomChoices(query.getEntityType(), field, editor);
        }
        if(chooser) {
            editor.setEditable(false);
            HashSet<CustomChoice> set = new HashSet<CustomChoice>();
            set.add(AnyChoice.choose);
            editor.setCustomChoices(set);
        }
        setContent(filterFactory, query.getEntityType(), field.getName(), query.getValue(field.getName()), editor);
    }
}
 
開發者ID:janotav,項目名稱:ali-idea-plugin,代碼行數:28,代碼來源:FilterObserver.java

示例3: createFilterTable

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
protected JPanel createFilterTable(final E query, final Metadata metadata) {
    final EntityFilterTableModel<E> model = new EntityFilterTableModel<E>(project, metadata, query, hiddenFields);

    JBTable table = new JBTable() {
        public TableCellEditor getCellEditor(int row, int col) {
            int modelRow = convertRowIndexToModel(row);
            Field field = model.getFields().get(modelRow);
            FilterFactory factory = fieldManager.getFilterFactory(new Context<E>(query), entityType, field, true);
            if(factory != null) {
                if(factory.getCustomChoices() == null) {
                    return new ReferenceCellEditor(factory, model);
                } else {
                    return new LookupCellEditor(factory.getCustomChoices(), false);
                }
            } else if(field.getListId() != null) {
                List<String> list = project.getComponent(ProjectListService.class).getProjectList(entityType, field);
                return new LookupCellEditor(list, true);
            } else {
                return super.getCellEditor(row, col);
            }
        }
    };
    table.setRowSelectionAllowed(false);
    table.setCellSelectionEnabled(true);
    table.setModel(model);
    TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(model);
    table.setRowSorter(sorter);
    new TableFilterHeader(table);
    model.addTableModelListener(new TableModelListener() {
        public void tableChanged(TableModelEvent tableModelEvent) {
            queryModel.fireFilterUpdated(true);
        }
    });
    sorter.setSortKeys(Arrays.asList(new RowSorter.SortKey(0, SortOrder.ASCENDING)));
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new JBScrollPane(table), BorderLayout.CENTER);
    return panel;
}
 
開發者ID:janotav,項目名稱:ali-idea-plugin,代碼行數:39,代碼來源:EntityFilterDialog.java

示例4: tableFilterUpdated

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
@Override
public void tableFilterUpdated(TableFilterHeader tableFilterHeader, IFilterEditor iFilterEditor, TableColumn tableColumn) {
    String filter = iFilterEditor.getContent().toString();
    if(!filter.isEmpty() && !filter.endsWith("*")) {
        // enforce prefix semantics to remain compatible with instant search that is used when all items fit into the first (filter-less) request
        iFilterEditor.setContent(filter + "*");
    } else {
        load(false, filter);
    }
}
 
開發者ID:janotav,項目名稱:ali-idea-plugin,代碼行數:11,代碼來源:MultipleItemsDialog.java

示例5: requestPropertyFilterFocus

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
private void requestPropertyFilterFocus(TableFilterHeader header) {
    IFilterEditor editor = header.getFilterEditor(model.getColumnCount() - 1);
    if(editor instanceof JComponent) {
        if(((JComponent) editor).getComponentCount() == 2) {
            ((JComponent) editor).getComponent(1).requestFocus();
        }
    }
}
 
開發者ID:janotav,項目名稱:ali-idea-plugin,代碼行數:9,代碼來源:MultipleItemsDialog.java

示例6: tableFilterUpdated

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
@Override
public void tableFilterUpdated(TableFilterHeader tableFilterHeader, IFilterEditor iFilterEditor, TableColumn tableColumn) {
    String filter = iFilterEditor.getContent().toString();
    if(!filter.endsWith("*")) {
        // enforce prefix semantics to remain compatible with instant search that is used when all items fit into the first (filter-less) request
        iFilterEditor.setContent(filter + "*");
    } else {
        executeQuery(false, filter);
    }
}
 
開發者ID:janotav,項目名稱:ali-idea-plugin,代碼行數:11,代碼來源:TableFilterDialog.java

示例7: init

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
private void init()
{
    setLayout(new MigLayout("insets 0 0 0 0",
        "[grow,fill]",
        "[grow,fill]"));

    //System Configuration View and Editor
    mAliasTable = new JTable(mAliasModel);
    mAliasTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    mAliasTable.getSelectionModel().addListSelectionListener(this);
    mAliasTable.setAutoCreateRowSorter(true);

    mAliasTable.getColumnModel().getColumn(AliasModel.COLUMN_COLOR)
        .setCellRenderer(new ColorCellRenderer());

    mAliasTable.getColumnModel().getColumn(AliasModel.COLUMN_ICON)
        .setCellRenderer(mIconCellRenderer);

    mTableFilterHeader = new TableFilterHeader(mAliasTable, AutoChoices.ENABLED);
    mTableFilterHeader.setFilterOnUpdates(true);

    JScrollPane tableScroller = new JScrollPane(mAliasTable);

    JPanel buttonsPanel = new JPanel();

    buttonsPanel.setLayout(
        new MigLayout("insets 0 0 0 0", "[grow,fill][grow,fill][grow,fill]", "[]"));

    mNewButton.addActionListener(this);
    mNewButton.setToolTipText("Adds a new alias");
    buttonsPanel.add(mNewButton);

    mCopyButton.addActionListener(this);
    mCopyButton.setEnabled(false);
    mCopyButton.setToolTipText("Creates a copy of the currently selected alias and adds it");
    buttonsPanel.add(mCopyButton);

    mDeleteButton.addActionListener(this);
    mDeleteButton.setEnabled(false);
    mDeleteButton.setToolTipText("Deletes the currently selected alias");
    buttonsPanel.add(mDeleteButton);

    JPanel listAndButtonsPanel = new JPanel();

    listAndButtonsPanel.setLayout(
        new MigLayout("insets 0 0 0 0", "[grow,fill]", "[grow,fill][]"));

    listAndButtonsPanel.add(tableScroller, "wrap");
    listAndButtonsPanel.add(buttonsPanel);

    mSplitPane = new JideSplitPane(JideSplitPane.HORIZONTAL_SPLIT);
    mSplitPane.setDividerSize(5);
    mSplitPane.setShowGripper(true);
    mSplitPane.add(listAndButtonsPanel);
    mSplitPane.add(mAliasEditor);

    add(mSplitPane);
}
 
開發者ID:DSheirer,項目名稱:sdrtrunk,代碼行數:59,代碼來源:AliasController.java

示例8: init

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
private void init()
{
   	setLayout( new MigLayout( "", "[grow,fill]", "[grow,fill]") );

	//System Configuration View and Editor
   	mChannelTable = new JTable( mChannelModel );
   	mChannelTable.setDefaultRenderer( String.class, new ChannelTableCellRenderer() );
   	mChannelTable.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
   	mChannelTable.getSelectionModel().addListSelectionListener( this );
   	mChannelTable.setAutoCreateRowSorter( true );
   	
   	mTableFilterHeader = new TableFilterHeader( mChannelTable, AutoChoices.ENABLED );
   	mTableFilterHeader.setFilterOnUpdates( true );
   	
   	JScrollPane channelScroller = new JScrollPane( mChannelTable );

   	JPanel buttonsPanel = new JPanel();
   	
   	buttonsPanel.setLayout( 
		new MigLayout( "insets 0 0 0 0", "[grow,fill][grow,fill][grow,fill]", "[]") );

   	mNewChannelButton.addActionListener( this );
   	mNewChannelButton.setToolTipText( "Create a new channel configuration" );
   	buttonsPanel.add( mNewChannelButton );
   	
   	mCopyChannelButton.addActionListener( this );
   	mCopyChannelButton.setEnabled( false );
   	mCopyChannelButton.setToolTipText( "Create a copy of the currently selected channel configuration" );
   	buttonsPanel.add( mCopyChannelButton );

   	mDeleteChannelButton.addActionListener( this );
   	mDeleteChannelButton.setEnabled( false );
   	mDeleteChannelButton.setToolTipText( "Delete the currently selected channel configuration" );
   	buttonsPanel.add( mDeleteChannelButton );
   	
   	JPanel listAndButtonsPanel = new JPanel();

   	listAndButtonsPanel.setLayout( 
		new MigLayout( "insets 0 0 0 0", "[grow,fill]", "[grow,fill][]") );

   	listAndButtonsPanel.add( channelScroller, "wrap" );
   	listAndButtonsPanel.add( buttonsPanel );
	
	JideSplitPane splitPane = new JideSplitPane( JideSplitPane.VERTICAL_SPLIT );
	splitPane.setDividerSize( 5 );
	splitPane.setShowGripper( true );

	//Shrink this guy so that he'll eventually be expanded to the scroller preferred size
	listAndButtonsPanel.setPreferredSize( new Dimension( 10, 10 ) );

	//Attempt to get a 60:40 vertical sizing preference
	JScrollPane listScroller = new JScrollPane( listAndButtonsPanel );
	listScroller.setPreferredSize( new Dimension( 800, 58 ) );
	
	JScrollPane editorScroller = new JScrollPane( mEditor );
	editorScroller.setPreferredSize( new Dimension( 800, 42 ) );

	splitPane.add( listScroller );
	splitPane.add( editorScroller );

	add( splitPane );
}
 
開發者ID:DSheirer,項目名稱:sdrtrunk,代碼行數:63,代碼來源:ChannelController.java

示例9: tableFilterEditorExcluded

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
public void tableFilterEditorExcluded(TableFilterHeader header, IFilterEditor editor, TableColumn tableColumn) {
}
 
開發者ID:janotav,項目名稱:ali-idea-plugin,代碼行數:3,代碼來源:FilterObserver.java

示例10: tableFilterEditorCreated

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
@Override
public void tableFilterEditorCreated(TableFilterHeader tableFilterHeader, IFilterEditor iFilterEditor, TableColumn tableColumn) {
}
 
開發者ID:janotav,項目名稱:ali-idea-plugin,代碼行數:4,代碼來源:MultipleItemsDialog.java

示例11: tableFilterEditorExcluded

import net.coderazzi.filters.gui.TableFilterHeader; //導入依賴的package包/類
@Override
public void tableFilterEditorExcluded(TableFilterHeader tableFilterHeader, IFilterEditor iFilterEditor, TableColumn tableColumn) {
}
 
開發者ID:janotav,項目名稱:ali-idea-plugin,代碼行數:4,代碼來源:MultipleItemsDialog.java


注:本文中的net.coderazzi.filters.gui.TableFilterHeader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。