本文整理汇总了Java中ca.odell.glazedlists.EventList.size方法的典型用法代码示例。如果您正苦于以下问题:Java EventList.size方法的具体用法?Java EventList.size怎么用?Java EventList.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca.odell.glazedlists.EventList
的用法示例。
在下文中一共展示了EventList.size方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updatePanel
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
private void updatePanel() {
EventList<Message> list = TmmUIMessageCollector.instance.getMessages();
list.getReadWriteLock().readLock().lock();
try {
for (int i = 0; i < list.size(); i++) {
Message message = list.get(i);
if (!messageMap.containsKey(message)) {
MessagePanel panel = new MessagePanel(message);
messageMap.put(message, panel);
messagesPanel.add(panel);
}
}
messagesPanel.revalidate();
messagesPanel.repaint();
}
finally {
list.getReadWriteLock().readLock().unlock();
}
}
示例2: updatePreview
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
private void updatePreview(final BibEntry toShow, int repeats) {
if (workingOnPreview) {
if (repeats > 0) {
return; // We've already waited once. Give up on this selection.
}
Timer t = new Timer(50, actionEvent -> updatePreview(toShow, 1));
t.setRepeats(false);
t.start();
return;
}
EventList<BibEntry> list = table.getSelected();
// Check if the entry to preview is still selected:
if ((list.size() != 1) || (list.get(0) != toShow)) {
return;
}
workingOnPreview = true;
SwingUtilities.invokeLater(() -> {
panel.showPreview(toShow);
workingOnPreview = false;
});
}
示例3: size
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
public static <E> int size(EventList<E> eventList) {
try {
eventList.getReadWriteLock().readLock().lock();
return eventList.size();
} finally {
eventList.getReadWriteLock().readLock().unlock();
}
}
示例4: findEntry
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
public int findEntry(BibEntry entry) {
EventList<BibEntry> tableRows = model.getTableRows();
for (int row = 0; row < tableRows.size(); row++) {
BibEntry bibEntry = tableRows.get(row);
if (entry == bibEntry) { // NOPMD (equals doesn't recognise duplicates)
return row;
}
}
return -1;
}
示例5: addCoreDataObject
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
private <T extends AbstractNamedObject<T>> void addCoreDataObject(final EventList<T> objectsList, final T object,
final JTable table) {
checkAndResetActiveCoreDataObject();
log.debug("Adding a new item...");
objectsList.add(object);
activeCoreDataObject = object;
int index = objectsList.size() - 1;
if (index == -1) {
index = table.getSelectedRow();
}
table.changeSelection(index, 0, false, false);
}
示例6: addSafe
import ca.odell.glazedlists.EventList; //导入方法依赖的package包/类
private void addSafe(final EventList<E> eventList, List<E> list, int index) {
if (index >= 0 && index < eventList.size()) {
list.add(eventList.get(index));
}
}