use of org.eclipse.swt.widgets.Spinner in project linuxtools by eclipse.
the class ValgrindOptionsTab method createErrorOptions.
private void createErrorOptions(Composite top) {
Group errorGroup = new Group(top, SWT.NONE);
errorGroup.setLayout(new GridLayout());
errorGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// $NON-NLS-1$
errorGroup.setText(Messages.getString("ValgrindOptionsTab.Error_Options"));
Composite errorTop = new Composite(errorGroup, SWT.NONE);
errorTop.setLayout(new GridLayout(2, true));
errorTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
demangleButton = new Button(errorTop, SWT.CHECK);
// $NON-NLS-1$
demangleButton.setText(Messages.getString("ValgrindOptionsTab.demangle"));
demangleButton.addSelectionListener(selectListener);
demangleButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composite numCallersTop = new Composite(errorTop, SWT.NONE);
numCallersTop.setLayout(new GridLayout(2, false));
Label numCallersLabel = new Label(numCallersTop, SWT.NONE);
// $NON-NLS-1$
numCallersLabel.setText(Messages.getString("ValgrindOptionsTab.num_callers"));
numCallersSpinner = new Spinner(numCallersTop, SWT.BORDER);
numCallersSpinner.setMaximum(50);
numCallersSpinner.addModifyListener(modifyListener);
numCallersSpinner.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
errorLimitButton = new Button(errorTop, SWT.CHECK);
// $NON-NLS-1$
errorLimitButton.setText(Messages.getString("ValgrindOptionsTab.limit_errors"));
errorLimitButton.addSelectionListener(selectListener);
errorLimitButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
showBelowMainButton = new Button(errorTop, SWT.CHECK);
// $NON-NLS-1$
showBelowMainButton.setText(Messages.getString("ValgrindOptionsTab.show_errors_below_main"));
showBelowMainButton.addSelectionListener(selectListener);
showBelowMainButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composite maxStackFrameTop = new Composite(errorTop, SWT.NONE);
maxStackFrameTop.setLayout(new GridLayout(2, false));
Label maxStackFrameLabel = new Label(maxStackFrameTop, SWT.NONE);
// $NON-NLS-1$
maxStackFrameLabel.setText(Messages.getString("ValgrindOptionsTab.max_size_of_stack_frame"));
maxStackFrameSpinner = new Spinner(maxStackFrameTop, SWT.BORDER);
maxStackFrameSpinner.setMaximum(Integer.MAX_VALUE);
maxStackFrameSpinner.addModifyListener(modifyListener);
maxStackFrameSpinner.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// Option only visible for valgrind > 3.4.0
mainStackSizeTop = new Composite(errorTop, SWT.NONE);
GridLayout mainStackSizeLayout = new GridLayout(2, false);
mainStackSizeLayout.marginHeight = mainStackSizeLayout.marginWidth = 0;
mainStackSizeTop.setLayout(mainStackSizeLayout);
mainStackSizeButton = new Button(mainStackSizeTop, SWT.CHECK);
// $NON-NLS-1$
mainStackSizeButton.setText(Messages.getString("ValgrindOptionsTab.Main_stack_size"));
mainStackSizeButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
checkMainStackEnablement();
updateLaunchConfigurationDialog();
}));
mainStackSizeSpinner = new Spinner(mainStackSizeTop, SWT.BORDER);
mainStackSizeSpinner.setMaximum(Integer.MAX_VALUE);
mainStackSizeSpinner.addModifyListener(modifyListener);
mainStackSizeSpinner.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
mainStackSizeTop.setVisible(false);
// Option only visible for valgrind > 3.6.0
dSymUtilButton = new Button(errorTop, SWT.CHECK);
// $NON-NLS-1$
dSymUtilButton.setText(Messages.getString("ValgrindOptionsTab.dsymutil"));
dSymUtilButton.addSelectionListener(selectListener);
dSymUtilButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
dSymUtilButton.setVisible(false);
}
use of org.eclipse.swt.widgets.Spinner in project linuxtools by eclipse.
the class MassifToolPage method createControl.
@Override
public void createControl(Composite parent) {
Composite top = new Composite(parent, SWT.NONE);
GridLayout topLayout = new GridLayout(2, true);
topLayout.horizontalSpacing = 10;
top.setLayout(topLayout);
top.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite heapTop = new Composite(top, SWT.NONE);
heapTop.setLayout(new GridLayout(2, false));
heapButton = new Button(heapTop, SWT.CHECK);
// $NON-NLS-1$
heapButton.setText(Messages.getString("MassifToolPage.profile_heap"));
heapButton.addSelectionListener(selectListener);
Composite heapAdminTop = new Composite(top, SWT.NONE);
heapAdminTop.setLayout(new GridLayout(2, false));
Label heapAdminLabel = new Label(heapAdminTop, SWT.NONE);
// $NON-NLS-1$
heapAdminLabel.setText(Messages.getString("MassifToolPage.administrative_bytes"));
heapAdminSpinner = new Spinner(heapAdminTop, SWT.BORDER);
heapAdminSpinner.addModifyListener(modifyListener);
Composite stacksTop = new Composite(top, SWT.NONE);
stacksTop.setLayout(new GridLayout(2, false));
stacksButton = new Button(stacksTop, SWT.CHECK);
// $NON-NLS-1$
stacksButton.setText(Messages.getString("MassifToolPage.profile_stack"));
stacksButton.addSelectionListener(selectListener);
if (valgrindVersion == null || valgrindVersion.compareTo(VER_3_6_0) >= 0) {
Composite pagesasheapTop = new Composite(top, SWT.NONE);
pagesasheapTop.setLayout(new GridLayout(2, false));
pagesasheapButton = new Button(pagesasheapTop, SWT.CHECK);
// $NON-NLS-1$
pagesasheapButton.setText(Messages.getString("MassifToolPage.profile_pagesasheap"));
pagesasheapButton.addSelectionListener(selectListener);
}
Composite depthTop = new Composite(top, SWT.NONE);
depthTop.setLayout(new GridLayout(2, false));
Label depthLabel = new Label(depthTop, SWT.NONE);
// $NON-NLS-1$
depthLabel.setText(Messages.getString("MassifToolPage.allocation_tree_depth"));
depthSpinner = new Spinner(depthTop, SWT.BORDER);
depthSpinner.addModifyListener(modifyListener);
Composite thresholdTop = new Composite(top, SWT.NONE);
thresholdTop.setLayout(new GridLayout(3, false));
Label thresholdLabel = new Label(thresholdTop, SWT.NONE);
// $NON-NLS-1$
thresholdLabel.setText(Messages.getString("MassifToolPage.heap_allocation_threshold"));
thresholdSpinner = new Spinner(thresholdTop, SWT.BORDER);
thresholdSpinner.setDigits(1);
thresholdSpinner.setMaximum(1000);
thresholdSpinner.addModifyListener(modifyListener);
Label thresholdPercentLabel = new Label(thresholdTop, SWT.NONE);
// $NON-NLS-1$
thresholdPercentLabel.setText("%");
Composite peakInaccuracyTop = new Composite(top, SWT.NONE);
peakInaccuracyTop.setLayout(new GridLayout(3, false));
Label peakInaccuracyLabel = new Label(peakInaccuracyTop, SWT.NONE);
// $NON-NLS-1$
peakInaccuracyLabel.setText(Messages.getString("MassifToolPage.allocation_peak_inaccuracy"));
peakInaccuracySpinner = new Spinner(peakInaccuracyTop, SWT.BORDER);
peakInaccuracySpinner.setDigits(1);
peakInaccuracySpinner.setMaximum(1000);
peakInaccuracySpinner.addModifyListener(modifyListener);
Label peakInaccuracyPercentLabel = new Label(peakInaccuracyTop, SWT.NONE);
// $NON-NLS-1$
peakInaccuracyPercentLabel.setText("%");
Composite timeUnitTop = new Composite(top, SWT.NONE);
timeUnitTop.setLayout(new GridLayout(2, false));
Label timeUnitLabel = new Label(timeUnitTop, SWT.NONE);
// $NON-NLS-1$
timeUnitLabel.setText(Messages.getString("MassifToolPage.time_unit"));
timeUnitCombo = new Combo(timeUnitTop, SWT.READ_ONLY);
String[] items = new String[] { TIME_I_STRING, TIME_MS_STRING, TIME_B_STRING };
timeUnitCombo.setItems(items);
timeUnitCombo.addSelectionListener(selectListener);
Composite detailedFreqTop = new Composite(top, SWT.NONE);
detailedFreqTop.setLayout(new GridLayout(2, false));
Label detailedFreqLabel = new Label(detailedFreqTop, SWT.NONE);
// $NON-NLS-1$
detailedFreqLabel.setText(Messages.getString("MassifToolPage.detailed_snapshot_freq"));
detailedFreqSpinner = new Spinner(detailedFreqTop, SWT.BORDER);
detailedFreqSpinner.setMinimum(1);
detailedFreqSpinner.setMaximum(Integer.MAX_VALUE);
detailedFreqSpinner.addModifyListener(modifyListener);
Composite maxSnapshotsTop = new Composite(top, SWT.NONE);
maxSnapshotsTop.setLayout(new GridLayout(2, false));
Label maxSnapshotsLabel = new Label(maxSnapshotsTop, SWT.NONE);
// $NON-NLS-1$
maxSnapshotsLabel.setText(Messages.getString("MassifToolPage.max_snapshots"));
maxSnapshotsSpinner = new Spinner(maxSnapshotsTop, SWT.BORDER);
maxSnapshotsSpinner.setMaximum(Integer.MAX_VALUE);
maxSnapshotsSpinner.addModifyListener(modifyListener);
Composite alignmentTop = new Composite(top, SWT.NONE);
GridLayout alignmentLayout = new GridLayout(2, false);
alignmentLayout.marginWidth = alignmentLayout.marginHeight = 0;
alignmentTop.setLayout(alignmentLayout);
alignmentButton = new Button(alignmentTop, SWT.CHECK);
// $NON-NLS-1$
alignmentButton.setText(Messages.getString("MassifToolPage.minimum_heap_block"));
alignmentButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
checkAlignmentEnablement();
updateLaunchConfigurationDialog();
}));
alignmentSpinner = new Spinner(alignmentTop, SWT.BORDER);
alignmentSpinner.setMinimum(0);
alignmentSpinner.setMaximum(4096);
alignmentSpinner.addModifyListener(modifyListener);
Composite allocFnTop = new Composite(top, SWT.NONE);
allocFnTop.setLayout(new GridLayout(3, false));
allocFnTop.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
Label allocFnLabel = new Label(allocFnTop, SWT.NONE);
// $NON-NLS-1$
allocFnLabel.setText(Messages.getString("MassifToolPage.allocation_functions"));
allocFnLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
createAllocFnControls(allocFnTop);
Composite ignoreFnTop = new Composite(top, SWT.NONE);
ignoreFnTop.setLayout(new GridLayout(3, false));
ignoreFnTop.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
Label ignoreFnLabel = new Label(ignoreFnTop, SWT.NONE);
// $NON-NLS-1$
ignoreFnLabel.setText(Messages.getString("MassifToolPage.ignore_functions"));
ignoreFnLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
createIgnoreFnControls(ignoreFnTop);
}
use of org.eclipse.swt.widgets.Spinner in project knime-core by knime.
the class BorderStyleDialog method createSizeSelector.
private void createSizeSelector(final Composite parent) {
Composite panel = new Composite(parent, SWT.FILL);
GridData gData = new GridData(GridData.FILL_HORIZONTAL);
panel.setLayoutData(gData);
panel.setLayout(new GridLayout(2, false));
Label msg = new Label(panel, SWT.LEFT);
msg.setText("Border size (0 = no border):");
msg.setLayoutData(gData);
final Spinner spinner = new Spinner(panel, SWT.NONE);
spinner.setDigits(3);
spinner.setValues(m_defBorderSize, 0, 100, 0, 1, 5);
spinner.addModifyListener(new ModifyListener() {
@Override
public void modifyText(final ModifyEvent e) {
m_size = spinner.getSelection();
}
});
m_size = m_defBorderSize;
}
use of org.eclipse.swt.widgets.Spinner in project eclipse.platform.swt by eclipse.
the class ImageTransformTab method createControlPanel.
/**
* This method creates the controls specific to the tab. The call to the
* createControlPanel method in the super class create the controls that are
* defined in the super class.
*
* @param parent The parent composite
*/
@Override
public void createControlPanel(Composite parent) {
Composite comp;
GridLayout gridLayout = new GridLayout(2, false);
// create spinner for the rotation angle
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
// $NON-NLS-1$
new Label(comp, SWT.CENTER).setText(GraphicsExample.getResourceString("Rotate"));
rotateSpinner = new Spinner(comp, SWT.BORDER | SWT.WRAP);
GC gc = new GC(rotateSpinner);
int width = (int) (gc.getFontMetrics().getAverageCharacterWidth() * 5);
gc.dispose();
rotateSpinner.setLayoutData(new GridData(width, SWT.DEFAULT));
rotateSpinner.setSelection(0);
rotateSpinner.setMinimum(-720);
rotateSpinner.setMaximum(720);
rotateSpinner.setIncrement(30);
rotateSpinner.addListener(SWT.Selection, event -> example.redraw());
// create a spinner for translating along the x axis
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
// $NON-NLS-1$
new Label(comp, SWT.CENTER).setText(GraphicsExample.getResourceString("xtranslate"));
translateSpinnerX = new Spinner(comp, SWT.BORDER | SWT.WRAP);
translateSpinnerX.setLayoutData(new GridData(width, SWT.DEFAULT));
translateSpinnerX.setMinimum(-100);
translateSpinnerX.setMaximum(500);
translateSpinnerX.setSelection(0);
translateSpinnerX.setIncrement(10);
translateSpinnerX.addListener(SWT.Selection, event -> example.redraw());
// create a spinner for translating along the y axis
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
// $NON-NLS-1$
new Label(comp, SWT.CENTER).setText(GraphicsExample.getResourceString("ytranslate"));
translateSpinnerY = new Spinner(comp, SWT.BORDER | SWT.WRAP);
translateSpinnerY.setLayoutData(new GridData(width, SWT.DEFAULT));
translateSpinnerY.setMinimum(-100);
translateSpinnerY.setMaximum(500);
translateSpinnerY.setSelection(0);
translateSpinnerY.setIncrement(10);
translateSpinnerY.addListener(SWT.Selection, event -> example.redraw());
// create a spinner for scaling along the x axis
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
// $NON-NLS-1$
new Label(comp, SWT.CENTER).setText(GraphicsExample.getResourceString("xscale"));
scaleSpinnerX = new Spinner(comp, SWT.BORDER | SWT.WRAP);
scaleSpinnerX.setLayoutData(new GridData(width, SWT.DEFAULT));
scaleSpinnerX.setDigits(2);
scaleSpinnerX.setMinimum(1);
scaleSpinnerX.setMaximum(400);
scaleSpinnerX.setSelection(100);
scaleSpinnerX.setIncrement(10);
scaleSpinnerX.addListener(SWT.Selection, event -> example.redraw());
// create a spinner for scaling along the y axis
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
// $NON-NLS-1$
new Label(comp, SWT.CENTER).setText(GraphicsExample.getResourceString("yscale"));
scaleSpinnerY = new Spinner(comp, SWT.BORDER | SWT.WRAP);
scaleSpinnerY.setLayoutData(new GridData(width, SWT.DEFAULT));
scaleSpinnerY.setDigits(2);
scaleSpinnerY.setMinimum(1);
scaleSpinnerY.setMaximum(400);
scaleSpinnerY.setSelection(100);
scaleSpinnerY.setIncrement(10);
scaleSpinnerY.addListener(SWT.Selection, event -> example.redraw());
// create a button for inverting the transform matrix
comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout());
invertButton = new Button(comp, SWT.TOGGLE);
// $NON-NLS-1$
invertButton.setText(GraphicsExample.getResourceString("Invert"));
invertButton.addListener(SWT.Selection, event -> example.redraw());
}
use of org.eclipse.swt.widgets.Spinner in project eclipse.platform.swt by eclipse.
the class SpiralTab method createControlPanel.
/**
* This method creates a spinner for specifying the number of petals. The call to the
* createControlPanel method in the super class create the controls that are
* defined in the super class.
*
* @param parent The parent composite
*/
@Override
public void createControlPanel(Composite parent) {
super.createControlPanel(parent);
// create spinner number of petals
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout(2, false));
new Label(comp, SWT.CENTER).setText(GraphicsExample.getResourceString(// $NON-NLS-1$
"Petals"));
petalSpinner = new Spinner(comp, SWT.BORDER | SWT.WRAP);
petalSpinner.setSelection(8);
petalSpinner.setMinimum(3);
petalSpinner.setMaximum(20);
petalSpinner.addListener(SWT.Selection, event -> example.redraw());
// create color button
comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout());
ColorMenu cm = new ColorMenu();
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), gb -> {
foreground = gb;
colorButton.setImage(gb.getThumbNail());
example.redraw();
});
// initialize the foreground to the 2nd item in the menu
foreground = (GraphicsBackground) menu.getItem(1).getData();
// color button
colorButton = new Button(comp, SWT.PUSH);
colorButton.setText(GraphicsExample.getResourceString(// $NON-NLS-1$
"Color"));
colorButton.setImage(foreground.getThumbNail());
colorButton.addListener(SWT.Selection, event -> {
final Button button = (Button) event.widget;
final Composite parent1 = button.getParent();
Rectangle bounds = button.getBounds();
Point point = parent1.toDisplay(new Point(bounds.x, bounds.y));
menu.setLocation(point.x, point.y + bounds.height);
menu.setVisible(true);
});
}
Aggregations