Archive for the ‘widget’ tag
9 bugs on the bugzilla!
Finally I think I have what I need.
To give you an idea:

Here’s how I configured the DoubleListViewer(yeah that’s what I call it) widget:
viewer = new DoubleListViewer(shell, SWT.NONE);
viewer.setSourceLabel(SOURCE_LIST_LABEL);
viewer.setDestinationLabel(DESTINATION_LIST_LABEL);
viewer.setLabelProvider(new LabelProvider());
viewer.setContentProvider(new ContentProvider());
viewer.setUseHashlookup(true);
// filter the input so that part of it is shown in the source list.
viewer.setSourceFilter(new SourceListFilter());
// filter the input so that part of it is shown in the destination list.
viewer.setDestinationFilter(new DestinationListFilter());
// helps in reordering the destination list (Up/Down buttons)
viewer.setReorderingFilter(new ListReorderFilter());
// moves objects to and fro between the two lists.
viewer.setAddRemoveFilter(new ListAddRemoveFilter());
// finally the model for the view ![]()
viewer.setInput(getFullList());
The SourceListFilter and DestinationListFilter are implementations of DoubleListFilter:
public interface DoubleListFilter {
public abstract Object filter(Object toTest);
}
ReorderFilter is implementation of AbstractReorderFilter:
public abstract class AbstractReorderFilter {
public abstract Object moveUp(Object input, Object toMove, int numPlaces) ;
public Object moveUp(Object input, Object toMove){
return moveUp(input, toMove, 1);
}
public abstract Object moveDown (Object input, Object toMove, int numPlaces);
public Object moveDown(Object input, Object toMove){
return moveDown(input, toMove, 1);
}
}
ListAddRemoveFilter is an implementation of AbstractAddRemoveFilter:
public abstract class AbstractAddRemoveFilter {
public abstract void add(Object source, Object toAdd);
public abstract void remove(Object source, Object toRemove);
public void move(Object source, Object dest, Object toMove) {
add(dest, toMove);
remove(source, toMove);
}
}
The LabelProvider is an implementations of org.eclipse.jface.viewers.LabelProvider and ContentProvider is an implementation of org.eclipse.jface.viewers.IStructuredContentProvider.
Looks simple eh, that’s what was intended of the widget
Suggestions welcome!
10 green bugs on the bugzilla!
One green bug standing on the bugzilla,
one green bug standing on the bugzilla,
and if one green bug should accidentally fall,
there’d be one green bug on the bugzilla (still to be filed).
WTF, did I get my math wrong ? Is it one of the rules of software engineering ?
This is what I just discovered:

Does the thing on the right look like a new SWT widget or a Jface control ? Sure does to me.