Search in sources :

Example 1 with Param

use of org.polymap.core.data.pipeline.Param in project polymap4-core by Polymap4.

the class StatisticsSupplier method createContents.

@Override
public Control createContents(Composite parent, Param<Object> param, PipelineProcessorSite site) {
    this.layerId = site.layerId.get();
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(FormLayoutFactory.defaults().spacing(3).margins(0, 0, 3, 0).create());
    // Label
    l = new Label(container, SWT.NONE);
    l.setFont(UIUtils.italic(l.getFont()));
    updateUI();
    // 
    Button btn = new Button(container, SWT.PUSH);
    btn.setText("FLUSH CACHE");
    btn.setToolTipText("Reset timestamp so that next access will re-fetch contents from backend store");
    btn.addSelectionListener(UIUtils.selectionListener(ev -> {
        StoreCacheProcessor.lastUpdated.put(layerId, new AtomicLong2());
        updateUI();
    }));
    // layout
    FormDataFactory.on(l).fill().noBottom();
    FormDataFactory.on(btn).top(l).left(30).right(70).bottom(100);
    return container;
}
Also used : PipelineProcessorSite(org.polymap.core.data.pipeline.PipelineProcessorSite) Button(org.eclipse.swt.widgets.Button) Date(java.util.Date) AtomicLong2(org.polymap.core.data.feature.storecache.StoreCacheProcessor.AtomicLong2) DurationFormat(org.polymap.core.runtime.DurationFormat) FormLayoutFactory(org.polymap.core.ui.FormLayoutFactory) Composite(org.eclipse.swt.widgets.Composite) Duration(java.time.Duration) SWT(org.eclipse.swt.SWT) UIUtils(org.polymap.core.ui.UIUtils) FormDataFactory(org.polymap.core.ui.FormDataFactory) Label(org.eclipse.swt.widgets.Label) DateFormat(java.text.DateFormat) Control(org.eclipse.swt.widgets.Control) Param(org.polymap.core.data.pipeline.Param) Polymap(org.polymap.core.runtime.Polymap) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) Label(org.eclipse.swt.widgets.Label) AtomicLong2(org.polymap.core.data.feature.storecache.StoreCacheProcessor.AtomicLong2)

Aggregations

DateFormat (java.text.DateFormat)1 Duration (java.time.Duration)1 Date (java.util.Date)1 SWT (org.eclipse.swt.SWT)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 Control (org.eclipse.swt.widgets.Control)1 Label (org.eclipse.swt.widgets.Label)1 AtomicLong2 (org.polymap.core.data.feature.storecache.StoreCacheProcessor.AtomicLong2)1 Param (org.polymap.core.data.pipeline.Param)1 PipelineProcessorSite (org.polymap.core.data.pipeline.PipelineProcessorSite)1 DurationFormat (org.polymap.core.runtime.DurationFormat)1 Polymap (org.polymap.core.runtime.Polymap)1 FormDataFactory (org.polymap.core.ui.FormDataFactory)1 FormLayoutFactory (org.polymap.core.ui.FormLayoutFactory)1 UIUtils (org.polymap.core.ui.UIUtils)1