njrzdevil | 19 May 2013 21:21
Picon
Favicon

Retrieving selected AutoComplete Object

I have a setback in using GlazedLists within my program and would love
your assistance in solving this (probably simple) problem.

I'm using an autocomplete text box:
AutoCompleteSupport support = AutoCompleteSupport.install(
			comboBox, dataCenter.createCommands());
		
BasicEventList<Command> is what is used, and Command
contains both a String and unique ID #.

Essentially, right now I have the code working such that when the
user presses enter, I look at the text inside the text box after an
ActionEvent 
via:

((JTextField) comboBox.getEditor().getEditorComponent()).getText();
	
The problem with this is that I could have two Commands, both with the
same name (which is the toString) but different unique ID's.

Visually, I could overcome this via color coding, but functionally, I
cannot determine the difference as the Strings are the same. 

Essentially what I'm asking is, Is there any way that I can see which
Command (Object) was selected on ActionEvent? As opposed to just the
String?

Holger Brands | 21 May 2013 22:38

Re: JXTable: viewport not repainted after clearing the eventList

Hi,

sorry for the long delay.
I found out that the problem occurs when the property "fillsViewportHeight" of the table is set to true.
Whereas the default value is true for JXTable, it's false for a JTable.
As a workaround you can set this property to false:
myJXTable.setFillsViewportHeight(false);

I can reproduce the issue with a normal JTable and Glazed Lists on JDK 1.6 when setting this property to true:
myJTable.setFillsViewportHeight(true);

The cause of this problem is the known mismatch between ListEvents and TableModelEvents.
A ListEvent can represent more than one block of events, for example multiple deletions at different indexes.
Each block is translated to one TableModelEvent, so multiple TableModelEvents could be generated.
In response to a TableModelEvent, the table uses the row count of the model to determine the rectangle that needs to be repainted.
The problem is, that the model returns the row count representing the state after processing the whole ListEvent
and not the row count representing the state after processing the current TableModelEvent.
So a wrong row count is used to calculate the dirty region that needs to be repainted.
That seems to be true for both JTable and JXTable.
After handling the events, when the property "fillsViewportHeight" is false, the viewport layouts the container with the preferred size of the table,
so a "correct" repaint happens after all.
When the property "fillsViewportHeight" is true, this last repaint doesn't happen anymore,
because JTable#getScrollableTracksViewportHeight() returns true (and the real preferred size of the table isn't used).

I don't have a better solution right now.
As an alternative you could try to use the EventJXTableModel.
If the ListEvent contains multiple blocks, it fires a special data changed TableModelEvent instead of multiple TableModelEvents,
indicating that all row data has changed.
Note, that such a data changed TableModelEvent can lead to a loss of the table selection.

I'm thinking about using EventJXTableModel as default model in JXTableSupport.
But because this issue can also occur with a JTable, we need to find a better solution...

Hope this helps,
Holger

2013/3/20 Holger Brands <holger.brands <at> googlemail.com>
Yes, I was able to reproduce the issue.
But I didn't have the time to debug the issue yet.
I hope to find some time in April again...

Sorry for the delay,
Holger

2013/3/20 davide.cavestro <davide.cavestro <at> gmail.com>

hbrands wrote
> Until now I'm not able to reproduce this in a pure Java app.
> Do you have a Java example that demonstrates this issue?

Did you reproduce it with the sources I sent some days ago?
Please tell me if you need other info.

Cheers
Davide



--
View this message in context: http://glazedlists.1045722.n5.nabble.com/JXTable-viewport-not-repainted-after-clearing-the-eventList-tp5709890p5709900.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


Avenue Network Services | 15 Jan 2012 03:54

ObservableElementList not consistently updating in JTable

Hi guys,

                Could I please get some assistance in looking at something. My application is relatively complex but I’m more than happy to put a test case togther. I’m wondering if someone could point out to me what Im doing wrong.

My problem is that the display of a Bean in the JTable is not updated until I move the selection off the row containing the bean or do something else to trigger a repaint.

 

I have a chain of eventlists set up as follows:

 

protected static EventList<Invoice> unoballinvoices = GlazedLists.threadSafeList(new BasicEventList<Invoice>());

private static ObservableElementList.Connector<Invoice> InvoiceConnector = GlazedLists.beanConnector(Invoice.class);

private static EventList<Invoice> allinvoices = new ObservableElementList<Invoice>(unoballinvoices, InvoiceConnector);

private SortedList<Invoice> sortedInvoices = new SortedList<Invoice>(allinvoices, new InvoiceComparator());

private FilterList<Invoice> filteredInvoices = new FilterList(sortedInvoices, componenteditor);

 

My JTable looks pretty much like this.

EventTableModel invoicesTableModel = new EventTableModel(filteredInvoices, new AllInvoicesTableFormat());

JTable AllInvoicesTable = new JTable(invoicesTableModel);

invoiceEventSelectionModel = new EventSelectionModel(filteredInvoices);

AllInvoicesTable.setSelectionModel(invoiceEventSelectionModel);

 

Kind Regards

Ed Murray
--

www.avenuedesign.net

THIS MESSAGE CONTAINS CONFIDENTIAL INFORMATION AND IS INTENDED FOR THE ADDRESSED RECIPIENT(S) ONLY. IF YOU ARE NOT THE INTENDED RECIPIENT YOU ARE NOTIFIED THAT DISCLOSING, COPYING, DISTRIBUTING OR TAKING ANY ACTION IN RELIANCE ON THE CONTENTS OF THIS INFORMATION IS STRICTLY PROHIBITED.

 

amolle | 14 Dec 2011 14:36
Favicon

Sorting a jtable using a hidden column

Hi all,

I would like to sort my JTable using a column wihich is not always visible..
(<=> not in the sortedlist given to my tableformat)
Has anyone tried to do this ?

a.m

--
View this message in context: http://glazedlists.1045722.n5.nabble.com/Sorting-a-jtable-using-a-hidden-column-tp5074482p5074482.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.

sialivi | 3 Oct 2011 01:47
Picon
Favicon

Making a list item bypass all filters?

I need some advice on how to tackle the following scenario:

I have a list pipeline with a bunch of filters. I want to be able to right
click on an item in my list and "pin" it, making it always show no matter
what the other filters do. Is there a clever way to make an item bypass all
the filters? Or do I have to change every single filter to take my pinned
boolean bean property into account?

--
View this message in context: http://glazedlists.1045722.n5.nabble.com/Making-a-list-item-bypass-all-filters-tp4863423p4863423.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.

Bruce Alspaugh | 7 Oct 2011 06:01
Picon

Strategies to Navigate Large Lists

I have what I think is a rather common use case:  A large number of
records in an SQL table that I need to allow the user to edit in a Swing
client application.  The problem is that as the lists grow larger, the
time to download the records increases causing the application to become
less responsive.  The best solution I have come up with is to download
the records on a separate thread and append them to the list as they
come in.  The problem is that this causes the user's scroll position in
the list to keep changing as the records come in.

Glazed Lists assumes all the list elements fit in memory, and I don't
see a good way to page sections of a list in and out or do lazy loading.
Another problem with that approach is that other users could insert,
modify or delete records in the underlying table throwing the record
count off and causing the downloaded elements to become stale as the
user pages through the list.

Has anyone found a good solution for this problem?  

Bruce

Fabian Zeindl | 6 Sep 2011 16:57
Picon

FilterList wants a reverse function - Why?

Hi, 
 i have this little LogWindow, that shows me log4j-LoggingEvents. I wanted a
facility to filter by class and loglevel, but i ran into problems. 

This is my code: http://pastie.org/2491565

It shows correctly, when i select an item though, i get the following
stacktrace: 

http://pastie.org/2491572

Can you help me? 
Regards 
Fabian Zeindl

--
View this message in context: http://glazedlists.1045722.n5.nabble.com/FilterList-wants-a-reverse-function-Why-tp4774694p4774694.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.

andzsinszan | 29 Aug 2011 14:00
Picon

SWT without JFace

Hi,

Is it possible to use glazedlist with SWT but *without* JFace? 
Previously I used glazedlist with Swing, now I'm working on a
standalone SWT project and preferably would leave out JFace from
dev/deployment.

It seems that
ca.odell.glazedlists.swt.EventTableViewer.createSwtThreadProxyList(Even
tTableViewer.java:186)
needs
org/eclipse/jface/viewers/ILabelProvider.

Is there a workaround using pure SWT?

Thanks in advance,

Gabor

sialivi | 24 Aug 2011 06:41
Picon
Favicon

swingThreadProxyList headache

At the start of my pipeline I define the following lists:

EventList<DDIBean> ddiEventList = GlazedLists.threadSafeList(new
BasicEventList());
SortedList<DDIBean> sortedList = new SortedList(ddiEventList);

At a later point in the application I create a shortlived UniqueList to
populate a JComboBox:

UniqueList<DDIBean> uniqueList = new UniqueList(sortedList, new
BeanPropertyComparator(DDIBean.class, "Alignment",
GlazedLists.caseInsensitiveComparator()));

So far so good, but when I today introduced a SwingThreadProxyList to the
mix by changing the first line to:

EventList<DDIBean> ddiEventList =
GlazedListsSwing.swingThreadProxyList(GlazedLists.threadSafeList(new
BasicEventList()));

...the application now hangs when I create the UniqueList, with no visible
exception (probably hidden in a thread somewhere, which I'm terrible at
tracking down).

I know this isn't much to go on, but any ideas what I'm doing wrong?

--
View this message in context: http://glazedlists.1045722.n5.nabble.com/swingThreadProxyList-headache-tp4729236p4729236.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.

Jason S | 16 Aug 2011 16:15
Picon
Gravatar

sorting a treelist

Could someone comment on this old thread:
http://glazedlists.1045722.n5.nabble.com/Sorting-TreeList-td3419834.html#none

I see what looks like some erroneous statements, namely that if you sort
upstream from a TreeList, the treelist will be sorted (doesn't seem to work
for me), and that the comparator in the TreeList.Format is used to group
items together (how can this be possible? you're comparing items, not
parents of items).

What are the requirements of the TreeList.Format comparator?

e.g. if these are my TreeList nodes

- A
-- A1
-- A2
- B
-- B1
-- B2
-- B3
--- B3a
--- B3b
- C

then:
- which nodes are going to be compared to each other? is it comparisons
within the sets (A,B,C) and (A1,A2) and (B1,B2,B3) and (B3a,B3b) or is it
all 10 nodes, or something else?
- what happens if I return null for a comparator? (bad things seem to happen
as some nodes seem to be duplicated in the output list)

Also is it possible to change the comparators at runtime, in the way that
TableComparatorChooser operates?

--
View this message in context: http://glazedlists.1045722.n5.nabble.com/sorting-a-treelist-tp4704550p4704550.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.

pcafstockf | 12 Aug 2011 23:15

Pre-populate / initialize UniqueList without comparing?

Hi,

I've used GlazedLists for many projects, and my eyes are eternally grateful
not to have been gouged out !

My latest project requires very large UniqueLists.  The lists are initially
populated with large numbers of elements that are known to be both unique
and properly sorted.  However, new elements do need to be sorted and
filtered for uniqueness as they are added to the list.  Because the
comparator is rather complex and the initial size is very large, it can take
many minutes to initialize a single list.  

Is there a way to tell a UniqueList to 'trust' that it's initial contents
are unique and sorted?

SortedList.setMode looked promising, but when strict sorting is restored,
the comparator is again invoked for every element.

TIA,

pcafstockf

--
View this message in context: http://glazedlists.1045722.n5.nabble.com/Pre-populate-initialize-UniqueList-without-comparing-tp4694655p4694655.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


Gmane