Search in sources :

Example 1 with MigLayout

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"));
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry) ExpandBar(org.eclipse.swt.widgets.ExpandBar) Listener(org.eclipse.swt.widgets.Listener) IResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) MigLayout(net.miginfocom.swt.MigLayout) Label(org.eclipse.swt.widgets.Label) Event(org.eclipse.swt.widgets.Event) IResourceChangeEvent(org.eclipse.core.resources.IResourceChangeEvent) Text(org.eclipse.swt.widgets.Text)

Aggregations

MigLayout (net.miginfocom.swt.MigLayout)1 IResourceChangeEvent (org.eclipse.core.resources.IResourceChangeEvent)1 IResourceChangeListener (org.eclipse.core.resources.IResourceChangeListener)1 ImageRegistry (org.eclipse.jface.resource.ImageRegistry)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 Event (org.eclipse.swt.widgets.Event)1 ExpandBar (org.eclipse.swt.widgets.ExpandBar)1 Label (org.eclipse.swt.widgets.Label)1 Listener (org.eclipse.swt.widgets.Listener)1 Text (org.eclipse.swt.widgets.Text)1