• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Entry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.swing.RowFilter.Entry的典型用法代码示例。如果您正苦于以下问题:Java Entry类的具体用法?Java Entry怎么用?Java Entry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Entry类属于javax.swing.RowFilter包,在下文中一共展示了Entry类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testSelectionWithFilterXListRemove

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
/**
 * Issue #1536-swingx: AIOOB on restoring selection with filter
 * Reopened: overfixed - the removeIndexInterval _does_ take 
 * the endIndex instead of length.
 * 
 */
@Test
public void testSelectionWithFilterXListRemove() {
    JXList table = new JXList(ascendingListModel, true);
    // set selection somewhere below the filtered (which is 0)
    int selected = 1;
    table.setSelectionInterval(selected, selected);
    // exclude rows based on identifier (here: first item
    final RowFilter filter = new RowFilters.GeneralFilter() {
        
        List excludes = Arrays.asList(0);
        @Override
        protected boolean include(
                Entry<? extends Object, ? extends Object> entry,
                int index) {
            return !excludes.contains(entry.getIdentifier());
        }
        
    };
    table.setRowFilter(filter);
    assertEquals("sanity: filtered selection", selected - 1, table.getSelectedIndex());
    // remove last row
    ascendingListModel.remove(ascendingListModel.getSize() - 1);
    assertEquals("filtered selection unchanged", selected - 1, table.getSelectedIndex());
    assertFalse(table.isSelectionEmpty());
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:32,代码来源:ListSortUITest.java


示例2: setDependantRowFilter

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
private RowFilter setDependantRowFilter(final FilterType type) {
    RowFilter<DossierTableModel, Integer> filter = new RowFilter<DossierTableModel, Integer>() {
        @Override
        public boolean include(Entry<? extends DossierTableModel, ? extends Integer> entry) {
            Dossier dos = entry.getModel().getDossier(entry.getIdentifier());
            switch (type) {
                case SALES_CLOSED:
                    return !dos.isLegacy() && dos.getCrucialDirective() == Document.Directive.NONE;
                case SALES_OPEN:
                    return !dos.isLegacy() && dos.getId() > 0 && dos.getCrucialDirective() != Document.Directive.NONE;
                case ACCOUNTANCY_CLOSED:
                    return !dos.isLegacy() && dos.getId() > 0 && dos.isClosed();
                case ACCOUNTANCY_OPEN:
                    return !dos.isLegacy() && dos.getId() > 0 && !dos.isClosed();
                case ALL:
                    return true;
                case LEGACY:
                    return dos.isLegacy();
                default:
                    return true;
            }
        }
    };
    return filter;
}
 
开发者ID:gg-net,项目名称:dwoss,代码行数:26,代码来源:DossierTableView.java


示例3: EDACCFilter

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
/**
 * Creates new form EDACCFilter. If the table has no instance of TableRowSorter a IllegalArgumentException is thrown.
 * @param parent The parent for this dialog
 * @param modal
 * @param table the table to be used for this filter
 * @param autoUpdateFilterTypes if this is set to true, the filter will updated the classes of the columns on each setVisible(true)
 */
public EDACCFilter(java.awt.Frame parent, boolean modal, JTable table, boolean autoUpdateFilterTypes) {
    this(parent, modal);
    if (!(table.getRowSorter() instanceof TableRowSorter)) {
        throw new IllegalArgumentException("Expected TableRowSorter.");
    }
    this.table = table;
    rowSorter = (TableRowSorter<? extends TableModel>) table.getRowSorter();
    final RowFilter oldRowFilter = rowSorter.getRowFilter();
    rowFilter = new RowFilter<Object, Object>() {

        @Override
        public boolean include(Entry<? extends Object, ? extends Object> entry) {
            return (oldRowFilter == null || oldRowFilter.include(entry)) && EDACCFilter.this.include(entry);
        }
    };
    rowSorter.setRowFilter(rowFilter);
    this.updateFilterTypes = autoUpdateFilterTypes;
}
 
开发者ID:EDACC,项目名称:edacc_gui,代码行数:26,代码来源:EDACCFilter.java


示例4: EDACCGenerateJobsFilter

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
/** Creates new form EDACCGenerateJobsFilter */
public EDACCGenerateJobsFilter(java.awt.Frame parent, boolean modal, JTable table, GenerateJobsTableModel model) {
    super(parent, modal);
    initComponents();

    this.table = table;
    this.model = model;
    TableRowSorter<? extends TableModel> rowSorter = (TableRowSorter<? extends TableModel>) table.getRowSorter();
    final RowFilter oldRowFilter = rowSorter.getRowFilter();
    RowFilter rowFilter = new RowFilter<Object, Object>() {

        @Override
        public boolean include(Entry<? extends Object, ? extends Object> entry) {
            return (oldRowFilter == null || oldRowFilter.include(entry)) && EDACCGenerateJobsFilter.this.include(entry);
        }
    };
    rowSorter.setRowFilter(rowFilter);
    instanceRegex = ".*";
    solverConfigRegex = ".*";
}
 
开发者ID:EDACC,项目名称:edacc_gui,代码行数:21,代码来源:EDACCGenerateJobsFilter.java


示例5: testSelectionWithFilterXListInsert

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
/**
 * Issue #1536-swingx: AIOOB on restoring selection with filter
 * This is a core issue, sneaked into ListSortUI by c&p
 * 
 */
@Test
public void testSelectionWithFilterXListInsert() {
    DefaultListModel model = new DefaultListModel();
    // a model with 3 elements is the minimum size to demonstrate
    // the bug
    int last = 2;
    for (int i = 0; i <= last; i++) {
        model.addElement(i);
    }
    JXList table = new JXList(model, true);
    // set selection to the end
    table.setSelectionInterval(last, last);
    // exclude rows based on identifier
    final RowFilter filter = new RowFilters.GeneralFilter() {
        
        List excludes = Arrays.asList(0);
        @Override
        protected boolean include(
                Entry<? extends Object, ? extends Object> entry,
                int index) {
            return !excludes.contains(entry.getIdentifier());
        }
        
    };
    table.setRowFilter(filter);
    // insertRow _before or at_ selected model index, such that
    // endIndex (in event) > 1
    model.add(2, "x");
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:35,代码来源:ListSortUITest.java


示例6: annotate

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
@Override
public RowFilter<M, I> annotate(Entry<? extends M, ? extends I> entry) {
	int resultCount = 0;

	for (RowFilter<M, I> filter : filters) {
		if (filter.include(entry)) {
			return filter;
		}
	}

	return null;
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:13,代码来源:RowAnnotator.java


示例7: include

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
@Override
public boolean include(Entry<? extends Object, ? extends Object> entry) {
    LinkedList<Integer> classIds = model.getInstanceClassIdsForRow((Integer) entry.getIdentifier());
    if (filterInstanceClasses) {
        boolean res = false;
        for (Integer id : classIds) {
            if (instanceClassIds.contains(id)) {
                res = true;
            }
        }
        if (!res) return false;
    }
    return super.include(entry);
}
 
开发者ID:EDACC,项目名称:edacc_gui,代码行数:15,代码来源:EDACCInstanceFilter.java


示例8: include

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
/**
 * Returns true iff the given entry matches the filter parameters.
 * @param entry
 * @return boolean
 */
public synchronized boolean include(Entry<? extends Object, ? extends Object> entry) {
    HashMap<Integer, Boolean> arguments = new HashMap<Integer, Boolean>();
    for (ArgumentPanel panel : filterArguments) {
        arguments.put(panel.getArgNum(), panel.getFilterInterface().include(getValueAt(entry.getIdentifier(), panel.getColumn())));
    }
    try {
        return parser.eval(expression, arguments);
    } catch (Exception ex) {
        return false;
    }
}
 
开发者ID:EDACC,项目名称:edacc_gui,代码行数:17,代码来源:EDACCFilter.java


示例9: include

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
public boolean include(Entry<? extends Object, ? extends Object> entry) {
    Object value = entry.getValue(0);
    String val;
    if (value instanceof String) {
        val = (String) value;
    } else {
        val = value.toString();
    }
    try {
        return val.matches(instanceRegex);
    } catch (Exception e) {
        return false;
    }
}
 
开发者ID:EDACC,项目名称:edacc_gui,代码行数:15,代码来源:EDACCGenerateJobsFilter.java


示例10: include

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
@Override
public boolean include(Entry<? extends InstanceDupErrorTableModel, ? extends Integer> entry) {
    ArrayList<Instance> instances = model.getRelatedErrorInstance((Integer) entry.getIdentifier());
    if (instances == null) {
        return false;
    }

    if (instances.contains(selectedInstance)) {
        return true;
    }
    return false;
}
 
开发者ID:EDACC,项目名称:edacc_gui,代码行数:13,代码来源:InstanceDupErrorFilter.java


示例11: include

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
@Override
public boolean include(Entry<? extends HistoryTableModel, ? extends Integer> entry) {
    return ((String) entry.getModel().getValueAt(entry.getIdentifier(), referenzColumn)).equals(referenz);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:SQLHistoryPanel.java


示例12: include

import javax.swing.RowFilter.Entry; //导入依赖的package包/类
@Override
public boolean include(Entry<? extends SolverConfigurationTableModel, ? extends Integer> entry) {
    SolverConfiguration sc = entry.getModel().getSolverConfigurationAt(entry.getIdentifier());
    return includeExperiments.contains(sc.getExperiment_id()) || (!excludeExperiments.contains(sc.getExperiment_id()) && solverBinaryIds.contains(sc.getSolverBinary().getId()));
}
 
开发者ID:EDACC,项目名称:edacc_gui,代码行数:6,代码来源:SolverConfigurationTableRowFilter.java



注:本文中的javax.swing.RowFilter.Entry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Source类代码示例发布时间:2022-05-22
下一篇:
Java Accessors类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap