use of org.eclipse.nebula.widgets.nattable.viewport.SliderScroller in project nebula.widgets.nattable by eclipse.
the class _5043_VerticalSplitViewportExample method createSplitSliders.
private void createSplitSliders(Composite natTableParent, final ViewportLayer top, final ViewportLayer bottom) {
Composite sliderComposite = new Composite(natTableParent, SWT.NONE);
GridData gridData = new GridData();
gridData.verticalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = false;
gridData.grabExcessVerticalSpace = true;
gridData.widthHint = 17;
sliderComposite.setLayoutData(gridData);
GridLayout gridLayout = new GridLayout(1, false);
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
sliderComposite.setLayout(gridLayout);
// Slider Left
// Need a composite here to set preferred size because Slider can't be
// subclassed.
Composite sliderTopComposite = new Composite(sliderComposite, SWT.NONE) {
@Override
public Point computeSize(int wHint, int hHint, boolean changed) {
int height = ((ClientAreaAdapter) top.getClientAreaProvider()).getHeight();
return new Point(17, height);
}
};
sliderTopComposite.setLayout(new FillLayout());
gridData = new GridData();
gridData.horizontalAlignment = GridData.BEGINNING;
gridData.verticalAlignment = GridData.BEGINNING;
sliderTopComposite.setLayoutData(gridData);
Slider sliderTop = new Slider(sliderTopComposite, SWT.VERTICAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.FILL;
sliderTop.setLayoutData(gridData);
top.setVerticalScroller(new SliderScroller(sliderTop));
// Slider Right
Slider sliderBottom = new Slider(sliderComposite, SWT.VERTICAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.BEGINNING;
gridData.verticalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = false;
gridData.grabExcessVerticalSpace = true;
sliderBottom.setLayoutData(gridData);
bottom.setVerticalScroller(new SliderScroller(sliderBottom));
}
use of org.eclipse.nebula.widgets.nattable.viewport.SliderScroller in project nebula.widgets.nattable by eclipse.
the class _5045_ScrollableRowHeaderExample method createSplitSliders.
private void createSplitSliders(Composite natTableParent, final ViewportLayer left, int fixedHeaderWidth, final ViewportLayer right) {
Composite sliderComposite = new Composite(natTableParent, SWT.NONE);
GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = false;
gridData.heightHint = 17;
sliderComposite.setLayoutData(gridData);
GridLayout gridLayout = new GridLayout(2, false);
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
sliderComposite.setLayout(gridLayout);
// Slider Left
// Need a composite here to set preferred size because Slider can't be
// subclassed.
Composite sliderLeftComposite = new Composite(sliderComposite, SWT.NONE) {
@Override
public Point computeSize(int wHint, int hHint, boolean changed) {
int width = ((ClientAreaAdapter) left.getClientAreaProvider()).getWidth() + fixedHeaderWidth;
return new Point(width, 17);
}
};
sliderLeftComposite.setLayout(new FillLayout());
gridData = new GridData();
gridData.horizontalAlignment = GridData.BEGINNING;
gridData.verticalAlignment = GridData.BEGINNING;
sliderLeftComposite.setLayoutData(gridData);
Slider sliderLeft = new Slider(sliderLeftComposite, SWT.HORIZONTAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.FILL;
sliderLeft.setLayoutData(gridData);
left.setHorizontalScroller(new SliderScroller(sliderLeft));
// Slider Right
Slider sliderRight = new Slider(sliderComposite, SWT.HORIZONTAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.BEGINNING;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = false;
sliderRight.setLayoutData(gridData);
right.setHorizontalScroller(new SliderScroller(sliderRight));
}
use of org.eclipse.nebula.widgets.nattable.viewport.SliderScroller in project nebula.widgets.nattable by eclipse.
the class _5046_MultiScrollExample method createSplitSliders.
/**
* @param natTableParent
* @param gridLayer
* @param fixedHeaderWidth
*/
private void createSplitSliders(Composite natTableParent, ExtendedGridLayer gridLayer, int fixedHeaderWidth) {
Composite sliderComposite = new Composite(natTableParent, SWT.NONE);
GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = false;
gridData.heightHint = 17;
sliderComposite.setLayoutData(gridData);
GridLayout gridLayout = new GridLayout(2, false);
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
sliderComposite.setLayout(gridLayout);
// Slider Left
// Need a composite here to set preferred size because Slider can't be
// subclassed.
Composite sliderLeftComposite = new Composite(sliderComposite, SWT.NONE) {
@Override
public Point computeSize(int wHint, int hHint, boolean changed) {
int width = ((ClientAreaAdapter) gridLayer.getStructureBody().getViewportLayer().getClientAreaProvider()).getWidth() + fixedHeaderWidth;
return new Point(width, 17);
}
};
sliderLeftComposite.setLayout(new FillLayout());
gridData = new GridData();
gridData.horizontalAlignment = GridData.BEGINNING;
gridData.verticalAlignment = GridData.BEGINNING;
sliderLeftComposite.setLayoutData(gridData);
Slider sliderLeft = new Slider(sliderLeftComposite, SWT.HORIZONTAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.FILL;
sliderLeft.setLayoutData(gridData);
gridLayer.getStructureBody().getViewportLayer().setHorizontalScroller(new SliderScroller(sliderLeft));
// Slider Right
Slider sliderRight = new Slider(sliderComposite, SWT.HORIZONTAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.BEGINNING;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = false;
sliderRight.setLayoutData(gridData);
gridLayer.getContentBody().getViewportLayer().setHorizontalScroller(new SliderScroller(sliderRight));
}
use of org.eclipse.nebula.widgets.nattable.viewport.SliderScroller in project nebula.widgets.nattable by eclipse.
the class _5042_HorizontalSplitViewportExample method createSplitSliders.
private void createSplitSliders(Composite natTableParent, final ViewportLayer left, final ViewportLayer right) {
Composite sliderComposite = new Composite(natTableParent, SWT.NONE);
GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = false;
gridData.heightHint = 17;
sliderComposite.setLayoutData(gridData);
GridLayout gridLayout = new GridLayout(2, false);
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
sliderComposite.setLayout(gridLayout);
// Slider Left
// Need a composite here to set preferred size because Slider can't be
// subclassed.
Composite sliderLeftComposite = new Composite(sliderComposite, SWT.NONE) {
@Override
public Point computeSize(int wHint, int hHint, boolean changed) {
int width = ((ClientAreaAdapter) left.getClientAreaProvider()).getWidth();
return new Point(width, 17);
}
};
sliderLeftComposite.setLayout(new FillLayout());
gridData = new GridData();
gridData.horizontalAlignment = GridData.BEGINNING;
gridData.verticalAlignment = GridData.BEGINNING;
sliderLeftComposite.setLayoutData(gridData);
Slider sliderLeft = new Slider(sliderLeftComposite, SWT.HORIZONTAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.FILL;
sliderLeft.setLayoutData(gridData);
left.setHorizontalScroller(new SliderScroller(sliderLeft));
// Slider Right
Slider sliderRight = new Slider(sliderComposite, SWT.HORIZONTAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.BEGINNING;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = false;
sliderRight.setLayoutData(gridData);
right.setHorizontalScroller(new SliderScroller(sliderRight));
}
use of org.eclipse.nebula.widgets.nattable.viewport.SliderScroller in project nebula.widgets.nattable by eclipse.
the class _5044_HorizontalSplitViewportGridExample method createSplitSliders.
private void createSplitSliders(Composite natTableParent, final ILayer rowHeaderLayer, final ViewportLayer left, final ViewportLayer right) {
Composite sliderComposite = new Composite(natTableParent, SWT.NONE);
GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = false;
gridData.heightHint = 17;
sliderComposite.setLayoutData(gridData);
GridLayout gridLayout = new GridLayout(2, false);
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
gridLayout.horizontalSpacing = 0;
gridLayout.verticalSpacing = 0;
sliderComposite.setLayout(gridLayout);
// Slider Left
// Need a composite here to set preferred size because Slider can't be
// subclassed.
Composite sliderLeftComposite = new Composite(sliderComposite, SWT.NONE) {
@Override
public Point computeSize(int wHint, int hHint, boolean changed) {
int width = ((ClientAreaAdapter) left.getClientAreaProvider()).getWidth();
width += rowHeaderLayer.getWidth();
return new Point(width, 17);
}
};
sliderLeftComposite.setLayout(new FillLayout());
gridData = new GridData();
gridData.horizontalAlignment = GridData.BEGINNING;
gridData.verticalAlignment = GridData.BEGINNING;
sliderLeftComposite.setLayoutData(gridData);
Slider sliderLeft = new Slider(sliderLeftComposite, SWT.HORIZONTAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.FILL;
sliderLeft.setLayoutData(gridData);
left.setHorizontalScroller(new SliderScroller(sliderLeft));
// Slider Right
Slider sliderRight = new Slider(sliderComposite, SWT.HORIZONTAL);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.BEGINNING;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
sliderRight.setLayoutData(gridData);
right.setHorizontalScroller(new SliderScroller(sliderRight));
}
Aggregations