use of net.miginfocom.swt.MigLayout in project meclipse by flaper87.
the class CollectionEditor method createPages.
@Override
protected void createPages() {
final Composite composite = new Composite(getContainer(), SWT.FILL);
ImageRegistry reg = MeclipsePlugin.getDefault().getImageRegistry();
composite.setLayout(new MigLayout("wrap 9", "[][][][40px!][][40px!][][][]", "[30px!][]"));
Label find = new Label(composite, SWT.FILL);
find.setLayoutData("w 30!");
find.setText(getCaption("collectionEditor.find"));
query = new Text(composite, SWT.FILL);
query.setLayoutData("w 100: 500: 600");
query.setText("{}");
Label skip = new Label(composite, SWT.FILL);
skip.setText(getCaption("collectionEditor.skip"));
skipV = new Text(composite, SWT.FILL);
skipV.setText("0");
skipV.setLayoutData("w 40px!");
skipV.addListener(SWT.DefaultSelection, runQuery);
Label limit = new Label(composite, SWT.FILL);
limit.setText(getCaption("collectionEditor.limit"));
limitV = new Text(composite, SWT.FILL);
limitV.setText("10");
limitV.setLayoutData("w 40px!");
limitV.addListener(SWT.DefaultSelection, runQuery);
search = new Button(composite, SWT.PUSH);
search.setToolTipText(getCaption("collectionEditor.tooltip.search"));
search.setImage(reg.get(MeclipsePlugin.FIND_IMG_ID));
search.addListener(SWT.Selection, runQuery);
more = new Button(composite, SWT.PUSH);
more.setToolTipText(getCaption("collectionEditor.tooltip.next"));
more.setImage(reg.get(MeclipsePlugin.GET_NEXT_IMG_ID));
more.setEnabled(false);
more.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event arg0) {
loadEntries(false);
}
});
all = new Button(composite, SWT.PUSH);
all.setToolTipText(String.format(getCaption("collectionEditor.tooltip.getAll"), maxElements));
all.setImage(reg.get(MeclipsePlugin.GET_ALL_IMG_ID));
all.setEnabled(false);
all.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event arg0) {
loadEntries(true);
}
});
bar = new ExpandBar(composite, SWT.V_SCROLL);
bar.setLayoutData("span, w 100%-20px !,h 100%-50px !");
cursor = col.getCollection().find().limit(maxElements);
loadEntries(false);
int index = addPage(composite);
setPageText(index, getCaption("collectionEditor.tab.properties"));
}
Aggregations